@okta/odyssey-react-mui 1.25.0 → 1.27.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 +17 -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 +14 -3
- 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/DataView.js +6 -0
- package/dist/labs/DataView/DataView.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} +36 -8
- 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 +316 -172
- 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 +150 -68
- package/dist/labs/SideNav/SideNavItemContent.js.map +1 -1
- package/dist/labs/SideNav/SideNavItemContentContext.js +20 -0
- package/dist/labs/SideNav/SideNavItemContentContext.js.map +1 -0
- package/dist/labs/SideNav/SideNavItemLinkContent.js +15 -14
- 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/SortableList/SortableItem.js +162 -0
- package/dist/labs/SideNav/SortableList/SortableItem.js.map +1 -0
- package/dist/labs/SideNav/SortableList/SortableList.js +118 -0
- package/dist/labs/SideNav/SortableList/SortableList.js.map +1 -0
- package/dist/labs/SideNav/SortableList/SortableOverlay.js +30 -0
- package/dist/labs/SideNav/SortableList/SortableOverlay.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 +14 -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/DataView.d.ts +1 -1
- package/dist/src/labs/DataView/DataView.d.ts.map +1 -1
- package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -1
- package/dist/src/labs/DataView/componentTypes.d.ts +4 -3
- 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} +7 -7
- 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 +38 -3
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -1
- package/dist/src/labs/SideNav/SideNavItemContentContext.d.ts +19 -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/SortableList/SortableItem.d.ts +26 -0
- package/dist/src/labs/SideNav/SortableList/SortableItem.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SortableList/SortableList.d.ts +36 -0
- package/dist/src/labs/SideNav/SortableList/SortableList.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SortableList/SortableOverlay.d.ts +17 -0
- package/dist/src/labs/SideNav/SortableList/SortableOverlay.d.ts.map +1 -0
- package/dist/src/labs/SideNav/types.d.ts +79 -35
- 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 +13 -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/i18n.config.json +2 -1
- package/jest.config.cjs +1 -1
- package/jest.setup.js +0 -3
- package/package.json +7 -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 +18 -5
- 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/DataView.tsx +6 -0
- package/src/labs/DataView/TableLayoutContent.tsx +6 -2
- package/src/labs/DataView/componentTypes.ts +7 -3
- 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} +51 -16
- 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 +405 -205
- package/src/labs/SideNav/SideNavFooterContent.tsx +36 -28
- package/src/labs/SideNav/SideNavHeader.tsx +62 -45
- package/src/labs/SideNav/SideNavItemContent.tsx +202 -69
- package/src/labs/SideNav/SideNavItemContentContext.tsx +29 -0
- package/src/labs/SideNav/SideNavItemLinkContent.tsx +18 -15
- package/src/labs/SideNav/SideNavLogo.tsx +41 -0
- package/src/labs/SideNav/SideNavToggleButton.tsx +245 -0
- package/src/labs/SideNav/SortableList/SortableItem.tsx +202 -0
- package/src/labs/SideNav/SortableList/SortableList.tsx +122 -0
- package/src/labs/SideNav/SortableList/SortableOverlay.tsx +34 -0
- package/src/labs/SideNav/types.ts +85 -36
- 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 +14 -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
|
@@ -11,10 +11,30 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { memo, useMemo } from "react";
|
|
14
|
-
import
|
|
14
|
+
import styled from "@emotion/styled";
|
|
15
|
+
|
|
16
|
+
import {
|
|
17
|
+
useOdysseyDesignTokens,
|
|
18
|
+
DesignTokens,
|
|
19
|
+
} from "../../OdysseyDesignTokensContext";
|
|
15
20
|
import type { SideNavFooterItem } from "./types";
|
|
16
21
|
import { Box } from "../../Box";
|
|
17
22
|
import { Link } from "../../Link";
|
|
23
|
+
import { useTranslation } from "react-i18next";
|
|
24
|
+
|
|
25
|
+
const StyledFooterNav = styled("nav")({
|
|
26
|
+
display: "flex",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const StyledFooterItemContainer = styled("div", {
|
|
30
|
+
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
31
|
+
})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
|
|
32
|
+
"& + &": {
|
|
33
|
+
marginInlineStart: odysseyDesignTokens.Spacing4,
|
|
34
|
+
paddingInlineStart: odysseyDesignTokens.Spacing4,
|
|
35
|
+
borderInlineStart: `1px solid ${odysseyDesignTokens.HueNeutral300}`,
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
18
38
|
|
|
19
39
|
const SideNavFooterContent = ({
|
|
20
40
|
footerItems,
|
|
@@ -22,41 +42,29 @@ const SideNavFooterContent = ({
|
|
|
22
42
|
footerItems: SideNavFooterItem[];
|
|
23
43
|
}) => {
|
|
24
44
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
45
|
+
const { t } = useTranslation();
|
|
25
46
|
|
|
26
|
-
const
|
|
27
|
-
return footerItems?.map((item
|
|
28
|
-
<
|
|
29
|
-
key={
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}}
|
|
47
|
+
const memoizedFooterContent = useMemo(() => {
|
|
48
|
+
return footerItems?.map((item) => (
|
|
49
|
+
<StyledFooterItemContainer
|
|
50
|
+
key={item.id}
|
|
51
|
+
odysseyDesignTokens={odysseyDesignTokens}
|
|
52
|
+
role="menuitem"
|
|
33
53
|
>
|
|
34
54
|
{item.href ? (
|
|
35
|
-
<Link
|
|
36
|
-
{item.label}
|
|
37
|
-
</Link>
|
|
55
|
+
<Link href={item.href}>{item.label}</Link>
|
|
38
56
|
) : (
|
|
39
|
-
<Box component="span"
|
|
40
|
-
{item.label}
|
|
41
|
-
</Box>
|
|
42
|
-
)}
|
|
43
|
-
{index < footerItems.length - 1 && (
|
|
44
|
-
<Box
|
|
45
|
-
key={`${item.id}-separator`}
|
|
46
|
-
sx={{
|
|
47
|
-
marginLeft: odysseyDesignTokens.Spacing4,
|
|
48
|
-
marginRight: odysseyDesignTokens.Spacing4,
|
|
49
|
-
color: odysseyDesignTokens.HueNeutral300,
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
|
|
|
53
|
-
</Box>
|
|
57
|
+
<Box component="span">{item.label}</Box>
|
|
54
58
|
)}
|
|
55
|
-
</
|
|
59
|
+
</StyledFooterItemContainer>
|
|
56
60
|
));
|
|
57
61
|
}, [footerItems, odysseyDesignTokens]);
|
|
58
62
|
|
|
59
|
-
return
|
|
63
|
+
return (
|
|
64
|
+
<StyledFooterNav role="menubar" aria-label={t("navigation.footer")}>
|
|
65
|
+
{memoizedFooterContent}
|
|
66
|
+
</StyledFooterNav>
|
|
67
|
+
);
|
|
60
68
|
};
|
|
61
69
|
const MemoizedSideNavFooterContent = memo(SideNavFooterContent);
|
|
62
70
|
MemoizedSideNavFooterContent.displayName = "SideNavFooterContent";
|
|
@@ -11,77 +11,94 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import styled from "@emotion/styled";
|
|
14
|
-
import { memo
|
|
14
|
+
import { memo } from "react";
|
|
15
|
+
import { Skeleton } from "@mui/material";
|
|
16
|
+
|
|
15
17
|
import {
|
|
16
18
|
type DesignTokens,
|
|
17
19
|
useOdysseyDesignTokens,
|
|
18
20
|
} from "../../OdysseyDesignTokensContext";
|
|
19
|
-
import {
|
|
21
|
+
import { SideNavLogo } from "./SideNavLogo";
|
|
22
|
+
import { SideNavProps } from "./types";
|
|
20
23
|
import { Heading6 } from "../../Typography";
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
import { TOP_NAV_HEIGHT } from "../TopNav";
|
|
25
|
+
|
|
26
|
+
const SideNavHeaderContainer = styled("div", {
|
|
27
|
+
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
28
|
+
})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
|
|
29
|
+
position: "relative",
|
|
30
|
+
display: "flex",
|
|
31
|
+
flexDirection: "column",
|
|
32
|
+
backgroundColor: odysseyDesignTokens.HueNeutralWhite,
|
|
33
|
+
zIndex: 1,
|
|
34
|
+
}));
|
|
24
35
|
|
|
25
36
|
const SideNavLogoContainer = styled("div", {
|
|
26
37
|
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
27
38
|
})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
39
|
+
display: "flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
height: TOP_NAV_HEIGHT,
|
|
42
|
+
padding: odysseyDesignTokens.Spacing4,
|
|
43
|
+
|
|
44
|
+
"svg, img": {
|
|
45
|
+
maxHeight: "100%",
|
|
46
|
+
width: "auto",
|
|
47
|
+
maxWidth: "100%",
|
|
48
|
+
},
|
|
34
49
|
}));
|
|
35
50
|
|
|
36
|
-
const
|
|
51
|
+
const SideNavHeadingContainer = styled("div", {
|
|
37
52
|
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
38
53
|
})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
|
|
39
54
|
display: "flex",
|
|
40
55
|
justifyContent: "space-between",
|
|
41
56
|
alignItems: "center",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
57
|
+
padding: odysseyDesignTokens.Spacing4,
|
|
58
|
+
width: "100%",
|
|
59
|
+
|
|
60
|
+
["& .MuiTypography-root"]: {
|
|
61
|
+
margin: 0,
|
|
62
|
+
width: "100%",
|
|
63
|
+
},
|
|
46
64
|
}));
|
|
47
65
|
|
|
66
|
+
export type SideNavHeaderProps = {
|
|
67
|
+
/**
|
|
68
|
+
* The app's name.
|
|
69
|
+
*/
|
|
70
|
+
appName: string;
|
|
71
|
+
/**
|
|
72
|
+
* If the side nav currently has no items, it will be loading.
|
|
73
|
+
*/
|
|
74
|
+
isLoading?: boolean;
|
|
75
|
+
} & Pick<SideNavProps, "logoProps">;
|
|
76
|
+
|
|
48
77
|
const SideNavHeader = ({
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}: Pick<
|
|
54
|
-
SideNavProps,
|
|
55
|
-
"navHeaderText" | "isCollapsible" | "onCollapse" | "logo"
|
|
56
|
-
>): ReactNode => {
|
|
78
|
+
appName,
|
|
79
|
+
isLoading,
|
|
80
|
+
logoProps,
|
|
81
|
+
}: SideNavHeaderProps) => {
|
|
57
82
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
58
83
|
|
|
59
|
-
const sideNavHeaderStyles = useMemo(
|
|
60
|
-
() => ({
|
|
61
|
-
marginTop: odysseyDesignTokens.Spacing2,
|
|
62
|
-
}),
|
|
63
|
-
[odysseyDesignTokens],
|
|
64
|
-
);
|
|
65
|
-
|
|
66
84
|
return (
|
|
67
|
-
<
|
|
68
|
-
sx={{
|
|
69
|
-
display: "flex",
|
|
70
|
-
flexDirection: "column",
|
|
71
|
-
}}
|
|
72
|
-
>
|
|
85
|
+
<SideNavHeaderContainer odysseyDesignTokens={odysseyDesignTokens}>
|
|
73
86
|
<SideNavLogoContainer odysseyDesignTokens={odysseyDesignTokens}>
|
|
74
|
-
{
|
|
87
|
+
{isLoading ? (
|
|
88
|
+
// The skeleton takes the hardcoded dimensions of the Okta logo
|
|
89
|
+
<Skeleton variant="rounded" height={24} width={67} />
|
|
90
|
+
) : (
|
|
91
|
+
<SideNavLogo {...logoProps} />
|
|
92
|
+
)}
|
|
75
93
|
</SideNavLogoContainer>
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</SideNavHeaderContainer>
|
|
82
|
-
</Box>
|
|
94
|
+
|
|
95
|
+
<SideNavHeadingContainer odysseyDesignTokens={odysseyDesignTokens}>
|
|
96
|
+
<Heading6 component="h2">{isLoading ? <Skeleton /> : appName}</Heading6>
|
|
97
|
+
</SideNavHeadingContainer>
|
|
98
|
+
</SideNavHeaderContainer>
|
|
83
99
|
);
|
|
84
100
|
};
|
|
101
|
+
|
|
85
102
|
const MemoizedSideNavHeader = memo(SideNavHeader);
|
|
86
103
|
MemoizedSideNavHeader.displayName = "SideNavHeader";
|
|
87
104
|
|
|
@@ -17,55 +17,39 @@ import {
|
|
|
17
17
|
useCallback,
|
|
18
18
|
memo,
|
|
19
19
|
KeyboardEvent,
|
|
20
|
+
useMemo,
|
|
20
21
|
} from "react";
|
|
21
|
-
import { Link } from "
|
|
22
|
+
import { Link as NavItemLink } from "@mui/material";
|
|
22
23
|
import {
|
|
23
24
|
type DesignTokens,
|
|
24
25
|
useOdysseyDesignTokens,
|
|
25
26
|
} from "../../OdysseyDesignTokensContext";
|
|
26
27
|
import { SideNavItemLinkContent } from "./SideNavItemLinkContent";
|
|
27
28
|
import type { SideNavItem } from "./types";
|
|
29
|
+
import {
|
|
30
|
+
SideNavItemContentContextValue,
|
|
31
|
+
useSideNavItemContent,
|
|
32
|
+
} from "./SideNavItemContentContext";
|
|
33
|
+
import { ExternalLinkIcon } from "../../icons.generated";
|
|
28
34
|
|
|
29
|
-
export const
|
|
35
|
+
export const StyledSideNavListItem = styled("li", {
|
|
30
36
|
shouldForwardProp: (prop) =>
|
|
31
|
-
prop !== "odysseyDesignTokens" &&
|
|
32
|
-
prop !== "isSelected" &&
|
|
33
|
-
prop !== "isDisabled",
|
|
37
|
+
prop !== "odysseyDesignTokens" && prop !== "isSelected",
|
|
34
38
|
})<{
|
|
35
39
|
odysseyDesignTokens: DesignTokens;
|
|
36
40
|
isSelected?: boolean;
|
|
37
41
|
disabled?: boolean;
|
|
38
|
-
|
|
39
|
-
}>(({ odysseyDesignTokens, isSelected, isDisabled }) => ({
|
|
42
|
+
}>(({ odysseyDesignTokens, isSelected }) => ({
|
|
40
43
|
display: "flex",
|
|
41
44
|
alignItems: "center",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
display: "flex",
|
|
51
|
-
alignItems: "center",
|
|
52
|
-
width: "100%",
|
|
53
|
-
minHeight: "48px",
|
|
54
|
-
padding: `${odysseyDesignTokens.Spacing3} ${odysseyDesignTokens.Spacing4}`,
|
|
55
|
-
color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
|
|
56
|
-
pointerEvents: isDisabled ? "none" : "auto",
|
|
57
|
-
},
|
|
58
|
-
"& a:hover": {
|
|
59
|
-
textDecoration: "none",
|
|
60
|
-
cursor: isDisabled ? "default" : "pointer",
|
|
61
|
-
backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit",
|
|
62
|
-
},
|
|
63
|
-
"& a:focus-visible": {
|
|
64
|
-
outlineOffset: 0,
|
|
65
|
-
borderRadius: 0,
|
|
66
|
-
outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
|
|
67
|
-
backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit",
|
|
68
|
-
},
|
|
45
|
+
backgroundColor: "unset",
|
|
46
|
+
borderRadius: odysseyDesignTokens.BorderRadiusMain,
|
|
47
|
+
transition: `backgroundColor ${odysseyDesignTokens.TransitionDurationMain}, color ${odysseyDesignTokens.TransitionDurationMain}`,
|
|
48
|
+
|
|
49
|
+
...(isSelected && {
|
|
50
|
+
color: `${odysseyDesignTokens.TypographyColorAction} !important`,
|
|
51
|
+
backgroundColor: odysseyDesignTokens.HueBlue50,
|
|
52
|
+
}),
|
|
69
53
|
}));
|
|
70
54
|
|
|
71
55
|
const scrollToNode = (node: HTMLElement | null) => {
|
|
@@ -82,7 +66,127 @@ type ScrollIntoViewHandle = {
|
|
|
82
66
|
scrollIntoView: () => void;
|
|
83
67
|
};
|
|
84
68
|
|
|
69
|
+
export const getBaseNavItemContentStyles = ({
|
|
70
|
+
odysseyDesignTokens,
|
|
71
|
+
isDisabled,
|
|
72
|
+
isSelected,
|
|
73
|
+
}: {
|
|
74
|
+
odysseyDesignTokens: DesignTokens;
|
|
75
|
+
isDisabled?: boolean;
|
|
76
|
+
isSelected?: boolean;
|
|
77
|
+
}) => ({
|
|
78
|
+
display: "flex",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
width: "100%",
|
|
81
|
+
textDecoration: "none",
|
|
82
|
+
color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
|
|
83
|
+
minHeight: "unset",
|
|
84
|
+
paddingBlock: odysseyDesignTokens.Spacing3,
|
|
85
|
+
paddingInlineEnd: odysseyDesignTokens.Spacing4,
|
|
86
|
+
borderRadius: odysseyDesignTokens.BorderRadiusMain,
|
|
87
|
+
transition: `backgroundColor ${odysseyDesignTokens.TransitionDurationMain}, color ${odysseyDesignTokens.TransitionDurationMain}`,
|
|
88
|
+
cursor: "pointer",
|
|
89
|
+
|
|
90
|
+
// `[data-sortable-container='true']:has(button:hover) &` - when the sortable item's drag handle is hovered we want to trigger the same hover behavior as if you were hovering the actual item
|
|
91
|
+
"&:hover, [data-sortable-container='true']:has(button:hover, button:focus, button:focus-visible) &":
|
|
92
|
+
{
|
|
93
|
+
textDecoration: "none",
|
|
94
|
+
backgroundColor: odysseyDesignTokens.HueNeutral50,
|
|
95
|
+
|
|
96
|
+
...(isSelected && {
|
|
97
|
+
backgroundColor: odysseyDesignTokens.HueBlue50,
|
|
98
|
+
color: odysseyDesignTokens.TypographyColorAction,
|
|
99
|
+
}),
|
|
100
|
+
|
|
101
|
+
...(isDisabled && {
|
|
102
|
+
backgroundColor: "unset",
|
|
103
|
+
}),
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
...(isSelected && {
|
|
107
|
+
color: `${odysseyDesignTokens.TypographyColorAction}`,
|
|
108
|
+
fontWeight: odysseyDesignTokens.TypographyWeightBodyBold,
|
|
109
|
+
}),
|
|
110
|
+
|
|
111
|
+
...(isDisabled && {
|
|
112
|
+
cursor: "default",
|
|
113
|
+
color: `${odysseyDesignTokens.TypographyColorDisabled} !important`,
|
|
114
|
+
}),
|
|
115
|
+
|
|
116
|
+
"&:focus-visible, &:focus": {
|
|
117
|
+
outline: "none",
|
|
118
|
+
boxShadow: `inset 0 0 0 2px ${odysseyDesignTokens.PalettePrimaryMain}`,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export const getNavItemContentStyles = ({
|
|
123
|
+
odysseyDesignTokens,
|
|
124
|
+
contextValue,
|
|
125
|
+
}: {
|
|
126
|
+
odysseyDesignTokens: DesignTokens;
|
|
127
|
+
contextValue: SideNavItemContentContextValue;
|
|
128
|
+
}) => ({
|
|
129
|
+
paddingInlineStart: `calc(${odysseyDesignTokens.Spacing4} * ${contextValue.depth} + ${odysseyDesignTokens.Spacing6})`,
|
|
130
|
+
|
|
131
|
+
...(contextValue.depth === 1 && {
|
|
132
|
+
paddingInlineStart: odysseyDesignTokens.Spacing4,
|
|
133
|
+
}),
|
|
134
|
+
|
|
135
|
+
...(contextValue.isCompact && {
|
|
136
|
+
paddingBlock: odysseyDesignTokens.Spacing1,
|
|
137
|
+
}),
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const NavItemContentContainer = styled("div", {
|
|
141
|
+
shouldForwardProp: (prop) =>
|
|
142
|
+
prop !== "odysseyDesignTokens" &&
|
|
143
|
+
prop != "contextValue" &&
|
|
144
|
+
prop !== "isDisabled" &&
|
|
145
|
+
prop !== "isSelected",
|
|
146
|
+
})<{
|
|
147
|
+
contextValue: SideNavItemContentContextValue;
|
|
148
|
+
odysseyDesignTokens: DesignTokens;
|
|
149
|
+
isSelected?: boolean;
|
|
150
|
+
isDisabled?: boolean;
|
|
151
|
+
}>(({ contextValue, odysseyDesignTokens, isDisabled, isSelected }) => ({
|
|
152
|
+
...getBaseNavItemContentStyles({
|
|
153
|
+
odysseyDesignTokens,
|
|
154
|
+
isDisabled,
|
|
155
|
+
isSelected,
|
|
156
|
+
}),
|
|
157
|
+
|
|
158
|
+
...getNavItemContentStyles({
|
|
159
|
+
odysseyDesignTokens,
|
|
160
|
+
contextValue,
|
|
161
|
+
}),
|
|
162
|
+
}));
|
|
163
|
+
|
|
164
|
+
const StyledNavItemLink = styled(NavItemLink, {
|
|
165
|
+
shouldForwardProp: (prop) =>
|
|
166
|
+
prop !== "odysseyDesignTokens" &&
|
|
167
|
+
prop != "contextValue" &&
|
|
168
|
+
prop !== "isDisabled" &&
|
|
169
|
+
prop !== "isSelected",
|
|
170
|
+
})<{
|
|
171
|
+
contextValue: SideNavItemContentContextValue;
|
|
172
|
+
odysseyDesignTokens: DesignTokens;
|
|
173
|
+
isSelected?: boolean;
|
|
174
|
+
isDisabled?: boolean;
|
|
175
|
+
}>(({ contextValue, odysseyDesignTokens, isDisabled, isSelected }) => ({
|
|
176
|
+
...getBaseNavItemContentStyles({
|
|
177
|
+
odysseyDesignTokens,
|
|
178
|
+
isDisabled,
|
|
179
|
+
isSelected,
|
|
180
|
+
}),
|
|
181
|
+
|
|
182
|
+
...getNavItemContentStyles({
|
|
183
|
+
odysseyDesignTokens,
|
|
184
|
+
contextValue,
|
|
185
|
+
}),
|
|
186
|
+
}));
|
|
187
|
+
|
|
85
188
|
const SideNavItemContent = ({
|
|
189
|
+
count,
|
|
86
190
|
id,
|
|
87
191
|
label,
|
|
88
192
|
href,
|
|
@@ -92,11 +196,13 @@ const SideNavItemContent = ({
|
|
|
92
196
|
statusLabel,
|
|
93
197
|
endIcon,
|
|
94
198
|
onClick,
|
|
95
|
-
isSelected,
|
|
96
199
|
isDisabled,
|
|
200
|
+
isSelected,
|
|
97
201
|
scrollRef,
|
|
202
|
+
onItemSelected,
|
|
98
203
|
}: Pick<
|
|
99
204
|
SideNavItem,
|
|
205
|
+
| "count"
|
|
100
206
|
| "id"
|
|
101
207
|
| "label"
|
|
102
208
|
| "href"
|
|
@@ -106,14 +212,22 @@ const SideNavItemContent = ({
|
|
|
106
212
|
| "statusLabel"
|
|
107
213
|
| "endIcon"
|
|
108
214
|
| "onClick"
|
|
109
|
-
| "isSelected"
|
|
110
215
|
| "isDisabled"
|
|
216
|
+
| "isSelected"
|
|
111
217
|
> & {
|
|
112
218
|
/**
|
|
113
219
|
* The ref used to scroll to this item
|
|
114
220
|
*/
|
|
115
221
|
scrollRef?: React.RefObject<ScrollIntoViewHandle>;
|
|
222
|
+
onItemSelected?(selectedItemId: string): void;
|
|
116
223
|
}) => {
|
|
224
|
+
const sidenavItemContentContext = useSideNavItemContent();
|
|
225
|
+
const contextValue = useMemo(
|
|
226
|
+
() => sidenavItemContentContext,
|
|
227
|
+
[sidenavItemContentContext],
|
|
228
|
+
);
|
|
229
|
+
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
230
|
+
|
|
117
231
|
const localScrollRef = useRef<HTMLLIElement>(null);
|
|
118
232
|
useImperativeHandle(
|
|
119
233
|
scrollRef,
|
|
@@ -126,90 +240,109 @@ const SideNavItemContent = ({
|
|
|
126
240
|
},
|
|
127
241
|
[],
|
|
128
242
|
);
|
|
129
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
130
243
|
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
minHeight: "48px",
|
|
138
|
-
padding: `${odysseyDesignTokens.Spacing3} ${odysseyDesignTokens.Spacing4}`,
|
|
139
|
-
color: `${isDisabled ? odysseyDesignTokens.TypographyColorDisabled : odysseyDesignTokens.TypographyColorHeading} !important`,
|
|
140
|
-
"&:focus-visible": {
|
|
141
|
-
borderRadius: 0,
|
|
142
|
-
outlineColor: odysseyDesignTokens.FocusOutlineColorPrimary,
|
|
143
|
-
outlineStyle: odysseyDesignTokens.FocusOutlineStyle,
|
|
144
|
-
outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
|
|
145
|
-
backgroundColor: odysseyDesignTokens.HueNeutral50,
|
|
146
|
-
textDecoration: "none",
|
|
244
|
+
const itemClickHandler = useCallback(
|
|
245
|
+
(id: string) => {
|
|
246
|
+
return () => {
|
|
247
|
+
onItemSelected?.(id);
|
|
248
|
+
onClick?.();
|
|
249
|
+
};
|
|
147
250
|
},
|
|
148
|
-
|
|
251
|
+
[onClick, onItemSelected],
|
|
252
|
+
);
|
|
149
253
|
|
|
150
254
|
const sideNavItemContentKeyHandler = useCallback(
|
|
151
|
-
(event: KeyboardEvent<HTMLDivElement>) => {
|
|
255
|
+
(id: string, event: KeyboardEvent<HTMLDivElement>) => {
|
|
152
256
|
if (event?.key === "Enter") {
|
|
153
257
|
event.preventDefault();
|
|
258
|
+
onItemSelected?.(id);
|
|
154
259
|
onClick?.();
|
|
155
260
|
}
|
|
156
261
|
},
|
|
157
|
-
[onClick],
|
|
262
|
+
[onClick, onItemSelected],
|
|
158
263
|
);
|
|
159
264
|
|
|
160
265
|
return (
|
|
161
|
-
<
|
|
266
|
+
<StyledSideNavListItem
|
|
162
267
|
ref={localScrollRef}
|
|
163
268
|
id={id}
|
|
164
269
|
key={id}
|
|
270
|
+
isSelected={isSelected}
|
|
165
271
|
disabled={isDisabled}
|
|
166
272
|
aria-disabled={isDisabled}
|
|
167
|
-
|
|
168
|
-
isSelected={isSelected}
|
|
273
|
+
aria-current={isSelected ? "page" : undefined}
|
|
169
274
|
odysseyDesignTokens={odysseyDesignTokens}
|
|
170
275
|
>
|
|
171
276
|
{
|
|
172
277
|
// Use Link for nav items with links and div for disabled or non-link items
|
|
173
278
|
isDisabled ? (
|
|
174
|
-
<
|
|
279
|
+
<NavItemContentContainer
|
|
280
|
+
odysseyDesignTokens={odysseyDesignTokens}
|
|
281
|
+
contextValue={contextValue}
|
|
282
|
+
isDisabled={isDisabled}
|
|
283
|
+
isSelected={isSelected}
|
|
284
|
+
>
|
|
175
285
|
<SideNavItemLinkContent
|
|
286
|
+
count={count}
|
|
176
287
|
label={label}
|
|
177
288
|
startIcon={startIcon}
|
|
178
289
|
endIcon={endIcon}
|
|
179
290
|
statusLabel={statusLabel}
|
|
180
291
|
severity={severity}
|
|
181
292
|
/>
|
|
182
|
-
</
|
|
293
|
+
</NavItemContentContainer>
|
|
183
294
|
) : !href ? (
|
|
184
|
-
<
|
|
185
|
-
|
|
295
|
+
<NavItemContentContainer
|
|
296
|
+
odysseyDesignTokens={odysseyDesignTokens}
|
|
297
|
+
contextValue={contextValue}
|
|
298
|
+
isDisabled={isDisabled}
|
|
186
299
|
tabIndex={0}
|
|
187
|
-
|
|
188
|
-
|
|
300
|
+
role="button"
|
|
301
|
+
onClick={itemClickHandler(id)}
|
|
302
|
+
onKeyDown={(event: KeyboardEvent<HTMLDivElement>) =>
|
|
303
|
+
sideNavItemContentKeyHandler(id, event)
|
|
304
|
+
}
|
|
305
|
+
isSelected={isSelected}
|
|
189
306
|
>
|
|
190
307
|
<SideNavItemLinkContent
|
|
308
|
+
count={count}
|
|
191
309
|
label={label}
|
|
192
310
|
startIcon={startIcon}
|
|
193
311
|
endIcon={endIcon}
|
|
194
312
|
statusLabel={statusLabel}
|
|
195
313
|
severity={severity}
|
|
196
314
|
/>
|
|
197
|
-
</
|
|
315
|
+
</NavItemContentContainer>
|
|
198
316
|
) : (
|
|
199
|
-
<
|
|
317
|
+
<StyledNavItemLink
|
|
318
|
+
odysseyDesignTokens={odysseyDesignTokens}
|
|
319
|
+
contextValue={contextValue}
|
|
320
|
+
isDisabled={isDisabled}
|
|
321
|
+
isSelected={isSelected}
|
|
322
|
+
href={href}
|
|
323
|
+
target={target}
|
|
324
|
+
onClick={itemClickHandler(id)}
|
|
325
|
+
>
|
|
200
326
|
<SideNavItemLinkContent
|
|
327
|
+
count={count}
|
|
201
328
|
label={label}
|
|
202
329
|
startIcon={startIcon}
|
|
203
330
|
endIcon={endIcon}
|
|
204
331
|
statusLabel={statusLabel}
|
|
205
332
|
severity={severity}
|
|
206
333
|
/>
|
|
207
|
-
|
|
334
|
+
{target === "_blank" && (
|
|
335
|
+
<span className="Link-indicator" role="presentation">
|
|
336
|
+
<ExternalLinkIcon />
|
|
337
|
+
</span>
|
|
338
|
+
)}
|
|
339
|
+
</StyledNavItemLink>
|
|
208
340
|
)
|
|
209
341
|
}
|
|
210
|
-
</
|
|
342
|
+
</StyledSideNavListItem>
|
|
211
343
|
);
|
|
212
344
|
};
|
|
345
|
+
|
|
213
346
|
const MemoizedSideNavItemContent = memo(SideNavItemContent);
|
|
214
347
|
MemoizedSideNavItemContent.displayName = "SideNavItemContent";
|
|
215
348
|
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { createContext, useContext } from "react";
|
|
14
|
+
|
|
15
|
+
export type SideNavItemContentContextValue = {
|
|
16
|
+
isCompact?: boolean;
|
|
17
|
+
isSortable?: boolean;
|
|
18
|
+
depth: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const SideNavItemContentContext =
|
|
22
|
+
createContext<SideNavItemContentContextValue>({
|
|
23
|
+
isCompact: false,
|
|
24
|
+
isSortable: false,
|
|
25
|
+
depth: 1,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const useSideNavItemContent = () =>
|
|
29
|
+
useContext(SideNavItemContentContext);
|