@ongov/ontario-design-system-component-library 5.0.0-alpha.3 → 5.0.0-alpha.5

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.
Files changed (50) hide show
  1. package/dist/cjs/ontario-accordion_44.cjs.entry.js +36 -6
  2. package/dist/cjs/ontario-accordion_44.cjs.entry.js.map +1 -1
  3. package/dist/collection/components/ontario-card/ontario-card.css +8 -3
  4. package/dist/collection/components/ontario-card-collection/ontario-card-collection.css +8 -20
  5. package/dist/collection/components/ontario-footer/components/simple-footer.js +21 -1
  6. package/dist/collection/components/ontario-footer/components/simple-footer.js.map +1 -1
  7. package/dist/collection/components/ontario-footer/ontario-footer-interface.js.map +1 -1
  8. package/dist/collection/components/ontario-footer/ontario-footer.js +10 -4
  9. package/dist/collection/components/ontario-footer/ontario-footer.js.map +1 -1
  10. package/dist/collection/components/ontario-footer/test/ontario-footer.spec.js +4 -4
  11. package/dist/collection/components/ontario-footer/test/ontario-footer.spec.js.map +1 -1
  12. package/dist/collection/i18n/global.i18n.json +10 -0
  13. package/dist/components/global.i18n.js +11 -0
  14. package/dist/components/global.i18n.js.map +1 -1
  15. package/dist/components/ontario-card-collection.js +1 -1
  16. package/dist/components/ontario-card-collection.js.map +1 -1
  17. package/dist/components/ontario-card.js +1 -1
  18. package/dist/components/ontario-card.js.map +1 -1
  19. package/dist/components/ontario-footer.js +23 -4
  20. package/dist/components/ontario-footer.js.map +1 -1
  21. package/dist/components/ontario-header.js.map +1 -1
  22. package/dist/esm/ontario-accordion_44.entry.js +36 -6
  23. package/dist/esm/ontario-accordion_44.entry.js.map +1 -1
  24. package/dist/ontario-design-system-components/i18n/global.i18n.json +10 -0
  25. package/dist/ontario-design-system-components/ontario-design-system-components.esm.js +1 -1
  26. package/dist/ontario-design-system-components/{p-ac4e76b2.entry.js → p-150ea034.entry.js} +583 -557
  27. package/dist/ontario-design-system-components/p-150ea034.entry.js.map +1 -0
  28. package/dist/types/components/ontario-footer/ontario-footer-interface.d.ts +10 -8
  29. package/dist/types/components/ontario-footer/ontario-footer.d.ts +1 -1
  30. package/dist/types/components.d.ts +2 -2
  31. package/package.json +2 -2
  32. package/src/components/ontario-card/ontario-card.scss +8 -3
  33. package/src/components/ontario-card-collection/ontario-card-collection.scss +8 -24
  34. package/src/components/ontario-footer/components/simple-footer.tsx +8 -0
  35. package/src/components/ontario-footer/ontario-footer-interface.tsx +10 -8
  36. package/src/components/ontario-footer/ontario-footer.tsx +10 -3
  37. package/src/components/ontario-footer/readme.md +12 -7
  38. package/src/components/ontario-footer/test/ontario-footer.spec.tsx +4 -4
  39. package/src/components/ontario-header/ontario-header.scss +4 -4
  40. package/src/components.d.ts +2 -2
  41. package/src/index.html +6 -2
  42. package/src/translations/global.i18n.json +10 -0
  43. package/www/build/ontario-design-system-components.esm.js +1 -1
  44. package/www/build/{p-ac4e76b2.entry.js → p-150ea034.entry.js} +583 -557
  45. package/www/build/p-150ea034.entry.js.map +1 -0
  46. package/www/build/{p-c9a9b857.js → p-4140c6bb.js} +1 -1
  47. package/www/i18n/global.i18n.json +10 -0
  48. package/www/index.html +8 -4
  49. package/dist/ontario-design-system-components/p-ac4e76b2.entry.js.map +0 -1
  50. package/www/build/p-ac4e76b2.entry.js.map +0 -1
