@ongov/ontario-design-system-component-library 4.3.0 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/cjs/index-88d5cf20.js +2 -2
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/{ontario-accordion_43.cjs.entry.js → ontario-accordion_44.cjs.entry.js} +738 -296
  4. package/dist/cjs/ontario-accordion_44.cjs.entry.js.map +1 -0
  5. package/dist/cjs/ontario-design-system-components.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +1 -0
  7. package/dist/collection/components/ontario-card/ontario-card-types.js +29 -2
  8. package/dist/collection/components/ontario-card/ontario-card-types.js.map +1 -1
  9. package/dist/collection/components/ontario-card/ontario-card.css +257 -31
  10. package/dist/collection/components/ontario-card/ontario-card.js +104 -80
  11. package/dist/collection/components/ontario-card/ontario-card.js.map +1 -1
  12. package/dist/collection/components/ontario-card/test/ontario-cards.spec.js +23 -13
  13. package/dist/collection/components/ontario-card/test/ontario-cards.spec.js.map +1 -1
  14. package/dist/collection/components/ontario-header/ontario-header.js +17 -3
  15. package/dist/collection/components/ontario-header/ontario-header.js.map +1 -1
  16. package/dist/collection/components/ontario-header/service-ontario-header.css +0 -3
  17. package/dist/collection/components/ontario-header/test/ontario-header.spec.js +3 -3
  18. package/dist/collection/components/ontario-header/test/ontario-header.spec.js.map +1 -1
  19. package/dist/collection/components/ontario-language-toggle/ontario-language-toggle.js +193 -47
  20. package/dist/collection/components/ontario-language-toggle/ontario-language-toggle.js.map +1 -1
  21. package/dist/collection/components/ontario-language-toggle/test/ontario-language-toggle.spec.js +16 -3
  22. package/dist/collection/components/ontario-language-toggle/test/ontario-language-toggle.spec.js.map +1 -1
  23. package/dist/collection/components/ontario-search-box/assets/ontario-icon-close.svg +1 -0
  24. package/dist/collection/components/ontario-search-box/assets/ontario-logo--mobile.svg +6 -0
  25. package/dist/collection/components/ontario-search-box/ontario-search-box.css +823 -0
  26. package/dist/collection/components/ontario-search-box/ontario-search-box.js +584 -0
  27. package/dist/collection/components/ontario-search-box/ontario-search-box.js.map +1 -0
  28. package/dist/collection/components/ontario-search-box/test/ontario-search-box.e2e.js +20 -0
  29. package/dist/collection/components/ontario-search-box/test/ontario-search-box.e2e.js.map +1 -0
  30. package/dist/collection/components/ontario-search-box/test/ontario-search-box.spec.js +19 -0
  31. package/dist/collection/components/ontario-search-box/test/ontario-search-box.spec.js.map +1 -0
  32. package/dist/collection/components/ontario-step-indicator/ontario-step-indicator.js +5 -5
  33. package/dist/collection/components/ontario-table/ontario-table.js +5 -5
  34. package/dist/collection/components/ontario-textarea/ontario-textarea.js +3 -3
  35. package/dist/collection/i18n/global.i18n.json +172 -162
  36. package/dist/collection/utils/common/input/input.js +3 -0
  37. package/dist/collection/utils/common/input/input.js.map +1 -1
  38. package/dist/collection/utils/common/input-caption/input-caption.js +5 -3
  39. package/dist/collection/utils/common/input-caption/input-caption.js.map +1 -1
  40. package/dist/collection/utils/common/language-types.js +1 -1
  41. package/dist/collection/utils/common/language-types.js.map +1 -1
  42. package/dist/collection/utils/helper/utils-types.js +2 -0
  43. package/dist/collection/utils/helper/utils-types.js.map +1 -0
  44. package/dist/collection/utils/helper/utils.js +26 -0
  45. package/dist/collection/utils/helper/utils.js.map +1 -1
  46. package/dist/components/error-message.js +1 -324
  47. package/dist/components/error-message.js.map +1 -1
  48. package/dist/components/event-handler.js +330 -0
  49. package/dist/components/event-handler.js.map +1 -0
  50. package/dist/components/global.i18n.js +184 -173
  51. package/dist/components/global.i18n.js.map +1 -1
  52. package/dist/components/input.js +3 -0
  53. package/dist/components/input.js.map +1 -1
  54. package/dist/components/ontario-card.js +118 -66
  55. package/dist/components/ontario-card.js.map +1 -1
  56. package/dist/components/ontario-checkboxes.js +2 -1
  57. package/dist/components/ontario-checkboxes.js.map +1 -1
  58. package/dist/components/ontario-date-input.js +2 -1
  59. package/dist/components/ontario-date-input.js.map +1 -1
  60. package/dist/components/ontario-dropdown-list.js +2 -1
  61. package/dist/components/ontario-dropdown-list.js.map +1 -1
  62. package/dist/components/ontario-header.js +13 -7
  63. package/dist/components/ontario-header.js.map +1 -1
  64. package/dist/components/ontario-icon-search2.js +6 -0
  65. package/dist/components/ontario-icon-search2.js.map +1 -0
  66. package/dist/components/ontario-input.js +2 -1
  67. package/dist/components/ontario-input.js.map +1 -1
  68. package/dist/components/ontario-language-toggle2.js +180 -37
  69. package/dist/components/ontario-language-toggle2.js.map +1 -1
  70. package/dist/components/ontario-radio-buttons.js +2 -1
  71. package/dist/components/ontario-radio-buttons.js.map +1 -1
  72. package/dist/components/ontario-search-box.d.ts +11 -0
  73. package/dist/components/ontario-search-box.js +269 -0
  74. package/dist/components/ontario-search-box.js.map +1 -0
  75. package/dist/components/ontario-step-indicator.js +5 -5
  76. package/dist/components/ontario-table.js +5 -5
  77. package/dist/components/ontario-textarea.js +5 -4
  78. package/dist/components/ontario-textarea.js.map +1 -1
  79. package/dist/components/utils.js +28 -0
  80. package/dist/components/utils.js.map +1 -1
  81. package/dist/esm/index-603026f7.js +2 -2
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/esm/{ontario-accordion_43.entry.js → ontario-accordion_44.entry.js} +738 -296
  84. package/dist/esm/ontario-accordion_44.entry.js.map +1 -0
  85. package/dist/esm/ontario-design-system-components.js +1 -1
  86. package/dist/ontario-design-system-components/i18n/global.i18n.json +172 -162
  87. package/dist/ontario-design-system-components/ontario-design-system-components.esm.js +1 -1
  88. package/dist/ontario-design-system-components/ontario-design-system-components.esm.js.map +1 -1
  89. package/dist/ontario-design-system-components/{p-cff41424.entry.js → p-9c3a1be9.entry.js} +2204 -1918
  90. package/dist/ontario-design-system-components/p-9c3a1be9.entry.js.map +1 -0
  91. package/dist/types/components/ontario-card/ontario-card-types.d.ts +4 -4
  92. package/dist/types/components/ontario-card/ontario-card.d.ts +40 -29
  93. package/dist/types/components/ontario-header/ontario-header.d.ts +13 -2
  94. package/dist/types/components/ontario-language-toggle/ontario-language-toggle.d.ts +75 -8
  95. package/dist/types/components/ontario-search-box/ontario-search-box.d.ts +180 -0
  96. package/dist/types/components.d.ts +211 -22
  97. package/dist/types/utils/common/input/input.d.ts +2 -1
  98. package/dist/types/utils/common/input-caption/input-caption.d.ts +7 -1
  99. package/dist/types/utils/common/language-types.d.ts +2 -1
  100. package/dist/types/utils/helper/utils-types.d.ts +2 -0
  101. package/dist/types/utils/helper/utils.d.ts +21 -0
  102. package/package.json +3 -3
  103. package/src/components/ontario-card/ontario-card-types.tsx +33 -4
  104. package/src/components/ontario-card/ontario-card.scss +59 -38
  105. package/src/components/ontario-card/ontario-card.tsx +98 -70
  106. package/src/components/ontario-card/readme.md +57 -27
  107. package/src/components/ontario-card/test/__snapshots__/ontario-cards.spec.tsx.snap +66 -0
  108. package/src/components/ontario-card/test/ontario-cards.spec.tsx +27 -13
  109. package/src/components/ontario-card-collection/readme.md +13 -13
  110. package/src/components/ontario-checkbox/ontario-checkboxes.scss +0 -1
  111. package/src/components/ontario-header/ontario-header.tsx +13 -4
  112. package/src/components/ontario-header/service-ontario-header.scss +0 -4
  113. package/src/components/ontario-header/test/ontario-header.spec.tsx +3 -3
  114. package/src/components/ontario-hint-text/readme.md +2 -0
  115. package/src/components/ontario-language-toggle/ontario-language-toggle.tsx +192 -45
  116. package/src/components/ontario-language-toggle/readme.md +10 -10
  117. package/src/components/ontario-language-toggle/test/__snapshots__/ontario-language-toggle.spec.tsx.snap +1 -1
  118. package/src/components/ontario-language-toggle/test/ontario-language-toggle.spec.tsx +17 -3
  119. package/src/components/ontario-radio-buttons/ontario-radio-buttons.scss +0 -1
  120. package/src/components/ontario-search-box/assets/ontario-icon-close.svg +1 -0
  121. package/src/components/ontario-search-box/assets/ontario-logo--mobile.svg +6 -0
  122. package/src/components/ontario-search-box/ontario-search-box.scss +141 -0
  123. package/src/components/ontario-search-box/ontario-search-box.tsx +341 -0
  124. package/src/components/ontario-search-box/readme.md +132 -0
  125. package/src/components/ontario-search-box/test/__snapshots__/ontario-search-box.spec.tsx.snap +35 -0
  126. package/src/components/ontario-search-box/test/ontario-search-box.e2e.ts +21 -0
  127. package/src/components/ontario-search-box/test/ontario-search-box.spec.tsx +22 -0
  128. package/src/components.d.ts +211 -22
  129. package/src/french.html +37 -0
  130. package/src/index.html +292 -38
  131. package/src/translations/global.i18n.json +172 -162
  132. package/src/utils/common/input/input.tsx +4 -1
  133. package/src/utils/common/input-caption/input-caption.tsx +9 -3
  134. package/src/utils/common/language-types.ts +2 -1
  135. package/src/utils/helper/utils-types.ts +2 -0
  136. package/src/utils/helper/utils.ts +30 -0
  137. package/www/build/ontario-design-system-components.esm.js +1 -1
  138. package/www/build/ontario-design-system-components.esm.js.map +1 -1
  139. package/www/build/{p-b61db0f6.js → p-84035ac3.js} +1 -1
  140. package/www/build/{p-cff41424.entry.js → p-9c3a1be9.entry.js} +2204 -1918
  141. package/www/build/p-9c3a1be9.entry.js.map +1 -0
  142. package/www/french.html +37 -0
  143. package/www/i18n/global.i18n.json +172 -162
  144. package/www/index.html +266 -38
  145. package/dist/cjs/ontario-accordion_43.cjs.entry.js.map +0 -1
  146. package/dist/esm/ontario-accordion_43.entry.js.map +0 -1
  147. package/dist/ontario-design-system-components/p-cff41424.entry.js.map +0 -1
  148. package/www/build/p-cff41424.entry.js.map +0 -1
