@ongov/ontario-design-system-component-library-react 6.0.0-alpha.9 → 7.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.
- package/README.md +34 -3
- package/dist/components/components.d.ts +35 -14
- package/dist/components/components.js +186 -149
- package/dist/components/components.js.map +1 -1
- package/dist/components/components.server.d.ts +35 -17
- package/dist/components/components.server.js +188 -4
- package/dist/components/components.server.js.map +1 -1
- package/dist/styles/slotted-styles/callouts-asides.scss +2 -2
- package/dist/styles/slotted-styles/page-alerts.scss +2 -2
- package/dist/styles/theme.scss +1 -1
- package/package.json +12 -11
- package/src/components/components.server.ts +374 -173
- package/src/components/components.ts +219 -169
- package/src/types/stencil-hydrate.d.ts +6 -0
package/README.md
CHANGED
|
@@ -8,7 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
## Introduction
|
|
10
10
|
|
|
11
|
-
This library was generated using Stencil's React output target dependency. It is based
|
|
11
|
+
This library was generated using Stencil's React output target dependency. It is based on the [Ontario Design System Component Library](https://www.npmjs.com/package/@ongov/ontario-design-system-component-library) built using [Stencil](https://stenciljs.com/). For more information, [find it on NPM](https://www.npmjs.com/package/@ongov/ontario-design-system-component-library-react).
|
|
12
|
+
|
|
13
|
+
### React 19 support and tooling
|
|
14
|
+
|
|
15
|
+
This package targets React 19 and ships bindings that align with React 19's JSX/runtime expectations and tooling. React 18 is no longer supported by this package's peer dependencies.
|
|
12
16
|
|
|
13
17
|
## Installation and usage
|
|
14
18
|
|
|
@@ -25,10 +29,29 @@ To use the Ontario Design System React component library, follow these steps:
|
|
|
25
29
|
2. Import the theme file into your project’s entry point.
|
|
26
30
|
|
|
27
31
|
```tsx
|
|
28
|
-
import '@ongov/ontario-design-system-component-library-react/
|
|
32
|
+
import '@ongov/ontario-design-system-component-library-react/styles';
|
|
29
33
|
```
|
|
30
34
|
|
|
31
|
-
3.
|
|
35
|
+
3. Configure the asset path (recommended when assets are not served from `/`).
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import { setAssetPath } from '@ongov/ontario-design-system-component-library-react';
|
|
39
|
+
|
|
40
|
+
setAssetPath(`${window.location.origin}/assets/`);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Call `setAssetPath` once, before rendering any components. This ensures Stencil can resolve component assets (fonts, images, favicons) when they are hosted under a custom base path.
|
|
44
|
+
|
|
45
|
+
If you need to override the global styles theme with a custom asset base path, you can create a local theme wrapper that forwards the global styles and sets `$asset-base-path`, then import that wrapper in your app entry point.
|
|
46
|
+
|
|
47
|
+
```scss
|
|
48
|
+
// src/styles/ontario-theme.scss
|
|
49
|
+
@forward 'pkg:@ongov/ontario-design-system-global-styles/styles/scss/theme.scss' with (
|
|
50
|
+
$asset-base-path: '/assets'
|
|
51
|
+
);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
4. Import the desired components from the component library.
|
|
32
55
|
|
|
33
56
|
```tsx
|
|
34
57
|
import { OntarioButton } from '@ongov/ontario-design-system-component-library-react';
|
|
@@ -50,6 +73,14 @@ You can now use the React components in your component and template files.
|
|
|
50
73
|
></OntarioBlockquote>
|
|
51
74
|
```
|
|
52
75
|
|
|
76
|
+
### Sass (optional)
|
|
77
|
+
|
|
78
|
+
If you use Sass and want `pkg:` resolution via `@use`, import the styles entry point:
|
|
79
|
+
|
|
80
|
+
```scss
|
|
81
|
+
@use 'pkg:@ongov/ontario-design-system-component-library-react/styles' as ods;
|
|
82
|
+
```
|
|
83
|
+
|
|
53
84
|
### Local assets
|
|
54
85
|
|
|
55
86
|
Along with the components, the local assets (logos, fonts, etc.) need to be copied into your project so that they are available for bundling upon building your React application.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was automatically generated by the Stencil React Output Target.
|
|
3
3
|
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
|
|
4
4
|
*/
|
|
5
|
-
import { type AccordionChangeDetail, type HeaderLanguageToggleEventDetails, type InputFocusBlurEvent, type InputInputEvent, type InputInteractionEvent, type Language, type OntarioAccordionCustomEvent, type OntarioCheckboxesCustomEvent, type OntarioDropdownListCustomEvent, type OntarioHintExpanderCustomEvent, type OntarioInputCustomEvent, type OntarioLanguageToggleCustomEvent, type OntarioRadioButtonsCustomEvent, type OntarioSearchBoxCustomEvent, type OntarioTextareaCustomEvent, type RadioAndCheckboxChangeEvent } from "@ongov/ontario-design-system-component-library";
|
|
5
|
+
import { type AccordionChangeDetail, type DateInputFieldType, type HeaderLanguageToggleEventDetails, type InputFocusBlurEvent, type InputInputEvent, type InputInteractionEvent, type Language, type OntarioAccordionCustomEvent, type OntarioCheckboxesCustomEvent, type OntarioDateInputCustomEvent, type OntarioDropdownListCustomEvent, type OntarioHeaderCustomEvent, type OntarioHeaderMenuTabsCustomEvent, type OntarioHeaderOverflowMenuCustomEvent, type OntarioHintExpanderCustomEvent, type OntarioInputCustomEvent, type OntarioLanguageToggleCustomEvent, type OntarioRadioButtonsCustomEvent, type OntarioSearchBoxCustomEvent, type OntarioTextareaCustomEvent, type RadioAndCheckboxChangeEvent } from "@ongov/ontario-design-system-component-library";
|
|
6
6
|
import { OntarioAccordion as OntarioAccordionElement } from "@ongov/ontario-design-system-component-library/components/ontario-accordion.js";
|
|
7
7
|
import { OntarioAside as OntarioAsideElement } from "@ongov/ontario-design-system-component-library/components/ontario-aside.js";
|
|
8
8
|
import { OntarioBackToTop as OntarioBackToTopElement } from "@ongov/ontario-design-system-component-library/components/ontario-back-to-top.js";
|
|
@@ -19,6 +19,7 @@ import { OntarioDropdownList as OntarioDropdownListElement } from "@ongov/ontari
|
|
|
19
19
|
import { OntarioFieldset as OntarioFieldsetElement } from "@ongov/ontario-design-system-component-library/components/ontario-fieldset.js";
|
|
20
20
|
import { OntarioFooter as OntarioFooterElement } from "@ongov/ontario-design-system-component-library/components/ontario-footer.js";
|
|
21
21
|
import { OntarioFormContainer as OntarioFormContainerElement } from "@ongov/ontario-design-system-component-library/components/ontario-form-container.js";
|
|
22
|
+
import { OntarioHeaderMenuTabs as OntarioHeaderMenuTabsElement } from "@ongov/ontario-design-system-component-library/components/ontario-header-menu-tabs.js";
|
|
22
23
|
import { OntarioHeaderOverflowMenu as OntarioHeaderOverflowMenuElement } from "@ongov/ontario-design-system-component-library/components/ontario-header-overflow-menu.js";
|
|
23
24
|
import { OntarioHeader as OntarioHeaderElement } from "@ongov/ontario-design-system-component-library/components/ontario-header.js";
|
|
24
25
|
import { OntarioHintExpander as OntarioHintExpanderElement } from "@ongov/ontario-design-system-component-library/components/ontario-hint-expander.js";
|
|
@@ -89,6 +90,7 @@ import { OntarioIconMenuHeader as OntarioIconMenuHeaderElement } from "@ongov/on
|
|
|
89
90
|
import { OntarioIconMenu as OntarioIconMenuElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-menu.js";
|
|
90
91
|
import { OntarioIconMicrophoneOff as OntarioIconMicrophoneOffElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-microphone-off.js";
|
|
91
92
|
import { OntarioIconMicrophoneOn as OntarioIconMicrophoneOnElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-microphone-on.js";
|
|
93
|
+
import { OntarioIconMoreAccounts as OntarioIconMoreAccountsElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-more-accounts.js";
|
|
92
94
|
import { OntarioIconMoreVertical as OntarioIconMoreVerticalElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-more-vertical.js";
|
|
93
95
|
import { OntarioIconNewWindow as OntarioIconNewWindowElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-new-window.js";
|
|
94
96
|
import { OntarioIconNext as OntarioIconNextElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-next.js";
|
|
@@ -129,6 +131,7 @@ import { OntarioIconTransportBus as OntarioIconTransportBusElement } from "@ongo
|
|
|
129
131
|
import { OntarioIconTransportCar as OntarioIconTransportCarElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-transport-car.js";
|
|
130
132
|
import { OntarioIconTransportWalk as OntarioIconTransportWalkElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-transport-walk.js";
|
|
131
133
|
import { OntarioIconTty as OntarioIconTtyElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-tty.js";
|
|
134
|
+
import { OntarioIconTune as OntarioIconTuneElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-tune.js";
|
|
132
135
|
import { OntarioIconTwitterAlt as OntarioIconTwitterAltElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-twitter-alt.js";
|
|
133
136
|
import { OntarioIconTwitter as OntarioIconTwitterElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-twitter.js";
|
|
134
137
|
import { OntarioIconUpload as OntarioIconUploadElement } from "@ongov/ontario-design-system-component-library/components/ontario-icon-upload.js";
|
|
@@ -176,7 +179,7 @@ export type OntarioCheckboxesEvents = {
|
|
|
176
179
|
onCheckboxOnChange: EventName<OntarioCheckboxesCustomEvent<RadioAndCheckboxChangeEvent>>;
|
|
177
180
|
onCheckboxOnBlur: EventName<OntarioCheckboxesCustomEvent<InputFocusBlurEvent>>;
|
|
178
181
|
onCheckboxOnFocus: EventName<OntarioCheckboxesCustomEvent<InputFocusBlurEvent>>;
|
|
179
|
-
onInputErrorOccurred: EventName<
|
|
182
|
+
onInputErrorOccurred: EventName<OntarioCheckboxesCustomEvent<{
|
|
180
183
|
errorMessage: string;
|
|
181
184
|
}>>;
|
|
182
185
|
};
|
|
@@ -184,17 +187,17 @@ export declare const OntarioCheckboxes: StencilReactComponent<OntarioCheckboxesE
|
|
|
184
187
|
export type OntarioCriticalAlertEvents = NonNullable<unknown>;
|
|
185
188
|
export declare const OntarioCriticalAlert: StencilReactComponent<OntarioCriticalAlertElement, OntarioCriticalAlertEvents>;
|
|
186
189
|
export type OntarioDateInputEvents = {
|
|
187
|
-
onInputOnInput: EventName<
|
|
190
|
+
onInputOnInput: EventName<OntarioDateInputCustomEvent<{
|
|
188
191
|
value: string;
|
|
189
192
|
fieldType: 'day' | 'month' | 'year';
|
|
190
193
|
}>>;
|
|
191
|
-
onInputOnChange: EventName<
|
|
194
|
+
onInputOnChange: EventName<OntarioDateInputCustomEvent<{
|
|
192
195
|
value: string;
|
|
193
196
|
fieldType: 'day' | 'month' | 'year';
|
|
194
197
|
}>>;
|
|
195
|
-
onInputOnBlur: EventName<
|
|
196
|
-
onInputOnFocus: EventName<
|
|
197
|
-
onInputErrorOccurred: EventName<
|
|
198
|
+
onInputOnBlur: EventName<OntarioDateInputCustomEvent<DateInputFieldType>>;
|
|
199
|
+
onInputOnFocus: EventName<OntarioDateInputCustomEvent<DateInputFieldType>>;
|
|
200
|
+
onInputErrorOccurred: EventName<OntarioDateInputCustomEvent<{
|
|
198
201
|
inputId: string;
|
|
199
202
|
errorMessage: string;
|
|
200
203
|
}>>;
|
|
@@ -204,7 +207,7 @@ export type OntarioDropdownListEvents = {
|
|
|
204
207
|
onDropdownOnChange: EventName<OntarioDropdownListCustomEvent<InputInteractionEvent>>;
|
|
205
208
|
onDropdownOnBlur: EventName<OntarioDropdownListCustomEvent<InputFocusBlurEvent>>;
|
|
206
209
|
onDropdownOnFocus: EventName<OntarioDropdownListCustomEvent<InputFocusBlurEvent>>;
|
|
207
|
-
onInputErrorOccurred: EventName<
|
|
210
|
+
onInputErrorOccurred: EventName<OntarioDropdownListCustomEvent<{
|
|
208
211
|
errorMessage: string;
|
|
209
212
|
}>>;
|
|
210
213
|
};
|
|
@@ -216,10 +219,24 @@ export declare const OntarioFooter: StencilReactComponent<OntarioFooterElement,
|
|
|
216
219
|
export type OntarioFormContainerEvents = NonNullable<unknown>;
|
|
217
220
|
export declare const OntarioFormContainer: StencilReactComponent<OntarioFormContainerElement, OntarioFormContainerEvents>;
|
|
218
221
|
export type OntarioHeaderEvents = {
|
|
219
|
-
onMenuButtonToggled: EventName<
|
|
222
|
+
onMenuButtonToggled: EventName<OntarioHeaderCustomEvent<boolean>>;
|
|
220
223
|
};
|
|
221
224
|
export declare const OntarioHeader: StencilReactComponent<OntarioHeaderElement, OntarioHeaderEvents>;
|
|
222
|
-
export type
|
|
225
|
+
export type OntarioHeaderMenuTabsEvents = {
|
|
226
|
+
onTakeOwnership: EventName<OntarioHeaderMenuTabsCustomEvent<{
|
|
227
|
+
panelId: string | null;
|
|
228
|
+
}>>;
|
|
229
|
+
onFocusFirstItem: EventName<OntarioHeaderMenuTabsCustomEvent<void>>;
|
|
230
|
+
onFocusMenuButton: EventName<OntarioHeaderMenuTabsCustomEvent<void>>;
|
|
231
|
+
};
|
|
232
|
+
export declare const OntarioHeaderMenuTabs: StencilReactComponent<OntarioHeaderMenuTabsElement, OntarioHeaderMenuTabsEvents>;
|
|
233
|
+
export type OntarioHeaderOverflowMenuEvents = {
|
|
234
|
+
onMenuClosed: EventName<OntarioHeaderOverflowMenuCustomEvent<void>>;
|
|
235
|
+
onEndOfMenuReached: EventName<OntarioHeaderOverflowMenuCustomEvent<void>>;
|
|
236
|
+
onFocusMenuButton: EventName<OntarioHeaderOverflowMenuCustomEvent<void>>;
|
|
237
|
+
onFocusNextElement: EventName<OntarioHeaderOverflowMenuCustomEvent<void>>;
|
|
238
|
+
onMenuButtonTabPressed: EventName<OntarioHeaderOverflowMenuCustomEvent<void>>;
|
|
239
|
+
};
|
|
223
240
|
export declare const OntarioHeaderOverflowMenu: StencilReactComponent<OntarioHeaderOverflowMenuElement, OntarioHeaderOverflowMenuEvents>;
|
|
224
241
|
export type OntarioHintExpanderEvents = {
|
|
225
242
|
onToggleExpanderEvent: EventName<OntarioHintExpanderCustomEvent<MouseEvent | KeyboardEvent>>;
|
|
@@ -359,6 +376,8 @@ export type OntarioIconMicrophoneOffEvents = NonNullable<unknown>;
|
|
|
359
376
|
export declare const OntarioIconMicrophoneOff: StencilReactComponent<OntarioIconMicrophoneOffElement, OntarioIconMicrophoneOffEvents>;
|
|
360
377
|
export type OntarioIconMicrophoneOnEvents = NonNullable<unknown>;
|
|
361
378
|
export declare const OntarioIconMicrophoneOn: StencilReactComponent<OntarioIconMicrophoneOnElement, OntarioIconMicrophoneOnEvents>;
|
|
379
|
+
export type OntarioIconMoreAccountsEvents = NonNullable<unknown>;
|
|
380
|
+
export declare const OntarioIconMoreAccounts: StencilReactComponent<OntarioIconMoreAccountsElement, OntarioIconMoreAccountsEvents>;
|
|
362
381
|
export type OntarioIconMoreVerticalEvents = NonNullable<unknown>;
|
|
363
382
|
export declare const OntarioIconMoreVertical: StencilReactComponent<OntarioIconMoreVerticalElement, OntarioIconMoreVerticalEvents>;
|
|
364
383
|
export type OntarioIconNewWindowEvents = NonNullable<unknown>;
|
|
@@ -439,6 +458,8 @@ export type OntarioIconTransportWalkEvents = NonNullable<unknown>;
|
|
|
439
458
|
export declare const OntarioIconTransportWalk: StencilReactComponent<OntarioIconTransportWalkElement, OntarioIconTransportWalkEvents>;
|
|
440
459
|
export type OntarioIconTtyEvents = NonNullable<unknown>;
|
|
441
460
|
export declare const OntarioIconTty: StencilReactComponent<OntarioIconTtyElement, OntarioIconTtyEvents>;
|
|
461
|
+
export type OntarioIconTuneEvents = NonNullable<unknown>;
|
|
462
|
+
export declare const OntarioIconTune: StencilReactComponent<OntarioIconTuneElement, OntarioIconTuneEvents>;
|
|
442
463
|
export type OntarioIconTwitterEvents = NonNullable<unknown>;
|
|
443
464
|
export declare const OntarioIconTwitter: StencilReactComponent<OntarioIconTwitterElement, OntarioIconTwitterEvents>;
|
|
444
465
|
export type OntarioIconTwitterAltEvents = NonNullable<unknown>;
|
|
@@ -466,7 +487,7 @@ export type OntarioInputEvents = {
|
|
|
466
487
|
onInputOnChange: EventName<OntarioInputCustomEvent<InputInteractionEvent>>;
|
|
467
488
|
onInputOnBlur: EventName<OntarioInputCustomEvent<InputFocusBlurEvent>>;
|
|
468
489
|
onInputOnFocus: EventName<OntarioInputCustomEvent<InputFocusBlurEvent>>;
|
|
469
|
-
onInputErrorOccurred: EventName<
|
|
490
|
+
onInputErrorOccurred: EventName<OntarioInputCustomEvent<{
|
|
470
491
|
inputId: string;
|
|
471
492
|
errorMessage: string;
|
|
472
493
|
}>>;
|
|
@@ -485,13 +506,13 @@ export type OntarioRadioButtonsEvents = {
|
|
|
485
506
|
onRadioOnChange: EventName<OntarioRadioButtonsCustomEvent<RadioAndCheckboxChangeEvent>>;
|
|
486
507
|
onRadioOnBlur: EventName<OntarioRadioButtonsCustomEvent<InputFocusBlurEvent>>;
|
|
487
508
|
onRadioOnFocus: EventName<OntarioRadioButtonsCustomEvent<InputFocusBlurEvent>>;
|
|
488
|
-
onInputErrorOccurred: EventName<
|
|
509
|
+
onInputErrorOccurred: EventName<OntarioRadioButtonsCustomEvent<{
|
|
489
510
|
errorMessage: string;
|
|
490
511
|
}>>;
|
|
491
512
|
};
|
|
492
513
|
export declare const OntarioRadioButtons: StencilReactComponent<OntarioRadioButtonsElement, OntarioRadioButtonsEvents>;
|
|
493
514
|
export type OntarioSearchBoxEvents = {
|
|
494
|
-
onSearchOnSubmit: EventName<
|
|
515
|
+
onSearchOnSubmit: EventName<OntarioSearchBoxCustomEvent<string>>;
|
|
495
516
|
onInputOnInput: EventName<OntarioSearchBoxCustomEvent<InputInputEvent>>;
|
|
496
517
|
onInputOnChange: EventName<OntarioSearchBoxCustomEvent<InputInteractionEvent>>;
|
|
497
518
|
onInputOnBlur: EventName<OntarioSearchBoxCustomEvent<InputFocusBlurEvent>>;
|
|
@@ -511,7 +532,7 @@ export type OntarioTextareaEvents = {
|
|
|
511
532
|
onInputOnChange: EventName<OntarioTextareaCustomEvent<InputInteractionEvent>>;
|
|
512
533
|
onInputOnBlur: EventName<OntarioTextareaCustomEvent<InputFocusBlurEvent>>;
|
|
513
534
|
onInputOnFocus: EventName<OntarioTextareaCustomEvent<InputFocusBlurEvent>>;
|
|
514
|
-
onInputErrorOccurred: EventName<
|
|
535
|
+
onInputErrorOccurred: EventName<OntarioTextareaCustomEvent<{
|
|
515
536
|
inputId: string;
|
|
516
537
|
errorMessage: string;
|
|
517
538
|
}>>;
|