@@ -76,7 +76,7 @@
76
76
  .ontario-card {
77
77
  box-shadow: 0rem 0.1875rem 0.5rem 0.0625rem rgba(0, 0, 0, 0.4);
78
78
  border-radius: 4px;
79
- margin: 0 2.5rem 2.5rem 0;
79
+ margin-bottom: 2.5rem;
80
80
  padding: 0;
81
81
  /*
82
82
  * Required for cards to stay the same height regardless of content size.
@@ -87,6 +87,7 @@
87
87
  transition: all 0.3s ease-in-out;
88
88
  position: relative;
89
89
  cursor: pointer;
90
+ background: #ffffff;
90
91
  }
91
92
  .ontario-card:hover {
92
93
  box-shadow: 0rem 0.375rem 0.75rem 0.125rem rgba(0, 0, 0, 0.35);
@@ -162,7 +163,11 @@
162
163
  .ontario-card--image-true .ontario-card__heading {
163
164
  border-radius: 0;
164
165
  }
165
- .ontario-card__card-type--horizontal .ontario-card--image-true .ontario-card__heading {
166
+ .ontario-card__image-right .ontario-card--image-true .ontario-card__heading {
167
+ border-radius: 4px 0 0 0;
168
+ }
169
+
170
+ .ontario-card__image-left .ontario-card--image-true .ontario-card__heading {
166
171
  border-radius: 0 4px 0 0;
167
172
  }
168
173
 
@@ -434,7 +439,7 @@
434
439
  }
435
440
 
436
441
  .ontario-card__card-type--horizontal .ontario-card__text-container {
437
- width: 66.6%;
442
+ width: 66.6666666667%;
438
443
  }
439
444
  .ontario-card__image-size-one-fourth .ontario-card__text-container {
440
445
  width: 75%;
@@ -5,51 +5,39 @@
5
5
  .ontario-card-collection__container {
6
6
  display: flex;
7
7
  flex-wrap: wrap;
8
- justify-content: flex-start;
8
+ gap: 2rem;
9
9
  margin: 0;
10
10
  padding: 0;
11
11
  }
12
12
 
13
13
  .ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card) {
14
- width: calc(25% - 2rem);
15
- }
16
- .ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card):nth-child(4n) {
17
- margin-right: 0;
14
+ width: calc(25% - 1.5rem);
18
15
  }
19
16
  @media screen and (max-width: 73em) {
20
17
  .ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card) {
21
- width: calc(50% - 1.25rem);
22
- }
23
- .ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card):nth-child(2n) {
24
- margin-right: 0;
18
+ width: calc(50% - 1rem);
25
19
  }
26
20
  }
27
21
  @media screen and (max-width: 40em) {
28
22
  .ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card) {
29
- width: calc(100% - 0.5rem);
23
+ width: 100%;
30
24
  }
31
25
  }
32
26
 
33
27
  .ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card) {
34
- width: calc(33.3% - 1.75rem);
35
- }
36
- .ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card):nth-child(3n) {
37
- margin-right: 0;
28
+ width: calc(33.3% - 1.33rem);
38
29
  }
39
30
  @media screen and (max-width: 40em) {
40
31
  .ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card) {
41
- width: calc(100% - 0.5rem);
32
+ width: 100%;
42
33
  }
43
34
  }
44
35
 
45
36
  .ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card) {
46
- width: calc(50% - 1.25rem);
47
- }
48
- .ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card):nth-child(2n) {
49
- margin-right: 0;
37
+ width: calc(50% - 1rem);
50
38
  }
51
39
  @media screen and (max-width: 40em) {
52
40
  .ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card) {
53
- width: calc(100% - 0.5rem);
41
+ width: 100%;
54
42
  }
55
43
  }
@@ -1,6 +1,13 @@
1
1
  import { h } from '@stencil/core';
2
2
  const enDash = '\u2013';
3
- export const SimpleFooter = ({ accessibilityLink, privacyLink, contactLink, printerLink, className }) => {
3
+ export const SimpleFooter = ({
4
+ accessibilityLink,
5
+ privacyLink,
6
+ contactLink,
7
+ printerLink,
8
+ className,
9
+ termsOfUseLink,
10
+ }) => {
4
11
  return h(
5
12
  'div',
6
13
  { class: `ontario-row ${className !== null && className !== void 0 ? className : ''}` },
@@ -25,6 +32,19 @@ export const SimpleFooter = ({ accessibilityLink, privacyLink, contactLink, prin
25
32
  contactLink === null || contactLink === void 0 ? void 0 : contactLink.text,
26
33
  ),
27
34
  ),
35
+ termsOfUseLink &&
36
+ h(
37
+ 'li',
38
+ null,
39
+ h(
40
+ 'a',
41
+ {
42
+ class: 'ontario-footer__link',
43
+ href: termsOfUseLink === null || termsOfUseLink === void 0 ? void 0 : termsOfUseLink.href,
44
+ },
45
+ termsOfUseLink === null || termsOfUseLink === void 0 ? void 0 : termsOfUseLink.text,
46
+ ),
47
+ ),
28
48
  ),
29
49
  h(
30
50
  'div',
@@ -1 +1 @@
1
- {"version":3,"file":"simple-footer.js","sourceRoot":"","sources":["../../../../src/components/ontario-footer/components/simple-footer.tsx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inks } from '../ontario-footer-interface';\n\nconst enDash = '\\u2013';\n\ntype SimpleFooterProps = SimpleFooterLinks & {\n\tclassName?: string;\n};\n\nexport const SimpleFooter: FunctionalComponent<SimpleFooterProps> = ({\n\taccessibilityLink,\n\tprivacyLink,\n\tcontactLink,\n\tprinterLink,\n\tclassName,\n}) => {\n\treturn (\n\t\t<div class={`ontario-row ${className ?? ''}`}>\n\t\t\t<div class=\"ontario-columns ontario-small-12\">\n\t\t\t\t<ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a class=\"ontario-footer__link\" href={accessibilityLink.href}>\n\t\t\t\t\t\t\t{accessibilityLink.text}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a class=\"ontario-footer__link\" href={privacyLink.href}>\n\t\t\t\t\t\t\t{privacyLink.text}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t{contactLink && (\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<a class=\"ontario-footer__link\" href={contactLink?.href}>\n\t\t\t\t\t\t\t\t{contactLink?.text}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t)}\n\t\t\t\t</ul>\n\t\t\t\t<div class=\"ontario-footer__copyright\">\n\t\t\t\t\t<a class=\"ontario-footer__link\" href={printerLink?.href}>\n\t\t\t\t\t\t&copy; {printerLink?.text}{' '}\n\t\t\t\t\t\t<span class=\"ontario-nbsp\">\n\t\t\t\t\t\t\t2012{enDash}\n\t\t\t\t\t\t\t{String(new Date().getFullYear()).slice(-2)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"]}
1
+ {"version":3,"file":"simple-footer.js","sourceRoot":"","sources":["../../../../src/components/ontario-footer/components/simple-footer.tsx"],"names":[],"mappings":"AAAA,OAA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E,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACrC,CACJ,CACC,CACD,CACD,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { h, FunctionalComponent } from '@stencil/core';\nimport { SimpleFooterLinks } from '../ontario-footer-interface';\n\nconst enDash = '\\u2013';\n\ntype SimpleFooterProps = SimpleFooterLinks & {\n\tclassName?: string;\n};\n\nexport const SimpleFooter: FunctionalComponent<SimpleFooterProps> = ({\n\taccessibilityLink,\n\tprivacyLink,\n\tcontactLink,\n\tprinterLink,\n\tclassName,\n\ttermsOfUseLink,\n}) => {\n\treturn (\n\t\t<div class={`ontario-row ${className ?? ''}`}>\n\t\t\t<div class=\"ontario-columns ontario-small-12\">\n\t\t\t\t<ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a class=\"ontario-footer__link\" href={accessibilityLink.href}>\n\t\t\t\t\t\t\t{accessibilityLink.text}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<a class=\"ontario-footer__link\" href={privacyLink.href}>\n\t\t\t\t\t\t\t{privacyLink.text}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t{contactLink && (\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<a class=\"ontario-footer__link\" href={contactLink?.href}>\n\t\t\t\t\t\t\t\t{contactLink?.text}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t)}\n\t\t\t\t\t{termsOfUseLink && (\n\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t<a class=\"ontario-footer__link\" href={termsOfUseLink?.href}>\n\t\t\t\t\t\t\t\t{termsOfUseLink?.text}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t)}\n\t\t\t\t</ul>\n\t\t\t\t<div class=\"ontario-footer__copyright\">\n\t\t\t\t\t<a class=\"ontario-footer__link\" href={printerLink?.href}>\n\t\t\t\t\t\t&copy; {printerLink?.text}{' '}\n\t\t\t\t\t\t<span class=\"ontario-nbsp\">\n\t\t\t\t\t\t\t2012{enDash}\n\t\t\t\t\t\t\t{String(new Date().getFullYear()).slice(-2)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</a>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ontario-footer-interface.js","sourceRoot":"","sources":["../../../src/components/ontario-footer/ontario-footer-interface.tsx"],"names":[],"mappings":"","sourcesContent":["export type OntarioFooterType = 'default' | 'twoColumn' | 'threeColumn';\n\nexport interface FooterLink {\n\ttext?: string;\n\thref: string;\n}\n\n// External interface to be passed to the Footer component\nexport interface FooterLinks {\n\taccessibilityLink?: Partial<FooterLink>;\n\tprivacyLink?: Partial<FooterLink>;\n\tcontactLink?: FooterLink;\n\tprinterLink?: Partial<FooterLink>;\n}\n\n// Internal interface for SimpleFooter Component\nexport interface SimpleFooterLinks {\n\taccessibilityLink: Required<FooterLink>;\n\tprivacyLink: Required<FooterLink>;\n\tprinterLink: Required<FooterLink>;\n\tcontactLink?: Required<FooterLink>;\n}\n\nexport type FooterContentType = 'text' | 'list' | 'html';\n\nexport type HeadingLevelType = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport interface FooterColumnContent {\n\theading?: string;\n\theadingLevel?: HeadingLevelType;\n\ttype: FooterContentType;\n\ttext?: string;\n\thtml?: string | HTMLElement;\n\tlist?: string[];\n}\n\nexport interface FooterColumnData {\n\ttitle: string;\n\theadingLevel?: HeadingLevelType;\n\tcontent: Array<FooterColumnContent>;\n\tbutton?: {\n\t\ttext: string;\n\t\tlink: string;\n\t};\n}\nexport interface TwoColumnOptions {\n\tcolumn1: FooterColumnData;\n\tcolumn2: FooterColumnData;\n}\n\nexport interface ThreeColumnOptions extends TwoColumnOptions {\n\tcolumn3: FooterColumnData;\n}\n"]}
1
+ {"version":3,"file":"ontario-footer-interface.js","sourceRoot":"","sources":["../../../src/components/ontario-footer/ontario-footer-interface.tsx"],"names":[],"mappings":"","sourcesContent":["export type OntarioFooterType = 'default' | 'twoColumn' | 'threeColumn';\n\nexport interface FooterLink {\n\ttext: string;\n\thref: string;\n}\n\n// External interface to be passed to the Footer component\nexport interface FooterLinks {\n\taccessibilityLink?: FooterLink;\n\tprivacyLink?: FooterLink;\n\tcontactLink?: FooterLink;\n\tprinterLink?: FooterLink;\n\ttermsOfUseLink?: FooterLink;\n}\n\n// Internal interface for SimpleFooter Component\nexport interface SimpleFooterLinks {\n\taccessibilityLink: FooterLink;\n\tprivacyLink: FooterLink;\n\tprinterLink: FooterLink;\n\tcontactLink?: FooterLink;\n\ttermsOfUseLink?: FooterLink;\n}\n\nexport type FooterContentType = 'text' | 'list' | 'html';\n\nexport type HeadingLevelType = 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\n\nexport interface FooterColumnContent {\n\theading?: string;\n\theadingLevel?: HeadingLevelType;\n\ttype: FooterContentType;\n\ttext?: string;\n\thtml?: string | HTMLElement;\n\tlist?: string[];\n}\n\nexport interface FooterColumnData {\n\ttitle: string;\n\theadingLevel?: HeadingLevelType;\n\tcontent: Array<FooterColumnContent>;\n\tbutton?: {\n\t\ttext: string;\n\t\tlink: string;\n\t};\n}\nexport interface TwoColumnOptions {\n\tcolumn1: FooterColumnData;\n\tcolumn2: FooterColumnData;\n}\n\nexport interface ThreeColumnOptions extends TwoColumnOptions {\n\tcolumn3: FooterColumnData;\n}\n"]}
@@ -129,9 +129,9 @@ export class OntarioFooter {
129
129
  return classes;
130
130
  }
131
131
  getFooterLinks() {
132
- var _a, _b, _c, _d, _e, _f, _g;
132
+ var _a, _b, _c, _d, _e, _f, _g, _h;
133
133
  const { language, translations, footerLinksState } = this;
134
- const { accessibilityLink, privacyLink, contactLink, printerLink } =
134
+ const { accessibilityLink, privacyLink, contactLink, termsOfUseLink, printerLink } =
135
135
  footerLinksState !== null && footerLinksState !== void 0 ? footerLinksState : {};
136
136
  const links = {
137
137
  accessibilityLink: {
@@ -168,11 +168,17 @@ export class OntarioFooter {
168
168
  },
169
169
  };
170
170
  if (contactLink) {
171
- links['contactLink'] = {
171
+ links.contactLink = {
172
172
  href: contactLink.href,
173
173
  text: (_g = contactLink.text) !== null && _g !== void 0 ? _g : translations.contactUs[language],
174
174
  };
175
175
  }
176
+ if (termsOfUseLink) {
177
+ links.termsOfUseLink = {
178
+ href: termsOfUseLink.href,
179
+ text: (_h = termsOfUseLink.text) !== null && _h !== void 0 ? _h : translations.termsOfUse[language],
180
+ };
181
+ }
176
182
  return links;
177
183
  }
178
184
  componentWillLoad() {
@@ -294,7 +300,7 @@ export class OntarioFooter {
294
300
  optional: false,
295
301
  docs: {
296
302
  tags: [],
297
- text: "A prop that stores the required links for all footers.\nAvailable options are 'accessibilityLink', 'privacyLink', 'contactLink' and 'printerLink'",
303
+ text: "A prop that stores the required links for all footers.\nAvailable options are 'accessibilityLink', 'privacyLink', 'contactLink','termsOfUseLink' and 'printerLink'",
298
304
  },
299
305
  attribute: 'footer-links',
300
306
  reflect: false,
@@ -1 +1 @@
1
- {"version":3,"file":"ontario-footer.js","sourceRoot":"","sources":["../../../src/components/ontario-footer/ontario-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AASvF,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAA0B,YAAY,EAAE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,M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IAAI,CAAC,sBAAsB,EAAE;gBAElD,EAAC,YAAY,IAAC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,QAAC,yBAAyB,SAAG;gBAC3F,EAAC,YAAY,IAAC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,SAAG;gBACjE,EAAC,YAAY,IAAC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,SAAG,CACzE,CACxB,CAAC;QACH,CAAC;QAED,OAAO,CACN,cAAQ,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,sBAAsB,EAAE,EAAE;YAC9F,EAAC,YAAY,oBAAK,WAAW,EAAI,CACzB,CACT,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Prop, h, State, Watch, Listen, getAssetPath } from '@stencil/core';\n\nimport {\n\tFooterLinks,\n\tOntarioFooterType,\n\tThreeColumnOptions,\n\tTwoColumnOptions,\n\tSimpleFooterLinks,\n} from './ontario-footer-interface';\nimport { ExpandedFooterWrapper, FooterColumn, FooterSocialLinksProps, SimpleFooter } from './components';\nimport { isInvalidTwoColumnOptions, isInvalidThreeColumnOptions } from './utils';\nimport { Language } from '../../utils/common/language-types';\nimport { validateLanguage } from '../../utils/validation/validation-functions';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\nimport { ConsoleType } from '../../utils/console-message/console-message.enum';\n\nimport translations from '../../translations/global.i18n.json';\n\n@Component({\n\ttag: 'ontario-footer',\n\tstyleUrl: 'ontario-footer.scss',\n\tshadow: true,\n\tassetsDirs: ['assets'],\n})\nexport class OntarioFooter {\n\t/**\n\t * The language of the component.\n\t * This is used for translations, and is by default set through event listeners checking for a language property from the header. If no language is passed, it will default to English.\n\t */\n\t@Prop({ mutable: true }) language: Language;\n\n\t/**\n\t * The type of footer to be rendered. If no prop is provided, it will default to the 'default' type.\n\t */\n\t@Prop() type: OntarioFooterType = 'default';\n\n\t/**\n\t * A prop that stores the required links for all footers.\n\t * Available options are 'accessibilityLink', 'privacyLink', 'contactLink' and 'printerLink'\n\t */\n\t@Prop() footerLinks: FooterLinks | string;\n\n\t/**\n\t * Social media links to render in the footer.\n\t * Available options are 'facebook', 'twitter', 'instagram' and 'youtube'\n\t */\n\t@Prop() socialLinks: FooterSocialLinksProps | string;\n\n\t/**\n\t * Stores the titles and content for the expanded two column footer.\n\t */\n\t@Prop() twoColumnOptions?: TwoColumnOptions | string;\n\n\t/**\n\t * Stores the titles and content for the expanded three column footer.\n\t */\n\t@Prop() threeColumnOptions?: ThreeColumnOptions | string;\n\n\t/**\n\t * Top margin for the footer. By default, this prop is set to `true`, which adds a margin top value of `5rem`.\n\t * If set to `false`, the top margin value will be set to zero.\n\t */\n\t@Prop() topMargin: boolean = true;\n\n\t/**\n\t * The base path to an assets folder containing the Design System assets\n\t */\n\t@Prop() assetBasePath: string;\n\n\t@State() translations: any = translations;\n\n\t@State() private footerLinksState: FooterLinks;\n\n\t@State() private socialLinksState: FooterSocialLinksProps;\n\n\t@State() private twoColumnState: TwoColumnOptions;\n\n\t@State() private threeColumnState: ThreeColumnOptions;\n\n\t/**\n\t * This listens for the `setAppLanguage` event sent from the test language toggler when it is\n\t * connected to the DOM. It is used for the initial language when the input component loads.\n\t */\n\t@Listen('setAppLanguage', { target: 'window' })\n\thandleSetAppLanguage(event: CustomEvent<Language>) {\n\t\tif (!this.language) {\n\t\t\tthis.language = validateLanguage(event);\n\t\t}\n\t}\n\n\t@Listen('headerLanguageToggled', { target: 'window' })\n\thandleHeaderLanguageToggled(event: CustomEvent<Language>) {\n\t\tthis.language = validateLanguage(event);\n\t}\n\n\t@Watch('footerLinks')\n\tprivate processFooterLinks() {\n\t\tthis.parseOptions(this.footerLinks);\n\t}\n\n\t@Watch('socialLinks')\n\tprivate processSocialLinks() {\n\t\tthis.parseOptions(this.socialLinks);\n\t}\n\n\t@Watch('twoColumnOptions')\n\tprivate processTwoColumnOptions() {\n\t\tthis.twoColumnOptions && this.parseOptions(this.twoColumnOptions);\n\t\tthis.verifyTwoColumnOptions();\n\t}\n\n\t@Watch('threeColumnOptions')\n\tprivate processThreeColumnOptions() {\n\t\tthis.threeColumnOptions && this.parseOptions(this.threeColumnOptions);\n\t\tthis.verifyThreeColumnOptions();\n\t}\n\n\tprivate isTwoColumnLayout = (): boolean => this.type === 'twoColumn';\n\tprivate isThreeColumnLayout = (): boolean => this.type === 'threeColumn';\n\tprivate isExpandedLayout = (): boolean => this.isTwoColumnLayout() || this.isThreeColumnLayout();\n\n\tprivate verifyTwoColumnOptions() {\n\t\tif (this.isTwoColumnLayout() && isInvalidTwoColumnOptions(this.twoColumnState)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' twoColumnOptions ')\n\t\t\t\t.addRegularText('for')\n\t\t\t\t.addMonospaceText(' <ontario-footer> ')\n\t\t\t\t.addRegularText('were not fully set. Please review your values and ensure all options are set.')\n\t\t\t\t.printMessage();\n\t\t}\n\t}\n\n\tprivate verifyThreeColumnOptions() {\n\t\tif (this.isThreeColumnLayout() && isInvalidThreeColumnOptions(this.threeColumnState)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' threeColumnOptions ')\n\t\t\t\t.addRegularText('for')\n\t\t\t\t.addMonospaceText(' <ontario-footer> ')\n\t\t\t\t.addRegularText('were not fully set. Please review your values and ensure all options are set.')\n\t\t\t\t.printMessage();\n\t\t}\n\t}\n\n\tprivate parseOptions(optionType: any) {\n\t\tconst options = optionType;\n\t\tconst isString = typeof options === 'string';\n\n\t\tif (!options) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tif (options === this.footerLinks) {\n\t\t\t\tthis.footerLinksState = isString ? JSON.parse(options) : options;\n\t\t\t} else if (options === this.socialLinks) {\n\t\t\t\tthis.socialLinksState = isString ? JSON.parse(options) : options;\n\t\t\t} else if (options === this.twoColumnOptions) {\n\t\t\t\tthis.twoColumnState = isString ? JSON.parse(options) : options;\n\t\t\t} else {\n\t\t\t\tthis.threeColumnState = isString ? JSON.parse(options) : options;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addRegularText(' failed to parse props for ')\n\t\t\t\t.addMonospaceText('<ontario-footer>')\n\t\t\t\t.addRegularText(' in ')\n\t\t\t\t.addMonospaceText('parseOptions()')\n\t\t\t\t.addRegularText(' method \\n ')\n\t\t\t\t.addMonospaceText(error.stack)\n\t\t\t\t.printMessage(ConsoleType.Error);\n\t\t}\n\t}\n\n\t/**\n\t * Generate a link to the given image based on the base asset path.\n\t * @param imageName Name of the image to build the path to\n\t * @returns Path to image with asset path\n\t */\n\tprivate getImageAssetSrcPath(imageName: string): string {\n\t\treturn `${this.assetBasePath ? this.assetBasePath : getAssetPath('./assets')}/${imageName}`;\n\t}\n\n\t/**\n\t * Generate CSS url to the background image\n\t * @returns path to the background image\n\t */\n\tprivate getBackgroundImagePath(): string {\n\t\tconst supergraphicLogoFile = this.isExpandedLayout()\n\t\t\t? 'footer-expanded-supergraphic-logo.svg'\n\t\t\t: 'footer-default-supergraphic-logo.svg';\n\n\t\treturn `url(${this.getImageAssetSrcPath(supergraphicLogoFile)})`;\n\t}\n\n\tprivate getFooterClasses() {\n\t\tlet classes = 'ontario-footer ontario-footer--default';\n\n\t\tif (!this.topMargin) {\n\t\t\tclasses = `${classes} ontario-margin-top-0-!`;\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tprivate getFooterLinks(): SimpleFooterLinks {\n\t\tconst { language, translations, footerLinksState } = this;\n\t\tconst { accessibilityLink, privacyLink, contactLink, printerLink } = footerLinksState ?? {};\n\n\t\tconst links: SimpleFooterLinks = {\n\t\t\taccessibilityLink: {\n\t\t\t\thref: accessibilityLink?.href ?? translations.accessibilityLink.link[language],\n\t\t\t\ttext: accessibilityLink?.text ?? translations.accessibilityLink.text[language],\n\t\t\t},\n\t\t\tprivacyLink: {\n\t\t\t\thref: privacyLink?.href ?? translations.privacyLink.link[language],\n\t\t\t\ttext: privacyLink?.text ?? translations.privacyLink.text[language],\n\t\t\t},\n\t\t\tprinterLink: {\n\t\t\t\thref: printerLink?.href ?? translations.printerLink.link[language],\n\t\t\t\ttext: printerLink?.text ?? translations.printerLink.text[language],\n\t\t\t},\n\t\t};\n\n\t\tif (contactLink) {\n\t\t\tlinks['contactLink'] = {\n\t\t\t\thref: contactLink.href,\n\t\t\t\ttext: contactLink.text ?? translations.contactUs[language],\n\t\t\t};\n\t\t}\n\n\t\treturn links;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.processFooterLinks();\n\t\tthis.processSocialLinks();\n\t\tthis.processTwoColumnOptions();\n\t\tthis.processThreeColumnOptions();\n\n\t\tthis.language = validateLanguage(this.language);\n\t}\n\n\trender() {\n\t\tconst { socialLinksState, twoColumnState, threeColumnState, topMargin } = this;\n\t\tconst footerLinks = this.getFooterLinks();\n\n\t\tif (this.isTwoColumnLayout()) {\n\t\t\treturn (\n\t\t\t\t<ExpandedFooterWrapper\n\t\t\t\t\tfooterLinks={footerLinks}\n\t\t\t\t\ttopMargin={topMargin}\n\t\t\t\t\tbackgroundImagePath={this.getBackgroundImagePath()}\n\t\t\t\t>\n\t\t\t\t\t<FooterColumn data={twoColumnState.column1} />\n\t\t\t\t\t<FooterColumn data={twoColumnState.column2} socialLinks={socialLinksState} />\n\t\t\t\t</ExpandedFooterWrapper>\n\t\t\t);\n\t\t}\n\n\t\tif (this.isThreeColumnLayout()) {\n\t\t\treturn (\n\t\t\t\t<ExpandedFooterWrapper\n\t\t\t\t\tfooterLinks={footerLinks}\n\t\t\t\t\ttopMargin={topMargin}\n\t\t\t\t\tbackgroundImagePath={this.getBackgroundImagePath()}\n\t\t\t\t>\n\t\t\t\t\t<FooterColumn data={threeColumnState.column1} isThreeColLayout isFullWidthInMediumLayout />\n\t\t\t\t\t<FooterColumn data={threeColumnState.column2} isThreeColLayout />\n\t\t\t\t\t<FooterColumn data={threeColumnState.column3} socialLinks={socialLinksState} isThreeColLayout />\n\t\t\t\t</ExpandedFooterWrapper>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<footer class={this.getFooterClasses()} style={{ '--imagePath': this.getBackgroundImagePath() }}>\n\t\t\t\t<SimpleFooter {...footerLinks} />\n\t\t\t</footer>\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"ontario-footer.js","sourceRoot":"","sources":["../../../src/components/ontario-footer/ontario-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AASvF,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAA0B,YAAY,EAAE,MAAM,cAAc,CAAC;AACzG,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AAE/E,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAQ/D,MAAM,OAAO,aAAa;;QA6FjB,s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EAAE,EAAE,CAAC;YAChC,OAAO,CACN,EAAC,qBAAqB,IACrB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,IAAI,CAAC,sBAAsB,EAAE;gBAElD,EAAC,YAAY,IAAC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,QAAC,yBAAyB,SAAG;gBAC3F,EAAC,YAAY,IAAC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,SAAG;gBACjE,EAAC,YAAY,IAAC,IAAI,EAAE,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,SAAG,CACzE,CACxB,CAAC;QACH,CAAC;QAED,OAAO,CACN,cAAQ,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,sBAAsB,EAAE,EAAE;YAC9F,EAAC,YAAY,oBAAK,WAAW,EAAI,CACzB,CACT,CAAC;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACD","sourcesContent":["import { Component, Prop, h, State, Watch, Listen, getAssetPath } from '@stencil/core';\n\nimport {\n\tFooterLinks,\n\tOntarioFooterType,\n\tThreeColumnOptions,\n\tTwoColumnOptions,\n\tSimpleFooterLinks,\n} from './ontario-footer-interface';\nimport { ExpandedFooterWrapper, FooterColumn, FooterSocialLinksProps, SimpleFooter } from './components';\nimport { isInvalidTwoColumnOptions, isInvalidThreeColumnOptions } from './utils';\nimport { Language } from '../../utils/common/language-types';\nimport { validateLanguage } from '../../utils/validation/validation-functions';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\nimport { ConsoleType } from '../../utils/console-message/console-message.enum';\n\nimport translations from '../../translations/global.i18n.json';\n\n@Component({\n\ttag: 'ontario-footer',\n\tstyleUrl: 'ontario-footer.scss',\n\tshadow: true,\n\tassetsDirs: ['assets'],\n})\nexport class OntarioFooter {\n\t/**\n\t * The language of the component.\n\t * This is used for translations, and is by default set through event listeners checking for a language property from the header. If no language is passed, it will default to English.\n\t */\n\t@Prop({ mutable: true }) language: Language;\n\n\t/**\n\t * The type of footer to be rendered. If no prop is provided, it will default to the 'default' type.\n\t */\n\t@Prop() type: OntarioFooterType = 'default';\n\n\t/**\n\t * A prop that stores the required links for all footers.\n\t * Available options are 'accessibilityLink', 'privacyLink', 'contactLink','termsOfUseLink' and 'printerLink'\n\t */\n\t@Prop() footerLinks: FooterLinks | string;\n\n\t/**\n\t * Social media links to render in the footer.\n\t * Available options are 'facebook', 'twitter', 'instagram' and 'youtube'\n\t */\n\t@Prop() socialLinks: FooterSocialLinksProps | string;\n\n\t/**\n\t * Stores the titles and content for the expanded two column footer.\n\t */\n\t@Prop() twoColumnOptions?: TwoColumnOptions | string;\n\n\t/**\n\t * Stores the titles and content for the expanded three column footer.\n\t */\n\t@Prop() threeColumnOptions?: ThreeColumnOptions | string;\n\n\t/**\n\t * Top margin for the footer. By default, this prop is set to `true`, which adds a margin top value of `5rem`.\n\t * If set to `false`, the top margin value will be set to zero.\n\t */\n\t@Prop() topMargin: boolean = true;\n\n\t/**\n\t * The base path to an assets folder containing the Design System assets\n\t */\n\t@Prop() assetBasePath: string;\n\n\t@State() translations: any = translations;\n\n\t@State() private footerLinksState: FooterLinks;\n\n\t@State() private socialLinksState: FooterSocialLinksProps;\n\n\t@State() private twoColumnState: TwoColumnOptions;\n\n\t@State() private threeColumnState: ThreeColumnOptions;\n\n\t/**\n\t * This listens for the `setAppLanguage` event sent from the test language toggler when it is\n\t * connected to the DOM. It is used for the initial language when the input component loads.\n\t */\n\t@Listen('setAppLanguage', { target: 'window' })\n\thandleSetAppLanguage(event: CustomEvent<Language>) {\n\t\tif (!this.language) {\n\t\t\tthis.language = validateLanguage(event);\n\t\t}\n\t}\n\n\t@Listen('headerLanguageToggled', { target: 'window' })\n\thandleHeaderLanguageToggled(event: CustomEvent<Language>) {\n\t\tthis.language = validateLanguage(event);\n\t}\n\n\t@Watch('footerLinks')\n\tprivate processFooterLinks() {\n\t\tthis.parseOptions(this.footerLinks);\n\t}\n\n\t@Watch('socialLinks')\n\tprivate processSocialLinks() {\n\t\tthis.parseOptions(this.socialLinks);\n\t}\n\n\t@Watch('twoColumnOptions')\n\tprivate processTwoColumnOptions() {\n\t\tthis.twoColumnOptions && this.parseOptions(this.twoColumnOptions);\n\t\tthis.verifyTwoColumnOptions();\n\t}\n\n\t@Watch('threeColumnOptions')\n\tprivate processThreeColumnOptions() {\n\t\tthis.threeColumnOptions && this.parseOptions(this.threeColumnOptions);\n\t\tthis.verifyThreeColumnOptions();\n\t}\n\n\tprivate isTwoColumnLayout = (): boolean => this.type === 'twoColumn';\n\tprivate isThreeColumnLayout = (): boolean => this.type === 'threeColumn';\n\tprivate isExpandedLayout = (): boolean => this.isTwoColumnLayout() || this.isThreeColumnLayout();\n\n\tprivate verifyTwoColumnOptions() {\n\t\tif (this.isTwoColumnLayout() && isInvalidTwoColumnOptions(this.twoColumnState)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' twoColumnOptions ')\n\t\t\t\t.addRegularText('for')\n\t\t\t\t.addMonospaceText(' <ontario-footer> ')\n\t\t\t\t.addRegularText('were not fully set. Please review your values and ensure all options are set.')\n\t\t\t\t.printMessage();\n\t\t}\n\t}\n\n\tprivate verifyThreeColumnOptions() {\n\t\tif (this.isThreeColumnLayout() && isInvalidThreeColumnOptions(this.threeColumnState)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' threeColumnOptions ')\n\t\t\t\t.addRegularText('for')\n\t\t\t\t.addMonospaceText(' <ontario-footer> ')\n\t\t\t\t.addRegularText('were not fully set. Please review your values and ensure all options are set.')\n\t\t\t\t.printMessage();\n\t\t}\n\t}\n\n\tprivate parseOptions(optionType: any) {\n\t\tconst options = optionType;\n\t\tconst isString = typeof options === 'string';\n\n\t\tif (!options) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tif (options === this.footerLinks) {\n\t\t\t\tthis.footerLinksState = isString ? JSON.parse(options) : options;\n\t\t\t} else if (options === this.socialLinks) {\n\t\t\t\tthis.socialLinksState = isString ? JSON.parse(options) : options;\n\t\t\t} else if (options === this.twoColumnOptions) {\n\t\t\t\tthis.twoColumnState = isString ? JSON.parse(options) : options;\n\t\t\t} else {\n\t\t\t\tthis.threeColumnState = isString ? JSON.parse(options) : options;\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addRegularText(' failed to parse props for ')\n\t\t\t\t.addMonospaceText('<ontario-footer>')\n\t\t\t\t.addRegularText(' in ')\n\t\t\t\t.addMonospaceText('parseOptions()')\n\t\t\t\t.addRegularText(' method \\n ')\n\t\t\t\t.addMonospaceText(error.stack)\n\t\t\t\t.printMessage(ConsoleType.Error);\n\t\t}\n\t}\n\n\t/**\n\t * Generate a link to the given image based on the base asset path.\n\t * @param imageName Name of the image to build the path to\n\t * @returns Path to image with asset path\n\t */\n\tprivate getImageAssetSrcPath(imageName: string): string {\n\t\treturn `${this.assetBasePath ? this.assetBasePath : getAssetPath('./assets')}/${imageName}`;\n\t}\n\n\t/**\n\t * Generate CSS url to the background image\n\t * @returns path to the background image\n\t */\n\tprivate getBackgroundImagePath(): string {\n\t\tconst supergraphicLogoFile = this.isExpandedLayout()\n\t\t\t? 'footer-expanded-supergraphic-logo.svg'\n\t\t\t: 'footer-default-supergraphic-logo.svg';\n\n\t\treturn `url(${this.getImageAssetSrcPath(supergraphicLogoFile)})`;\n\t}\n\n\tprivate getFooterClasses() {\n\t\tlet classes = 'ontario-footer ontario-footer--default';\n\n\t\tif (!this.topMargin) {\n\t\t\tclasses = `${classes} ontario-margin-top-0-!`;\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tprivate getFooterLinks(): SimpleFooterLinks {\n\t\tconst { language, translations, footerLinksState } = this;\n\t\tconst { accessibilityLink, privacyLink, contactLink, termsOfUseLink, printerLink } = footerLinksState ?? {};\n\n\t\tconst links: SimpleFooterLinks = {\n\t\t\taccessibilityLink: {\n\t\t\t\thref: accessibilityLink?.href ?? translations.accessibilityLink.link[language],\n\t\t\t\ttext: accessibilityLink?.text ?? translations.accessibilityLink.text[language],\n\t\t\t},\n\t\t\tprivacyLink: {\n\t\t\t\thref: privacyLink?.href ?? translations.privacyLink.link[language],\n\t\t\t\ttext: privacyLink?.text ?? translations.privacyLink.text[language],\n\t\t\t},\n\t\t\tprinterLink: {\n\t\t\t\thref: printerLink?.href ?? translations.printerLink.link[language],\n\t\t\t\ttext: printerLink?.text ?? translations.printerLink.text[language],\n\t\t\t},\n\t\t};\n\n\t\tif (contactLink) {\n\t\t\tlinks.contactLink = {\n\t\t\t\thref: contactLink.href,\n\t\t\t\ttext: contactLink.text ?? translations.contactUs[language],\n\t\t\t};\n\t\t}\n\n\t\tif (termsOfUseLink) {\n\t\t\tlinks.termsOfUseLink = {\n\t\t\t\thref: termsOfUseLink.href,\n\t\t\t\ttext: termsOfUseLink.text ?? translations.termsOfUse[language],\n\t\t\t};\n\t\t}\n\n\t\treturn links;\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.processFooterLinks();\n\t\tthis.processSocialLinks();\n\t\tthis.processTwoColumnOptions();\n\t\tthis.processThreeColumnOptions();\n\n\t\tthis.language = validateLanguage(this.language);\n\t}\n\n\trender() {\n\t\tconst { socialLinksState, twoColumnState, threeColumnState, topMargin } = this;\n\t\tconst footerLinks = this.getFooterLinks();\n\n\t\tif (this.isTwoColumnLayout()) {\n\t\t\treturn (\n\t\t\t\t<ExpandedFooterWrapper\n\t\t\t\t\tfooterLinks={footerLinks}\n\t\t\t\t\ttopMargin={topMargin}\n\t\t\t\t\tbackgroundImagePath={this.getBackgroundImagePath()}\n\t\t\t\t>\n\t\t\t\t\t<FooterColumn data={twoColumnState.column1} />\n\t\t\t\t\t<FooterColumn data={twoColumnState.column2} socialLinks={socialLinksState} />\n\t\t\t\t</ExpandedFooterWrapper>\n\t\t\t);\n\t\t}\n\n\t\tif (this.isThreeColumnLayout()) {\n\t\t\treturn (\n\t\t\t\t<ExpandedFooterWrapper\n\t\t\t\t\tfooterLinks={footerLinks}\n\t\t\t\t\ttopMargin={topMargin}\n\t\t\t\t\tbackgroundImagePath={this.getBackgroundImagePath()}\n\t\t\t\t>\n\t\t\t\t\t<FooterColumn data={threeColumnState.column1} isThreeColLayout isFullWidthInMediumLayout />\n\t\t\t\t\t<FooterColumn data={threeColumnState.column2} isThreeColLayout />\n\t\t\t\t\t<FooterColumn data={threeColumnState.column3} socialLinks={socialLinksState} isThreeColLayout />\n\t\t\t\t</ExpandedFooterWrapper>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<footer class={this.getFooterClasses()} style={{ '--imagePath': this.getBackgroundImagePath() }}>\n\t\t\t\t<SimpleFooter {...footerLinks} />\n\t\t\t</footer>\n\t\t);\n\t}\n}\n"]}
@@ -56,7 +56,7 @@ describe('ontario-footer', () => {
56
56
  <li><a class="ontario-footer__link" href="https://www.ontario.ca/feedback/contact-us">Contact</a></li>
57
57
  </ul>
58
58
  <div class="ontario-footer__copyright">
59
- <a class="ontario-footer__link" href="https://www.ontario.ca/page/copyright-information">© King's Printer for Ontario, <span class="ontario-nbsp">2012–24</span></a>
59
+ <a class="ontario-footer__link" href="https://www.ontario.ca/page/copyright-information">© King's Printer for Ontario, <span class="ontario-nbsp">2012–25</span></a>
60
60
  </div>
61
61
  </div>
62
62
  </div>
@@ -198,7 +198,7 @@ describe('ontario-footer', () => {
198
198
  <li><a class="ontario-footer__link" href="https://www.ontario.ca/feedback/contact-us">Contact</a></li>
199
199
  </ul>
200
200
  <div class="ontario-footer__copyright">
201
- <a class="ontario-footer__link" href="https://www.ontario.ca/page/copyright-information">© King's Printer for Ontario, <span class="ontario-nbsp">2012–24</span></a>
201
+ <a class="ontario-footer__link" href="https://www.ontario.ca/page/copyright-information">© King's Printer for Ontario, <span class="ontario-nbsp">2012–25</span></a>
202
202
  </div>
203
203
  </div>
204
204
  </div>
@@ -366,7 +366,7 @@ describe('ontario-footer', () => {
366
366
  <li><a class="ontario-footer__link" href="https://www.ontario.ca/feedback/contact-us">Contact</a></li>
367
367
  </ul>
368
368
  <div class="ontario-footer__copyright">
369
- <a class="ontario-footer__link" href="https://www.ontario.ca/page/copyright-information">© King's Printer for Ontario, <span class="ontario-nbsp">2012–24</span></a>
369
+ <a class="ontario-footer__link" href="https://www.ontario.ca/page/copyright-information">© King's Printer for Ontario, <span class="ontario-nbsp">2012–25</span></a>
370
370
  </div>
371
371
  </div>
372
372
  </div>
@@ -544,7 +544,7 @@ describe('ontario-footer', () => {
544
544
  <li><a class="ontario-footer__link" href="https://www.ontario.ca/feedback/contact-us">Contact</a></li>
545
545
  </ul>
546
546
  <div class="ontario-footer__copyright">
547
- <a class="ontario-footer__link" href="https://www.ontario.ca/page/copyright-information">© King's Printer for Ontario, <span class="ontario-nbsp">2012–24</span></a>
547
+ <a class="ontario-footer__link" href="https://www.ontario.ca/page/copyright-information">© King's Printer for Ontario, <span class="ontario-nbsp">2012–25</span></a>
548
548
  </div>
549
549
  </div>
550
550
  </div>
@@ -1 +1 @@
1
- {"version":3,"file":"ontario-footer.spec.js","sourceRoot":"","sources":["../../../../src/components/ontario-footer/test/ontario-footer.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,O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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA0G3B,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,KAAK,IAAI,EAAE;QACtE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC9B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2DF;SACJ,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgH3B,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { OntarioFooter } from '../ontario-footer';\n\ndescribe('ontario-footer', () => {\n\tit('renders default ontario-footer', async () => {\n\t\tconst page = await newSpecPage({\n\t\t\tcomponents: [OntarioFooter],\n\t\t\thtml: `\n <ontario-footer\n type=\"default\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n ></ontario-footer>\n `,\n\t\t});\n\n\t\texpect(page.root).toEqualHtml(`\n <ontario-footer\n type=\"default\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n >\n <mock:shadow-root>\n <footer class=\"ontario-footer ontario-footer--default\" style=\"--imagePath: url(/assets/footer-default-supergraphic-logo.svg);\">\n <div class=\"ontario-row\">\n <div class=\"ontario-columns ontario-small-12\">\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/accessibility\">Accessibility</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/privacy-statement\">Privacy</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/feedback/contact-us\">Contact</a></li>\n </ul>\n <div class=\"ontario-footer__copyright\">\n <a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/copyright-information\">© King's Printer for Ontario, <span class=\"ontario-nbsp\">2012–24</span></a>\n </div>\n </div>\n </div>\n </footer>\n </mock:shadow-root>\n </ontario-footer>\n `);\n\t});\n\n\tit('renders twoColoumn ontario-footer', async () => {\n\t\tconst page = await newSpecPage({\n\t\t\tcomponents: [OntarioFooter],\n\t\t\thtml: `\n <ontario-footer\n type=\"twoColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n two-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n },\n {\n \"type\": \"list\",\n \"heading\": \"Latest release\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column2\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n ></ontario-footer>\n `,\n\t\t});\n\t\texpect(page.root).toEqualHtml(`\n <ontario-footer\n type=\"twoColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n two-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n },\n {\n \"type\": \"list\",\n \"heading\": \"Latest release\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column2\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n >\n <mock:shadow-root>\n <footer class=\"ontario-footer ontario-footer--expanded\" style=\"--imagePath: url(/assets/footer-expanded-supergraphic-logo.svg);\">\n <div class=\"ontario-footer__expanded-top-section\">\n <div class=\"ontario-row\">\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6\">\n <h2 class=\"ontario-h4\">Ontario Design System</h2>\n <p>The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.</p>\n <h3 class=\"ontario-h5\">Latest release</h3>\n <ul>\n <li class=\"ontario-footer__list_item\">Built on: June 3, 2022</li>\n <li class=\"ontario-footer__list_item\">Distribution package version 0.12.10</li>\n </ul>\n </div>\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6\">\n <h2 class=\"ontario-h4\">Help us improve the design system</h2>\n <div class=\"ontario-footer__paragraph\">You can check our <a href=\"#\">help and feedback page</a> if you don’t see the component you need.</div>\n <a class=\"ontario-button ontario-footer__button ontario-margin-bottom-0-!\" href=\"#\">\n Send us an email\n </a>\n </div>\n </div>\n </div>\n <div class=\"ontario-row ontario-footer__expanded-bottom-section\">\n <div class=\"ontario-columns ontario-small-12\">\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/accessibility\">Accessibility</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/privacy-statement\">Privacy</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/feedback/contact-us\">Contact</a></li>\n </ul>\n <div class=\"ontario-footer__copyright\">\n <a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/copyright-information\">© King's Printer for Ontario, <span class=\"ontario-nbsp\">2012–24</span></a>\n </div>\n </div>\n </div>\n </footer>\n </mock:shadow-root>\n </ontario-footer>\n `);\n\t});\n\n\tit('renders twoColoumn ontario-footer with social links', async () => {\n\t\tconst page = await newSpecPage({\n\t\t\tcomponents: [OntarioFooter],\n\t\t\thtml: `\n <ontario-footer\n type=\"twoColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n social-links='{\n \"facebook\": \"https://www.facebook.com/ONgov\",\n \"instagram\": \"https://www.instagram.com/ongov\",\n \"twitter\": \"https://twitter.com/ONgov\",\n \"youtube\": \"https://www.youtube.com/ongov\"\n }'\n two-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n },\n {\n \"type\": \"list\",\n \"heading\": \"Latest release\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column2\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n ></ontario-footer>\n `,\n\t\t});\n\t\texpect(page.root).toEqualHtml(`\n <ontario-footer\n type=\"twoColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n social-links='{\n \"facebook\": \"https://www.facebook.com/ONgov\",\n \"instagram\": \"https://www.instagram.com/ongov\",\n \"twitter\": \"https://twitter.com/ONgov\",\n \"youtube\": \"https://www.youtube.com/ongov\"\n }'\n two-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n },\n {\n \"type\": \"list\",\n \"heading\": \"Latest release\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column2\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n >\n <mock:shadow-root>\n <footer class=\"ontario-footer ontario-footer--expanded\" style=\"--imagePath: url(/assets/footer-expanded-supergraphic-logo.svg);\">\n <div class=\"ontario-footer__expanded-top-section\">\n <div class=\"ontario-row\">\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6\">\n <h2 class=\"ontario-h4\">Ontario Design System</h2>\n <p>The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.</p>\n <h3 class=\"ontario-h5\">Latest release</h3>\n <ul>\n <li class=\"ontario-footer__list_item\">Built on: June 3, 2022</li>\n <li class=\"ontario-footer__list_item\">Distribution package version 0.12.10</li>\n </ul>\n </div>\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6\">\n <h2 class=\"ontario-h4\">Help us improve the design system</h2>\n <div class=\"ontario-footer__paragraph\">You can check our <a href=\"#\">help and feedback page</a> if you don’t see the component you need.</div>\n <a class=\"ontario-button ontario-footer__button ontario-margin-bottom-0-!\" href=\"#\">\n Send us an email\n </a>\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--social\">\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.facebook.com/ONgov\" aria-label=\"Facebook\"><ontario-icon-facebook colour=\"white\" icon-width=\"32\"></ontario-icon-facebook></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://twitter.com/ONgov\" aria-label=\"Twitter\"><ontario-icon-twitter colour=\"white\" icon-width=\"32\"></ontario-icon-twitter></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.instagram.com/ongov\" aria-label=\"Instagram\"><ontario-icon-instagram colour=\"white\" icon-width=\"32\"></ontario-icon-instagram></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.youtube.com/ongov\" aria-label=\"Youtube\"><ontario-icon-youtube colour=\"white\" icon-width=\"32\"></ontario-icon-youtube></a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"ontario-row ontario-footer__expanded-bottom-section\">\n <div class=\"ontario-columns ontario-small-12\">\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/accessibility\">Accessibility</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/privacy-statement\">Privacy</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/feedback/contact-us\">Contact</a></li>\n </ul>\n <div class=\"ontario-footer__copyright\">\n <a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/copyright-information\">© King's Printer for Ontario, <span class=\"ontario-nbsp\">2012–24</span></a>\n </div>\n </div>\n </div>\n </footer>\n </mock:shadow-root>\n </ontario-footer>\n `);\n\t});\n\n\tit('renders threeColoumn ontario-footer with social links', async () => {\n\t\tconst page = await newSpecPage({\n\t\t\tcomponents: [OntarioFooter],\n\t\t\thtml: `\n <ontario-footer\n type=\"threeColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n social-links='{\n \"facebook\": \"https://www.facebook.com/ONgov\",\n \"instagram\": \"https://www.instagram.com/ongov\",\n \"twitter\": \"https://twitter.com/ONgov\",\n \"youtube\": \"https://www.youtube.com/ongov\"\n }'\n three-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n }\n ]\n },\n \"column2\": {\n \"title\": \"Latest release\",\n \"content\": [\n {\n \"type\": \"list\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column3\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n ></ontario-footer>\n `,\n\t\t});\n\t\texpect(page.root).toEqualHtml(`\n <ontario-footer\n type=\"threeColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n social-links='{\n \"facebook\": \"https://www.facebook.com/ONgov\",\n \"instagram\": \"https://www.instagram.com/ongov\",\n \"twitter\": \"https://twitter.com/ONgov\",\n \"youtube\": \"https://www.youtube.com/ongov\"\n }'\n three-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n }\n ]\n },\n \"column2\": {\n \"title\": \"Latest release\",\n \"content\": [\n {\n \"type\": \"list\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column3\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n >\n <mock:shadow-root>\n <footer class=\"ontario-footer ontario-footer--expanded\" style=\"--imagePath: url(/assets/footer-expanded-supergraphic-logo.svg);\">\n <div class=\"ontario-footer__expanded-top-section\">\n <div class=\"ontario-row\">\n <div class=\"ontario-columns ontario-small-12 ontario-medium-12 ontario-large-4 ontario-expanded-footer__one-third-block\">\n <h2 class=\"ontario-h4\">Ontario Design System</h2>\n <p>The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.</p>\n </div>\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6 ontario-large-4 ontario-expanded-footer__one-third-block\">\n <h2 class=\"ontario-h4\">Latest release</h2>\n <ul>\n <li class=\"ontario-footer__list_item\">Built on: June 3, 2022</li>\n <li class=\"ontario-footer__list_item\">Distribution package version 0.12.10</li>\n </ul>\n </div>\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6 ontario-large-4 ontario-expanded-footer__one-third-block\">\n <h2 class=\"ontario-h4\">Help us improve the design system</h2>\n <div class=\"ontario-footer__paragraph\">You can check our <a href=\"#\">help and feedback page</a> if you don’t see the component you need.</div>\n <a class=\"ontario-button ontario-footer__button ontario-margin-bottom-0-!\" href=\"#\">\n Send us an email\n </a>\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--social\">\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.facebook.com/ONgov\" aria-label=\"Facebook\"><ontario-icon-facebook colour=\"white\" icon-width=\"32\"></ontario-icon-facebook></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://twitter.com/ONgov\" aria-label=\"Twitter\"><ontario-icon-twitter colour=\"white\" icon-width=\"32\"></ontario-icon-twitter></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.instagram.com/ongov\" aria-label=\"Instagram\"><ontario-icon-instagram colour=\"white\" icon-width=\"32\"></ontario-icon-instagram></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.youtube.com/ongov\" aria-label=\"Youtube\"><ontario-icon-youtube colour=\"white\" icon-width=\"32\"></ontario-icon-youtube></a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"ontario-row ontario-footer__expanded-bottom-section\">\n <div class=\"ontario-columns ontario-small-12\">\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/accessibility\">Accessibility</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/privacy-statement\">Privacy</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/feedback/contact-us\">Contact</a></li>\n </ul>\n <div class=\"ontario-footer__copyright\">\n <a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/copyright-information\">© King's Printer for Ontario, <span class=\"ontario-nbsp\">2012–24</span></a>\n </div>\n </div>\n </div>\n </footer>\n </mock:shadow-root>\n </ontario-footer>\n `);\n\t});\n});\n"]}
1
+ {"version":3,"file":"ontario-footer.spec.js","sourceRoot":"","sources":["../../../../src/components/ontario-footer/test/ontario-footer.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC/C,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC9B,UAAU,EAAE,CAAC,aAAa,CAAC;YAC3B,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;OAoBF;SACJ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2DF;SACJ,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAgH3B,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { OntarioFooter } from '../ontario-footer';\n\ndescribe('ontario-footer', () => {\n\tit('renders default ontario-footer', async () => {\n\t\tconst page = await newSpecPage({\n\t\t\tcomponents: [OntarioFooter],\n\t\t\thtml: `\n <ontario-footer\n type=\"default\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n ></ontario-footer>\n `,\n\t\t});\n\n\t\texpect(page.root).toEqualHtml(`\n <ontario-footer\n type=\"default\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n >\n <mock:shadow-root>\n <footer class=\"ontario-footer ontario-footer--default\" style=\"--imagePath: url(/assets/footer-default-supergraphic-logo.svg);\">\n <div class=\"ontario-row\">\n <div class=\"ontario-columns ontario-small-12\">\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/accessibility\">Accessibility</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/privacy-statement\">Privacy</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/feedback/contact-us\">Contact</a></li>\n </ul>\n <div class=\"ontario-footer__copyright\">\n <a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/copyright-information\">© King's Printer for Ontario, <span class=\"ontario-nbsp\">2012–25</span></a>\n </div>\n </div>\n </div>\n </footer>\n </mock:shadow-root>\n </ontario-footer>\n `);\n\t});\n\n\tit('renders twoColoumn ontario-footer', async () => {\n\t\tconst page = await newSpecPage({\n\t\t\tcomponents: [OntarioFooter],\n\t\t\thtml: `\n <ontario-footer\n type=\"twoColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n two-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n },\n {\n \"type\": \"list\",\n \"heading\": \"Latest release\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column2\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n ></ontario-footer>\n `,\n\t\t});\n\t\texpect(page.root).toEqualHtml(`\n <ontario-footer\n type=\"twoColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n two-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n },\n {\n \"type\": \"list\",\n \"heading\": \"Latest release\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column2\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n >\n <mock:shadow-root>\n <footer class=\"ontario-footer ontario-footer--expanded\" style=\"--imagePath: url(/assets/footer-expanded-supergraphic-logo.svg);\">\n <div class=\"ontario-footer__expanded-top-section\">\n <div class=\"ontario-row\">\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6\">\n <h2 class=\"ontario-h4\">Ontario Design System</h2>\n <p>The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.</p>\n <h3 class=\"ontario-h5\">Latest release</h3>\n <ul>\n <li class=\"ontario-footer__list_item\">Built on: June 3, 2022</li>\n <li class=\"ontario-footer__list_item\">Distribution package version 0.12.10</li>\n </ul>\n </div>\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6\">\n <h2 class=\"ontario-h4\">Help us improve the design system</h2>\n <div class=\"ontario-footer__paragraph\">You can check our <a href=\"#\">help and feedback page</a> if you don’t see the component you need.</div>\n <a class=\"ontario-button ontario-footer__button ontario-margin-bottom-0-!\" href=\"#\">\n Send us an email\n </a>\n </div>\n </div>\n </div>\n <div class=\"ontario-row ontario-footer__expanded-bottom-section\">\n <div class=\"ontario-columns ontario-small-12\">\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/accessibility\">Accessibility</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/privacy-statement\">Privacy</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/feedback/contact-us\">Contact</a></li>\n </ul>\n <div class=\"ontario-footer__copyright\">\n <a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/copyright-information\">© King's Printer for Ontario, <span class=\"ontario-nbsp\">2012–25</span></a>\n </div>\n </div>\n </div>\n </footer>\n </mock:shadow-root>\n </ontario-footer>\n `);\n\t});\n\n\tit('renders twoColoumn ontario-footer with social links', async () => {\n\t\tconst page = await newSpecPage({\n\t\t\tcomponents: [OntarioFooter],\n\t\t\thtml: `\n <ontario-footer\n type=\"twoColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n social-links='{\n \"facebook\": \"https://www.facebook.com/ONgov\",\n \"instagram\": \"https://www.instagram.com/ongov\",\n \"twitter\": \"https://twitter.com/ONgov\",\n \"youtube\": \"https://www.youtube.com/ongov\"\n }'\n two-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n },\n {\n \"type\": \"list\",\n \"heading\": \"Latest release\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column2\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n ></ontario-footer>\n `,\n\t\t});\n\t\texpect(page.root).toEqualHtml(`\n <ontario-footer\n type=\"twoColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n social-links='{\n \"facebook\": \"https://www.facebook.com/ONgov\",\n \"instagram\": \"https://www.instagram.com/ongov\",\n \"twitter\": \"https://twitter.com/ONgov\",\n \"youtube\": \"https://www.youtube.com/ongov\"\n }'\n two-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n },\n {\n \"type\": \"list\",\n \"heading\": \"Latest release\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column2\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n >\n <mock:shadow-root>\n <footer class=\"ontario-footer ontario-footer--expanded\" style=\"--imagePath: url(/assets/footer-expanded-supergraphic-logo.svg);\">\n <div class=\"ontario-footer__expanded-top-section\">\n <div class=\"ontario-row\">\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6\">\n <h2 class=\"ontario-h4\">Ontario Design System</h2>\n <p>The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.</p>\n <h3 class=\"ontario-h5\">Latest release</h3>\n <ul>\n <li class=\"ontario-footer__list_item\">Built on: June 3, 2022</li>\n <li class=\"ontario-footer__list_item\">Distribution package version 0.12.10</li>\n </ul>\n </div>\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6\">\n <h2 class=\"ontario-h4\">Help us improve the design system</h2>\n <div class=\"ontario-footer__paragraph\">You can check our <a href=\"#\">help and feedback page</a> if you don’t see the component you need.</div>\n <a class=\"ontario-button ontario-footer__button ontario-margin-bottom-0-!\" href=\"#\">\n Send us an email\n </a>\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--social\">\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.facebook.com/ONgov\" aria-label=\"Facebook\"><ontario-icon-facebook colour=\"white\" icon-width=\"32\"></ontario-icon-facebook></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://twitter.com/ONgov\" aria-label=\"Twitter\"><ontario-icon-twitter colour=\"white\" icon-width=\"32\"></ontario-icon-twitter></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.instagram.com/ongov\" aria-label=\"Instagram\"><ontario-icon-instagram colour=\"white\" icon-width=\"32\"></ontario-icon-instagram></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.youtube.com/ongov\" aria-label=\"Youtube\"><ontario-icon-youtube colour=\"white\" icon-width=\"32\"></ontario-icon-youtube></a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"ontario-row ontario-footer__expanded-bottom-section\">\n <div class=\"ontario-columns ontario-small-12\">\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/accessibility\">Accessibility</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/privacy-statement\">Privacy</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/feedback/contact-us\">Contact</a></li>\n </ul>\n <div class=\"ontario-footer__copyright\">\n <a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/copyright-information\">© King's Printer for Ontario, <span class=\"ontario-nbsp\">2012–25</span></a>\n </div>\n </div>\n </div>\n </footer>\n </mock:shadow-root>\n </ontario-footer>\n `);\n\t});\n\n\tit('renders threeColoumn ontario-footer with social links', async () => {\n\t\tconst page = await newSpecPage({\n\t\t\tcomponents: [OntarioFooter],\n\t\t\thtml: `\n <ontario-footer\n type=\"threeColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n social-links='{\n \"facebook\": \"https://www.facebook.com/ONgov\",\n \"instagram\": \"https://www.instagram.com/ongov\",\n \"twitter\": \"https://twitter.com/ONgov\",\n \"youtube\": \"https://www.youtube.com/ongov\"\n }'\n three-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n }\n ]\n },\n \"column2\": {\n \"title\": \"Latest release\",\n \"content\": [\n {\n \"type\": \"list\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column3\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n ></ontario-footer>\n `,\n\t\t});\n\t\texpect(page.root).toEqualHtml(`\n <ontario-footer\n type=\"threeColumn\"\n footer-links='{\n \"accessibilityLink\": {\n \"text\": \"Accessibility\",\n \"href\": \"https://www.ontario.ca/page/accessibility\"\n },\n \"privacyLink\": {\n \"href\": \"https://www.ontario.ca/page/privacy-statement\"\n },\n \"contactLink\": {\n \"text\": \"Contact\",\n \"href\": \"https://www.ontario.ca/feedback/contact-us\"\n },\n \"printerLink\": {\n \"href\": \"https://www.ontario.ca/page/copyright-information\"\n }\n }'\n social-links='{\n \"facebook\": \"https://www.facebook.com/ONgov\",\n \"instagram\": \"https://www.instagram.com/ongov\",\n \"twitter\": \"https://twitter.com/ONgov\",\n \"youtube\": \"https://www.youtube.com/ongov\"\n }'\n three-column-options='{\n \"column1\": {\n \"title\": \"Ontario Design System\",\n \"content\": [\n {\n \"type\": \"text\",\n \"text\": \"The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.\"\n }\n ]\n },\n \"column2\": {\n \"title\": \"Latest release\",\n \"content\": [\n {\n \"type\": \"list\",\n \"list\": [\"Built on: June 3, 2022\", \"Distribution package version 0.12.10\"]\n }\n ]\n },\n \"column3\": {\n \"title\": \"Help us improve the design system\",\n \"content\": [\n {\n \"type\": \"html\",\n \"html\": \"You can check our <a href=#>help and feedback page</a> if you don&#8217;t see the component you need.\"\n }\n ],\n \"button\": {\n \"text\": \"Send us an email\",\n \"link\": \"#\"\n }\n }\n }'\n >\n <mock:shadow-root>\n <footer class=\"ontario-footer ontario-footer--expanded\" style=\"--imagePath: url(/assets/footer-expanded-supergraphic-logo.svg);\">\n <div class=\"ontario-footer__expanded-top-section\">\n <div class=\"ontario-row\">\n <div class=\"ontario-columns ontario-small-12 ontario-medium-12 ontario-large-4 ontario-expanded-footer__one-third-block\">\n <h2 class=\"ontario-h4\">Ontario Design System</h2>\n <p>The Ontario Design System provides principles, guidance and code to help teams design and build accessible, mobile-friendly government websites and digital services.</p>\n </div>\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6 ontario-large-4 ontario-expanded-footer__one-third-block\">\n <h2 class=\"ontario-h4\">Latest release</h2>\n <ul>\n <li class=\"ontario-footer__list_item\">Built on: June 3, 2022</li>\n <li class=\"ontario-footer__list_item\">Distribution package version 0.12.10</li>\n </ul>\n </div>\n <div class=\"ontario-columns ontario-small-12 ontario-medium-6 ontario-large-4 ontario-expanded-footer__one-third-block\">\n <h2 class=\"ontario-h4\">Help us improve the design system</h2>\n <div class=\"ontario-footer__paragraph\">You can check our <a href=\"#\">help and feedback page</a> if you don’t see the component you need.</div>\n <a class=\"ontario-button ontario-footer__button ontario-margin-bottom-0-!\" href=\"#\">\n Send us an email\n </a>\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--social\">\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.facebook.com/ONgov\" aria-label=\"Facebook\"><ontario-icon-facebook colour=\"white\" icon-width=\"32\"></ontario-icon-facebook></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://twitter.com/ONgov\" aria-label=\"Twitter\"><ontario-icon-twitter colour=\"white\" icon-width=\"32\"></ontario-icon-twitter></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.instagram.com/ongov\" aria-label=\"Instagram\"><ontario-icon-instagram colour=\"white\" icon-width=\"32\"></ontario-icon-instagram></a>\n </li>\n <li>\n <a class=\"ontario-footer__link\" href=\"https://www.youtube.com/ongov\" aria-label=\"Youtube\"><ontario-icon-youtube colour=\"white\" icon-width=\"32\"></ontario-icon-youtube></a>\n </li>\n </ul>\n </div>\n </div>\n </div>\n <div class=\"ontario-row ontario-footer__expanded-bottom-section\">\n <div class=\"ontario-columns ontario-small-12\">\n <ul class=\"ontario-footer__links-container ontario-footer__links-container--inline\">\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/accessibility\">Accessibility</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/privacy-statement\">Privacy</a></li>\n <li><a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/feedback/contact-us\">Contact</a></li>\n </ul>\n <div class=\"ontario-footer__copyright\">\n <a class=\"ontario-footer__link\" href=\"https://www.ontario.ca/page/copyright-information\">© King's Printer for Ontario, <span class=\"ontario-nbsp\">2012–25</span></a>\n </div>\n </div>\n </div>\n </footer>\n </mock:shadow-root>\n </ontario-footer>\n `);\n\t});\n});\n"]}
@@ -23,6 +23,16 @@
23
23
  "fr": "Accessibilité"
24
24
  }
25
25
  },
26
+ "termsOfUse": {
27
+ "link": {
28
+ "en": "https://www.ontario.ca/page/terms-use",
29
+ "fr": "https://www.ontario.ca/fr/page/conditions-dutilisation"
30
+ },
31
+ "text": {
32
+ "en": "Terms of Use",
33
+ "fr": "Conditions d’utilisation"
34
+ }
35
+ },
26
36
  "accordion": {
27
37
  "collapse": {
28
38
  "en": "Collapse all",
@@ -22,6 +22,16 @@ const accessibilityLink = {
22
22
  fr: 'Accessibilité',
23
23
  },
24
24
  };
25
+ const termsOfUse = {
26
+ link: {
27
+ en: 'https://www.ontario.ca/page/terms-use',
28
+ fr: 'https://www.ontario.ca/fr/page/conditions-dutilisation',
29
+ },
30
+ text: {
31
+ en: 'Terms of Use',
32
+ fr: 'Conditions d’utilisation',
33
+ },
34
+ };
25
35
  const accordion = {
26
36
  collapse: {
27
37
  en: 'Collapse all',
@@ -239,6 +249,7 @@ const required = {
239
249
  const translations = {
240
250
  accessibility: accessibility,
241
251
  accessibilityLink: accessibilityLink,
252
+ termsOfUse: termsOfUse,
242
253
  accordion: accordion,
243
254
  backToTop: backToTop,
244
255
  contactUs: contactUs,
@@ -1 +1 @@
1
- {"file":"global.i18n.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
1
+ {"file":"global.i18n.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":[],"sourcesContent":[],"version":3}
@@ -2,7 +2,7 @@ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/clien
2
2
  import { C as ConsoleMessageClass } from './console-message.js';
3
3
 
4
4
  const ontarioCardCollectionCss =
5
- '.ontario-card-collection__container{display:flex;flex-wrap:wrap;justify-content:flex-start;margin:0;padding:0}.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card){width:calc(25% - 2rem)}.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card):nth-child(4n){margin-right:0}@media screen and (max-width: 73em){.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card){width:calc(50% - 1.25rem)}.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card):nth-child(2n){margin-right:0}}@media screen and (max-width: 40em){.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card){width:calc(100% - 0.5rem)}}.ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card){width:calc(33.3% - 1.75rem)}.ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card):nth-child(3n){margin-right:0}@media screen and (max-width: 40em){.ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card){width:calc(100% - 0.5rem)}}.ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card){width:calc(50% - 1.25rem)}.ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card):nth-child(2n){margin-right:0}@media screen and (max-width: 40em){.ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card){width:calc(100% - 0.5rem)}}';
5
+ '.ontario-card-collection__container{display:flex;flex-wrap:wrap;gap:2rem;margin:0;padding:0}.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card){width:calc(25% - 1.5rem)}@media screen and (max-width: 73em){.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card){width:calc(50% - 1rem)}}@media screen and (max-width: 40em){.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card){width:100%}}.ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card){width:calc(33.3% - 1.33rem)}@media screen and (max-width: 40em){.ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card){width:100%}}.ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card){width:calc(50% - 1rem)}@media screen and (max-width: 40em){.ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card){width:100%}}';
6
6
  const OntarioCardCollectionStyle0 = ontarioCardCollectionCss;
7
7
 
8
8
  const OntarioCardCollection$1 = /*@__PURE__*/ proxyCustomElement(
@@ -1 +1 @@
1
- {"file":"ontario-card-collection.js","mappings":";;;AAAA,MAAM,wBAAwB,GAAG,wvCAAwvC,CAAC;AAC1xC,oCAAe,wBAAwB;;MCQ1BA,uBAAqB;;;;;2BAQE,CAAC;;;;;;;;IAepC,mBAAmB;QAClB,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,EAAE;YACnF,MAAM,OAAO,GAAG,IAAI,mBAAmB,EAAE,CAAC;YAC1C,OAAO;iBACL,kBAAkB,EAAE;iBACpB,gBAAgB,CAAC,iBAAiB,CAAC;iBACnC,cAAc,CAAC,IAAI,CAAC;iBACpB,gBAAgB,CAAC,kBAAkB,CAAC;iBACpC,cAAc,CACd,GACC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,gCAAgC,GAAG,8BAC9D,4EAA4E,CAC5E;iBACA,gBAAgB,CAAC,KAAK,CAAC;iBACvB,cAAc,CAAC,cAAc,CAAC;iBAC9B,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;SAC1B;aAAM;YACN,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC;SACzC;KACD;;;;IAKO,QAAQ;QACf,OAAO;;8CAEqC,IAAI,CAAC,gBAAgB;KAC9D,CAAC,IAAI,EAAE,CAAC;KACX;IAED,iBAAiB;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC3B;IAED,MAAM;QACL,QACC,2DAAI,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IACzB,8DAAa,CACT,EACJ;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["OntarioCardCollection"],"sources":["src/components/ontario-card-collection/ontario-card-collection.scss?tag=ontario-card-collection&encapsulation=shadow","src/components/ontario-card-collection/ontario-card-collection.tsx"],"sourcesContent":["@use 'sass:math';\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/breakpoints.variables' as breakpoints;\n\n.ontario-card-collection__container {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: flex-start;\n\tmargin: spacing.$spacing-0;\n\tpadding: spacing.$spacing-0;\n}\n\n.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card) {\n\twidth: calc(25% - 2rem);\n\n\t&:nth-child(4n) {\n\t\tmargin-right: spacing.$spacing-0;\n\t}\n\n\t@media screen and (max-width: breakpoints.$medium-breakpoint) {\n\t\twidth: calc(50% - 1.25rem);\n\n\t\t&:nth-child(2n) {\n\t\t\tmargin-right: spacing.$spacing-0;\n\t\t}\n\t}\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\twidth: calc(100% - 0.5rem);\n\t}\n}\n\n.ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card) {\n\twidth: calc(33.3% - 1.75rem);\n\n\t&:nth-child(3n) {\n\t\tmargin-right: spacing.$spacing-0;\n\t}\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\twidth: calc(100% - 0.5rem);\n\t}\n}\n\n.ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card) {\n\twidth: calc(50% - 1.25rem);\n\n\t&:nth-child(2n) {\n\t\tmargin-right: spacing.$spacing-0;\n\t}\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\twidth: calc(100% - 0.5rem);\n\t}\n}\n","import { Component, Prop, Element, h, Watch, State } from '@stencil/core';\nimport { CardsPerRow } from './ontario-collection-card-types';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\n\n@Component({\n\ttag: 'ontario-card-collection',\n\tstyleUrl: 'ontario-card-collection.scss',\n\tshadow: true,\n})\nexport class OntarioCardCollection {\n\t@Element() host: HTMLElement;\n\n\t/**\n\t * The number of cards to display per row.\n\t *\n\t * If no number is passed, it will default to 3.\n\t */\n\t@Prop() cardsPerRow: CardsPerRow = 3;\n\n\t/**\n\t * Mutable variable, for internal use only.\n\t *\n\t * Set number of cards per row depending on validation result.\n\t */\n\t@State() private cardsPerRowState: number;\n\n\t/**\n\t * Watch for changes to the `cardsPerRow` property for validation purposes.\n\t *\n\t * If the user input is not a number or is a negative number then `cardsPerRow` will be set to its default (3).\n\t */\n\t@Watch('cardsPerRow')\n\tvalidateCardsPerRow() {\n\t\tif (isNaN(this.cardsPerRow) || (!isNaN(this.cardsPerRow) && this.cardsPerRow <= 0)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' cards-per-row ')\n\t\t\t\t.addRegularText('on')\n\t\t\t\t.addMonospaceText(' <ontario-card> ')\n\t\t\t\t.addRegularText(\n\t\t\t\t\t`${\n\t\t\t\t\t\tisNaN(this.cardsPerRow) ? 'was set to a non-numeric value' : 'was set to a negative number'\n\t\t\t\t\t}; only a positive number is allowed. The default number of cards per row: `,\n\t\t\t\t)\n\t\t\t\t.addMonospaceText(' 3 ')\n\t\t\t\t.addRegularText('was assumed.')\n\t\t\t\t.printMessage();\n\t\t\tthis.cardsPerRowState = 3;\n\t\t} else {\n\t\t\tthis.cardsPerRowState = this.cardsPerRow;\n\t\t}\n\t}\n\n\t/**\n\t * @returns the classes of the ontario cards based off the `cardType` and number of cards per row.\n\t */\n\tprivate getClass(): string {\n\t\treturn `\n ontario-card-collection__container\n ontario-card-collecton--cards-per-row-${this.cardsPerRowState}\n `.trim();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateCardsPerRow();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<ul class={this.getClass()}>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t);\n\t}\n}\n"],"version":3}
1
+ {"file":"ontario-card-collection.js","mappings":";;;AAAA,MAAM,wBAAwB,GAAG,6zBAA6zB,CAAC;AAC/1B,oCAAe,wBAAwB;;MCQ1BA,uBAAqB;;;;;2BAQE,CAAC;;;;;;;;IAepC,mBAAmB;QAClB,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC,EAAE;YACnF,MAAM,OAAO,GAAG,IAAI,mBAAmB,EAAE,CAAC;YAC1C,OAAO;iBACL,kBAAkB,EAAE;iBACpB,gBAAgB,CAAC,iBAAiB,CAAC;iBACnC,cAAc,CAAC,IAAI,CAAC;iBACpB,gBAAgB,CAAC,kBAAkB,CAAC;iBACpC,cAAc,CACd,GACC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,gCAAgC,GAAG,8BAC9D,4EAA4E,CAC5E;iBACA,gBAAgB,CAAC,KAAK,CAAC;iBACvB,cAAc,CAAC,cAAc,CAAC;iBAC9B,YAAY,EAAE,CAAC;YACjB,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;SAC1B;aAAM;YACN,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC;SACzC;KACD;;;;IAKO,QAAQ;QACf,OAAO;;8CAEqC,IAAI,CAAC,gBAAgB;KAC9D,CAAC,IAAI,EAAE,CAAC;KACX;IAED,iBAAiB;QAChB,IAAI,CAAC,mBAAmB,EAAE,CAAC;KAC3B;IAED,MAAM;QACL,QACC,2DAAI,KAAK,EAAE,IAAI,CAAC,QAAQ,EAAE,IACzB,8DAAa,CACT,EACJ;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["OntarioCardCollection"],"sources":["src/components/ontario-card-collection/ontario-card-collection.scss?tag=ontario-card-collection&encapsulation=shadow","src/components/ontario-card-collection/ontario-card-collection.tsx"],"sourcesContent":["@use 'sass:math';\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/breakpoints.variables' as breakpoints;\n\n.ontario-card-collection__container {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: spacing.$spacing-6;\n\tmargin: spacing.$spacing-0;\n\tpadding: spacing.$spacing-0;\n}\n\n.ontario-card-collecton--cards-per-row-4 ::slotted(ontario-card) {\n\twidth: calc(25% - 1.5rem);\n\n\t@media screen and (max-width: breakpoints.$medium-breakpoint) {\n\t\twidth: calc(50% - 1rem);\n\t}\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\twidth: 100%;\n\t}\n}\n\n.ontario-card-collecton--cards-per-row-3 ::slotted(ontario-card) {\n\twidth: calc(33.3% - 1.33rem);\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\twidth: 100%;\n\t}\n}\n\n.ontario-card-collecton--cards-per-row-2 ::slotted(ontario-card) {\n\twidth: calc(50% - 1rem);\n\n\t@media screen and (max-width: breakpoints.$small-breakpoint) {\n\t\twidth: 100%;\n\t}\n}\n","import { Component, Prop, Element, h, Watch, State } from '@stencil/core';\nimport { CardsPerRow } from './ontario-collection-card-types';\nimport { ConsoleMessageClass } from '../../utils/console-message/console-message';\n\n@Component({\n\ttag: 'ontario-card-collection',\n\tstyleUrl: 'ontario-card-collection.scss',\n\tshadow: true,\n})\nexport class OntarioCardCollection {\n\t@Element() host: HTMLElement;\n\n\t/**\n\t * The number of cards to display per row.\n\t *\n\t * If no number is passed, it will default to 3.\n\t */\n\t@Prop() cardsPerRow: CardsPerRow = 3;\n\n\t/**\n\t * Mutable variable, for internal use only.\n\t *\n\t * Set number of cards per row depending on validation result.\n\t */\n\t@State() private cardsPerRowState: number;\n\n\t/**\n\t * Watch for changes to the `cardsPerRow` property for validation purposes.\n\t *\n\t * If the user input is not a number or is a negative number then `cardsPerRow` will be set to its default (3).\n\t */\n\t@Watch('cardsPerRow')\n\tvalidateCardsPerRow() {\n\t\tif (isNaN(this.cardsPerRow) || (!isNaN(this.cardsPerRow) && this.cardsPerRow <= 0)) {\n\t\t\tconst message = new ConsoleMessageClass();\n\t\t\tmessage\n\t\t\t\t.addDesignSystemTag()\n\t\t\t\t.addMonospaceText(' cards-per-row ')\n\t\t\t\t.addRegularText('on')\n\t\t\t\t.addMonospaceText(' <ontario-card> ')\n\t\t\t\t.addRegularText(\n\t\t\t\t\t`${\n\t\t\t\t\t\tisNaN(this.cardsPerRow) ? 'was set to a non-numeric value' : 'was set to a negative number'\n\t\t\t\t\t}; only a positive number is allowed. The default number of cards per row: `,\n\t\t\t\t)\n\t\t\t\t.addMonospaceText(' 3 ')\n\t\t\t\t.addRegularText('was assumed.')\n\t\t\t\t.printMessage();\n\t\t\tthis.cardsPerRowState = 3;\n\t\t} else {\n\t\t\tthis.cardsPerRowState = this.cardsPerRow;\n\t\t}\n\t}\n\n\t/**\n\t * @returns the classes of the ontario cards based off the `cardType` and number of cards per row.\n\t */\n\tprivate getClass(): string {\n\t\treturn `\n ontario-card-collection__container\n ontario-card-collecton--cards-per-row-${this.cardsPerRowState}\n `.trim();\n\t}\n\n\tcomponentWillLoad() {\n\t\tthis.validateCardsPerRow();\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<ul class={this.getClass()}>\n\t\t\t\t<slot></slot>\n\t\t\t</ul>\n\t\t);\n\t}\n}\n"],"version":3}