@@ -16,10 +16,10 @@ import {
16
16
  import { BadgeColour } from './components/ontario-badge/ontario-badge.types';
17
17
  import { ButtonType, HtmlType } from './components/ontario-button/ontario-button.types';
18
18
  import {
19
- CardType,
20
- HeaderType,
19
+ HeaderColour,
21
20
  HorizontalImagePositionType,
22
21
  HorizontalImageSizeType,
22
+ Layout,
23
23
  } from './components/ontario-card/ontario-card-types';
24
24
  import { CardsPerRow } from './components/ontario-card-collection/ontario-collection-card-types';
25
25
  import { Caption } from './utils/common/input-caption/caption.interface';
@@ -68,10 +68,10 @@ export {
68
68
  export { BadgeColour } from './components/ontario-badge/ontario-badge.types';
69
69
  export { ButtonType, HtmlType } from './components/ontario-button/ontario-button.types';
70
70
  export {
71
- CardType,
72
- HeaderType,
71
+ HeaderColour,
73
72
  HorizontalImagePositionType,
74
73
  HorizontalImageSizeType,
74
+ Layout,
75
75
  } from './components/ontario-card/ontario-card-types';
76
76
  export { CardsPerRow } from './components/ontario-card-collection/ontario-collection-card-types';
77
77
  export { Caption } from './utils/common/input-caption/caption.interface';
@@ -248,18 +248,14 @@ export namespace Components {
248
248
  * Action link for when the card is clicked. This is optional.
249
249
  */
250
250
  cardLink?: string;
251
- /**
252
- * The type of card to render. If no type is passed, it will default to 'basic'.
253
- */
254
- cardType: CardType;
255
251
  /**
256
252
  * Text to be displayed within the card description container. This is optional.
257
253
  */
258
254
  description?: string;
259
255
  /**
260
- * The type of header to render. If no type is passed, it will default to 'default'.
256
+ * Set the card's header colour. This is optional.
261
257
  */
262
- headerType: HeaderType;
258
+ headerColour?: HeaderColour;
263
259
  /**
264
260
  * The position of the image when the card-type is set to 'horizontal'. This prop is only necessry when the card-type is set to 'horizontal'.
265
261
  * @example <ontario-card card-type="horizontal" label="Card Title 1" image="https://picsum.photos/200/300" horizontal-image-position-type="left" horizontal-image-size-type="one-fourth" description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum" > </ontario-card>
@@ -279,6 +275,10 @@ export namespace Components {
279
275
  * @example <ontario-card header-type="dark" card-type="horizontal" label="Card Title 1" description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum" >
280
276
  */
281
277
  label: string;
278
+ /**
279
+ * The layout oritnetation of the card. If no type is passed, it will default to 'vertical'.
280
+ */
281
+ layout?: Layout;
282
282
  }
283
283
  interface OntarioCardCollection {
284
284
  /**
@@ -1725,7 +1725,10 @@ export namespace Components {
1725
1725
  * A custom function to pass to the language toggle button. This is optional.
1726
1726
  */
1727
1727
  customLanguageToggle?: (event: globalThis.Event) => void;
1728
- language: Language | string;
1728
+ /**
1729
+ * The language of the component. In most cases, the language toggle should be the source of truth for determining the site language. Only pass a language value here if necessary.
1730
+ */
1731
+ language?: Language;
1729
1732
  /**
1730
1733
  * The size of the language toggle button. If no prop is passed, it will be set to the `default` size.
1731
1734
  */
@@ -1823,6 +1826,54 @@ export namespace Components {
1823
1826
  */
1824
1827
  required?: boolean;
1825
1828
  }
1829
+ interface OntarioSearchBox {
1830
+ /**
1831
+ * The text to display as the input label
1832
+ * @example <ontario-search-box      caption='{ "captionText": "Search directory", "captionType": "default" }' required = "true" > </ontario-search-box>
1833
+ */
1834
+ caption: Caption | string;
1835
+ /**
1836
+ * Used to add a custom function to the input onBlur event.
1837
+ */
1838
+ customOnBlur?: (event: globalThis.Event) => void;
1839
+ /**
1840
+ * Used to add a custom function to the input onChange event.
1841
+ */
1842
+ customOnChange?: (event: globalThis.Event) => void;
1843
+ /**
1844
+ * Used to add a custom function to the input onFocus event.
1845
+ */
1846
+ customOnFocus?: (event: globalThis.Event) => void;
1847
+ /**
1848
+ * Used to add a custom function to the input onInput event.
1849
+ */
1850
+ customOnInput?: (event: globalThis.Event) => void;
1851
+ /**
1852
+ * The unique identifier of the search-box component. This is optional - if no ID is passed, one will be generated.
1853
+ */
1854
+ elementId?: string;
1855
+ /**
1856
+ * Used to include the ontario-hint-text component for the search-box. This is optional.
1857
+ */
1858
+ hintText?: string | Hint;
1859
+ /**
1860
+ * The language of the component. This is used for translations. If none is passed, it will default to English.
1861
+ */
1862
+ language?: Language;
1863
+ /**
1864
+ * This Function to perform a search operation. This function will be called when the search submit button is triggered. The value argument is used for as search term to use for the search operation. This parameter is optional. The performSearch prop can be set dynamically using JavaScript, allowing you to define custom search functionality when the search form is submitted.
1865
+ * @example <ontario-search-box id="ontario-search-box" caption='Search directory' ></ontario-search-box> <script> window.addEventListener('load', () => { const searchBox = document.getElementById('ontario-search-box'); searchBox.performSearch = async (value) => { console.log('Performing search with value:', value); }; }); </script>
1866
+ */
1867
+ performSearch?: (value?: string) => Promise<void>;
1868
+ /**
1869
+ * This is used to determine whether the dropdown list is required or not. This prop gets passed to the InputCaption utility to display either an optional or required flag in the label. If no prop is set, it will default to false (optional).
1870
+ */
1871
+ required?: boolean;
1872
+ /**
1873
+ * The value of the search term. This is optional.
1874
+ */
1875
+ value?: string;
1876
+ }
1826
1877
  interface OntarioStepIndicator {
1827
1878
  /**
1828
1879
  * URL for the back element to set a path for where the link will lead. If a URL is passed in, the back element will display as an anchor tag. The back element will require either the backButtonURL prop or the customOnClick prop to be passed in order for the back element to display.
@@ -1966,6 +2017,10 @@ export interface OntarioRadioButtonsCustomEvent<T> extends CustomEvent<T> {
1966
2017
  detail: T;
1967
2018
  target: HTMLOntarioRadioButtonsElement;
1968
2019
  }
2020
+ export interface OntarioSearchBoxCustomEvent<T> extends CustomEvent<T> {
2021
+ detail: T;
2022
+ target: HTMLOntarioSearchBoxElement;
2023
+ }
1969
2024
  export interface OntarioTextareaCustomEvent<T> extends CustomEvent<T> {
1970
2025
  detail: T;
1971
2026
  target: HTMLOntarioTextareaElement;
@@ -2893,7 +2948,7 @@ declare global {
2893
2948
  new (): HTMLOntarioInputElement;
2894
2949
  };
2895
2950
  interface HTMLOntarioLanguageToggleElementEventMap {
2896
- setAppLanguage: string;
2951
+ setAppLanguage: Language;
2897
2952
  headerLanguageToggled: HeaderLanguageToggleEventDetails;
2898
2953
  }
2899
2954
  interface HTMLOntarioLanguageToggleElement extends Components.OntarioLanguageToggle, HTMLStencilElement {
@@ -3016,6 +3071,65 @@ declare global {
3016
3071
  prototype: HTMLOntarioRadioButtonsElement;
3017
3072
  new (): HTMLOntarioRadioButtonsElement;
3018
3073
  };
3074
+ interface HTMLOntarioSearchBoxElementEventMap {
3075
+ searchOnSubmit: string;
3076
+ inputOnInput: InputInputEvent;
3077
+ inputOnChange: InputInteractionEvent;
3078
+ inputOnBlur: InputFocusBlurEvent;
3079
+ inputOnFocus: InputFocusBlurEvent;
3080
+ }
3081
+ interface HTMLOntarioSearchBoxElement extends Components.OntarioSearchBox, HTMLStencilElement {
3082
+ addEventListener<K extends keyof HTMLOntarioSearchBoxElementEventMap>(
3083
+ type: K,
3084
+ listener: (
3085
+ this: HTMLOntarioSearchBoxElement,
3086
+ ev: OntarioSearchBoxCustomEvent<HTMLOntarioSearchBoxElementEventMap[K]>,
3087
+ ) => any,
3088
+ options?: boolean | AddEventListenerOptions,
3089
+ ): void;
3090
+ addEventListener<K extends keyof DocumentEventMap>(
3091
+ type: K,
3092
+ listener: (this: Document, ev: DocumentEventMap[K]) => any,
3093
+ options?: boolean | AddEventListenerOptions,
3094
+ ): void;
3095
+ addEventListener<K extends keyof HTMLElementEventMap>(
3096
+ type: K,
3097
+ listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
3098
+ options?: boolean | AddEventListenerOptions,
3099
+ ): void;
3100
+ addEventListener(
3101
+ type: string,
3102
+ listener: EventListenerOrEventListenerObject,
3103
+ options?: boolean | AddEventListenerOptions,
3104
+ ): void;
3105
+ removeEventListener<K extends keyof HTMLOntarioSearchBoxElementEventMap>(
3106
+ type: K,
3107
+ listener: (
3108
+ this: HTMLOntarioSearchBoxElement,
3109
+ ev: OntarioSearchBoxCustomEvent<HTMLOntarioSearchBoxElementEventMap[K]>,
3110
+ ) => any,
3111
+ options?: boolean | EventListenerOptions,
3112
+ ): void;
3113
+ removeEventListener<K extends keyof DocumentEventMap>(
3114
+ type: K,
3115
+ listener: (this: Document, ev: DocumentEventMap[K]) => any,
3116
+ options?: boolean | EventListenerOptions,
3117
+ ): void;
3118
+ removeEventListener<K extends keyof HTMLElementEventMap>(
3119
+ type: K,
3120
+ listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,
3121
+ options?: boolean | EventListenerOptions,
3122
+ ): void;
3123
+ removeEventListener(
3124
+ type: string,
3125
+ listener: EventListenerOrEventListenerObject,
3126
+ options?: boolean | EventListenerOptions,
3127
+ ): void;
3128
+ }
3129
+ var HTMLOntarioSearchBoxElement: {
3130
+ prototype: HTMLOntarioSearchBoxElement;
3131
+ new (): HTMLOntarioSearchBoxElement;
3132
+ };
3019
3133
  interface HTMLOntarioStepIndicatorElement extends Components.OntarioStepIndicator, HTMLStencilElement {}
3020
3134
  var HTMLOntarioStepIndicatorElement: {
3021
3135
  prototype: HTMLOntarioStepIndicatorElement;
@@ -3221,6 +3335,7 @@ declare global {
3221
3335
  'ontario-loading-indicator': HTMLOntarioLoadingIndicatorElement;
3222
3336
  'ontario-page-alert': HTMLOntarioPageAlertElement;
3223
3337
  'ontario-radio-buttons': HTMLOntarioRadioButtonsElement;
3338
+ 'ontario-search-box': HTMLOntarioSearchBoxElement;
3224
3339
  'ontario-step-indicator': HTMLOntarioStepIndicatorElement;
3225
3340
  'ontario-table': HTMLOntarioTableElement;
3226
3341
  'ontario-textarea': HTMLOntarioTextareaElement;
@@ -3365,18 +3480,14 @@ declare namespace LocalJSX {
3365
3480
  * Action link for when the card is clicked. This is optional.
3366
3481
  */
3367
3482
  cardLink?: string;
3368
- /**
3369
- * The type of card to render. If no type is passed, it will default to 'basic'.
3370
- */
3371
- cardType?: CardType;
3372
3483
  /**
3373
3484
  * Text to be displayed within the card description container. This is optional.
3374
3485
  */
3375
3486
  description?: string;
3376
3487
  /**
3377
- * The type of header to render. If no type is passed, it will default to 'default'.
3488
+ * Set the card's header colour. This is optional.
3378
3489
  */
3379
- headerType?: HeaderType;
3490
+ headerColour?: HeaderColour;
3380
3491
  /**
3381
3492
  * The position of the image when the card-type is set to 'horizontal'. This prop is only necessry when the card-type is set to 'horizontal'.
3382
3493
  * @example <ontario-card card-type="horizontal" label="Card Title 1" image="https://picsum.photos/200/300" horizontal-image-position-type="left" horizontal-image-size-type="one-fourth" description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum" > </ontario-card>
@@ -3396,6 +3507,10 @@ declare namespace LocalJSX {
3396
3507
  * @example <ontario-card header-type="dark" card-type="horizontal" label="Card Title 1" description="Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum" >
3397
3508
  */
3398
3509
  label?: string;
3510
+ /**
3511
+ * The layout oritnetation of the card. If no type is passed, it will default to 'vertical'.
3512
+ */
3513
+ layout?: Layout;
3399
3514
  }
3400
3515
  interface OntarioCardCollection {
3401
3516
  /**
@@ -4923,15 +5038,18 @@ declare namespace LocalJSX {
4923
5038
  * A custom function to pass to the language toggle button. This is optional.
4924
5039
  */
4925
5040
  customLanguageToggle?: (event: globalThis.Event) => void;
4926
- language?: Language | string;
4927
5041
  /**
4928
- * An event that emits to other components that the language toggle button has been toggled.
5042
+ * The language of the component. In most cases, the language toggle should be the source of truth for determining the site language. Only pass a language value here if necessary.
5043
+ */
5044
+ language?: Language;
5045
+ /**
5046
+ * Event that fires when the language toggle is pressed/clicked. The event contains the oldLanguage along with the newLanguage.
4929
5047
  */
4930
5048
  onHeaderLanguageToggled?: (event: OntarioLanguageToggleCustomEvent<HeaderLanguageToggleEventDetails>) => void;
4931
5049
  /**
4932
- * An event to set the Document's HTML lang property, and emit the toggled language to other components.
5050
+ * Event that fires during the setAppLanguageHandler() method. The event contains the current language (after language logic has already occurred).
4933
5051
  */
4934
- onSetAppLanguage?: (event: OntarioLanguageToggleCustomEvent<string>) => void;
5052
+ onSetAppLanguage?: (event: OntarioLanguageToggleCustomEvent<Language>) => void;
4935
5053
  /**
4936
5054
  * The size of the language toggle button. If no prop is passed, it will be set to the `default` size.
4937
5055
  */
@@ -5045,6 +5163,75 @@ declare namespace LocalJSX {
5045
5163
  */
5046
5164
  required?: boolean;
5047
5165
  }
5166
+ interface OntarioSearchBox {
5167
+ /**
5168
+ * The text to display as the input label
5169
+ * @example <ontario-search-box      caption='{ "captionText": "Search directory", "captionType": "default" }' required = "true" > </ontario-search-box>
5170
+ */
5171
+ caption?: Caption | string;
5172
+ /**
5173
+ * Used to add a custom function to the input onBlur event.
5174
+ */
5175
+ customOnBlur?: (event: globalThis.Event) => void;
5176
+ /**
5177
+ * Used to add a custom function to the input onChange event.
5178
+ */
5179
+ customOnChange?: (event: globalThis.Event) => void;
5180
+ /**
5181
+ * Used to add a custom function to the input onFocus event.
5182
+ */
5183
+ customOnFocus?: (event: globalThis.Event) => void;
5184
+ /**
5185
+ * Used to add a custom function to the input onInput event.
5186
+ */
5187
+ customOnInput?: (event: globalThis.Event) => void;
5188
+ /**
5189
+ * The unique identifier of the search-box component. This is optional - if no ID is passed, one will be generated.
5190
+ */
5191
+ elementId?: string;
5192
+ /**
5193
+ * Used to include the ontario-hint-text component for the search-box. This is optional.
5194
+ */
5195
+ hintText?: string | Hint;
5196
+ /**
5197
+ * The language of the component. This is used for translations. If none is passed, it will default to English.
5198
+ */
5199
+ language?: Language;
5200
+ /**
5201
+ * Emitted when a keyboard input event occurs when an input has lost focus.
5202
+ */
5203
+ onInputOnBlur?: (event: OntarioSearchBoxCustomEvent<InputFocusBlurEvent>) => void;
5204
+ /**
5205
+ * Emitted when a keyboard input or mouse event occurs when an input has been changed.
5206
+ */
5207
+ onInputOnChange?: (event: OntarioSearchBoxCustomEvent<InputInteractionEvent>) => void;
5208
+ /**
5209
+ * Emitted when a keyboard input event occurs when an input has gained focus.
5210
+ */
5211
+ onInputOnFocus?: (event: OntarioSearchBoxCustomEvent<InputFocusBlurEvent>) => void;
5212
+ /**
5213
+ * Emitted when a input  occurs when an input has been changed.
5214
+ */
5215
+ onInputOnInput?: (event: OntarioSearchBoxCustomEvent<InputInputEvent>) => void;
5216
+ /**
5217
+ * Emitted when the search is submitted. Below is an example on how to hook into the event to get the event details.
5218
+ * @example <script> document.getElementById('ontario-search-box').addEventListener('searchOnSubmit', (event) => { const searchValue = event.detail; console.log('Search submitted with value:', searchValue); }; </script>
5219
+ */
5220
+ onSearchOnSubmit?: (event: OntarioSearchBoxCustomEvent<string>) => void;
5221
+ /**
5222
+ * This Function to perform a search operation. This function will be called when the search submit button is triggered. The value argument is used for as search term to use for the search operation. This parameter is optional. The performSearch prop can be set dynamically using JavaScript, allowing you to define custom search functionality when the search form is submitted.
5223
+ * @example <ontario-search-box id="ontario-search-box" caption='Search directory' ></ontario-search-box> <script> window.addEventListener('load', () => { const searchBox = document.getElementById('ontario-search-box'); searchBox.performSearch = async (value) => { console.log('Performing search with value:', value); }; }); </script>
5224
+ */
5225
+ performSearch?: (value?: string) => Promise<void>;
5226
+ /**
5227
+ * This is used to determine whether the dropdown list is required or not. This prop gets passed to the InputCaption utility to display either an optional or required flag in the label. If no prop is set, it will default to false (optional).
5228
+ */
5229
+ required?: boolean;
5230
+ /**
5231
+ * The value of the search term. This is optional.
5232
+ */
5233
+ value?: string;
5234
+ }
5048
5235
  interface OntarioStepIndicator {
5049
5236
  /**
5050
5237
  * URL for the back element to set a path for where the link will lead. If a URL is passed in, the back element will display as an anchor tag. The back element will require either the backButtonURL prop or the customOnClick prop to be passed in order for the back element to display.
@@ -5315,6 +5502,7 @@ declare namespace LocalJSX {
5315
5502
  'ontario-loading-indicator': OntarioLoadingIndicator;
5316
5503
  'ontario-page-alert': OntarioPageAlert;
5317
5504
  'ontario-radio-buttons': OntarioRadioButtons;
5505
+ 'ontario-search-box': OntarioSearchBox;
5318
5506
  'ontario-step-indicator': OntarioStepIndicator;
5319
5507
  'ontario-table': OntarioTable;
5320
5508
  'ontario-textarea': OntarioTextarea;
@@ -5519,6 +5707,7 @@ declare module '@stencil/core' {
5519
5707
  JSXBase.HTMLAttributes<HTMLOntarioLoadingIndicatorElement>;
5520
5708
  'ontario-page-alert': LocalJSX.OntarioPageAlert & JSXBase.HTMLAttributes<HTMLOntarioPageAlertElement>;
5521
5709
  'ontario-radio-buttons': LocalJSX.OntarioRadioButtons & JSXBase.HTMLAttributes<HTMLOntarioRadioButtonsElement>;
5710
+ 'ontario-search-box': LocalJSX.OntarioSearchBox & JSXBase.HTMLAttributes<HTMLOntarioSearchBoxElement>;
5522
5711
  'ontario-step-indicator': LocalJSX.OntarioStepIndicator & JSXBase.HTMLAttributes<HTMLOntarioStepIndicatorElement>;
5523
5712
  'ontario-table': LocalJSX.OntarioTable & JSXBase.HTMLAttributes<HTMLOntarioTableElement>;
5524
5713
  'ontario-textarea': LocalJSX.OntarioTextarea & JSXBase.HTMLAttributes<HTMLOntarioTextareaElement>;
@@ -0,0 +1,37 @@
1
+ <!DOCTYPE html>
2
+ <html dir="ltr" lang="fr">
3
+ <head>
4
+ <link rel="stylesheet" href="/build/ontario-design-system-components.css" />
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
7
+ <title>Ontario Design System - component samples</title>
8
+ <script type="module" src="/build/ontario-design-system-components.esm.js"></script>
9
+ <script nomodule src="/build/ontario-design-system-components.js"></script>
10
+ </head>
11
+
12
+ <body>
13
+ <ontario-header
14
+ id="ontarioHeader"
15
+ type="serviceOntario"
16
+ application-header-info='{
17
+ "title": "Application name",
18
+ "href": "/application-homepage",
19
+ "maxSubheaderDesktopLinks": "3",
20
+ "maxSubheaderTabletLinks": "2",
21
+ "maxSubheaderMobileLinks": "1"
22
+ }'
23
+ language-toggle-options='{
24
+ "englishLink": "/index.html",
25
+ "frenchLink" : "/french.html"
26
+ }'
27
+ >
28
+ </ontario-header>
29
+
30
+ <script>
31
+ function activateHeaderType(headerType) {
32
+ const ontarioHeaderElement = document.querySelector('ontario-header');
33
+ ontarioHeaderElement.type = headerType;
34
+ }
35
+ </script>
36
+ </body>
37
+ </html>