@okta/odyssey-react-mui 1.25.0 → 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 +11 -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 +9 -7
- package/dist/OdysseyProvider.js.map +1 -1
- package/dist/OdysseyThemeProvider.js +33 -13
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/Pagination/Pagination.js +46 -14
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/Surface.js +4 -1
- package/dist/Surface.js.map +1 -1
- package/dist/Tag.js +42 -27
- package/dist/Tag.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 +3 -3
- package/dist/src/OdysseyProvider.d.ts.map +1 -1
- package/dist/src/OdysseyThemeProvider.d.ts +10 -12
- 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/Pagination/Pagination.d.ts +21 -7
- package/dist/src/Pagination/Pagination.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/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 +2 -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 +36 -32
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/createOdysseyMuiTheme.js +3 -2
- 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 +1 -1
- 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 +13 -8
- package/src/OdysseyThemeProvider.test.tsx +209 -0
- package/src/OdysseyThemeProvider.tsx +42 -26
- package/src/Pagination/Pagination.test.tsx +305 -0
- package/src/Pagination/Pagination.tsx +86 -38
- package/src/Surface.tsx +2 -1
- package/src/Tag.tsx +64 -39
- package/src/createUniqueAlphabeticalId.test.ts +1 -1
- package/src/createUniqueId.test.ts +1 -1
- 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 +50 -33
- package/src/theme/createOdysseyMuiTheme.ts +4 -3
- 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
package/src/OdysseyProvider.tsx
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { memo, ReactNode } from "react";
|
|
14
14
|
import { ScopedCssBaseline } from "@mui/material";
|
|
15
|
+
|
|
15
16
|
import {
|
|
16
17
|
OdysseyCacheProvider,
|
|
17
18
|
OdysseyCacheProviderProps,
|
|
@@ -25,10 +26,10 @@ import {
|
|
|
25
26
|
OdysseyTranslationProviderProps,
|
|
26
27
|
} from "./OdysseyTranslationProvider";
|
|
27
28
|
import { DefaultSupportedLanguages } from "./OdysseyTranslationProvider.types";
|
|
28
|
-
|
|
29
29
|
const scopedCssBaselineStyles = {
|
|
30
30
|
height: "inherit",
|
|
31
31
|
};
|
|
32
|
+
|
|
32
33
|
export type OdysseyProviderProps<
|
|
33
34
|
SupportedLanguages extends string = DefaultSupportedLanguages,
|
|
34
35
|
> = OdysseyCacheProviderProps &
|
|
@@ -36,29 +37,32 @@ export type OdysseyProviderProps<
|
|
|
36
37
|
OdysseyTranslationProviderProps<SupportedLanguages> & {
|
|
37
38
|
children: ReactNode;
|
|
38
39
|
};
|
|
40
|
+
|
|
39
41
|
const OdysseyProvider = <SupportedLanguages extends string>({
|
|
40
42
|
children,
|
|
43
|
+
contrastMode,
|
|
41
44
|
designTokensOverride,
|
|
42
45
|
emotionRoot,
|
|
43
46
|
emotionRootElement,
|
|
44
|
-
shadowDomElement,
|
|
45
|
-
shadowRootElement,
|
|
46
47
|
languageCode,
|
|
47
48
|
nonce,
|
|
49
|
+
shadowDomElement,
|
|
50
|
+
shadowRootElement,
|
|
48
51
|
stylisPlugins,
|
|
49
52
|
themeOverride,
|
|
50
53
|
translationOverrides,
|
|
51
54
|
}: OdysseyProviderProps<SupportedLanguages>) => (
|
|
52
55
|
<OdysseyCacheProvider
|
|
53
|
-
|
|
54
|
-
emotionRootElement={emotionRootElement}
|
|
56
|
+
emotionRootElement={emotionRootElement || emotionRoot}
|
|
55
57
|
hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}
|
|
56
58
|
nonce={nonce}
|
|
57
59
|
stylisPlugins={stylisPlugins}
|
|
58
60
|
>
|
|
59
61
|
<OdysseyThemeProvider
|
|
62
|
+
contrastMode={contrastMode}
|
|
60
63
|
designTokensOverride={designTokensOverride}
|
|
61
|
-
|
|
64
|
+
shadowDomElement={shadowDomElement}
|
|
65
|
+
shadowRootElement={shadowRootElement}
|
|
62
66
|
themeOverride={themeOverride}
|
|
63
67
|
>
|
|
64
68
|
{/* This component creates a div; for flexibility of layout of children, make it inherit its parent's height */}
|
|
@@ -73,5 +77,6 @@ const OdysseyProvider = <SupportedLanguages extends string>({
|
|
|
73
77
|
</OdysseyThemeProvider>
|
|
74
78
|
</OdysseyCacheProvider>
|
|
75
79
|
);
|
|
76
|
-
const
|
|
77
|
-
|
|
80
|
+
const MemoizedOdysseyProvider = memo(OdysseyProvider) as typeof OdysseyProvider;
|
|
81
|
+
|
|
82
|
+
export { MemoizedOdysseyProvider as OdysseyProvider };
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { render, waitFor, act } from "@testing-library/react";
|
|
14
|
+
import { useTheme } from "@mui/material/styles";
|
|
15
|
+
import { OdysseyThemeProvider } from "./OdysseyThemeProvider";
|
|
16
|
+
import { ContrastModeContext } from "./useContrastMode";
|
|
17
|
+
import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext";
|
|
18
|
+
import * as Tokens from "@okta/odyssey-design-tokens";
|
|
19
|
+
import { useContext } from "react";
|
|
20
|
+
|
|
21
|
+
describe("OdysseyThemeProvider", () => {
|
|
22
|
+
afterEach(() => {
|
|
23
|
+
jest.clearAllMocks();
|
|
24
|
+
document.documentElement.style.setProperty("backgroundColor", null);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
describe("contrast mode handling", () => {
|
|
28
|
+
let getComputedStyleSpy: jest.SpyInstance;
|
|
29
|
+
|
|
30
|
+
beforeEach(() => {
|
|
31
|
+
getComputedStyleSpy = jest
|
|
32
|
+
.spyOn(window, "getComputedStyle")
|
|
33
|
+
.mockImplementation(
|
|
34
|
+
() =>
|
|
35
|
+
({ backgroundColor: Tokens.HueNeutral50 }) as CSSStyleDeclaration,
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
afterEach(() => {
|
|
40
|
+
getComputedStyleSpy.mockRestore();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("should update contrast mode based on background color changes", async () => {
|
|
44
|
+
const TestComponent = () => {
|
|
45
|
+
const { contrastMode } = useContext(ContrastModeContext);
|
|
46
|
+
return <div data-testid="container">{contrastMode}</div>;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const { getByTestId } = render(
|
|
50
|
+
<OdysseyThemeProvider>
|
|
51
|
+
<TestComponent />
|
|
52
|
+
</OdysseyThemeProvider>,
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const testContainer = getByTestId("container");
|
|
56
|
+
|
|
57
|
+
act(() => {
|
|
58
|
+
testContainer.style.backgroundColor = Tokens.HueNeutral50;
|
|
59
|
+
const event = new Event("transitionend");
|
|
60
|
+
Object.defineProperty(event, "propertyName", {
|
|
61
|
+
value: "background-color",
|
|
62
|
+
});
|
|
63
|
+
testContainer.dispatchEvent(event);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
await waitFor(() => {
|
|
67
|
+
expect(getByTestId("container").textContent).toBe("highContrast");
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
describe("theme customization", () => {
|
|
73
|
+
it("should merge theme overrides with base theme", () => {
|
|
74
|
+
const themeOverride = {
|
|
75
|
+
palette: {
|
|
76
|
+
primary: {
|
|
77
|
+
main: "#000000",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const TestComponent = () => {
|
|
83
|
+
const theme = useTheme();
|
|
84
|
+
return <div data-testid="theme-test">{theme.palette.primary.main}</div>;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const { getByTestId } = render(
|
|
88
|
+
<OdysseyThemeProvider themeOverride={themeOverride}>
|
|
89
|
+
<TestComponent />
|
|
90
|
+
</OdysseyThemeProvider>,
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
expect(getByTestId("theme-test").textContent).toBe("#000000");
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it("should merge design tokens override with base tokens", () => {
|
|
97
|
+
const designTokensOverride = {
|
|
98
|
+
HueNeutral50: "#654321",
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const TestComponent = () => {
|
|
102
|
+
const tokens = useOdysseyDesignTokens();
|
|
103
|
+
return <div data-testid="token-test">{tokens.HueNeutral50}</div>;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const { getByTestId } = render(
|
|
107
|
+
<OdysseyThemeProvider designTokensOverride={designTokensOverride}>
|
|
108
|
+
<TestComponent />
|
|
109
|
+
</OdysseyThemeProvider>,
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
expect(getByTestId("token-test").textContent).toBe("#654321");
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("should properly handle nested providers with different configurations", () => {
|
|
116
|
+
const outerThemeOverride = {
|
|
117
|
+
palette: {
|
|
118
|
+
primary: {
|
|
119
|
+
main: "#111111",
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const innerThemeOverride = {
|
|
125
|
+
palette: {
|
|
126
|
+
primary: {
|
|
127
|
+
main: "#222222",
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const TestComponent = () => {
|
|
133
|
+
const theme = useTheme();
|
|
134
|
+
return (
|
|
135
|
+
<div data-testid="nested-test">{theme.palette.primary.main}</div>
|
|
136
|
+
);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const { getByTestId } = render(
|
|
140
|
+
<OdysseyThemeProvider themeOverride={outerThemeOverride}>
|
|
141
|
+
<OdysseyThemeProvider themeOverride={innerThemeOverride}>
|
|
142
|
+
<TestComponent />
|
|
143
|
+
</OdysseyThemeProvider>
|
|
144
|
+
</OdysseyThemeProvider>,
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
expect(getByTestId("nested-test").textContent).toBe("#222222");
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe("shadow DOM configuration", () => {
|
|
152
|
+
let shadowRoot: HTMLDivElement;
|
|
153
|
+
let shadowDom: HTMLDivElement;
|
|
154
|
+
|
|
155
|
+
beforeEach(() => {
|
|
156
|
+
shadowRoot = document.createElement("div");
|
|
157
|
+
shadowDom = document.createElement("div");
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("should properly configure shadow root element for MUI components", () => {
|
|
161
|
+
const TestComponent = () => {
|
|
162
|
+
const theme = useTheme();
|
|
163
|
+
return (
|
|
164
|
+
<div data-testid="shadow-root-test">
|
|
165
|
+
{theme.components?.MuiPopover?.defaultProps?.container ===
|
|
166
|
+
shadowRoot
|
|
167
|
+
? "shadow-root-configured"
|
|
168
|
+
: "no-shadow-root"}
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const { getByTestId } = render(
|
|
174
|
+
<OdysseyThemeProvider shadowRootElement={shadowRoot}>
|
|
175
|
+
<TestComponent />
|
|
176
|
+
</OdysseyThemeProvider>,
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
expect(getByTestId("shadow-root-test").textContent).toBe(
|
|
180
|
+
"shadow-root-configured",
|
|
181
|
+
);
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
it("should handle both shadowRootElement and deprecated shadowDomElement", () => {
|
|
185
|
+
const TestComponent = () => {
|
|
186
|
+
const theme = useTheme();
|
|
187
|
+
return (
|
|
188
|
+
<div data-testid="shadow-test">
|
|
189
|
+
{theme.components?.MuiPopover?.defaultProps?.container ===
|
|
190
|
+
shadowRoot
|
|
191
|
+
? "using-shadow-root"
|
|
192
|
+
: "using-shadow-dom"}
|
|
193
|
+
</div>
|
|
194
|
+
);
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const { getByTestId } = render(
|
|
198
|
+
<OdysseyThemeProvider
|
|
199
|
+
shadowRootElement={shadowRoot}
|
|
200
|
+
shadowDomElement={shadowDom}
|
|
201
|
+
>
|
|
202
|
+
<TestComponent />
|
|
203
|
+
</OdysseyThemeProvider>,
|
|
204
|
+
);
|
|
205
|
+
|
|
206
|
+
expect(getByTestId("shadow-test").textContent).toBe("using-shadow-root");
|
|
207
|
+
});
|
|
208
|
+
});
|
|
209
|
+
});
|
|
@@ -10,77 +10,93 @@
|
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { ReactNode, useMemo } from "react";
|
|
13
14
|
import {
|
|
14
15
|
createTheme,
|
|
15
16
|
ThemeProvider as MuiThemeProvider,
|
|
16
17
|
} from "@mui/material/styles";
|
|
17
|
-
import { memo, ReactNode, useMemo } from "react";
|
|
18
|
-
|
|
19
18
|
import { ThemeOptions } from "@mui/material";
|
|
20
19
|
import { deepmerge } from "@mui/utils";
|
|
20
|
+
import styled from "@emotion/styled";
|
|
21
21
|
import { createOdysseyMuiTheme, DesignTokensOverride } from "./theme";
|
|
22
22
|
import * as Tokens from "@okta/odyssey-design-tokens";
|
|
23
|
+
|
|
24
|
+
import {
|
|
25
|
+
ContrastMode,
|
|
26
|
+
ContrastModeContext,
|
|
27
|
+
useContrastMode,
|
|
28
|
+
} from "./useContrastMode";
|
|
23
29
|
import { OdysseyDesignTokensContext } from "./OdysseyDesignTokensContext";
|
|
24
30
|
|
|
25
31
|
export type OdysseyThemeProviderProps = {
|
|
26
32
|
children: ReactNode;
|
|
33
|
+
contrastMode?: ContrastMode;
|
|
27
34
|
designTokensOverride?: DesignTokensOverride;
|
|
28
|
-
/** @deprecated Use
|
|
29
|
-
shadowDomElement?: HTMLDivElement | HTMLElement
|
|
35
|
+
/** @deprecated Use shadowRootElement instead */
|
|
36
|
+
shadowDomElement?: HTMLDivElement | HTMLElement;
|
|
30
37
|
shadowRootElement?: HTMLDivElement | HTMLElement;
|
|
31
38
|
themeOverride?: ThemeOptions;
|
|
32
39
|
};
|
|
33
40
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
interface ThemeOptions {
|
|
39
|
-
contrastMode?: string;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
41
|
+
const StyledContrastContainer = styled("div")(() => ({
|
|
42
|
+
height: "inherit",
|
|
43
|
+
}));
|
|
42
44
|
|
|
43
45
|
/**
|
|
44
46
|
* This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.
|
|
45
47
|
*
|
|
46
48
|
* Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.
|
|
47
49
|
*/
|
|
48
|
-
const OdysseyThemeProvider = ({
|
|
50
|
+
export const OdysseyThemeProvider = ({
|
|
49
51
|
children,
|
|
52
|
+
contrastMode: explicitContrastMode,
|
|
50
53
|
designTokensOverride,
|
|
51
54
|
shadowDomElement,
|
|
52
55
|
shadowRootElement,
|
|
53
56
|
themeOverride,
|
|
54
57
|
}: OdysseyThemeProviderProps) => {
|
|
58
|
+
const { contrastMode, contrastContainerRef } = useContrastMode({
|
|
59
|
+
contrastMode: explicitContrastMode,
|
|
60
|
+
});
|
|
61
|
+
|
|
55
62
|
const odysseyTokens = useMemo(
|
|
56
63
|
() => ({ ...Tokens, ...designTokensOverride }),
|
|
57
64
|
[designTokensOverride],
|
|
58
65
|
);
|
|
59
66
|
|
|
67
|
+
const effectiveShadowRootElement = shadowRootElement || shadowDomElement;
|
|
68
|
+
|
|
60
69
|
const odysseyTheme = useMemo(
|
|
61
70
|
() =>
|
|
62
71
|
createOdysseyMuiTheme({
|
|
72
|
+
contrastMode,
|
|
63
73
|
odysseyTokens,
|
|
64
|
-
shadowRootElement:
|
|
65
|
-
contrastMode: "highContrast",
|
|
74
|
+
shadowRootElement: effectiveShadowRootElement,
|
|
66
75
|
}),
|
|
67
|
-
[
|
|
76
|
+
[contrastMode, odysseyTokens, effectiveShadowRootElement],
|
|
68
77
|
);
|
|
69
78
|
|
|
70
79
|
const customOdysseyTheme = useMemo(
|
|
71
|
-
() =>
|
|
80
|
+
() => createTheme(deepmerge(odysseyTheme, themeOverride || {})),
|
|
72
81
|
[odysseyTheme, themeOverride],
|
|
73
82
|
);
|
|
74
83
|
|
|
84
|
+
const contrastModeProviderValue = useMemo(
|
|
85
|
+
() => ({
|
|
86
|
+
contrastMode,
|
|
87
|
+
}),
|
|
88
|
+
[contrastMode],
|
|
89
|
+
);
|
|
90
|
+
|
|
75
91
|
return (
|
|
76
|
-
<
|
|
77
|
-
<
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
|
|
92
|
+
<StyledContrastContainer ref={contrastContainerRef}>
|
|
93
|
+
<ContrastModeContext.Provider value={contrastModeProviderValue}>
|
|
94
|
+
<MuiThemeProvider theme={customOdysseyTheme}>
|
|
95
|
+
<OdysseyDesignTokensContext.Provider value={odysseyTokens}>
|
|
96
|
+
{children}
|
|
97
|
+
</OdysseyDesignTokensContext.Provider>
|
|
98
|
+
</MuiThemeProvider>
|
|
99
|
+
</ContrastModeContext.Provider>
|
|
100
|
+
</StyledContrastContainer>
|
|
81
101
|
);
|
|
82
102
|
};
|
|
83
|
-
|
|
84
|
-
const MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);
|
|
85
|
-
|
|
86
|
-
export { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
14
|
+
import { Pagination } from "./Pagination";
|
|
15
|
+
|
|
16
|
+
describe("Pagination", () => {
|
|
17
|
+
it("renders the expected controls in 'paged' variant", () => {
|
|
18
|
+
const onPaginationChange = jest.fn();
|
|
19
|
+
render(
|
|
20
|
+
<Pagination
|
|
21
|
+
currentPageLabel="Page"
|
|
22
|
+
nextLabel="Next page"
|
|
23
|
+
previousLabel="Previous page"
|
|
24
|
+
rowsPerPageLabel="Rows per page"
|
|
25
|
+
loadMoreLabel="Load more"
|
|
26
|
+
totalRows={100}
|
|
27
|
+
lastRow={10}
|
|
28
|
+
pageIndex={1}
|
|
29
|
+
pageSize={10}
|
|
30
|
+
onPaginationChange={onPaginationChange}
|
|
31
|
+
variant="paged"
|
|
32
|
+
/>,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
expect(screen.getByLabelText("Rows per page")).toBeInTheDocument();
|
|
36
|
+
expect(screen.getByLabelText("Page")).toBeInTheDocument();
|
|
37
|
+
expect(screen.getByLabelText("Previous page")).toBeInTheDocument();
|
|
38
|
+
expect(screen.getByLabelText("Next page")).toBeInTheDocument();
|
|
39
|
+
// Temporarily disabled while we figure out why i18n string interpolation
|
|
40
|
+
// isn't playing nicely with testing-library. Can confirm this works properly
|
|
41
|
+
// via VRT results
|
|
42
|
+
// expect(screen.getByText("1-10 of 100")).toBeInTheDocument();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("calls onPaginationChange with correct pageIndex when clicking next", async () => {
|
|
46
|
+
const onPaginationChange = jest.fn();
|
|
47
|
+
render(
|
|
48
|
+
<Pagination
|
|
49
|
+
currentPageLabel="Page"
|
|
50
|
+
nextLabel="Next page"
|
|
51
|
+
previousLabel="Previous page"
|
|
52
|
+
rowsPerPageLabel="Rows per page"
|
|
53
|
+
loadMoreLabel="Load more"
|
|
54
|
+
totalRows={100}
|
|
55
|
+
lastRow={10}
|
|
56
|
+
pageIndex={1}
|
|
57
|
+
pageSize={10}
|
|
58
|
+
onPaginationChange={onPaginationChange}
|
|
59
|
+
variant="paged"
|
|
60
|
+
/>,
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
fireEvent.click(screen.getByLabelText("Next page"));
|
|
64
|
+
|
|
65
|
+
await waitFor(() => {
|
|
66
|
+
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
67
|
+
pageIndex: 2,
|
|
68
|
+
pageSize: 10,
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("calls onPaginationChange with correct pageIndex when clicking previous", async () => {
|
|
74
|
+
const onPaginationChange = jest.fn();
|
|
75
|
+
render(
|
|
76
|
+
<Pagination
|
|
77
|
+
currentPageLabel="Page"
|
|
78
|
+
nextLabel="Next page"
|
|
79
|
+
previousLabel="Previous page"
|
|
80
|
+
rowsPerPageLabel="Rows per page"
|
|
81
|
+
loadMoreLabel="Load more"
|
|
82
|
+
totalRows={100}
|
|
83
|
+
lastRow={20}
|
|
84
|
+
pageIndex={2}
|
|
85
|
+
pageSize={10}
|
|
86
|
+
onPaginationChange={onPaginationChange}
|
|
87
|
+
variant="paged"
|
|
88
|
+
/>,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
fireEvent.click(screen.getByLabelText("Previous page"));
|
|
92
|
+
|
|
93
|
+
await waitFor(() => {
|
|
94
|
+
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
95
|
+
pageIndex: 1,
|
|
96
|
+
pageSize: 10,
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("disables previous button on first page", () => {
|
|
102
|
+
const onPaginationChange = jest.fn();
|
|
103
|
+
render(
|
|
104
|
+
<Pagination
|
|
105
|
+
currentPageLabel="Page"
|
|
106
|
+
nextLabel="Next page"
|
|
107
|
+
previousLabel="Previous page"
|
|
108
|
+
rowsPerPageLabel="Rows per page"
|
|
109
|
+
loadMoreLabel="Load more"
|
|
110
|
+
totalRows={100}
|
|
111
|
+
lastRow={10}
|
|
112
|
+
pageIndex={1}
|
|
113
|
+
pageSize={10}
|
|
114
|
+
onPaginationChange={onPaginationChange}
|
|
115
|
+
variant="paged"
|
|
116
|
+
/>,
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
expect(screen.getByLabelText("Previous page")).toBeDisabled();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("disables next button on last page", () => {
|
|
123
|
+
const onPaginationChange = jest.fn();
|
|
124
|
+
render(
|
|
125
|
+
<Pagination
|
|
126
|
+
currentPageLabel="Page"
|
|
127
|
+
nextLabel="Next page"
|
|
128
|
+
previousLabel="Previous page"
|
|
129
|
+
rowsPerPageLabel="Rows per page"
|
|
130
|
+
loadMoreLabel="Load more"
|
|
131
|
+
totalRows={100}
|
|
132
|
+
lastRow={100}
|
|
133
|
+
pageIndex={10}
|
|
134
|
+
pageSize={10}
|
|
135
|
+
onPaginationChange={onPaginationChange}
|
|
136
|
+
variant="paged"
|
|
137
|
+
/>,
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
expect(screen.getByLabelText("Next page")).toBeDisabled();
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("updates pageIndex when entering a new page number", async () => {
|
|
144
|
+
const onPaginationChange = jest.fn();
|
|
145
|
+
render(
|
|
146
|
+
<Pagination
|
|
147
|
+
currentPageLabel="Page"
|
|
148
|
+
nextLabel="Next page"
|
|
149
|
+
previousLabel="Previous page"
|
|
150
|
+
rowsPerPageLabel="Rows per page"
|
|
151
|
+
loadMoreLabel="Load more"
|
|
152
|
+
totalRows={100}
|
|
153
|
+
lastRow={10}
|
|
154
|
+
pageIndex={1}
|
|
155
|
+
pageSize={10}
|
|
156
|
+
onPaginationChange={onPaginationChange}
|
|
157
|
+
variant="paged"
|
|
158
|
+
/>,
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
const pageInput = screen.getByLabelText("Page");
|
|
162
|
+
fireEvent.change(pageInput, { target: { value: "5" } });
|
|
163
|
+
fireEvent.blur(pageInput);
|
|
164
|
+
|
|
165
|
+
await waitFor(() => {
|
|
166
|
+
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
167
|
+
pageIndex: 5,
|
|
168
|
+
pageSize: 10,
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
it("updates pageSize when entering a new rows per page value", async () => {
|
|
174
|
+
const onPaginationChange = jest.fn();
|
|
175
|
+
render(
|
|
176
|
+
<Pagination
|
|
177
|
+
currentPageLabel="Page"
|
|
178
|
+
nextLabel="Next page"
|
|
179
|
+
previousLabel="Previous page"
|
|
180
|
+
rowsPerPageLabel="Rows per page"
|
|
181
|
+
loadMoreLabel="Load more"
|
|
182
|
+
totalRows={100}
|
|
183
|
+
lastRow={10}
|
|
184
|
+
pageIndex={1}
|
|
185
|
+
pageSize={10}
|
|
186
|
+
onPaginationChange={onPaginationChange}
|
|
187
|
+
variant="paged"
|
|
188
|
+
/>,
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
const rowsPerPageInput = screen.getByLabelText("Rows per page");
|
|
192
|
+
fireEvent.change(rowsPerPageInput, { target: { value: "20" } });
|
|
193
|
+
fireEvent.blur(rowsPerPageInput);
|
|
194
|
+
|
|
195
|
+
await waitFor(() => {
|
|
196
|
+
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
197
|
+
pageIndex: 1,
|
|
198
|
+
pageSize: 20,
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
it("renders 'Load more' button in 'loadMore' variant", () => {
|
|
204
|
+
const onPaginationChange = jest.fn();
|
|
205
|
+
render(
|
|
206
|
+
<Pagination
|
|
207
|
+
loadMoreLabel="Load more"
|
|
208
|
+
onPaginationChange={onPaginationChange}
|
|
209
|
+
pageIndex={1}
|
|
210
|
+
pageSize={20}
|
|
211
|
+
totalRows={100}
|
|
212
|
+
variant="loadMore"
|
|
213
|
+
/>,
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
expect(screen.getByText("Load more")).toBeInTheDocument();
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
it("calls onPaginationChange with increased pageSize when clicking 'Load more'", async () => {
|
|
220
|
+
const onPaginationChange = jest.fn();
|
|
221
|
+
render(
|
|
222
|
+
<Pagination
|
|
223
|
+
loadMoreLabel="Load more"
|
|
224
|
+
onPaginationChange={onPaginationChange}
|
|
225
|
+
pageIndex={1}
|
|
226
|
+
pageSize={20}
|
|
227
|
+
totalRows={100}
|
|
228
|
+
variant="loadMore"
|
|
229
|
+
/>,
|
|
230
|
+
);
|
|
231
|
+
|
|
232
|
+
fireEvent.click(screen.getByText("Load more"));
|
|
233
|
+
|
|
234
|
+
await waitFor(() => {
|
|
235
|
+
expect(onPaginationChange).toHaveBeenCalledWith({
|
|
236
|
+
pageIndex: 1,
|
|
237
|
+
pageSize: 40, // Assuming initial pageSize is 20, it should increment by 20
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
it("disables 'Load more' button when isMoreDisabled is true", () => {
|
|
243
|
+
const onPaginationChange = jest.fn();
|
|
244
|
+
render(
|
|
245
|
+
<Pagination
|
|
246
|
+
loadMoreLabel="Load more"
|
|
247
|
+
onPaginationChange={onPaginationChange}
|
|
248
|
+
pageIndex={1}
|
|
249
|
+
pageSize={100}
|
|
250
|
+
totalRows={100}
|
|
251
|
+
variant="loadMore"
|
|
252
|
+
isMoreDisabled={true}
|
|
253
|
+
/>,
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
expect(screen.getByText("Load more")).toBeDisabled();
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
it("disables 'Next page' button when isMoreDisabled is true", () => {
|
|
260
|
+
const onPaginationChange = jest.fn();
|
|
261
|
+
render(
|
|
262
|
+
<Pagination
|
|
263
|
+
currentPageLabel="Page"
|
|
264
|
+
nextLabel="Next page"
|
|
265
|
+
previousLabel="Previous page"
|
|
266
|
+
rowsPerPageLabel="Rows per page"
|
|
267
|
+
loadMoreLabel="Load more"
|
|
268
|
+
totalRows={100}
|
|
269
|
+
lastRow={10}
|
|
270
|
+
pageIndex={1}
|
|
271
|
+
pageSize={10}
|
|
272
|
+
onPaginationChange={onPaginationChange}
|
|
273
|
+
variant="paged"
|
|
274
|
+
isMoreDisabled={true}
|
|
275
|
+
/>,
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
expect(screen.getByLabelText("Next page")).toBeDisabled();
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
it("disables all controls when isDisabled is true", () => {
|
|
282
|
+
const onPaginationChange = jest.fn();
|
|
283
|
+
render(
|
|
284
|
+
<Pagination
|
|
285
|
+
currentPageLabel="Page"
|
|
286
|
+
nextLabel="Next page"
|
|
287
|
+
previousLabel="Previous page"
|
|
288
|
+
rowsPerPageLabel="Rows per page"
|
|
289
|
+
loadMoreLabel="Load more"
|
|
290
|
+
totalRows={100}
|
|
291
|
+
lastRow={10}
|
|
292
|
+
pageIndex={1}
|
|
293
|
+
pageSize={10}
|
|
294
|
+
onPaginationChange={onPaginationChange}
|
|
295
|
+
variant="paged"
|
|
296
|
+
isDisabled={true}
|
|
297
|
+
/>,
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
expect(screen.getByLabelText("Rows per page")).toBeDisabled();
|
|
301
|
+
expect(screen.getByLabelText("Page")).toBeDisabled();
|
|
302
|
+
expect(screen.getByLabelText("Previous page")).toBeDisabled();
|
|
303
|
+
expect(screen.getByLabelText("Next page")).toBeDisabled();
|
|
304
|
+
});
|
|
305
|
+
});
|