@ongov/ontario-design-system-component-library 4.3.0 → 4.3.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/ontario-accordion_43.cjs.entry.js +404 -223
- package/dist/cjs/ontario-accordion_43.cjs.entry.js.map +1 -1
- package/dist/cjs/ontario-design-system-components.cjs.js +1 -1
- package/dist/collection/components/ontario-card/ontario-card.css +13 -5
- package/dist/collection/components/ontario-card/ontario-card.js +10 -10
- package/dist/collection/components/ontario-card/ontario-card.js.map +1 -1
- package/dist/collection/components/ontario-card/test/ontario-cards.spec.js +1 -1
- package/dist/collection/components/ontario-card/test/ontario-cards.spec.js.map +1 -1
- package/dist/collection/components/ontario-header/ontario-header.js +17 -3
- package/dist/collection/components/ontario-header/ontario-header.js.map +1 -1
- package/dist/collection/components/ontario-header/test/ontario-header.spec.js +3 -3
- package/dist/collection/components/ontario-header/test/ontario-header.spec.js.map +1 -1
- package/dist/collection/components/ontario-language-toggle/ontario-language-toggle.js +193 -47
- package/dist/collection/components/ontario-language-toggle/ontario-language-toggle.js.map +1 -1
- package/dist/collection/components/ontario-language-toggle/test/ontario-language-toggle.spec.js +16 -3
- package/dist/collection/components/ontario-language-toggle/test/ontario-language-toggle.spec.js.map +1 -1
- package/dist/collection/i18n/global.i18n.json +172 -162
- package/dist/collection/utils/common/language-types.js +1 -1
- package/dist/collection/utils/common/language-types.js.map +1 -1
- package/dist/collection/utils/helper/utils-types.js +2 -0
- package/dist/collection/utils/helper/utils-types.js.map +1 -0
- package/dist/collection/utils/helper/utils.js +26 -0
- package/dist/collection/utils/helper/utils.js.map +1 -1
- package/dist/components/global.i18n.js +184 -173
- package/dist/components/global.i18n.js.map +1 -1
- package/dist/components/ontario-card.js +11 -11
- package/dist/components/ontario-card.js.map +1 -1
- package/dist/components/ontario-header.js +11 -3
- package/dist/components/ontario-header.js.map +1 -1
- package/dist/components/ontario-language-toggle2.js +180 -37
- package/dist/components/ontario-language-toggle2.js.map +1 -1
- package/dist/components/utils.js +28 -0
- package/dist/components/utils.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/ontario-accordion_43.entry.js +404 -223
- package/dist/esm/ontario-accordion_43.entry.js.map +1 -1
- package/dist/esm/ontario-design-system-components.js +1 -1
- package/dist/ontario-design-system-components/i18n/global.i18n.json +172 -162
- package/dist/ontario-design-system-components/ontario-design-system-components.esm.js +1 -1
- package/dist/ontario-design-system-components/ontario-design-system-components.esm.js.map +1 -1
- package/dist/ontario-design-system-components/{p-cff41424.entry.js → p-abe58ec9.entry.js} +697 -608
- package/dist/ontario-design-system-components/p-abe58ec9.entry.js.map +1 -0
- package/dist/types/components/ontario-header/ontario-header.d.ts +13 -2
- package/dist/types/components/ontario-language-toggle/ontario-language-toggle.d.ts +75 -8
- package/dist/types/components.d.ts +12 -6
- package/dist/types/utils/common/language-types.d.ts +2 -1
- package/dist/types/utils/helper/utils-types.d.ts +2 -0
- package/dist/types/utils/helper/utils.d.ts +21 -0
- package/package.json +3 -3
- package/src/components/ontario-card/ontario-card.scss +13 -6
- package/src/components/ontario-card/ontario-card.tsx +8 -6
- package/src/components/ontario-card/test/ontario-cards.spec.tsx +1 -1
- package/src/components/ontario-header/ontario-header.tsx +13 -4
- package/src/components/ontario-header/test/ontario-header.spec.tsx +3 -3
- package/src/components/ontario-language-toggle/ontario-language-toggle.tsx +192 -45
- package/src/components/ontario-language-toggle/readme.md +10 -10
- package/src/components/ontario-language-toggle/test/__snapshots__/ontario-language-toggle.spec.tsx.snap +1 -1
- package/src/components/ontario-language-toggle/test/ontario-language-toggle.spec.tsx +17 -3
- package/src/components.d.ts +12 -6
- package/src/french.html +37 -0
- package/src/index.html +19 -0
- package/src/translations/global.i18n.json +172 -162
- package/src/utils/common/language-types.ts +2 -1
- package/src/utils/helper/utils-types.ts +2 -0
- package/src/utils/helper/utils.ts +30 -0
- package/www/build/ontario-design-system-components.esm.js +1 -1
- package/www/build/ontario-design-system-components.esm.js.map +1 -1
- package/www/build/{p-cff41424.entry.js → p-abe58ec9.entry.js} +697 -608
- package/www/build/p-abe58ec9.entry.js.map +1 -0
- package/www/build/{p-b61db0f6.js → p-fdc9ab6d.js} +1 -1
- package/www/french.html +37 -0
- package/www/i18n/global.i18n.json +172 -162
- package/www/index.html +21 -2
- package/dist/ontario-design-system-components/p-cff41424.entry.js.map +0 -1
- package/www/build/p-cff41424.entry.js.map +0 -1
|
@@ -1,154 +1,54 @@
|
|
|
1
|
-
const required = {
|
|
2
|
-
en: 'required',
|
|
3
|
-
fr: 'obligatoire',
|
|
4
|
-
};
|
|
5
|
-
const optional = {
|
|
6
|
-
en: 'optional',
|
|
7
|
-
fr: 'facultative',
|
|
8
|
-
};
|
|
9
1
|
const accessibility = {
|
|
10
|
-
moreInfo: {
|
|
11
|
-
en: 'More information on',
|
|
12
|
-
fr: 'Des renseignements supplémentaires sur',
|
|
13
|
-
},
|
|
14
2
|
checkboxHintExpander: {
|
|
15
3
|
en: 'is available after the last checkbox item.',
|
|
16
4
|
fr: 'suivront à la dernière case à cocher.',
|
|
17
5
|
},
|
|
6
|
+
moreInfo: {
|
|
7
|
+
en: 'More information on',
|
|
8
|
+
fr: 'Des renseignements supplémentaires sur',
|
|
9
|
+
},
|
|
18
10
|
singleHintExpander: {
|
|
19
11
|
en: 'field is available in the next element.',
|
|
20
12
|
fr: 'suivront au prochain élément.',
|
|
21
13
|
},
|
|
22
14
|
};
|
|
23
|
-
const backToTop = {
|
|
24
|
-
top: {
|
|
25
|
-
en: 'Top',
|
|
26
|
-
fr: 'Haut',
|
|
27
|
-
},
|
|
28
|
-
ariaLabel: {
|
|
29
|
-
en: 'Scroll back to the top',
|
|
30
|
-
fr: 'Retour en haut de la page',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
const loading = {
|
|
34
|
-
en: 'Loading',
|
|
35
|
-
fr: 'Chargement',
|
|
36
|
-
};
|
|
37
|
-
const dropdownList = {
|
|
38
|
-
select: {
|
|
39
|
-
en: 'Select',
|
|
40
|
-
fr: 'Sélectionner',
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
const contactUs = {
|
|
44
|
-
en: 'Contact us',
|
|
45
|
-
fr: 'Contactez-nous',
|
|
46
|
-
};
|
|
47
15
|
const accessibilityLink = {
|
|
48
|
-
text: {
|
|
49
|
-
en: 'Accessibility',
|
|
50
|
-
fr: 'Accessibilité',
|
|
51
|
-
},
|
|
52
16
|
link: {
|
|
53
17
|
en: 'https://www.ontario.ca/page/accessibility',
|
|
54
18
|
fr: 'https://www.ontario.ca/fr/page/accessibilite',
|
|
55
19
|
},
|
|
56
|
-
};
|
|
57
|
-
const privacyLink = {
|
|
58
|
-
text: {
|
|
59
|
-
en: 'Privacy',
|
|
60
|
-
fr: 'Confidentialité',
|
|
61
|
-
},
|
|
62
|
-
link: {
|
|
63
|
-
en: 'https://www.ontario.ca/page/privacy-statement',
|
|
64
|
-
fr: 'https://www.ontario.ca/fr/page/declaration-concernant-la-protection-de-la-vie-privee',
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
const printerLink = {
|
|
68
20
|
text: {
|
|
69
|
-
en:
|
|
70
|
-
fr: '
|
|
71
|
-
},
|
|
72
|
-
link: {
|
|
73
|
-
en: 'https://www.ontario.ca/page/copyright-information',
|
|
74
|
-
fr: 'https://www.ontario.ca/fr/page/droits-dauteur',
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
const languageToggle = {
|
|
78
|
-
ariaLabel: {
|
|
79
|
-
en: 'Click to switch language to French',
|
|
80
|
-
fr: 'Cliquez pour changer de langue en anglais',
|
|
21
|
+
en: 'Accessibility',
|
|
22
|
+
fr: 'Accessibilité',
|
|
81
23
|
},
|
|
82
24
|
};
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
en: '
|
|
86
|
-
fr: '
|
|
87
|
-
},
|
|
88
|
-
step: {
|
|
89
|
-
en: 'Step',
|
|
90
|
-
fr: 'Étape',
|
|
25
|
+
const accordion = {
|
|
26
|
+
collapse: {
|
|
27
|
+
en: 'Collapse all',
|
|
28
|
+
fr: 'Réduire tout',
|
|
91
29
|
},
|
|
92
|
-
|
|
93
|
-
en: '
|
|
94
|
-
fr: '
|
|
30
|
+
expand: {
|
|
31
|
+
en: 'Expand all',
|
|
32
|
+
fr: 'Agrandir tout',
|
|
95
33
|
},
|
|
96
|
-
|
|
97
|
-
en: '
|
|
98
|
-
fr: '
|
|
34
|
+
expandCollapseAriaLabel: {
|
|
35
|
+
en: 'Expand or collapse the accordion',
|
|
36
|
+
fr: "Agrandissez ou réduisez l'accordéon",
|
|
99
37
|
},
|
|
100
38
|
};
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
en: '
|
|
104
|
-
fr: '
|
|
105
|
-
},
|
|
106
|
-
logoLink: {
|
|
107
|
-
en: 'https://www.ontario.ca/page/government-ontario',
|
|
108
|
-
fr: 'https://www.ontario.ca/fr/page/gouvernement-de-lontario',
|
|
109
|
-
},
|
|
110
|
-
logoAltText: {
|
|
111
|
-
en: 'Ontario.ca homepage',
|
|
112
|
-
fr: 'Page d’accueil Ontario.ca',
|
|
113
|
-
},
|
|
114
|
-
clearSearchField: {
|
|
115
|
-
en: 'Clear field',
|
|
116
|
-
fr: 'Vider le champ',
|
|
117
|
-
},
|
|
118
|
-
submit: {
|
|
119
|
-
en: 'Submit',
|
|
120
|
-
fr: 'Soumission',
|
|
121
|
-
},
|
|
122
|
-
search: {
|
|
123
|
-
en: 'Search',
|
|
124
|
-
fr: 'Rechercher',
|
|
125
|
-
},
|
|
126
|
-
serviceOntario: {
|
|
127
|
-
en: 'ServiceOntario',
|
|
128
|
-
fr: 'ServiceOntario',
|
|
129
|
-
},
|
|
130
|
-
openMenu: {
|
|
131
|
-
en: 'Show navigation menu',
|
|
132
|
-
fr: 'Ouvrir le menu de navigation',
|
|
133
|
-
},
|
|
134
|
-
closeMenu: {
|
|
135
|
-
en: 'Hide navigation menu',
|
|
136
|
-
fr: 'Fermer le menu de navigation',
|
|
137
|
-
},
|
|
138
|
-
close: {
|
|
139
|
-
en: 'close',
|
|
140
|
-
fr: 'fermer',
|
|
39
|
+
const backToTop = {
|
|
40
|
+
ariaLabel: {
|
|
41
|
+
en: 'Scroll back to the top',
|
|
42
|
+
fr: 'Retour en haut de la page',
|
|
141
43
|
},
|
|
142
|
-
|
|
143
|
-
en: '
|
|
144
|
-
fr: '
|
|
44
|
+
top: {
|
|
45
|
+
en: 'Top',
|
|
46
|
+
fr: 'Haut',
|
|
145
47
|
},
|
|
146
48
|
};
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
fr: 'Ce champ est obligatoire.',
|
|
151
|
-
},
|
|
49
|
+
const contactUs = {
|
|
50
|
+
en: 'Contact us',
|
|
51
|
+
fr: 'Contactez-nous',
|
|
152
52
|
};
|
|
153
53
|
const dateInput = {
|
|
154
54
|
caption: {
|
|
@@ -156,43 +56,23 @@ const dateInput = {
|
|
|
156
56
|
fr: 'Dates exactes',
|
|
157
57
|
},
|
|
158
58
|
day: {
|
|
159
|
-
label: {
|
|
160
|
-
en: 'Day',
|
|
161
|
-
fr: 'Jour',
|
|
162
|
-
},
|
|
163
59
|
accessibility: {
|
|
164
60
|
en: '4 digits',
|
|
165
61
|
fr: '4 chiffres',
|
|
166
62
|
},
|
|
167
|
-
},
|
|
168
|
-
month: {
|
|
169
63
|
label: {
|
|
170
|
-
en: '
|
|
171
|
-
fr: '
|
|
172
|
-
},
|
|
173
|
-
accessibility: {
|
|
174
|
-
en: '1 or 2 digits',
|
|
175
|
-
fr: '1 ou 2 chiffres',
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
year: {
|
|
179
|
-
label: {
|
|
180
|
-
en: 'Year',
|
|
181
|
-
fr: 'Année',
|
|
182
|
-
},
|
|
183
|
-
accessibility: {
|
|
184
|
-
en: '1 or 2 digits',
|
|
185
|
-
fr: '1 ou 2 chiffres',
|
|
64
|
+
en: 'Day',
|
|
65
|
+
fr: 'Jour',
|
|
186
66
|
},
|
|
187
67
|
},
|
|
188
68
|
error: {
|
|
189
69
|
en: {
|
|
190
70
|
emptyDay: 'Enter the day.',
|
|
191
|
-
emptyMonth: 'Enter the month.',
|
|
192
|
-
emptyYear: 'Enter the year.',
|
|
193
71
|
emptyDayAndMonth: 'Enter the month and day.',
|
|
194
72
|
emptyDayAndYear: 'Enter the year and day.',
|
|
73
|
+
emptyMonth: 'Enter the month.',
|
|
195
74
|
emptyMonthAndYear: 'Enter the year and month.',
|
|
75
|
+
emptyYear: 'Enter the year.',
|
|
196
76
|
invalidDate: 'Enter a valid date.',
|
|
197
77
|
invalidDay: 'Enter a valid day.',
|
|
198
78
|
invalidMonth: 'Enter a valid month.',
|
|
@@ -200,49 +80,180 @@ const dateInput = {
|
|
|
200
80
|
},
|
|
201
81
|
fr: {
|
|
202
82
|
emptyDay: 'Saisissez le jour.',
|
|
203
|
-
emptyMonth: 'Saisissez le mois.',
|
|
204
|
-
emptyYear: 'Saisissez l’année.',
|
|
205
83
|
emptyDayAndMonth: 'Saisissez le mois et le jour.',
|
|
206
84
|
emptyDayAndYear: 'Saisissez l’année et le jour.',
|
|
85
|
+
emptyMonth: 'Saisissez le mois.',
|
|
207
86
|
emptyMonthAndYear: 'Saisissez l’année et le mois.',
|
|
87
|
+
emptyYear: 'Saisissez l’année.',
|
|
208
88
|
invalidDate: 'Saisissez une date valide.',
|
|
209
89
|
invalidDay: 'Saisissez un jour valide.',
|
|
210
90
|
invalidMonth: 'Saisissez un mois valide.',
|
|
211
91
|
invalidYear: 'Saisissez une année valide.',
|
|
212
92
|
},
|
|
213
93
|
},
|
|
94
|
+
month: {
|
|
95
|
+
accessibility: {
|
|
96
|
+
en: '1 or 2 digits',
|
|
97
|
+
fr: '1 ou 2 chiffres',
|
|
98
|
+
},
|
|
99
|
+
label: {
|
|
100
|
+
en: 'Month',
|
|
101
|
+
fr: 'Mois',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
year: {
|
|
105
|
+
accessibility: {
|
|
106
|
+
en: '1 or 2 digits',
|
|
107
|
+
fr: '1 ou 2 chiffres',
|
|
108
|
+
},
|
|
109
|
+
label: {
|
|
110
|
+
en: 'Year',
|
|
111
|
+
fr: 'Année',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
214
114
|
};
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
en: '
|
|
218
|
-
fr: '
|
|
115
|
+
const dropdownList = {
|
|
116
|
+
select: {
|
|
117
|
+
en: 'Select',
|
|
118
|
+
fr: 'Sélectionner',
|
|
219
119
|
},
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
120
|
+
};
|
|
121
|
+
const header = {
|
|
122
|
+
clearSearchField: {
|
|
123
|
+
en: 'Clear field',
|
|
124
|
+
fr: 'Vider le champ',
|
|
223
125
|
},
|
|
224
|
-
|
|
225
|
-
en: '
|
|
226
|
-
fr:
|
|
126
|
+
close: {
|
|
127
|
+
en: 'close',
|
|
128
|
+
fr: 'fermer',
|
|
129
|
+
},
|
|
130
|
+
closeMenu: {
|
|
131
|
+
en: 'Hide navigation menu',
|
|
132
|
+
fr: 'Fermer le menu de navigation',
|
|
133
|
+
},
|
|
134
|
+
closeSearch: {
|
|
135
|
+
en: 'Close search bar',
|
|
136
|
+
fr: 'Fermer la barre de recherche',
|
|
137
|
+
},
|
|
138
|
+
logoAltText: {
|
|
139
|
+
en: 'Ontario.ca homepage',
|
|
140
|
+
fr: 'Page d’accueil Ontario.ca',
|
|
141
|
+
},
|
|
142
|
+
logoLink: {
|
|
143
|
+
en: 'https://www.ontario.ca/page/government-ontario',
|
|
144
|
+
fr: 'https://www.ontario.ca/fr/page/gouvernement-de-lontario',
|
|
145
|
+
},
|
|
146
|
+
ontarioSearchURL: {
|
|
147
|
+
en: 'https://www.ontario.ca/search/search-results?query=',
|
|
148
|
+
fr: 'https://www.ontario.ca/fr/recherche/resultats-de-recherche/?query=',
|
|
149
|
+
},
|
|
150
|
+
openMenu: {
|
|
151
|
+
en: 'Show navigation menu',
|
|
152
|
+
fr: 'Ouvrir le menu de navigation',
|
|
153
|
+
},
|
|
154
|
+
search: {
|
|
155
|
+
en: 'Search',
|
|
156
|
+
fr: 'Rechercher',
|
|
157
|
+
},
|
|
158
|
+
serviceOntario: {
|
|
159
|
+
en: 'ServiceOntario',
|
|
160
|
+
fr: 'ServiceOntario',
|
|
161
|
+
},
|
|
162
|
+
submit: {
|
|
163
|
+
en: 'Submit',
|
|
164
|
+
fr: 'Soumission',
|
|
165
|
+
},
|
|
166
|
+
};
|
|
167
|
+
const input = {
|
|
168
|
+
requiredFieldError: {
|
|
169
|
+
en: 'This is a required field.',
|
|
170
|
+
fr: 'Ce champ est obligatoire.',
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
const languageToggle = {
|
|
174
|
+
ariaLabel: {
|
|
175
|
+
en: 'Click to switch the language to English',
|
|
176
|
+
fr: 'Cliquez pour changer la langue en français',
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
const loading = {
|
|
180
|
+
en: 'Loading',
|
|
181
|
+
fr: 'Chargement',
|
|
182
|
+
};
|
|
183
|
+
const optional = {
|
|
184
|
+
en: 'optional',
|
|
185
|
+
fr: 'facultative',
|
|
186
|
+
};
|
|
187
|
+
const printerLink = {
|
|
188
|
+
link: {
|
|
189
|
+
en: 'https://www.ontario.ca/page/copyright-information',
|
|
190
|
+
fr: 'https://www.ontario.ca/fr/page/droits-dauteur',
|
|
191
|
+
},
|
|
192
|
+
text: {
|
|
193
|
+
en: "King's Printer for Ontario,",
|
|
194
|
+
fr: 'Imprimeur du Roi pour l’Ontario,',
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
const privacyLink = {
|
|
198
|
+
link: {
|
|
199
|
+
en: 'https://www.ontario.ca/page/privacy-statement',
|
|
200
|
+
fr: 'https://www.ontario.ca/fr/page/declaration-concernant-la-protection-de-la-vie-privee',
|
|
201
|
+
},
|
|
202
|
+
text: {
|
|
203
|
+
en: 'Privacy',
|
|
204
|
+
fr: 'Confidentialité',
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
const stepIndicator = {
|
|
208
|
+
back: {
|
|
209
|
+
en: 'Back',
|
|
210
|
+
fr: 'Retour',
|
|
211
|
+
},
|
|
212
|
+
complete: {
|
|
213
|
+
en: 'complete',
|
|
214
|
+
fr: 'complet',
|
|
215
|
+
},
|
|
216
|
+
of: {
|
|
217
|
+
en: 'of',
|
|
218
|
+
fr: 'sur',
|
|
219
|
+
},
|
|
220
|
+
step: {
|
|
221
|
+
en: 'Step',
|
|
222
|
+
fr: 'Étape',
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
const siteLanguage = {
|
|
226
|
+
fullWord: {
|
|
227
|
+
en: 'English',
|
|
228
|
+
fr: 'Français',
|
|
229
|
+
},
|
|
230
|
+
abbreviation: {
|
|
231
|
+
en: 'en',
|
|
232
|
+
fr: 'fr',
|
|
227
233
|
},
|
|
228
234
|
};
|
|
235
|
+
const required = {
|
|
236
|
+
en: 'required',
|
|
237
|
+
fr: 'obligatoire',
|
|
238
|
+
};
|
|
229
239
|
const translations = {
|
|
230
|
-
required: required,
|
|
231
|
-
optional: optional,
|
|
232
240
|
accessibility: accessibility,
|
|
241
|
+
accessibilityLink: accessibilityLink,
|
|
242
|
+
accordion: accordion,
|
|
233
243
|
backToTop: backToTop,
|
|
234
|
-
loading: loading,
|
|
235
|
-
dropdownList: dropdownList,
|
|
236
244
|
contactUs: contactUs,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
printerLink: printerLink,
|
|
240
|
-
languageToggle: languageToggle,
|
|
241
|
-
stepIndicator: stepIndicator,
|
|
245
|
+
dateInput: dateInput,
|
|
246
|
+
dropdownList: dropdownList,
|
|
242
247
|
header: header,
|
|
243
248
|
input: input,
|
|
244
|
-
|
|
245
|
-
|
|
249
|
+
languageToggle: languageToggle,
|
|
250
|
+
loading: loading,
|
|
251
|
+
optional: optional,
|
|
252
|
+
printerLink: printerLink,
|
|
253
|
+
privacyLink: privacyLink,
|
|
254
|
+
stepIndicator: stepIndicator,
|
|
255
|
+
siteLanguage: siteLanguage,
|
|
256
|
+
required: required,
|
|
246
257
|
};
|
|
247
258
|
|
|
248
259
|
export { translations as t };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"global.i18n.js","mappings":"
|
|
1
|
+
{"file":"global.i18n.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
|
|
@@ -6,7 +6,7 @@ const CardTypes = ['basic', 'image', 'title', 'horizontal'];
|
|
|
6
6
|
const HeaderTypes = ['default', 'light', 'dark'];
|
|
7
7
|
|
|
8
8
|
const ontarioCardCss =
|
|
9
|
-
'.ontario-card__heading{font-style:normal;font-weight:700;text-rendering:optimizeLegibility;margin-bottom:1rem;font-feature-settings:normal;font-family:"Raleway", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif}.ontario-card__heading{font-size:1.25rem;letter-spacing:0.03rem;line-height:1.5;margin:0 0 0.75rem 0;max-width:48rem}@media screen and (min-width: 40em){.ontario-card__heading{font-size:1.5rem;letter-spacing:0.0313rem;line-height:1.5}}.ontario-card{box-shadow:0rem 0.1875rem 0.5rem 0.0625rem rgba(0, 0, 0, 0.4);border-radius:4px;margin:0 2.5rem 2.5rem 0;padding:0;height:calc(100% - 2.5rem);list-style-type:none;transition:all 0.3s ease-in-out;position:relative;cursor:pointer}.ontario-card:hover{box-shadow:0rem 0.375rem 0.75rem 0.125rem rgba(0, 0, 0, 0.35)}.ontario-card:focus-within{box-shadow:0 0 0 4px #009ADB;outline:4px solid transparent;transition:box-shadow 0.1s ease-in-out}.ontario-card:active{box-shadow:0 0 0 4px #009ADB;background-color:#f2f2f2}@media screen and (max-width: 40em){.ontario-card{margin-bottom:3rem;width:100% !important;max-width:100%}}.ontario-card__card-type--horizontal{display:flex}@media screen and (max-width: 40em){.ontario-card__card-type--horizontal{width:100%;max-width:100%}}.ontario-card__card-type--horizontal .ontario-card__image-container,.ontario-card__card-type--horizontal .ontario-card__text-container{position:relative}.ontario-card__card-type--horizontal a:focus-within{box-shadow:none;outline:none}.ontario-card__card-type--horizontal a:active{box-shadow:none}.ontario-card__card-type--horizontal img{height:100%;position:absolute}.ontario-card__image-right{flex-direction:row-reverse}.ontario-card__heading{margin:0;border-radius:4px 4px 0 0;padding:1.25rem 1.5rem 0.5rem 1.5rem;transition:text-decoration 0.3s ease-in-out;background-color:#FFFFFF}.ontario-card:hover .ontario-card__heading{text-decoration-line:underline;text-decoration-color:#1a1a1a}.ontario-card__header-type--light .ontario-card__heading{background-color:#f2f2f2;padding-top:1rem;padding-bottom:1rem;padding-right:4rem;border-radius:4px 4px 0 0}.ontario-card__header-type--dark .ontario-card__heading{background-color:#1a1a1a;padding-top:1rem;padding-bottom:1rem;border-radius:4px 4px 0 0}.ontario-card__header-type--dark:hover .ontario-card__heading{text-decoration-line:underline;text-decoration-color:#FFFFFF}.ontario-
|
|
9
|
+
'.ontario-card__heading{font-style:normal;font-weight:700;text-rendering:optimizeLegibility;margin-bottom:1rem;font-feature-settings:normal;font-family:"Raleway", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif}.ontario-card__heading{font-size:1.25rem;letter-spacing:0.03rem;line-height:1.5;margin:0 0 0.75rem 0;max-width:48rem}@media screen and (min-width: 40em){.ontario-card__heading{font-size:1.5rem;letter-spacing:0.0313rem;line-height:1.5}}.ontario-card{box-shadow:0rem 0.1875rem 0.5rem 0.0625rem rgba(0, 0, 0, 0.4);border-radius:4px;margin:0 2.5rem 2.5rem 0;padding:0;height:calc(100% - 2.5rem);list-style-type:none;transition:all 0.3s ease-in-out;position:relative;cursor:pointer}.ontario-card:hover{box-shadow:0rem 0.375rem 0.75rem 0.125rem rgba(0, 0, 0, 0.35)}.ontario-card:focus-within{box-shadow:0 0 0 4px #009ADB;outline:4px solid transparent;transition:box-shadow 0.1s ease-in-out}.ontario-card:active{box-shadow:0 0 0 4px #009ADB;background-color:#f2f2f2}@media screen and (max-width: 40em){.ontario-card{margin-bottom:3rem;width:100% !important;max-width:100%}}.ontario-card__header-type--dark.ontario-card__description-false{background-color:#1a1a1a}.ontario-card__header-type--light.ontario-card__description-false{background-color:#f2f2f2}.ontario-card--image-true{margin-top:-0.5rem}.ontario-card__card-type--horizontal{display:flex}@media screen and (max-width: 40em){.ontario-card__card-type--horizontal{width:100%;max-width:100%}}.ontario-card__card-type--horizontal .ontario-card__image-container,.ontario-card__card-type--horizontal .ontario-card__text-container{position:relative}.ontario-card__card-type--horizontal a:focus-within{box-shadow:none;outline:none}.ontario-card__card-type--horizontal a:active{box-shadow:none}.ontario-card__card-type--horizontal img{height:100%;position:absolute}.ontario-card__image-right{flex-direction:row-reverse}.ontario-card__heading{margin:0;border-radius:4px 4px 0 0;padding:1.25rem 1.5rem 0.5rem 1.5rem;transition:text-decoration 0.3s ease-in-out;background-color:#FFFFFF}.ontario-card:hover .ontario-card__heading{text-decoration-line:underline;text-decoration-color:#1a1a1a}.ontario-card__header-type--light .ontario-card__heading{background-color:#f2f2f2;padding-top:1rem;padding-bottom:1rem;padding-right:4rem;border-radius:4px 4px 0 0}.ontario-card__header-type--dark .ontario-card__heading{background-color:#1a1a1a;padding-top:1rem;padding-bottom:1rem;border-radius:4px 4px 0 0}.ontario-card__header-type--dark:hover .ontario-card__heading{text-decoration-line:underline;text-decoration-color:#FFFFFF}.ontario-card__heading a{color:#1a1a1a;text-decoration:none;outline:none}.ontario-card__header-type--dark .ontario-card__heading a{color:#FFFFFF}.ontario-card__heading a::after{content:"";position:absolute;left:0;top:0;right:0;bottom:0}.ontario-card__heading a:focus{box-shadow:none}.ontario-card__heading a:active{outline:none}@media screen and (max-width: 73em){.ontario-card__heading{font-size:1.25rem;padding-left:1rem;padding-right:1rem}}.ontario-card__card-type--horizontal .ontario-card__text-container{width:66.6%}.ontario-card__image-size-one-fourth .ontario-card__text-container{width:75%}.ontario-card--no-image .ontario-card__text-container{width:100%}.ontario-card__description{margin:0;padding:0.5rem 1.5rem 1.5rem 1.5rem;background-color:#FFFFFF;border-bottom-left-radius:4px;border-bottom-right-radius:4px}.ontario-card__description p{margin-top:0}.ontario-card__description p:last-of-type{margin-bottom:0}.ontario-card__header-type--light .ontario-card__description,.ontario-card__header-type--dark .ontario-card__description{padding-top:1rem}@media screen and (max-width: 73em){.ontario-card__description{padding:0.5rem 1rem 1.5rem 1rem}.ontario-card__header-type--light .ontario-card__description,.ontario-card__header-type--dark .ontario-card__description{padding-top:1rem}}.ontario-card--position-vertical .ontario-card__image-container{margin-bottom:-0.5rem}.ontario-card__card-type--horizontal .ontario-card__image-container{width:33.3%}.ontario-card__image-size-one-fourth .ontario-card__image-container{width:25%}.ontario-card__image{width:100%;height:100%;object-fit:cover;background-size:100% 100%}.ontario-card--position-vertical .ontario-card__image{border-top-left-radius:4px;border-top-right-radius:4px}.ontario-card__image-right .ontario-card__image{border-top-right-radius:4px;border-bottom-right-radius:4px}.ontario-card__image-left .ontario-card__image{border-top-left-radius:4px;border-bottom-left-radius:4px}';
|
|
10
10
|
const OntarioCardStyle0 = ontarioCardCss;
|
|
11
11
|
|
|
12
12
|
const OntarioCard$1 = /*@__PURE__*/ proxyCustomElement(
|
|
@@ -97,12 +97,12 @@ const OntarioCard$1 = /*@__PURE__*/ proxyCustomElement(
|
|
|
97
97
|
* @returns the classes of the ontario cards based off the `cardType` and `headerType`.
|
|
98
98
|
*/
|
|
99
99
|
getClass() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
100
|
+
const baseClass =
|
|
101
|
+
this.cardTypeState === 'horizontal'
|
|
102
|
+
? `ontario-card ontario-card__card-type--horizontal ontario-card__image-${this.horizontalImagePositionType} ontario-card__image-size-${this.horizontalImageSizeType}`
|
|
103
|
+
: `ontario-card ontario-card__header-type--${this.headerTypeState} ontario-card__card-type--${this.cardTypeState}`;
|
|
104
|
+
const descriptionClass = this.description ? '' : ' ontario-card__description-false';
|
|
105
|
+
return `${baseClass}${descriptionClass}`;
|
|
106
106
|
}
|
|
107
107
|
getHref() {
|
|
108
108
|
return this.cardLink ? this.cardLink : '#';
|
|
@@ -114,7 +114,7 @@ const OntarioCard$1 = /*@__PURE__*/ proxyCustomElement(
|
|
|
114
114
|
render() {
|
|
115
115
|
return h(
|
|
116
116
|
'li',
|
|
117
|
-
{ key: '
|
|
117
|
+
{ key: '606e74cea5d81cd31b355ffb1a71cf7450126cf4', class: this.getClass() },
|
|
118
118
|
this.image &&
|
|
119
119
|
h(
|
|
120
120
|
'div',
|
|
@@ -128,16 +128,16 @@ const OntarioCard$1 = /*@__PURE__*/ proxyCustomElement(
|
|
|
128
128
|
h(
|
|
129
129
|
'div',
|
|
130
130
|
{
|
|
131
|
-
key: '
|
|
131
|
+
key: '7d71d14690d4e75dcf1e4ef5c0198183b27e4b39',
|
|
132
132
|
class: `ontario-card__text-container ${this.image ? 'ontario-card--image-true' : ''}`,
|
|
133
133
|
},
|
|
134
134
|
h(
|
|
135
135
|
'h2',
|
|
136
|
-
{ key: '
|
|
136
|
+
{ key: '4f6a337efa3986a5023f3c17e869f072aaef0e4f', class: 'ontario-card__heading' },
|
|
137
137
|
h(
|
|
138
138
|
'a',
|
|
139
139
|
{
|
|
140
|
-
'key': '
|
|
140
|
+
'key': '6efece75daafc95e43dca997e895dc88cab9194c',
|
|
141
141
|
'href': this.getHref(),
|
|
142
142
|
'aria-label': this.ariaLabelText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ACC,CACN,EACD,4DAAK,KAAK,EAAE,gCAAgC,IAAI,CAAC,KAAK,GAAG,0BAA0B,GAAG,EAAE,EAAE,IACzF,2DAAI,KAAK,EAAC,uBAAuB,IAChC,0DAAG,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAc,IAAI,CAAC,aAAa,IACrD,IAAI,CAAC,KAAK,CACR,CACA,EACJ,IAAI,CAAC,WAAW,KAChB,WAAK,KAAK,EAAC,2BAA2B,IACrC,aAAI,IAAI,CAAC,WAAW,CAAK,CACpB,CACN,CACI,CACF,EACJ;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["OntarioCard"],"sources":["src/components/ontario-card/ontario-card-types.tsx","src/components/ontario-card/ontario-card.scss?tag=ontario-card&encapsulation=shadow","src/components/ontario-card/ontario-card.tsx"],"sourcesContent":["export const CardTypes = ['basic', 'image', 'title', 'horizontal'] as const;\nexport const HeaderTypes = ['default', 'light', 'dark'] as const;\nexport const HorizontalImagePositionTypes = ['left', 'right'] as const;\nexport const HorizontalImageSizeTypes = ['one-fourth', 'one-third'] as const;\n\nexport type CardType = (typeof CardTypes)[number];\nexport type HeaderType = (typeof HeaderTypes)[number];\nexport type HorizontalImagePositionType = (typeof HorizontalImagePositionTypes)[number];\nexport type HorizontalImageSizeType = (typeof HorizontalImageSizeTypes)[number];\n","@use 'sass:math';\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/global.variables' as globalVariables;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/spacing.variables' as spacing;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/colours.variables' as colours;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/breakpoints.variables' as breakpoints;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/placeholder/focus.placeholders' as\n\tplaceholders;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-weights.variables' as fontWeights;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-sizes.variables' as fontSizes;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/functions/global.functions' as globalFunctions;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/typography.variables' as typography;\n\n.ontario-card {\n\tbox-shadow: 0rem 0.1875rem 0.5rem 0.0625rem rgba(0, 0, 0, 0.4);\n\tborder-radius: globalVariables.$global-radius;\n\tmargin: spacing.$spacing-0 spacing.$spacing-7 spacing.$spacing-7 spacing.$spacing-0;\n\tpadding: spacing.$spacing-0;\n\t/* \n\t * Required for cards to stay the same height regardless of content size.\n\t * Without subtracting the margin-bottom amount the cards will be too large.\n\t */\n\theight: calc(100% - spacing.$spacing-7);\n\tlist-style-type: none;\n\ttransition: all 0.3s ease-in-out;\n\tposition: relative;\n\tcursor: pointer;\n\n\t&:hover {\n\t\tbox-shadow: 0rem 0.375rem 0.75rem 0.125rem rgba(0, 0, 0, 0.35);\n\t}\n\n\t&:focus-within {\n\t\tbox-shadow: placeholders.$ontario-focus-box-shadow;\n\t\toutline: 4px solid transparent;\n\t\ttransition: box-shadow 0.1s ease-in-out;\n\t}\n\n\t&:active {\n\t\tbox-shadow: placeholders.$ontario-focus-box-shadow;\n\t\tbackground-color: colours.$ontario-greyscale-5;\n\t}\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\tmargin-bottom: spacing.$spacing-8;\n\t\twidth: 100% !important; // to override the specificity of the widths listed for the card-rows\n\t\tmax-width: 100%;\n\t}\n}\n\n.ontario-card__card-type--horizontal {\n\tdisplay: flex;\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t}\n\n\t.ontario-card__image-container,\n\t.ontario-card__text-container {\n\t\tposition: relative;\n\t}\n\n\ta {\n\t\t&:focus-within {\n\t\t\tbox-shadow: none;\n\t\t\toutline: none;\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\t}\n\n\timg {\n\t\theight: 100%;\n\t\tposition: absolute;\n\t}\n}\n\n.ontario-card__image-right {\n\tflex-direction: row-reverse;\n}\n\n.ontario-card__heading {\n\t@extend %h4-styles;\n\tmargin: spacing.$spacing-0;\n\tborder-radius: globalVariables.$global-radius globalVariables.$global-radius 0 0;\n\tpadding: (spacing.$spacing-5 - spacing.$spacing-1) spacing.$spacing-5 spacing.$spacing-2 spacing.$spacing-5;\n\ttransition: text-decoration 0.3s ease-in-out;\n\tbackground-color: colours.$ontario-colour-white;\n\n\t.ontario-card:hover & {\n\t\ttext-decoration-line: underline;\n\t\ttext-decoration-color: colours.$ontario-colour-black;\n\t}\n\n\t.ontario-card__header-type--light & {\n\t\tbackground-color: colours.$ontario-greyscale-5;\n\t\tpadding-top: spacing.$spacing-4;\n\t\tpadding-bottom: spacing.$spacing-4;\n\t\tpadding-right: spacing.$spacing-9;\n\t\tborder-radius: globalVariables.$global-radius globalVariables.$global-radius 0 0;\n\t}\n\n\t.ontario-card__header-type--dark & {\n\t\tbackground-color: colours.$ontario-colour-black;\n\t\tpadding-top: spacing.$spacing-4;\n\t\tpadding-bottom: spacing.$spacing-4;\n\t\tborder-radius: globalVariables.$global-radius globalVariables.$global-radius 0 0;\n\t}\n\n\t.ontario-card__header-type--dark:hover & {\n\t\ttext-decoration-line: underline;\n\t\ttext-decoration-color: colours.$ontario-colour-white;\n\t}\n\n\t.ontario-card--no-description & {\n\t\tpadding: spacing.$spacing-4 spacing.$spacing-5;\n\t\tborder-radius: 0 0 globalVariables.$global-radius globalVariables.$global-radius;\n\t}\n\n\ta {\n\t\tcolor: colours.$ontario-colour-black;\n\t\ttext-decoration: none;\n\t\toutline: none;\n\n\t\t.ontario-card__header-type--dark & {\n\t\t\tcolor: colours.$ontario-colour-white;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tleft: 0;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t}\n\n\t\t&:focus {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&:active {\n\t\t\toutline: none;\n\t\t}\n\t}\n\n\t@media screen and (max-width: breakpoints.$medium-breakpoint) {\n\t\tfont-size: fontSizes.$ontario-font-size-large;\n\t\tpadding-left: spacing.$spacing-4;\n\t\tpadding-right: spacing.$spacing-4;\n\t}\n}\n\n.ontario-card__text-container {\n\t.ontario-card__card-type--horizontal & {\n\t\twidth: 66.6%;\n\t}\n\n\t.ontario-card__image-size-one-fourth & {\n\t\twidth: 75%;\n\t}\n\n\t.ontario-card--no-image & {\n\t\twidth: 100%;\n\t}\n}\n\n.ontario-card__description {\n\tmargin: spacing.$spacing-0;\n\tpadding: spacing.$spacing-2 spacing.$spacing-5 spacing.$spacing-5 spacing.$spacing-5;\n\tbackground-color: colours.$ontario-colour-white;\n\tborder-bottom-left-radius: globalVariables.$global-radius;\n\tborder-bottom-right-radius: globalVariables.$global-radius;\n\n\tp {\n\t\tmargin-top: spacing.$spacing-0;\n\t}\n\n\tp:last-of-type {\n\t\tmargin-bottom: spacing.$spacing-0;\n\t}\n\n\t.ontario-card__header-type--light &,\n\t.ontario-card__header-type--dark & {\n\t\tpadding-top: spacing.$spacing-4;\n\t}\n\n\t@media screen and (max-width: breakpoints.$medium-breakpoint) {\n\t\tpadding: spacing.$spacing-2 spacing.$spacing-4 spacing.$spacing-5 spacing.$spacing-4;\n\n\t\t.ontario-card__header-type--light &,\n\t\t.ontario-card__header-type--dark & {\n\t\t\tpadding-top: spacing.$spacing-4;\n\t\t}\n\t}\n}\n\n.ontario-card__image-container {\n\t.ontario-card--position-vertical & {\n\t\tmargin-bottom: spacing.$spacing-2 * -1;\n\t}\n\n\t.ontario-card__card-type--horizontal & {\n\t\twidth: 33.3%;\n\t}\n\n\t.ontario-card__image-size-one-fourth & {\n\t\twidth: 25%;\n\t}\n}\n\n.ontario-card__image {\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tbackground-size: 100% 100%;\n\n\t.ontario-card--position-vertical & {\n\t\tborder-top-left-radius: globalVariables.$global-radius;\n\t\tborder-top-right-radius: globalVariables.$global-radius;\n\t}\n\n\t.ontario-card__image-right & {\n\t\tborder-top-right-radius: globalVariables.$global-radius;\n\t\tborder-bottom-right-radius: globalVariables.$global-radius;\n\t}\n\n\t.ontario-card__image-left & {\n\t\tborder-top-left-radius: globalVariables.$global-radius;\n\t\tborder-bottom-left-radius: globalVariables.$global-radius;\n\t}\n}\n","import { Component, Prop, Element, h, State, Watch } from '@stencil/core';\nimport {\n\tCardType,\n\tCardTypes,\n\tHeaderType,\n\tHeaderTypes,\n\tHorizontalImagePositionType,\n\tHorizontalImageSizeType,\n} from './ontario-card-types';\nimport { validateValueAgainstArray } from '../../utils/validation/validation-functions';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\n\n@Component({\n\ttag: 'ontario-card',\n\tstyleUrl: 'ontario-card.scss',\n\tshadow: true,\n})\nexport class OntarioCard {\n\t@Element() host: HTMLElement;\n\n\t/**\n\t * Text to be displayed within the header.\n\t *\n\t * @example\n\t *\t<ontario-card\n\t *\t\theader-type=\"dark\"\n\t *\t\tcard-type=\"horizontal\"\n\t *\t\tlabel=\"Card Title 1\"\n\t *\t\tdescription=\"Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum\"\n\t *\t>\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * Image to be displayed within the card image container.\n\t *\n\t * This is optional.\n\t */\n\t@Prop() image?: string;\n\n\t/**\n\t * Text to be displayed within the card description container.\n\t *\n\t * This is optional.\n\t */\n\t@Prop() description?: string;\n\n\t/**\n\t * Action link for when the card is clicked.\n\t *\n\t * This is optional.\n\t */\n\t@Prop() cardLink?: string;\n\n\t/**\n\t * The type of card to render.\n\t *\n\t * If no type is passed, it will default to 'basic'.\n\t *\n\t */\n\t@Prop() cardType: CardType = 'basic';\n\n\t/**\n\t * The type of header to render.\n\t *\n\t * If no type is passed, it will default to 'default'.\n\t */\n\t@Prop() headerType: HeaderType = 'default';\n\n\t/**\n\t * The position of the image when the card-type is set to 'horizontal'.\n\t *\n\t * This prop is only necessry when the card-type is set to 'horizontal'.\n\t *\n\t * @example\n\t * \t<ontario-card\n\t *\t\tcard-type=\"horizontal\"\n\t *\t\tlabel=\"Card Title 1\"\n\t *\t\timage=\"https://picsum.photos/200/300\"\n\t *\t\thorizontal-image-position-type=\"left\"\n\t *\t\thorizontal-image-size-type=\"one-fourth\"\n\t *\t description=\"Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum\"\n\t *\t>\n\t *\t</ontario-card>\n\t */\n\t@Prop() horizontalImagePositionType?: HorizontalImagePositionType = 'left';\n\n\t/**\n\t * The size of the image when the card-type is set to 'horizontal'.\n\t *\n\t * This prop is only necessry when the card-type is set to 'horizontal'.\n\t *\n\t * @example\n\t * \t<ontario-card\n\t *\t\tcard-type=\"horizontal\"\n\t *\t\tlabel=\"Card Title 1\"\n\t *\t\timage=\"https://picsum.photos/200/300\"\n\t *\t\thorizontal-image-position-type=\"left\"\n\t *\t\thorizontal-image-size-type=\"one-fourth\"\n\t *\t description=\"Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum\"\n\t *\t>\n\t *\t</ontario-card>\n\t */\n\t@Prop() horizontalImageSizeType?: HorizontalImageSizeType = 'one-third';\n\n\t/**\n\t * Provides more context as to what the card interaction is doing. This should only be used for accessibility purposes, if the card interaction requires more * * description than what the text provides.\n\t *\n\t * This is optional.\n\t *\n\t */\n\t@Prop() ariaLabelText?: string;\n\n\t/**\n\t * Mutable variable, for internal use only.\n\t * Set the card's type depending on validation result.\n\t */\n\t@State() private cardTypeState: string;\n\n\t/**\n\t * Mutable variable, for internal use only.\n\t * Set the card's header type depending on validation result.\n\t */\n\t@State() private headerTypeState: string;\n\n\t/**\n\t * Watch for changes to the `cardType` property for validation purposes.\n\t *\n\t * If the user input doesn't match one of the array values then `cardType` will be set to its default (`basic`).\n\t * If a match is found in one of the array values then `cardType` will be set to the matching array key value.\n\t */\n\t@Watch('cardType')\n\tvalidateCardType() {\n\t\tconst isValid = validateValueAgainstArray(this.cardType, CardTypes);\n\t\tif (isValid) {\n\t\t\tthis.cardTypeState = this.cardType;\n\t\t} else {\n\t\t\tthis.cardTypeState = this.warnDefaultCardType();\n\t\t}\n\t}\n\n\t/**\n\t * Watch for changes to the `headerType` property for validation purposes.\n\t *\n\t * If the user input doesn't match one of the array values then `headerType` will be set to its default (`default`).\n\t * If a match is found in one of the array values then `headerType` will be set to the matching array key value.\n\t */\n\t@Watch('headerType')\n\tvalidateHeaderType() {\n\t\tconst isValid = validateValueAgainstArray(this.headerType, HeaderTypes);\n\t\tif (isValid) {\n\t\t\tthis.headerTypeState = this.headerType;\n\t\t} else {\n\t\t\tthis.headerTypeState = this.warnDefaultHeaderType();\n\t\t}\n\t}\n\n\t/**\n\t * Print the invalid `cardType` prop warning message.\n\t * @returns default type (basic).\n\t */\n\tprivate warnDefaultCardType(): CardType {\n\t\tconst message = new ConsoleMessageClass();\n\t\tmessage\n\t\t\t.addDesignSystemTag()\n\t\t\t.addMonospaceText(' card-type ')\n\t\t\t.addRegularText('on')\n\t\t\t.addMonospaceText(' <ontario-card> ')\n\t\t\t.addRegularText('was set to an invalid type; only')\n\t\t\t.addMonospaceText(' basic, image, label, horizontal ')\n\t\t\t.addRegularText('are supported. The default type')\n\t\t\t.addMonospaceText(' basic ')\n\t\t\t.addRegularText('is assumed.')\n\t\t\t.printMessage();\n\t\treturn 'basic';\n\t}\n\n\t/**\n\t * Print the invalid `headerType` prop warning message.\n\t * @returns default type (default).\n\t */\n\tprivate warnDefaultHeaderType(): HeaderType {\n\t\tconst message = new ConsoleMessageClass();\n\t\tmessage\n\t\t\t.addDesignSystemTag()\n\t\t\t.addMonospaceText(' header-type ')\n\t\t\t.addRegularText('on')\n\t\t\t.addMonospaceText(' <ontario-card> ')\n\t\t\t.addRegularText('was set to an invalid type; only')\n\t\t\t.addMonospaceText(' default, light, dark')\n\t\t\t.addRegularText('are supported. The default type')\n\t\t\t.addMonospaceText(' default ')\n\t\t\t.addRegularText('is assumed.')\n\t\t\t.printMessage();\n\t\treturn 'default';\n\t}\n\n\t/**\n\t * @returns the classes of the ontario cards based off the `cardType` and `headerType`.\n\t */\n\tprivate getClass() {\n\t\tif (this.cardTypeState === 'horizontal') {\n\t\t\treturn `ontario-card ontario-card__card-type--horizontal ontario-card__image-${this.horizontalImagePositionType} ontario-card__image-size-${this.horizontalImageSizeType}`;\n\t\t} else {\n\t\t\t// Return other classes when cardTypeState is not 'horizontal'\n\t\t\treturn `ontario-card ontario-card__header-type--${this.headerTypeState} ontario-card__card-type--${this.cardTypeState}`;\n\t\t}\n\t}\n\n\tprivate getHref() {\n\t\treturn this.cardLink ? this.cardLink : '#';\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateCardType();\n\t\tthis.validateHeaderType();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<li class={this.getClass()}>\n\t\t\t\t{this.image && (\n\t\t\t\t\t<div class=\"ontario-card__image-container\">\n\t\t\t\t\t\t<a href={this.getHref()} aria-label={this.ariaLabelText}>\n\t\t\t\t\t\t\t<img class=\"ontario-card__image\" src={this.image} />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<div class={`ontario-card__text-container ${this.image ? 'ontario-card--image-true' : ''}`}>\n\t\t\t\t\t<h2 class=\"ontario-card__heading\">\n\t\t\t\t\t\t<a href={this.getHref()} aria-label={this.ariaLabelText}>\n\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</h2>\n\t\t\t\t\t{this.description && (\n\t\t\t\t\t\t<div class=\"ontario-card__description\">\n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WAAK,KAAK,EAAC,+BAA+B,IACzC,SAAG,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAc,IAAI,CAAC,aAAa,IACtD,WAAK,KAAK,EAAC,qBAAqB,EAAC,GAAG,EAAE,IAAI,CAAC,KAAK,GAAI,CACjD,CACC,CACN,EACD,4DAAK,KAAK,EAAE,gCAAgC,IAAI,CAAC,KAAK,GAAG,0BAA0B,GAAG,EAAE,EAAE,IACzF,2DAAI,KAAK,EAAC,uBAAuB,IAChC,0DAAG,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,gBAAc,IAAI,CAAC,aAAa,IACrD,IAAI,CAAC,KAAK,CACR,CACA,EACJ,IAAI,CAAC,WAAW,KAChB,WAAK,KAAK,EAAC,2BAA2B,IACrC,aAAI,IAAI,CAAC,WAAW,CAAK,CACpB,CACN,CACI,CACF,EACJ;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["OntarioCard"],"sources":["src/components/ontario-card/ontario-card-types.tsx","src/components/ontario-card/ontario-card.scss?tag=ontario-card&encapsulation=shadow","src/components/ontario-card/ontario-card.tsx"],"sourcesContent":["export const CardTypes = ['basic', 'image', 'title', 'horizontal'] as const;\nexport const HeaderTypes = ['default', 'light', 'dark'] as const;\nexport const HorizontalImagePositionTypes = ['left', 'right'] as const;\nexport const HorizontalImageSizeTypes = ['one-fourth', 'one-third'] as const;\n\nexport type CardType = (typeof CardTypes)[number];\nexport type HeaderType = (typeof HeaderTypes)[number];\nexport type HorizontalImagePositionType = (typeof HorizontalImagePositionTypes)[number];\nexport type HorizontalImageSizeType = (typeof HorizontalImageSizeTypes)[number];\n","@use 'sass:math';\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/global.variables' as globalVariables;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/spacing.variables' as spacing;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/colours.variables' as colours;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/breakpoints.variables' as breakpoints;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/placeholder/focus.placeholders' as\n\tplaceholders;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-weights.variables' as fontWeights;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/font-sizes.variables' as fontSizes;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/2-tools/functions/global.functions' as globalFunctions;\n@use '@ongov/ontario-design-system-global-styles/dist/styles/scss/1-variables/typography.variables' as typography;\n\n.ontario-card {\n\tbox-shadow: 0rem 0.1875rem 0.5rem 0.0625rem rgba(0, 0, 0, 0.4);\n\tborder-radius: globalVariables.$global-radius;\n\tmargin: spacing.$spacing-0 spacing.$spacing-7 spacing.$spacing-7 spacing.$spacing-0;\n\tpadding: spacing.$spacing-0;\n\t/*\n\t * Required for cards to stay the same height regardless of content size.\n\t * Without subtracting the margin-bottom amount the cards will be too large.\n\t */\n\theight: calc(100% - spacing.$spacing-7);\n\tlist-style-type: none;\n\ttransition: all 0.3s ease-in-out;\n\tposition: relative;\n\tcursor: pointer;\n\n\t&:hover {\n\t\tbox-shadow: 0rem 0.375rem 0.75rem 0.125rem rgba(0, 0, 0, 0.35);\n\t}\n\n\t&:focus-within {\n\t\tbox-shadow: placeholders.$ontario-focus-box-shadow;\n\t\toutline: 4px solid transparent;\n\t\ttransition: box-shadow 0.1s ease-in-out;\n\t}\n\n\t&:active {\n\t\tbox-shadow: placeholders.$ontario-focus-box-shadow;\n\t\tbackground-color: colours.$ontario-greyscale-5;\n\t}\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\tmargin-bottom: spacing.$spacing-8;\n\t\twidth: 100% !important; // to override the specificity of the widths listed for the card-rows\n\t\tmax-width: 100%;\n\t}\n}\n\n.ontario-card__header-type--dark.ontario-card__description-false {\n\tbackground-color: colours.$ontario-colour-black;\n}\n\n.ontario-card__header-type--light.ontario-card__description-false {\n\tbackground-color: colours.$ontario-greyscale-5;\n}\n\n.ontario-card--image-true {\n\tmargin-top: spacing.$spacing-2 * -1;\n}\n\n.ontario-card__card-type--horizontal {\n\tdisplay: flex;\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t}\n\n\t.ontario-card__image-container,\n\t.ontario-card__text-container {\n\t\tposition: relative;\n\t}\n\n\ta {\n\t\t&:focus-within {\n\t\t\tbox-shadow: none;\n\t\t\toutline: none;\n\t\t}\n\n\t\t&:active {\n\t\t\tbox-shadow: none;\n\t\t}\n\t}\n\n\timg {\n\t\theight: 100%;\n\t\tposition: absolute;\n\t}\n}\n\n.ontario-card__image-right {\n\tflex-direction: row-reverse;\n}\n\n.ontario-card__heading {\n\t@extend %h4-styles;\n\tmargin: spacing.$spacing-0;\n\tborder-radius: globalVariables.$global-radius globalVariables.$global-radius 0 0;\n\tpadding: (spacing.$spacing-5 - spacing.$spacing-1) spacing.$spacing-5 spacing.$spacing-2 spacing.$spacing-5;\n\ttransition: text-decoration 0.3s ease-in-out;\n\tbackground-color: colours.$ontario-colour-white;\n\n\t.ontario-card:hover & {\n\t\ttext-decoration-line: underline;\n\t\ttext-decoration-color: colours.$ontario-colour-black;\n\t}\n\n\t.ontario-card__header-type--light & {\n\t\tbackground-color: colours.$ontario-greyscale-5;\n\t\tpadding-top: spacing.$spacing-4;\n\t\tpadding-bottom: spacing.$spacing-4;\n\t\tpadding-right: spacing.$spacing-9;\n\t\tborder-radius: globalVariables.$global-radius globalVariables.$global-radius 0 0;\n\t}\n\n\t.ontario-card__header-type--dark & {\n\t\tbackground-color: colours.$ontario-colour-black;\n\t\tpadding-top: spacing.$spacing-4;\n\t\tpadding-bottom: spacing.$spacing-4;\n\t\tborder-radius: globalVariables.$global-radius globalVariables.$global-radius 0 0;\n\t}\n\n\t.ontario-card__header-type--dark:hover & {\n\t\ttext-decoration-line: underline;\n\t\ttext-decoration-color: colours.$ontario-colour-white;\n\t}\n\n\ta {\n\t\tcolor: colours.$ontario-colour-black;\n\t\ttext-decoration: none;\n\t\toutline: none;\n\n\t\t.ontario-card__header-type--dark & {\n\t\t\tcolor: colours.$ontario-colour-white;\n\t\t}\n\n\t\t&::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tleft: 0;\n\t\t\ttop: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t}\n\n\t\t&:focus {\n\t\t\tbox-shadow: none;\n\t\t}\n\n\t\t&:active {\n\t\t\toutline: none;\n\t\t}\n\t}\n\n\t@media screen and (max-width: breakpoints.$medium-breakpoint) {\n\t\tfont-size: fontSizes.$ontario-font-size-large;\n\t\tpadding-left: spacing.$spacing-4;\n\t\tpadding-right: spacing.$spacing-4;\n\t}\n}\n\n.ontario-card__text-container {\n\t.ontario-card__card-type--horizontal & {\n\t\twidth: 66.6%;\n\t}\n\n\t.ontario-card__image-size-one-fourth & {\n\t\twidth: 75%;\n\t}\n\n\t.ontario-card--no-image & {\n\t\twidth: 100%;\n\t}\n}\n\n.ontario-card__description {\n\tmargin: spacing.$spacing-0;\n\tpadding: spacing.$spacing-2 spacing.$spacing-5 spacing.$spacing-5 spacing.$spacing-5;\n\tbackground-color: colours.$ontario-colour-white;\n\tborder-bottom-left-radius: globalVariables.$global-radius;\n\tborder-bottom-right-radius: globalVariables.$global-radius;\n\n\tp {\n\t\tmargin-top: spacing.$spacing-0;\n\t}\n\n\tp:last-of-type {\n\t\tmargin-bottom: spacing.$spacing-0;\n\t}\n\n\t.ontario-card__header-type--light &,\n\t.ontario-card__header-type--dark & {\n\t\tpadding-top: spacing.$spacing-4;\n\t}\n\n\t@media screen and (max-width: breakpoints.$medium-breakpoint) {\n\t\tpadding: spacing.$spacing-2 spacing.$spacing-4 spacing.$spacing-5 spacing.$spacing-4;\n\n\t\t.ontario-card__header-type--light &,\n\t\t.ontario-card__header-type--dark & {\n\t\t\tpadding-top: spacing.$spacing-4;\n\t\t}\n\t}\n}\n\n.ontario-card__image-container {\n\t.ontario-card--position-vertical & {\n\t\tmargin-bottom: spacing.$spacing-2 * -1;\n\t}\n\n\t.ontario-card__card-type--horizontal & {\n\t\twidth: 33.3%;\n\t}\n\n\t.ontario-card__image-size-one-fourth & {\n\t\twidth: 25%;\n\t}\n}\n\n.ontario-card__image {\n\twidth: 100%;\n\theight: 100%;\n\tobject-fit: cover;\n\tbackground-size: 100% 100%;\n\n\t.ontario-card--position-vertical & {\n\t\tborder-top-left-radius: globalVariables.$global-radius;\n\t\tborder-top-right-radius: globalVariables.$global-radius;\n\t}\n\n\t.ontario-card__image-right & {\n\t\tborder-top-right-radius: globalVariables.$global-radius;\n\t\tborder-bottom-right-radius: globalVariables.$global-radius;\n\t}\n\n\t.ontario-card__image-left & {\n\t\tborder-top-left-radius: globalVariables.$global-radius;\n\t\tborder-bottom-left-radius: globalVariables.$global-radius;\n\t}\n}\n","import { Component, Prop, Element, h, State, Watch } from '@stencil/core';\nimport {\n\tCardType,\n\tCardTypes,\n\tHeaderType,\n\tHeaderTypes,\n\tHorizontalImagePositionType,\n\tHorizontalImageSizeType,\n} from './ontario-card-types';\nimport { validateValueAgainstArray } from '../../utils/validation/validation-functions';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\n\n@Component({\n\ttag: 'ontario-card',\n\tstyleUrl: 'ontario-card.scss',\n\tshadow: true,\n})\nexport class OntarioCard {\n\t@Element() host: HTMLElement;\n\n\t/**\n\t * Text to be displayed within the header.\n\t *\n\t * @example\n\t *\t<ontario-card\n\t *\t\theader-type=\"dark\"\n\t *\t\tcard-type=\"horizontal\"\n\t *\t\tlabel=\"Card Title 1\"\n\t *\t\tdescription=\"Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum\"\n\t *\t>\n\t */\n\t@Prop() label: string;\n\n\t/**\n\t * Image to be displayed within the card image container.\n\t *\n\t * This is optional.\n\t */\n\t@Prop() image?: string;\n\n\t/**\n\t * Text to be displayed within the card description container.\n\t *\n\t * This is optional.\n\t */\n\t@Prop() description?: string;\n\n\t/**\n\t * Action link for when the card is clicked.\n\t *\n\t * This is optional.\n\t */\n\t@Prop() cardLink?: string;\n\n\t/**\n\t * The type of card to render.\n\t *\n\t * If no type is passed, it will default to 'basic'.\n\t *\n\t */\n\t@Prop() cardType: CardType = 'basic';\n\n\t/**\n\t * The type of header to render.\n\t *\n\t * If no type is passed, it will default to 'default'.\n\t */\n\t@Prop() headerType: HeaderType = 'default';\n\n\t/**\n\t * The position of the image when the card-type is set to 'horizontal'.\n\t *\n\t * This prop is only necessry when the card-type is set to 'horizontal'.\n\t *\n\t * @example\n\t * \t<ontario-card\n\t *\t\tcard-type=\"horizontal\"\n\t *\t\tlabel=\"Card Title 1\"\n\t *\t\timage=\"https://picsum.photos/200/300\"\n\t *\t\thorizontal-image-position-type=\"left\"\n\t *\t\thorizontal-image-size-type=\"one-fourth\"\n\t *\t description=\"Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum\"\n\t *\t>\n\t *\t</ontario-card>\n\t */\n\t@Prop() horizontalImagePositionType?: HorizontalImagePositionType = 'left';\n\n\t/**\n\t * The size of the image when the card-type is set to 'horizontal'.\n\t *\n\t * This prop is only necessry when the card-type is set to 'horizontal'.\n\t *\n\t * @example\n\t * \t<ontario-card\n\t *\t\tcard-type=\"horizontal\"\n\t *\t\tlabel=\"Card Title 1\"\n\t *\t\timage=\"https://picsum.photos/200/300\"\n\t *\t\thorizontal-image-position-type=\"left\"\n\t *\t\thorizontal-image-size-type=\"one-fourth\"\n\t *\t description=\"Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum\"\n\t *\t>\n\t *\t</ontario-card>\n\t */\n\t@Prop() horizontalImageSizeType?: HorizontalImageSizeType = 'one-third';\n\n\t/**\n\t * Provides more context as to what the card interaction is doing. This should only be used for accessibility purposes, if the card interaction requires more * * description than what the text provides.\n\t *\n\t * This is optional.\n\t *\n\t */\n\t@Prop() ariaLabelText?: string;\n\n\t/**\n\t * Mutable variable, for internal use only.\n\t * Set the card's type depending on validation result.\n\t */\n\t@State() private cardTypeState: string;\n\n\t/**\n\t * Mutable variable, for internal use only.\n\t * Set the card's header type depending on validation result.\n\t */\n\t@State() private headerTypeState: string;\n\n\t/**\n\t * Watch for changes to the `cardType` property for validation purposes.\n\t *\n\t * If the user input doesn't match one of the array values then `cardType` will be set to its default (`basic`).\n\t * If a match is found in one of the array values then `cardType` will be set to the matching array key value.\n\t */\n\t@Watch('cardType')\n\tvalidateCardType() {\n\t\tconst isValid = validateValueAgainstArray(this.cardType, CardTypes);\n\t\tif (isValid) {\n\t\t\tthis.cardTypeState = this.cardType;\n\t\t} else {\n\t\t\tthis.cardTypeState = this.warnDefaultCardType();\n\t\t}\n\t}\n\n\t/**\n\t * Watch for changes to the `headerType` property for validation purposes.\n\t *\n\t * If the user input doesn't match one of the array values then `headerType` will be set to its default (`default`).\n\t * If a match is found in one of the array values then `headerType` will be set to the matching array key value.\n\t */\n\t@Watch('headerType')\n\tvalidateHeaderType() {\n\t\tconst isValid = validateValueAgainstArray(this.headerType, HeaderTypes);\n\t\tif (isValid) {\n\t\t\tthis.headerTypeState = this.headerType;\n\t\t} else {\n\t\t\tthis.headerTypeState = this.warnDefaultHeaderType();\n\t\t}\n\t}\n\n\t/**\n\t * Print the invalid `cardType` prop warning message.\n\t * @returns default type (basic).\n\t */\n\tprivate warnDefaultCardType(): CardType {\n\t\tconst message = new ConsoleMessageClass();\n\t\tmessage\n\t\t\t.addDesignSystemTag()\n\t\t\t.addMonospaceText(' card-type ')\n\t\t\t.addRegularText('on')\n\t\t\t.addMonospaceText(' <ontario-card> ')\n\t\t\t.addRegularText('was set to an invalid type; only')\n\t\t\t.addMonospaceText(' basic, image, label, horizontal ')\n\t\t\t.addRegularText('are supported. The default type')\n\t\t\t.addMonospaceText(' basic ')\n\t\t\t.addRegularText('is assumed.')\n\t\t\t.printMessage();\n\t\treturn 'basic';\n\t}\n\n\t/**\n\t * Print the invalid `headerType` prop warning message.\n\t * @returns default type (default).\n\t */\n\tprivate warnDefaultHeaderType(): HeaderType {\n\t\tconst message = new ConsoleMessageClass();\n\t\tmessage\n\t\t\t.addDesignSystemTag()\n\t\t\t.addMonospaceText(' header-type ')\n\t\t\t.addRegularText('on')\n\t\t\t.addMonospaceText(' <ontario-card> ')\n\t\t\t.addRegularText('was set to an invalid type; only')\n\t\t\t.addMonospaceText(' default, light, dark')\n\t\t\t.addRegularText('are supported. The default type')\n\t\t\t.addMonospaceText(' default ')\n\t\t\t.addRegularText('is assumed.')\n\t\t\t.printMessage();\n\t\treturn 'default';\n\t}\n\n\t/**\n\t * @returns the classes of the ontario cards based off the `cardType` and `headerType`.\n\t */\n\tprivate getClass() {\n\t\tconst baseClass =\n\t\t\tthis.cardTypeState === 'horizontal'\n\t\t\t\t? `ontario-card ontario-card__card-type--horizontal ontario-card__image-${this.horizontalImagePositionType} ontario-card__image-size-${this.horizontalImageSizeType}`\n\t\t\t\t: `ontario-card ontario-card__header-type--${this.headerTypeState} ontario-card__card-type--${this.cardTypeState}`;\n\n\t\tconst descriptionClass = this.description ? '' : ' ontario-card__description-false';\n\n\t\treturn `${baseClass}${descriptionClass}`;\n\t}\n\n\tprivate getHref() {\n\t\treturn this.cardLink ? this.cardLink : '#';\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateCardType();\n\t\tthis.validateHeaderType();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<li class={this.getClass()}>\n\t\t\t\t{this.image && (\n\t\t\t\t\t<div class=\"ontario-card__image-container\">\n\t\t\t\t\t\t<a href={this.getHref()} aria-label={this.ariaLabelText}>\n\t\t\t\t\t\t\t<img class=\"ontario-card__image\" src={this.image} />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<div class={`ontario-card__text-container ${this.image ? 'ontario-card--image-true' : ''}`}>\n\t\t\t\t\t<h2 class=\"ontario-card__heading\">\n\t\t\t\t\t\t<a href={this.getHref()} aria-label={this.ariaLabelText}>\n\t\t\t\t\t\t\t{this.label}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</h2>\n\t\t\t\t\t{this.description && (\n\t\t\t\t\t\t<div class=\"ontario-card__description\">\n\t\t\t\t\t\t\t<p>{this.description}</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t);\n\t}\n}\n"],"version":3}
|
|
@@ -262,10 +262,19 @@ const OntarioHeader$1 = /*@__PURE__*/ proxyCustomElement(
|
|
|
262
262
|
if (this.menuToggle) this.menuToggle = !this.menuToggle;
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
265
|
-
* This listens for the `setAppLanguage` event sent from the
|
|
265
|
+
* This listens for the `setAppLanguage` event sent from the language toggle when it is is connected to the DOM.
|
|
266
|
+
* It is used for the initial language when the input component loads.
|
|
266
267
|
*/
|
|
267
268
|
handleSetAppLanguage(event) {
|
|
268
269
|
this.language = validateLanguage(event);
|
|
270
|
+
this.parseMenuItems();
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* This listens for the `headerLanguageToggled` event sent from the language toggle when it is is connected to the DOM.
|
|
274
|
+
* It is used for changing the component language after the language toggle has been activated.
|
|
275
|
+
*/
|
|
276
|
+
handleLanguageToggle(event) {
|
|
277
|
+
this.handleSetAppLanguage(event.detail.newLanguage);
|
|
269
278
|
}
|
|
270
279
|
/**
|
|
271
280
|
* Call to Ontario Menu API to fetch linksets to populate header component
|
|
@@ -558,7 +567,6 @@ const OntarioHeader$1 = /*@__PURE__*/ proxyCustomElement(
|
|
|
558
567
|
: _b.englishLink,
|
|
559
568
|
size: 'default',
|
|
560
569
|
customLanguageToggle: this.customLanguageToggle,
|
|
561
|
-
language: this.language,
|
|
562
570
|
}),
|
|
563
571
|
h(
|
|
564
572
|
'button',
|
|
@@ -690,7 +698,6 @@ const OntarioHeader$1 = /*@__PURE__*/ proxyCustomElement(
|
|
|
690
698
|
? void 0
|
|
691
699
|
: _e.englishLink,
|
|
692
700
|
customLanguageToggle: this.customLanguageToggle,
|
|
693
|
-
language: this.language,
|
|
694
701
|
}),
|
|
695
702
|
),
|
|
696
703
|
),
|
|
@@ -981,6 +988,7 @@ const OntarioHeader$1 = /*@__PURE__*/ proxyCustomElement(
|
|
|
981
988
|
[
|
|
982
989
|
[10, 'click', 'handleClick'],
|
|
983
990
|
[8, 'setAppLanguage', 'handleSetAppLanguage'],
|
|
991
|
+
[8, 'headerLanguageToggled', 'handleLanguageToggle'],
|
|
984
992
|
],
|
|
985
993
|
{
|
|
986
994
|
applicationHeaderInfo: ['parseApplicationHeaderInfo'],
|