@okta/odyssey-react-mui 1.24.1 → 1.26.0
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/CHANGELOG.md +21 -0
- package/dist/Autocomplete.js +30 -191
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Box.js +2 -0
- package/dist/Box.js.map +1 -1
- package/dist/Card.js +1 -0
- package/dist/Card.js.map +1 -1
- package/dist/OdysseyDesignTokensContext.js +3 -2
- package/dist/OdysseyDesignTokensContext.js.map +1 -1
- package/dist/OdysseyProvider.js +22 -40
- package/dist/OdysseyProvider.js.map +1 -1
- package/dist/OdysseyThemeProvider.js +33 -12
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/OdysseyTranslationProvider.types.js +1 -1
- package/dist/OdysseyTranslationProvider.types.js.map +1 -1
- package/dist/Pagination/Pagination.js +46 -14
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/Select.js +10 -2
- package/dist/Select.js.map +1 -1
- package/dist/Surface.js +4 -1
- package/dist/Surface.js.map +1 -1
- package/dist/Tag.js +97 -47
- package/dist/Tag.js.map +1 -1
- package/dist/i18n.js +2 -0
- package/dist/i18n.js.map +1 -1
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/index.scss +1 -1
- package/dist/labs/AppTile.js +137 -39
- package/dist/labs/AppTile.js.map +1 -1
- package/dist/labs/DataView/CardLayoutContent.js +7 -8
- package/dist/labs/DataView/CardLayoutContent.js.map +1 -1
- package/dist/labs/DataView/DataCard.js +96 -43
- package/dist/labs/DataView/DataCard.js.map +1 -1
- package/dist/labs/DataView/TableLayoutContent.js +3 -2
- package/dist/labs/DataView/TableLayoutContent.js.map +1 -1
- package/dist/labs/DataView/componentTypes.js.map +1 -1
- package/dist/labs/DataView/index.js.map +1 -1
- package/dist/labs/OdysseyPickers/ComposablePicker.js +113 -0
- package/dist/labs/OdysseyPickers/ComposablePicker.js.map +1 -0
- package/dist/labs/OdysseyPickers/Picker.js +261 -0
- package/dist/labs/OdysseyPickers/Picker.js.map +1 -0
- package/dist/labs/OdysseyPickers/PickerVirtualizationListBox.js +132 -0
- package/dist/labs/OdysseyPickers/PickerVirtualizationListBox.js.map +1 -0
- package/dist/labs/OdysseyPickers/PickerWithOptionAdornment.js +291 -0
- package/dist/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -0
- package/dist/{src/createShadowDomElements.d.ts → labs/OdysseyPickers/index.js} +4 -7
- package/dist/labs/OdysseyPickers/index.js.map +1 -0
- package/dist/labs/PageTemplate.js +14 -10
- package/dist/labs/PageTemplate.js.map +1 -1
- package/dist/labs/SideNav/CollapseIcon.js +11 -25
- package/dist/labs/SideNav/CollapseIcon.js.map +1 -1
- package/dist/labs/SideNav/HandleIcon.js +32 -0
- package/dist/labs/SideNav/HandleIcon.js.map +1 -0
- package/dist/labs/{NavAccordion.js → SideNav/NavAccordion.js} +35 -6
- package/dist/labs/SideNav/NavAccordion.js.map +1 -0
- package/dist/labs/SideNav/OktaAura.js +32 -0
- package/dist/labs/SideNav/OktaAura.js.map +1 -0
- package/dist/labs/SideNav/OktaLogo.js +6 -9
- package/dist/labs/SideNav/OktaLogo.js.map +1 -1
- package/dist/labs/SideNav/SideNav.js +239 -169
- package/dist/labs/SideNav/SideNav.js.map +1 -1
- package/dist/labs/SideNav/SideNavFooterContent.js +32 -18
- package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -1
- package/dist/labs/SideNav/SideNavHeader.js +48 -37
- package/dist/labs/SideNav/SideNavHeader.js.map +1 -1
- package/dist/labs/SideNav/SideNavItemContent.js +100 -58
- package/dist/labs/SideNav/SideNavItemContent.js.map +1 -1
- package/dist/labs/SideNav/SideNavItemContentContext.js +19 -0
- package/dist/labs/SideNav/SideNavItemContentContext.js.map +1 -0
- package/dist/labs/SideNav/SideNavItemLinkContent.js +14 -13
- package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -1
- package/dist/labs/SideNav/SideNavLogo.js +42 -0
- package/dist/labs/SideNav/SideNavLogo.js.map +1 -0
- package/dist/labs/SideNav/SideNavToggleButton.js +170 -0
- package/dist/labs/SideNav/SideNavToggleButton.js.map +1 -0
- package/dist/labs/SideNav/types.js.map +1 -1
- package/dist/labs/TopNav/TopNav.js +65 -0
- package/dist/labs/TopNav/TopNav.js.map +1 -0
- package/dist/labs/TopNav/TopNavLinksList.js +38 -0
- package/dist/labs/TopNav/TopNavLinksList.js.map +1 -0
- package/dist/labs/TopNav/TopNavListItem.js +132 -0
- package/dist/labs/TopNav/TopNavListItem.js.map +1 -0
- package/dist/labs/TopNav/UserProfile.js +65 -0
- package/dist/labs/TopNav/UserProfile.js.map +1 -0
- package/dist/labs/TopNav/index.js +14 -0
- package/dist/labs/TopNav/index.js.map +1 -0
- package/dist/labs/UiShell/UiShell.js +68 -0
- package/dist/labs/UiShell/UiShell.js.map +1 -0
- package/dist/labs/UiShell/UiShellContent.js +114 -0
- package/dist/labs/UiShell/UiShellContent.js.map +1 -0
- package/dist/labs/UiShell/bufferLatest.js +37 -0
- package/dist/labs/UiShell/bufferLatest.js.map +1 -0
- package/dist/labs/UiShell/createMessageBus.js +30 -0
- package/dist/labs/UiShell/createMessageBus.js.map +1 -0
- package/dist/labs/UiShell/createStore.js +24 -0
- package/dist/labs/UiShell/createStore.js.map +1 -0
- package/dist/labs/UiShell/index.js +15 -0
- package/dist/labs/UiShell/index.js.map +1 -0
- package/dist/labs/UiShell/renderUiShell.js +78 -0
- package/dist/labs/UiShell/renderUiShell.js.map +1 -0
- package/dist/labs/UiShell/useHasUiShell.js +22 -0
- package/dist/labs/UiShell/useHasUiShell.js.map +1 -0
- package/dist/labs/UiShell/useScrollState.js +41 -0
- package/dist/labs/UiShell/useScrollState.js.map +1 -0
- package/dist/labs/index.js +5 -3
- package/dist/labs/index.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui.js +7 -1
- package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_cs.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_da.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_de.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_el.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_es.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_fi.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_fr.js +5 -3
- package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ht.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_hu.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_id.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_it.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ja.js +9 -7
- package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ko.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ms.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_nb.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_nl_NL.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_pl.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_pt_BR.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ro.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ru.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_sv.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_th.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_tr.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_uk.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_vi.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_zh_CN.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_zh_TW.js +3 -1
- package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
- package/dist/src/Autocomplete.d.ts +21 -22
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Box.d.ts +3 -1
- package/dist/src/Box.d.ts.map +1 -1
- package/dist/src/Card.d.ts.map +1 -1
- package/dist/src/OdysseyDesignTokensContext.d.ts +5 -4
- package/dist/src/OdysseyDesignTokensContext.d.ts.map +1 -1
- package/dist/src/OdysseyProvider.d.ts +1 -3
- package/dist/src/OdysseyProvider.d.ts.map +1 -1
- package/dist/src/OdysseyThemeProvider.d.ts +10 -4
- package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
- package/dist/src/OdysseyTranslationProvider.types.d.ts +1 -1
- package/dist/src/OdysseyTranslationProvider.types.d.ts.map +1 -1
- package/dist/src/Pagination/Pagination.d.ts +21 -7
- package/dist/src/Pagination/Pagination.d.ts.map +1 -1
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/Surface.d.ts.map +1 -1
- package/dist/src/Tag.d.ts +5 -2
- package/dist/src/Tag.d.ts.map +1 -1
- package/dist/src/i18n.d.ts.map +1 -1
- package/dist/src/index.d.ts +6 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/labs/AppTile.d.ts +3 -1
- package/dist/src/labs/AppTile.d.ts.map +1 -1
- package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -1
- package/dist/src/labs/DataView/DataCard.d.ts +9 -3
- package/dist/src/labs/DataView/DataCard.d.ts.map +1 -1
- package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -1
- package/dist/src/labs/DataView/componentTypes.d.ts +1 -1
- package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -1
- package/dist/src/labs/DataView/index.d.ts +1 -0
- package/dist/src/labs/DataView/index.d.ts.map +1 -1
- package/dist/src/labs/OdysseyPickers/ComposablePicker.d.ts +33 -0
- package/dist/src/labs/OdysseyPickers/ComposablePicker.d.ts.map +1 -0
- package/dist/src/labs/OdysseyPickers/Picker.d.ts +98 -0
- package/dist/src/labs/OdysseyPickers/Picker.d.ts.map +1 -0
- package/dist/src/labs/OdysseyPickers/PickerVirtualizationListBox.d.ts +17 -0
- package/dist/src/labs/OdysseyPickers/PickerVirtualizationListBox.d.ts.map +1 -0
- package/dist/src/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts +26 -0
- package/dist/src/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -0
- package/dist/src/labs/OdysseyPickers/index.d.ts +15 -0
- package/dist/src/labs/OdysseyPickers/index.d.ts.map +1 -0
- package/dist/src/labs/PageTemplate.d.ts +1 -1
- package/dist/src/labs/PageTemplate.d.ts.map +1 -1
- package/dist/src/labs/SideNav/CollapseIcon.d.ts +1 -4
- package/dist/src/labs/SideNav/CollapseIcon.d.ts.map +1 -1
- package/dist/src/labs/SideNav/HandleIcon.d.ts +14 -0
- package/dist/src/labs/SideNav/HandleIcon.d.ts.map +1 -0
- package/dist/src/labs/{NavAccordion.d.ts → SideNav/NavAccordion.d.ts} +6 -2
- package/dist/src/labs/SideNav/NavAccordion.d.ts.map +1 -0
- package/dist/src/labs/SideNav/OktaAura.d.ts +14 -0
- package/dist/src/labs/SideNav/OktaAura.d.ts.map +1 -0
- package/dist/src/labs/SideNav/OktaLogo.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNav.d.ts +2 -1
- package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNavFooterContent.d.ts +1 -1
- package/dist/src/labs/SideNav/SideNavFooterContent.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNavHeader.d.ts +12 -3
- package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts +2 -3
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNavItemContentContext.d.ts +18 -0
- package/dist/src/labs/SideNav/SideNavItemContentContext.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts +1 -1
- package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNavLogo.d.ts +15 -0
- package/dist/src/labs/SideNav/SideNavLogo.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavToggleButton.d.ts +38 -0
- package/dist/src/labs/SideNav/SideNavToggleButton.d.ts.map +1 -0
- package/dist/src/labs/SideNav/types.d.ts +67 -33
- package/dist/src/labs/SideNav/types.d.ts.map +1 -1
- package/dist/src/labs/TopNav/TopNav.d.ts +31 -0
- package/dist/src/labs/TopNav/TopNav.d.ts.map +1 -0
- package/dist/src/labs/TopNav/TopNavLinksList.d.ts +44 -0
- package/dist/src/labs/TopNav/TopNavLinksList.d.ts.map +1 -0
- package/dist/src/labs/TopNav/TopNavListItem.d.ts +42 -0
- package/dist/src/labs/TopNav/TopNavListItem.d.ts.map +1 -0
- package/dist/src/labs/TopNav/UserProfile.d.ts +29 -0
- package/dist/src/labs/TopNav/UserProfile.d.ts.map +1 -0
- package/dist/src/labs/TopNav/index.d.ts +14 -0
- package/dist/src/labs/TopNav/index.d.ts.map +1 -0
- package/dist/src/labs/UiShell/UiShell.d.ts +33 -0
- package/dist/src/labs/UiShell/UiShell.d.ts.map +1 -0
- package/dist/src/labs/UiShell/UiShellContent.d.ts +47 -0
- package/dist/src/labs/UiShell/UiShellContent.d.ts.map +1 -0
- package/dist/src/labs/UiShell/bufferLatest.d.ts +31 -0
- package/dist/src/labs/UiShell/bufferLatest.d.ts.map +1 -0
- package/dist/src/labs/UiShell/createMessageBus.d.ts +24 -0
- package/dist/src/labs/UiShell/createMessageBus.d.ts.map +1 -0
- package/dist/src/labs/UiShell/createStore.d.ts +22 -0
- package/dist/src/labs/UiShell/createStore.d.ts.map +1 -0
- package/dist/src/labs/UiShell/index.d.ts +16 -0
- package/dist/src/labs/UiShell/index.d.ts.map +1 -0
- package/dist/src/labs/UiShell/renderUiShell.d.ts +45 -0
- package/dist/src/labs/UiShell/renderUiShell.d.ts.map +1 -0
- package/dist/src/labs/UiShell/useHasUiShell.d.ts +13 -0
- package/dist/src/labs/UiShell/useHasUiShell.d.ts.map +1 -0
- package/dist/src/labs/UiShell/useScrollState.d.ts +16 -0
- package/dist/src/labs/UiShell/useScrollState.d.ts.map +1 -0
- package/dist/src/labs/index.d.ts +6 -2
- package/dist/src/labs/index.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui.d.ts +6 -0
- package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
- package/dist/src/test-selectors/querySelector.d.ts +2 -2
- package/dist/src/theme/components.d.ts +3 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/src/theme/createOdysseyMuiTheme.d.ts +3 -1
- package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
- package/dist/src/useAutocomplete.d.ts +29 -0
- package/dist/src/useAutocomplete.d.ts.map +1 -0
- package/dist/src/useContrastMode.d.ts +46 -0
- package/dist/src/useContrastMode.d.ts.map +1 -0
- package/dist/src/web-component/index.d.ts +14 -0
- package/dist/src/web-component/index.d.ts.map +1 -0
- package/dist/src/web-component/renderReactInWebComponent.d.ts +76 -0
- package/dist/src/web-component/renderReactInWebComponent.d.ts.map +1 -0
- package/dist/src/web-component/shadow-dom.d.ts +23 -0
- package/dist/src/web-component/shadow-dom.d.ts.map +1 -0
- package/dist/test-selectors/querySelector.js.map +1 -1
- package/dist/theme/components.js +41 -32
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/createOdysseyMuiTheme.js +3 -0
- package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/useAutocomplete.js +105 -0
- package/dist/useAutocomplete.js.map +1 -0
- package/dist/useContrastMode.js +93 -0
- package/dist/useContrastMode.js.map +1 -0
- package/dist/web-component/index.js +14 -0
- package/dist/web-component/index.js.map +1 -0
- package/dist/web-component/renderReactInWebComponent.js +72 -0
- package/dist/web-component/renderReactInWebComponent.js.map +1 -0
- package/dist/{createShadowDomElements.js → web-component/shadow-dom.js} +10 -12
- package/dist/web-component/shadow-dom.js.map +1 -0
- package/jest.config.cjs +21 -2
- package/jest.setup.js +0 -3
- package/package.json +4 -3
- package/src/Autocomplete.tsx +40 -330
- package/src/Box.tsx +4 -2
- package/src/Card.tsx +1 -0
- package/src/OdysseyDesignTokensContext.tsx +6 -3
- package/src/OdysseyProvider.tsx +29 -56
- package/src/OdysseyThemeProvider.test.tsx +209 -0
- package/src/OdysseyThemeProvider.tsx +43 -17
- package/src/OdysseyTranslationProvider.types.ts +1 -0
- package/src/Pagination/Pagination.test.tsx +305 -0
- package/src/Pagination/Pagination.tsx +86 -38
- package/src/Select.tsx +12 -3
- package/src/Surface.tsx +2 -1
- package/src/Tag.tsx +102 -41
- package/src/createUniqueAlphabeticalId.test.ts +1 -1
- package/src/createUniqueId.test.ts +1 -1
- package/src/i18n.ts +2 -0
- package/src/index.ts +6 -7
- package/src/labs/AppTile.tsx +169 -40
- package/src/labs/DataView/CardLayoutContent.tsx +12 -14
- package/src/labs/DataView/DataCard.tsx +137 -69
- package/src/labs/DataView/DataView.test.tsx +6 -4
- package/src/labs/DataView/TableLayoutContent.tsx +6 -2
- package/src/labs/DataView/componentTypes.ts +1 -1
- package/src/labs/DataView/index.tsx +1 -0
- package/src/labs/OdysseyPickers/ComposablePicker.test.tsx +29 -0
- package/src/labs/OdysseyPickers/ComposablePicker.tsx +188 -0
- package/src/labs/OdysseyPickers/Picker.tsx +381 -0
- package/src/labs/OdysseyPickers/PickerVirtualizationListBox.tsx +191 -0
- package/src/labs/OdysseyPickers/PickerWithOptionAdornment.tsx +429 -0
- package/src/labs/OdysseyPickers/index.ts +15 -0
- package/src/labs/PageTemplate.tsx +18 -10
- package/src/labs/SideNav/CollapseIcon.tsx +14 -28
- package/src/labs/SideNav/HandleIcon.tsx +35 -0
- package/src/labs/{NavAccordion.tsx → SideNav/NavAccordion.tsx} +48 -8
- package/src/labs/SideNav/OktaAura.tsx +35 -0
- package/src/labs/SideNav/OktaLogo.tsx +5 -10
- package/src/labs/SideNav/SideNav.test.tsx +323 -0
- package/src/labs/SideNav/SideNav.tsx +291 -204
- package/src/labs/SideNav/SideNavFooterContent.tsx +36 -28
- package/src/labs/SideNav/SideNavHeader.tsx +62 -45
- package/src/labs/SideNav/SideNavItemContent.tsx +142 -62
- package/src/labs/SideNav/SideNavItemContentContext.tsx +27 -0
- package/src/labs/SideNav/SideNavItemLinkContent.tsx +17 -14
- package/src/labs/SideNav/SideNavLogo.tsx +41 -0
- package/src/labs/SideNav/SideNavToggleButton.tsx +249 -0
- package/src/labs/SideNav/types.ts +72 -33
- package/src/labs/TopNav/TopNav.tsx +95 -0
- package/src/labs/TopNav/TopNavLinksList.tsx +68 -0
- package/src/labs/TopNav/TopNavListItem.tsx +209 -0
- package/src/labs/TopNav/UserProfile.tsx +79 -0
- package/src/labs/TopNav/index.ts +14 -0
- package/src/labs/UiShell/UiShell.test.tsx +284 -0
- package/src/labs/UiShell/UiShell.tsx +109 -0
- package/src/labs/UiShell/UiShellContent.tsx +170 -0
- package/src/labs/UiShell/bufferLatest.test.ts +79 -0
- package/src/labs/UiShell/bufferLatest.ts +64 -0
- package/src/labs/UiShell/createMessageBus.test.ts +115 -0
- package/src/labs/UiShell/createMessageBus.ts +53 -0
- package/src/labs/UiShell/createStore.test.ts +103 -0
- package/src/labs/UiShell/createStore.ts +37 -0
- package/src/labs/UiShell/index.ts +17 -0
- package/src/labs/UiShell/renderUiShell.test.tsx +197 -0
- package/src/labs/UiShell/renderUiShell.tsx +132 -0
- package/src/labs/UiShell/useHasUiShell.ts +25 -0
- package/src/labs/UiShell/useScrollState.ts +56 -0
- package/src/labs/index.ts +10 -3
- package/src/properties/odyssey-react-mui.properties +7 -0
- package/src/properties/translations/odyssey-react-mui_cs.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_da.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_de.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_el.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_es.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_fi.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_fr.properties +4 -3
- package/src/properties/translations/odyssey-react-mui_ht.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_hu.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_id.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_it.properties +3 -2
- package/src/properties/translations/odyssey-react-mui_ja.properties +8 -7
- package/src/properties/translations/odyssey-react-mui_ko.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_ms.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_nb.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_nl_NL.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_pl.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_pt_BR.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_ro.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_ru.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_sv.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_th.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_tr.properties +3 -2
- package/src/properties/translations/odyssey-react-mui_uk.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_vi.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_zh_CN.properties +2 -1
- package/src/properties/translations/odyssey-react-mui_zh_TW.properties +2 -1
- package/src/properties/ts/odyssey-react-mui.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ht.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
- package/src/test-selectors/querySelector.ts +1 -1
- package/src/theme/components.tsx +55 -31
- package/src/theme/createOdysseyMuiTheme.ts +4 -0
- package/src/theme/useContrastMode.test.tsx +503 -0
- package/src/useAutocomplete.tsx +183 -0
- package/src/useContrastMode.tsx +149 -0
- package/src/web-component/index.ts +14 -0
- package/src/web-component/renderReactInWebComponent.test.tsx +156 -0
- package/src/web-component/renderReactInWebComponent.ts +153 -0
- package/src/web-component/shadow-dom.test.ts +24 -0
- package/src/{createShadowDomElements.ts → web-component/shadow-dom.ts} +15 -14
- package/dist/ContrastModeProvider.js +0 -86
- package/dist/ContrastModeProvider.js.map +0 -1
- package/dist/createShadowDomElements.js.map +0 -1
- package/dist/labs/NavAccordion.js.map +0 -1
- package/dist/labs/TopNav.js +0 -281
- package/dist/labs/TopNav.js.map +0 -1
- package/dist/src/ContrastModeProvider.d.ts +0 -34
- package/dist/src/ContrastModeProvider.d.ts.map +0 -1
- package/dist/src/createShadowDomElements.d.ts.map +0 -1
- package/dist/src/labs/NavAccordion.d.ts.map +0 -1
- package/dist/src/labs/TopNav.d.ts +0 -78
- package/dist/src/labs/TopNav.d.ts.map +0 -1
- package/src/ContrastModeProvider.tsx +0 -131
- package/src/labs/TopNav.tsx +0 -396
|
@@ -9,22 +9,20 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
import { createReactRootElements } from "./renderReactInWebComponent.js";
|
|
13
13
|
export const createShadowDomElements = containerElement => {
|
|
14
14
|
const shadowRoot = containerElement.attachShadow({
|
|
15
15
|
mode: "open"
|
|
16
16
|
});
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
shadowRoot.appendChild(emotionRootElement);
|
|
24
|
-
shadowRoot.appendChild(shadowRootElement);
|
|
17
|
+
const {
|
|
18
|
+
appRootElement,
|
|
19
|
+
stylesRootElement
|
|
20
|
+
} = createReactRootElements();
|
|
21
|
+
shadowRoot.appendChild(appRootElement);
|
|
22
|
+
shadowRoot.appendChild(stylesRootElement);
|
|
25
23
|
return {
|
|
26
|
-
emotionRootElement,
|
|
27
|
-
shadowRootElement
|
|
24
|
+
emotionRootElement: stylesRootElement,
|
|
25
|
+
shadowRootElement: appRootElement
|
|
28
26
|
};
|
|
29
27
|
};
|
|
30
28
|
export const createShadowRootElement = containerElement => {
|
|
@@ -40,4 +38,4 @@ export const createShadowRootElement = containerElement => {
|
|
|
40
38
|
shadowRoot.appendChild(shadowRootElement);
|
|
41
39
|
return [emotionRootElement, shadowRootElement];
|
|
42
40
|
};
|
|
43
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=shadow-dom.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadow-dom.js","names":["createReactRootElements","createShadowDomElements","containerElement","shadowRoot","attachShadow","mode","appRootElement","stylesRootElement","appendChild","emotionRootElement","shadowRootElement","createShadowRootElement","document","createElement","setAttribute","window","cspNonce"],"sources":["../../src/web-component/shadow-dom.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { createReactRootElements } from \"./renderReactInWebComponent\";\n\n/**\n * @deprecated Use `renderReactInWebComponent` instead. This function was necessary when using bare Shadow DOM, but with UI Shell rendering in a Web Component, you won't be able to render your Shadow DOM in its Shadow DOM without using a Web Component.\n */\nexport const createShadowDomElements = (containerElement: HTMLElement) => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // Container for Emotion `<style>` elements.\n const { appRootElement, stylesRootElement } = createReactRootElements();\n\n shadowRoot.appendChild(appRootElement);\n shadowRoot.appendChild(stylesRootElement);\n\n return {\n emotionRootElement: stylesRootElement,\n shadowRootElement: appRootElement,\n };\n};\n\n/**\n * @deprecated Use `createShadowDomElements` instead which returns an object instead of an array. It's otherwise the same.\n * @deprecated Ideally, use `renderReactInWebComponent` instead. This function was necessary when using bare Shadow DOM, but with UI Shell rendering in a Web Component, you won't be able to render your Shadow DOM in its Shadow DOM without using a Web Component. */\nexport const createShadowRootElement = (\n containerElement: HTMLElement,\n): [HTMLStyleElement, HTMLDivElement] => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // the element that styles will be cached into\n const emotionRootElement = document.createElement(\"style\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // the element that emotion renders html into\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRootElement);\n shadowRoot.appendChild(shadowRootElement);\n\n return [emotionRootElement, shadowRootElement];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAYSA,uBAAuB;AAKhC,OAAO,MAAMC,uBAAuB,GAAIC,gBAA6B,IAAK;EACxE,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAM;IAAEC,cAAc;IAAEC;EAAkB,CAAC,GAAGP,uBAAuB,CAAC,CAAC;EAEvEG,UAAU,CAACK,WAAW,CAACF,cAAc,CAAC;EACtCH,UAAU,CAACK,WAAW,CAACD,iBAAiB,CAAC;EAEzC,OAAO;IACLE,kBAAkB,EAAEF,iBAAiB;IACrCG,iBAAiB,EAAEJ;EACrB,CAAC;AACH,CAAC;AAKD,OAAO,MAAMK,uBAAuB,GAClCT,gBAA6B,IACU;EACvC,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAMI,kBAAkB,GAAGG,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAC1DJ,kBAAkB,CAACK,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EACnDL,kBAAkB,CAACK,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAGzD,MAAMN,iBAAiB,GAAGE,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACvDH,iBAAiB,CAACI,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;EAEnDX,UAAU,CAACK,WAAW,CAACC,kBAAkB,CAAC;EAC1CN,UAAU,CAACK,WAAW,CAACE,iBAAiB,CAAC;EAEzC,OAAO,CAACD,kBAAkB,EAAEC,iBAAiB,CAAC;AAChD,CAAC"}
|
package/jest.config.cjs
CHANGED
|
@@ -10,7 +10,26 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/** @type { import("jest").Config } */
|
|
14
|
+
const jestConfig = {
|
|
15
|
+
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}"],
|
|
16
|
+
coveragePathIgnorePatterns: [
|
|
17
|
+
"/src/icons.generated/",
|
|
18
|
+
"/src/properties/",
|
|
19
|
+
"/node_modules/",
|
|
20
|
+
],
|
|
21
|
+
coverageReporters: ["json", "html", "text", "text-summary"],
|
|
22
|
+
coverageThreshold: {
|
|
23
|
+
global: {
|
|
24
|
+
branches: 13.63,
|
|
25
|
+
functions: 17.41,
|
|
26
|
+
lines: 29.98,
|
|
27
|
+
statements: 29.91,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
extensionsToTreatAsEsm: [".ts"],
|
|
14
31
|
setupFilesAfterEnv: ["./jest.setup.js"],
|
|
15
|
-
testEnvironment: "
|
|
32
|
+
testEnvironment: "@happy-dom/jest-environment",
|
|
16
33
|
};
|
|
34
|
+
|
|
35
|
+
module.exports = jestConfig;
|
package/jest.setup.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okta/odyssey-react-mui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"description": "React MUI components for Odyssey, Okta's design system",
|
|
5
5
|
"author": "Okta, Inc.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,13 +58,14 @@
|
|
|
58
58
|
"@mui/system": "^5.15.9",
|
|
59
59
|
"@mui/utils": "^5.15.9",
|
|
60
60
|
"@mui/x-date-pickers": "^7.2.0",
|
|
61
|
-
"@okta/odyssey-design-tokens": "^1.
|
|
61
|
+
"@okta/odyssey-design-tokens": "^1.26.0",
|
|
62
62
|
"@types/luxon": "^3.4.2",
|
|
63
63
|
"date-fns": "^2.30.0",
|
|
64
64
|
"dom-accessibility-api": "^0.7.0",
|
|
65
65
|
"i18next": "^23.15.1",
|
|
66
66
|
"luxon": "^3.4.4",
|
|
67
67
|
"material-react-table": "^2.11.3",
|
|
68
|
+
"react-error-boundary": "^4.1.1",
|
|
68
69
|
"react-i18next": "^14.0.5",
|
|
69
70
|
"react-window": "^1.8.10",
|
|
70
71
|
"word-wrap": "^1.2.5"
|
|
@@ -73,5 +74,5 @@
|
|
|
73
74
|
"react": "^18.2.0",
|
|
74
75
|
"react-dom": "^18.2.0"
|
|
75
76
|
},
|
|
76
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "72de92f62683a351a51e8682485a64f74c493ca8"
|
|
77
78
|
}
|
package/src/Autocomplete.tsx
CHANGED
|
@@ -10,39 +10,18 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { memo } from "react";
|
|
14
|
+
import { useTranslation } from "react-i18next";
|
|
13
15
|
import {
|
|
14
16
|
Autocomplete as MuiAutocomplete,
|
|
15
17
|
AutocompleteProps as MuiAutocompleteProps,
|
|
16
|
-
|
|
17
|
-
UseAutocompleteProps,
|
|
18
|
-
AutocompleteValue,
|
|
19
|
-
AutocompleteRenderInputParams,
|
|
18
|
+
UseAutocompleteProps as MuiUseAutocompleteProps,
|
|
20
19
|
} from "@mui/material";
|
|
21
|
-
import {
|
|
22
|
-
createContext,
|
|
23
|
-
forwardRef,
|
|
24
|
-
HTMLAttributes,
|
|
25
|
-
memo,
|
|
26
|
-
ReactElement,
|
|
27
|
-
useCallback,
|
|
28
|
-
useContext,
|
|
29
|
-
useEffect,
|
|
30
|
-
useMemo,
|
|
31
|
-
useRef,
|
|
32
|
-
useState,
|
|
33
|
-
} from "react";
|
|
34
|
-
import styled from "@emotion/styled";
|
|
35
|
-
import { VariableSizeList, ListChildComponentProps } from "react-window";
|
|
36
|
-
import { useTranslation } from "react-i18next";
|
|
37
20
|
|
|
38
|
-
import { Field } from "./Field";
|
|
39
21
|
import { FieldComponentProps } from "./FieldComponentProps";
|
|
40
22
|
import type { HtmlProps } from "./HtmlProps";
|
|
41
|
-
import {
|
|
42
|
-
|
|
43
|
-
useInputValues,
|
|
44
|
-
getControlState,
|
|
45
|
-
} from "./inputUtils";
|
|
23
|
+
import { PickerVirtualizationListBox } from "./labs/OdysseyPickers/PickerVirtualizationListBox";
|
|
24
|
+
import { useAutocomplete } from "./useAutocomplete";
|
|
46
25
|
import { TestSelector } from "./test-selectors";
|
|
47
26
|
|
|
48
27
|
export const AutocompleteTestSelector = {
|
|
@@ -75,8 +54,7 @@ export const AutocompleteTestSelector = {
|
|
|
75
54
|
role: "combobox",
|
|
76
55
|
},
|
|
77
56
|
} as const satisfies TestSelector;
|
|
78
|
-
|
|
79
|
-
type SetItemSize = (size: number) => void;
|
|
57
|
+
// type SetItemSize = (size: number) => void;
|
|
80
58
|
|
|
81
59
|
export type AutocompleteProps<
|
|
82
60
|
OptionType,
|
|
@@ -86,7 +64,7 @@ export type AutocompleteProps<
|
|
|
86
64
|
/**
|
|
87
65
|
* The default value. Use when the component is not controlled.
|
|
88
66
|
*/
|
|
89
|
-
defaultValue?:
|
|
67
|
+
defaultValue?: MuiUseAutocompleteProps<
|
|
90
68
|
OptionType,
|
|
91
69
|
HasMultipleChoices,
|
|
92
70
|
undefined,
|
|
@@ -97,12 +75,21 @@ export type AutocompleteProps<
|
|
|
97
75
|
*
|
|
98
76
|
* `function(option: Value) => string`
|
|
99
77
|
*/
|
|
100
|
-
getOptionLabel?:
|
|
78
|
+
getOptionLabel?: MuiUseAutocompleteProps<
|
|
101
79
|
OptionType,
|
|
102
80
|
HasMultipleChoices,
|
|
103
81
|
undefined,
|
|
104
82
|
IsCustomValueAllowed
|
|
105
83
|
>["getOptionLabel"];
|
|
84
|
+
|
|
85
|
+
/** Used to determine if the option represents the given value. Uses strict equality by default if none provided.
|
|
86
|
+
* Both arguments need to be handled, an option can only match with one value.
|
|
87
|
+
* option: the option to test
|
|
88
|
+
* value: the value to test against
|
|
89
|
+
*
|
|
90
|
+
* You will need to implement this function if your `option` items are objects.
|
|
91
|
+
*/
|
|
92
|
+
getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;
|
|
106
93
|
/**
|
|
107
94
|
* Enables multiple choice selection
|
|
108
95
|
*/
|
|
@@ -115,7 +102,7 @@ export type AutocompleteProps<
|
|
|
115
102
|
/**
|
|
116
103
|
* The value for the input
|
|
117
104
|
*/
|
|
118
|
-
inputValue?:
|
|
105
|
+
inputValue?: MuiUseAutocompleteProps<
|
|
119
106
|
OptionType,
|
|
120
107
|
HasMultipleChoices,
|
|
121
108
|
undefined,
|
|
@@ -157,6 +144,12 @@ export type AutocompleteProps<
|
|
|
157
144
|
undefined,
|
|
158
145
|
IsCustomValueAllowed
|
|
159
146
|
>["readOnly"];
|
|
147
|
+
/**
|
|
148
|
+
* If this component is required to display a virtualized list of options,
|
|
149
|
+
* then this value needs to be set to true.
|
|
150
|
+
* It is recommended if you're options are on the order of 10's of hundreds or more.
|
|
151
|
+
*/
|
|
152
|
+
isVirtualized?: boolean;
|
|
160
153
|
/**
|
|
161
154
|
* The label text for the autocomplete input
|
|
162
155
|
*/
|
|
@@ -179,7 +172,7 @@ export type AutocompleteProps<
|
|
|
179
172
|
/**
|
|
180
173
|
* Callback fired when a selection is made.
|
|
181
174
|
*/
|
|
182
|
-
onChange?:
|
|
175
|
+
onChange?: MuiUseAutocompleteProps<
|
|
183
176
|
OptionType,
|
|
184
177
|
HasMultipleChoices,
|
|
185
178
|
undefined,
|
|
@@ -210,29 +203,12 @@ export type AutocompleteProps<
|
|
|
210
203
|
/**
|
|
211
204
|
* The value of the Autocomplete input
|
|
212
205
|
*/
|
|
213
|
-
value?:
|
|
206
|
+
value?: MuiUseAutocompleteProps<
|
|
214
207
|
OptionType,
|
|
215
208
|
HasMultipleChoices,
|
|
216
209
|
undefined,
|
|
217
210
|
IsCustomValueAllowed
|
|
218
211
|
>["value"];
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Used to determine if the option represents the given value. Uses strict equality by default if none provided.
|
|
222
|
-
* Both arguments need to be handled, an option can only match with one value.
|
|
223
|
-
* option: the option to test
|
|
224
|
-
* value: the value to test against
|
|
225
|
-
*
|
|
226
|
-
* You will need to implement this function if your `option` items are objects.
|
|
227
|
-
*/
|
|
228
|
-
getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* If this component is required to display a virtualized list of options,
|
|
232
|
-
* then this value needs to be set to true.
|
|
233
|
-
* It is recommended if you're options are on the order of 10's of hundreds or more.
|
|
234
|
-
*/
|
|
235
|
-
isVirtualized?: boolean;
|
|
236
212
|
} & Pick<
|
|
237
213
|
FieldComponentProps,
|
|
238
214
|
| "errorMessage"
|
|
@@ -246,11 +222,6 @@ export type AutocompleteProps<
|
|
|
246
222
|
> &
|
|
247
223
|
Pick<HtmlProps, "ariaDescribedBy" | "testId" | "translate">;
|
|
248
224
|
|
|
249
|
-
const ListboxContainer = styled.div`
|
|
250
|
-
width: 100%;
|
|
251
|
-
height: 100%;
|
|
252
|
-
`;
|
|
253
|
-
|
|
254
225
|
const Autocomplete = <
|
|
255
226
|
OptionType,
|
|
256
227
|
HasMultipleChoices extends boolean | undefined,
|
|
@@ -270,15 +241,15 @@ const Autocomplete = <
|
|
|
270
241
|
isLoading,
|
|
271
242
|
isOptional = false,
|
|
272
243
|
isReadOnly,
|
|
273
|
-
isVirtualized
|
|
244
|
+
isVirtualized = false,
|
|
274
245
|
hint,
|
|
275
246
|
HintLinkComponent,
|
|
276
247
|
label,
|
|
277
248
|
name: nameOverride,
|
|
278
249
|
noOptionsText,
|
|
279
250
|
onBlur,
|
|
280
|
-
onChange
|
|
281
|
-
onInputChange
|
|
251
|
+
onChange,
|
|
252
|
+
onInputChange,
|
|
282
253
|
onFocus,
|
|
283
254
|
options,
|
|
284
255
|
value,
|
|
@@ -287,293 +258,32 @@ const Autocomplete = <
|
|
|
287
258
|
translate,
|
|
288
259
|
}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {
|
|
289
260
|
const { t } = useTranslation();
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
controlledValue: value,
|
|
293
|
-
uncontrolledValue: defaultValue,
|
|
294
|
-
}),
|
|
295
|
-
);
|
|
296
|
-
|
|
297
|
-
const isVirtualized = useRef(Boolean(isVirtualizedProp));
|
|
298
|
-
|
|
299
|
-
const defaultValueProp = useMemo<
|
|
300
|
-
| AutocompleteValue<
|
|
301
|
-
OptionType,
|
|
302
|
-
HasMultipleChoices,
|
|
303
|
-
undefined,
|
|
304
|
-
IsCustomValueAllowed
|
|
305
|
-
>
|
|
306
|
-
| undefined
|
|
307
|
-
>(() => {
|
|
308
|
-
if (hasMultipleChoices) {
|
|
309
|
-
if (value === undefined) {
|
|
310
|
-
return defaultValue;
|
|
311
|
-
}
|
|
312
|
-
return [] as AutocompleteValue<
|
|
313
|
-
OptionType,
|
|
314
|
-
HasMultipleChoices,
|
|
315
|
-
undefined,
|
|
316
|
-
IsCustomValueAllowed
|
|
317
|
-
>;
|
|
318
|
-
}
|
|
319
|
-
return value === undefined ? defaultValue : undefined;
|
|
320
|
-
}, [defaultValue, hasMultipleChoices, value]);
|
|
321
|
-
|
|
322
|
-
const valueProps = useInputValues({
|
|
323
|
-
defaultValue: defaultValueProp,
|
|
324
|
-
value: value,
|
|
325
|
-
controlState: controlledStateRef.current,
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
const inputValueProp = useMemo(() => {
|
|
329
|
-
if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {
|
|
330
|
-
return { inputValue };
|
|
331
|
-
}
|
|
332
|
-
return undefined;
|
|
333
|
-
}, [inputValue]);
|
|
334
|
-
|
|
335
|
-
const renderInput = useCallback(
|
|
336
|
-
({
|
|
337
|
-
InputLabelProps,
|
|
338
|
-
InputProps,
|
|
339
|
-
...params
|
|
340
|
-
}: AutocompleteRenderInputParams) => (
|
|
341
|
-
<Field
|
|
342
|
-
ariaDescribedBy={ariaDescribedBy}
|
|
343
|
-
errorMessage={errorMessage}
|
|
344
|
-
errorMessageList={errorMessageList}
|
|
345
|
-
fieldType="single"
|
|
346
|
-
hasVisibleLabel
|
|
347
|
-
//@ts-expect-error htmlFor does not exist ont he InputLabelProps for autocomplete
|
|
348
|
-
id={InputLabelProps.htmlFor}
|
|
349
|
-
isFullWidth={isFullWidth}
|
|
350
|
-
hint={hint}
|
|
351
|
-
HintLinkComponent={HintLinkComponent}
|
|
352
|
-
label={label}
|
|
353
|
-
isOptional={isOptional}
|
|
354
|
-
renderFieldComponent={({
|
|
355
|
-
ariaDescribedBy,
|
|
356
|
-
id,
|
|
357
|
-
errorMessageElementId,
|
|
358
|
-
labelElementId,
|
|
359
|
-
}) => (
|
|
360
|
-
<InputBase
|
|
361
|
-
{...params}
|
|
362
|
-
{...InputProps}
|
|
363
|
-
inputProps={{
|
|
364
|
-
...params.inputProps,
|
|
365
|
-
"aria-errormessage": errorMessageElementId,
|
|
366
|
-
"aria-labelledby": labelElementId,
|
|
367
|
-
"data-se": testId,
|
|
368
|
-
}}
|
|
369
|
-
aria-describedby={ariaDescribedBy}
|
|
370
|
-
id={id}
|
|
371
|
-
name={nameOverride ?? id}
|
|
372
|
-
required={!isOptional}
|
|
373
|
-
/>
|
|
374
|
-
)}
|
|
375
|
-
/>
|
|
376
|
-
),
|
|
377
|
-
[
|
|
261
|
+
const { inputValueProp, isVirtualizedRef, renderInput, valueProps } =
|
|
262
|
+
useAutocomplete<OptionType, HasMultipleChoices, IsCustomValueAllowed>({
|
|
378
263
|
ariaDescribedBy,
|
|
264
|
+
defaultValue,
|
|
379
265
|
errorMessage,
|
|
380
266
|
errorMessageList,
|
|
267
|
+
hasMultipleChoices,
|
|
381
268
|
hint,
|
|
382
269
|
HintLinkComponent,
|
|
270
|
+
inputValue,
|
|
383
271
|
isFullWidth,
|
|
384
272
|
isOptional,
|
|
273
|
+
isVirtualized,
|
|
385
274
|
label,
|
|
386
|
-
nameOverride,
|
|
275
|
+
name: nameOverride,
|
|
387
276
|
testId,
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
const Row = ({
|
|
392
|
-
data,
|
|
393
|
-
index,
|
|
394
|
-
setItemSize,
|
|
395
|
-
style,
|
|
396
|
-
}: ListChildComponentProps & { setItemSize: SetItemSize }) => {
|
|
397
|
-
const rowRef = useRef<HTMLDivElement>(null);
|
|
398
|
-
|
|
399
|
-
useEffect(() => {
|
|
400
|
-
if (rowRef.current) {
|
|
401
|
-
/**
|
|
402
|
-
* Checking for child height to workaround a bug where the clientHeight of the row isn't updated correctly
|
|
403
|
-
* @see here if you need to know more: https://github.com/bvaughn/react-window/issues/582#issuecomment-1883074908
|
|
404
|
-
*/
|
|
405
|
-
const firstChild = rowRef.current.firstElementChild;
|
|
406
|
-
const height = firstChild
|
|
407
|
-
? firstChild.clientHeight
|
|
408
|
-
: rowRef.current.clientHeight;
|
|
409
|
-
|
|
410
|
-
setItemSize(height);
|
|
411
|
-
}
|
|
412
|
-
}, [index, rowRef, setItemSize]);
|
|
413
|
-
|
|
414
|
-
const baseOption = data[index];
|
|
415
|
-
const { key, props } = baseOption;
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* react-window calculates the absolute positions of the list items, via an inline style, so
|
|
419
|
-
* we need to add it to each list item that is being rendered in the viewable list window.
|
|
420
|
-
* @see here if you need to know more: https://github.com/bvaughn/react-window?tab=readme-ov-file#why-is-my-list-blank-when-i-scroll
|
|
421
|
-
*/
|
|
422
|
-
const styles = useMemo(
|
|
423
|
-
() => ({
|
|
424
|
-
...style,
|
|
425
|
-
height: "auto",
|
|
426
|
-
}),
|
|
427
|
-
[style],
|
|
428
|
-
);
|
|
429
|
-
|
|
430
|
-
return (
|
|
431
|
-
<div ref={rowRef}>
|
|
432
|
-
<li {...props} key={key} style={styles} />
|
|
433
|
-
</div>
|
|
434
|
-
);
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
const OuterListboxContext = createContext({});
|
|
438
|
-
|
|
439
|
-
const OuterListboxElementType = forwardRef<HTMLDivElement>((props, ref) => {
|
|
440
|
-
const outerProps = useContext(OuterListboxContext);
|
|
441
|
-
return <div ref={ref} {...props} {...outerProps} />;
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
const useResetCache = (length: number) => {
|
|
445
|
-
const resetCacheRef = useRef<VariableSizeList>(null);
|
|
446
|
-
useEffect(() => {
|
|
447
|
-
if (resetCacheRef.current) {
|
|
448
|
-
resetCacheRef.current.resetAfterIndex(0, true);
|
|
449
|
-
}
|
|
450
|
-
}, [length]);
|
|
451
|
-
return resetCacheRef;
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
const ListboxComponent = forwardRef<
|
|
455
|
-
HTMLDivElement,
|
|
456
|
-
HTMLAttributes<HTMLElement>
|
|
457
|
-
>(function (props, ref) {
|
|
458
|
-
const [listHeight, setListHeight] = useState(0);
|
|
459
|
-
|
|
460
|
-
const { children, ...other } = props;
|
|
461
|
-
const itemData: ReactElement[] = (children as ReactElement[]).flatMap(
|
|
462
|
-
(item: ReactElement & { children?: ReactElement[] }) =>
|
|
463
|
-
[item].concat(item.children || []),
|
|
464
|
-
);
|
|
465
|
-
|
|
466
|
-
const sizeMap = useRef<number[]>([]);
|
|
467
|
-
|
|
468
|
-
const getListBoxHeight = useCallback(() => {
|
|
469
|
-
// 8px of padding top/bottom applied by MUI
|
|
470
|
-
const COMBINED_LISTBOX_PADDING = 16;
|
|
471
|
-
|
|
472
|
-
if (itemData.length > OVERSCAN_ROW_COUNT) {
|
|
473
|
-
// has a max-height of 40vh set in CSS. This is only set because height needs to be a number
|
|
474
|
-
return 99999;
|
|
475
|
-
} else {
|
|
476
|
-
const itemsHeightCalculated = itemData
|
|
477
|
-
.map((_, index) => sizeMap.current[index] || 0)
|
|
478
|
-
.reduce(
|
|
479
|
-
(prevItemHeight, nextItemHeight) => prevItemHeight + nextItemHeight,
|
|
480
|
-
0,
|
|
481
|
-
);
|
|
482
|
-
return COMBINED_LISTBOX_PADDING + itemsHeightCalculated;
|
|
483
|
-
}
|
|
484
|
-
}, [itemData, sizeMap]);
|
|
485
|
-
|
|
486
|
-
useEffect(() => {
|
|
487
|
-
if (sizeMap.current.length && itemData.length) {
|
|
488
|
-
setListHeight(getListBoxHeight());
|
|
489
|
-
}
|
|
490
|
-
}, [getListBoxHeight, itemData, sizeMap]);
|
|
491
|
-
|
|
492
|
-
// The number of items (rows or columns) to render outside of the visible area for performance and scrolling reasons
|
|
493
|
-
const OVERSCAN_ROW_COUNT = 8;
|
|
494
|
-
|
|
495
|
-
const gridRef = useResetCache(itemData.length);
|
|
496
|
-
|
|
497
|
-
const setItemSize = useCallback<SetItemSize>(
|
|
498
|
-
(size) => {
|
|
499
|
-
gridRef?.current?.resetAfterIndex(0, true);
|
|
500
|
-
sizeMap.current = sizeMap.current.concat(size);
|
|
501
|
-
},
|
|
502
|
-
[gridRef, sizeMap],
|
|
503
|
-
);
|
|
504
|
-
const getItemSize = useCallback(
|
|
505
|
-
// using 45px as a sane default here to avoid a lot of content shift on repaint
|
|
506
|
-
(index: number) => sizeMap.current[index] || 45,
|
|
507
|
-
[sizeMap],
|
|
508
|
-
);
|
|
509
|
-
|
|
510
|
-
return (
|
|
511
|
-
<ListboxContainer ref={ref}>
|
|
512
|
-
<OuterListboxContext.Provider value={other}>
|
|
513
|
-
<VariableSizeList
|
|
514
|
-
innerElementType="ul"
|
|
515
|
-
itemData={itemData}
|
|
516
|
-
itemCount={itemData.length}
|
|
517
|
-
itemSize={getItemSize}
|
|
518
|
-
height={listHeight}
|
|
519
|
-
width="100%"
|
|
520
|
-
ref={gridRef}
|
|
521
|
-
outerElementType={OuterListboxElementType}
|
|
522
|
-
overscanCount={OVERSCAN_ROW_COUNT}
|
|
523
|
-
>
|
|
524
|
-
{({ data, index, style }) => (
|
|
525
|
-
<Row
|
|
526
|
-
data={data}
|
|
527
|
-
index={index}
|
|
528
|
-
style={style}
|
|
529
|
-
setItemSize={setItemSize}
|
|
530
|
-
/>
|
|
531
|
-
)}
|
|
532
|
-
</VariableSizeList>
|
|
533
|
-
</OuterListboxContext.Provider>
|
|
534
|
-
</ListboxContainer>
|
|
535
|
-
);
|
|
536
|
-
});
|
|
537
|
-
|
|
538
|
-
const onChange = useCallback<
|
|
539
|
-
NonNullable<
|
|
540
|
-
UseAutocompleteProps<
|
|
541
|
-
OptionType,
|
|
542
|
-
HasMultipleChoices,
|
|
543
|
-
undefined,
|
|
544
|
-
IsCustomValueAllowed
|
|
545
|
-
>["onChange"]
|
|
546
|
-
>
|
|
547
|
-
>(
|
|
548
|
-
(event, value, reason, details) => {
|
|
549
|
-
onChangeProp?.(event, value, reason, details);
|
|
550
|
-
},
|
|
551
|
-
[onChangeProp],
|
|
552
|
-
);
|
|
553
|
-
|
|
554
|
-
const onInputChange = useCallback<
|
|
555
|
-
NonNullable<
|
|
556
|
-
UseAutocompleteProps<
|
|
557
|
-
OptionType,
|
|
558
|
-
HasMultipleChoices,
|
|
559
|
-
undefined,
|
|
560
|
-
IsCustomValueAllowed
|
|
561
|
-
>["onInputChange"]
|
|
562
|
-
>
|
|
563
|
-
>(
|
|
564
|
-
(event, value, reason) => {
|
|
565
|
-
onInputChangeProp?.(event, value, reason);
|
|
566
|
-
},
|
|
567
|
-
[onInputChangeProp],
|
|
568
|
-
);
|
|
277
|
+
value,
|
|
278
|
+
});
|
|
569
279
|
|
|
570
280
|
return (
|
|
571
281
|
<MuiAutocomplete
|
|
572
282
|
{...valueProps}
|
|
573
283
|
{...inputValueProp}
|
|
574
284
|
// conditionally provide the ListboxComponent if this needs to be virtualized
|
|
575
|
-
{...(
|
|
576
|
-
ListboxComponent,
|
|
285
|
+
{...(isVirtualizedRef.current && {
|
|
286
|
+
ListboxComponent: PickerVirtualizationListBox,
|
|
577
287
|
})}
|
|
578
288
|
// AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div
|
|
579
289
|
aria-disabled={isDisabled}
|
package/src/Box.tsx
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { Box as MuiBox, BoxProps as MuiBoxProps } from "@mui/material";
|
|
14
|
-
import { ReactNode, forwardRef, memo } from "react";
|
|
14
|
+
import { AriaRole, ReactNode, forwardRef, memo } from "react";
|
|
15
15
|
|
|
16
16
|
import type { HtmlProps } from "./HtmlProps";
|
|
17
17
|
|
|
@@ -19,17 +19,19 @@ export type BoxProps = {
|
|
|
19
19
|
children?: ReactNode;
|
|
20
20
|
component?: MuiBoxProps["component"];
|
|
21
21
|
id?: MuiBoxProps["id"];
|
|
22
|
+
role?: AriaRole;
|
|
22
23
|
sx?: MuiBoxProps["sx"];
|
|
23
24
|
} & Pick<HtmlProps, "testId" | "translate">;
|
|
24
25
|
|
|
25
26
|
const Box = forwardRef<HTMLElement, BoxProps>(
|
|
26
|
-
({ children, component, id, sx, testId, translate }, ref) => (
|
|
27
|
+
({ children, component, id, role, sx, testId, translate }, ref) => (
|
|
27
28
|
<MuiBox
|
|
28
29
|
ref={ref}
|
|
29
30
|
children={children}
|
|
30
31
|
component={component}
|
|
31
32
|
data-se={testId}
|
|
32
33
|
id={id}
|
|
34
|
+
role={role}
|
|
33
35
|
sx={sx}
|
|
34
36
|
translate={translate}
|
|
35
37
|
/>
|
package/src/Card.tsx
CHANGED
|
@@ -65,6 +65,7 @@ const ImageContainer = styled("div", {
|
|
|
65
65
|
display: "flex",
|
|
66
66
|
alignItems: "flex-start",
|
|
67
67
|
maxHeight: CARD_IMAGE_HEIGHT,
|
|
68
|
+
height: CARD_IMAGE_HEIGHT,
|
|
68
69
|
marginBlockEnd: odysseyDesignTokens.Spacing5,
|
|
69
70
|
paddingRight: hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0,
|
|
70
71
|
}));
|
|
@@ -10,11 +10,14 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import * as
|
|
13
|
+
import * as odysseyDesignTokens from "@okta/odyssey-design-tokens";
|
|
14
14
|
import { createContext, useContext } from "react";
|
|
15
15
|
|
|
16
|
-
export type DesignTokens = typeof
|
|
17
|
-
export const
|
|
16
|
+
export type DesignTokens = typeof odysseyDesignTokens;
|
|
17
|
+
export const defaultOdysseyDesignTokensContextValue = odysseyDesignTokens;
|
|
18
|
+
export const OdysseyDesignTokensContext = createContext(
|
|
19
|
+
defaultOdysseyDesignTokensContextValue,
|
|
20
|
+
);
|
|
18
21
|
|
|
19
22
|
export const useOdysseyDesignTokens = () =>
|
|
20
23
|
useContext(OdysseyDesignTokensContext);
|