@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavAccordion.js","names":["styled","memo","ChevronRightIcon","useOdysseyDesignTokens","Support","useUniqueId","jsx","_jsx","jsxs","_jsxs","AccordionLabelContainer","shouldForwardProp","prop","odysseyDesignTokens","isIconVisible","width","marginLeft","Spacing2","fontSize","TypographyScale0","fontWeight","TypographyWeightHeading","color","TypographyColorHeading","NavAccordion","children","label","id","idOverride","isDefaultExpanded","isDisabled","isExpanded","translate","startIcon","headerId","contentId","_Accordion","defaultExpanded","disabled","disableGutters","expanded","className","_AccordionSummary","expandIcon","component","Boolean","_AccordionDetails","MemoizedNavAccordion","displayName"],"sources":["../../src/labs/NavAccordion.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport {\n Accordion as MuiAccordion,\n AccordionDetails as MuiAccordionDetails,\n AccordionSummary as MuiAccordionSummary,\n AccordionProps as MuiAccordionProps,\n} from \"@mui/material\";\nimport { ReactNode, memo } from \"react\";\n\nimport type { HtmlProps } from \"../HtmlProps\";\nimport { ChevronRightIcon } from \"../icons.generated\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext\";\nimport { Support } from \"../Typography\";\nimport { useUniqueId } from \"../useUniqueId\";\n\nexport type NavAccordionProps = {\n /**\n * The content of the Accordion itself\n */\n children: ReactNode;\n /**\n * The label text for the AccordionSummary\n */\n label: string;\n /**\n * Defines IDs for the header and the content of the Accordion\n */\n id?: string;\n /**\n * Whether the item is expanded by default\n */\n isDefaultExpanded?: boolean;\n /**\n * Whether the item is disabled\n */\n isDisabled?: boolean;\n /**\n * If true, expands the accordion, otherwise collapse it.\n * Setting this prop enables control over the accordion.\n */\n isExpanded?: boolean;\n /**\n * Event fired when the expansion state of the accordion is changed\n */\n onChange?: MuiAccordionProps[\"onChange\"];\n /**\n * The icon element to display at the start of the Nav Item\n */\n startIcon?: ReactNode;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst AccordionLabelContainer = styled(\"span\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isIconVisible\",\n})<{\n odysseyDesignTokens: DesignTokens;\n isIconVisible: boolean;\n}>(({ odysseyDesignTokens, isIconVisible }) => ({\n width: \"100%\",\n marginLeft: isIconVisible ? odysseyDesignTokens.Spacing2 : 0,\n fontSize: odysseyDesignTokens.TypographyScale0,\n fontWeight: odysseyDesignTokens.TypographyWeightHeading,\n color: odysseyDesignTokens.TypographyColorHeading,\n}));\n\nconst NavAccordion = ({\n children,\n label,\n id: idOverride,\n isDefaultExpanded,\n isDisabled,\n isExpanded,\n translate,\n startIcon,\n}: NavAccordionProps) => {\n const id = useUniqueId(idOverride);\n const headerId = `${id}-header`;\n const contentId = `${id}-content`;\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <MuiAccordion\n defaultExpanded={isDefaultExpanded}\n disabled={isDisabled}\n disableGutters\n expanded={isExpanded}\n className=\"nav-accordion\"\n >\n <MuiAccordionSummary\n className=\"nav-accordion-summary\"\n aria-controls={contentId}\n expandIcon={<ChevronRightIcon />}\n id={headerId}\n >\n <Support component=\"div\" translate={translate}>\n {startIcon && startIcon}\n <AccordionLabelContainer\n odysseyDesignTokens={odysseyDesignTokens}\n isIconVisible={Boolean(startIcon)}\n >\n {label}\n </AccordionLabelContainer>\n </Support>\n </MuiAccordionSummary>\n <MuiAccordionDetails\n className=\"nav-accordion-details\"\n aria-labelledby={headerId}\n >\n {children}\n </MuiAccordionDetails>\n </MuiAccordion>\n );\n};\n\nconst MemoizedNavAccordion = memo(NavAccordion);\nMemoizedNavAccordion.displayName = \"NavAccordion\";\n\nexport { MemoizedNavAccordion as NavAccordion };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAOpC,SAAoBC,IAAI,QAAQ,OAAO;AAA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IAAE,CAAE;MACjCyB,EAAE,EAAEO,QAAS;MAAAT,QAAA,EAEbhB,KAAA,CAACL,OAAO;QAACwC,SAAS,EAAC,KAAK;QAACZ,SAAS,EAAEA,SAAU;QAAAP,QAAA,GAC3CQ,SAAS,IAAIA,SAAS,EACvB1B,IAAA,CAACG,uBAAuB;UACtBG,mBAAmB,EAAEA,mBAAoB;UACzCC,aAAa,EAAE+B,OAAO,CAACZ,SAAS,CAAE;UAAAR,QAAA,EAEjCC;QAAK,CACiB,CAAC;MAAA,CACnB;IAAC,CACS,CAAC,EACtBnB,IAAA,CAAAuC,iBAAA;MACEL,SAAS,EAAC,uBAAuB;MACjC,mBAAiBP,QAAS;MAAAT,QAAA,EAEzBA;IAAQ,CACU,CAAC;EAAA,CACV,CAAC;AAEnB,CAAC;AAED,MAAMsB,oBAAoB,GAAG9C,IAAI,CAACuB,YAAY,CAAC;AAC/CuB,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIvB,YAAY"}
|
package/dist/labs/TopNav.js
DELETED
|
@@ -1,281 +0,0 @@
|
|
|
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 styled from "@emotion/styled";
|
|
14
|
-
import { memo, useMemo, useCallback } from "react";
|
|
15
|
-
import { QuestionCircleIcon, SettingsIcon } from "../icons.generated/index.js";
|
|
16
|
-
import { Link } from "../Link.js";
|
|
17
|
-
import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
|
|
18
|
-
import { Subordinate } from "../Typography.js";
|
|
19
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
import { createElement as _createElement } from "react";
|
|
22
|
-
export const TOP_NAV_HEIGHT_TOKEN = "Spacing9";
|
|
23
|
-
const UserProfileContainer = styled("div", {
|
|
24
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
25
|
-
})(({
|
|
26
|
-
odysseyDesignTokens
|
|
27
|
-
}) => ({
|
|
28
|
-
display: "flex",
|
|
29
|
-
alignItems: "center",
|
|
30
|
-
paddingRight: odysseyDesignTokens.Spacing4
|
|
31
|
-
}));
|
|
32
|
-
const UserProfileIconContainer = styled("div", {
|
|
33
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
34
|
-
})(({
|
|
35
|
-
odysseyDesignTokens
|
|
36
|
-
}) => ({
|
|
37
|
-
display: "flex",
|
|
38
|
-
paddingRight: odysseyDesignTokens.Spacing2
|
|
39
|
-
}));
|
|
40
|
-
const UserProfileInfoContainer = styled("div")(() => ({
|
|
41
|
-
display: "flex",
|
|
42
|
-
flexDirection: "column"
|
|
43
|
-
}));
|
|
44
|
-
const UserProfile = ({
|
|
45
|
-
profileIcon,
|
|
46
|
-
userName,
|
|
47
|
-
orgName
|
|
48
|
-
}) => {
|
|
49
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
50
|
-
return _jsxs(UserProfileContainer, {
|
|
51
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
52
|
-
children: [profileIcon && _jsx(UserProfileIconContainer, {
|
|
53
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
54
|
-
children: profileIcon
|
|
55
|
-
}), _jsxs(UserProfileInfoContainer, {
|
|
56
|
-
children: [_jsx(Subordinate, {
|
|
57
|
-
color: "textPrimary",
|
|
58
|
-
children: userName
|
|
59
|
-
}), _jsx(Subordinate, {
|
|
60
|
-
color: "textSecondary",
|
|
61
|
-
children: orgName
|
|
62
|
-
})]
|
|
63
|
-
})]
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
const TopNavListContainer = styled("ul")(() => ({
|
|
67
|
-
padding: 0,
|
|
68
|
-
listStyle: "none",
|
|
69
|
-
listStyleType: "none",
|
|
70
|
-
display: "flex",
|
|
71
|
-
alignItems: "center"
|
|
72
|
-
}));
|
|
73
|
-
const TopNavItemLabelContainer = styled("div", {
|
|
74
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
75
|
-
})(({
|
|
76
|
-
odysseyDesignTokens
|
|
77
|
-
}) => ({
|
|
78
|
-
display: "flex",
|
|
79
|
-
flexWrap: "wrap",
|
|
80
|
-
alignItems: "center",
|
|
81
|
-
fontSize: odysseyDesignTokens.TypographyScale0,
|
|
82
|
-
fontWeight: odysseyDesignTokens.TypographyWeightHeading
|
|
83
|
-
}));
|
|
84
|
-
const TopNavListItemContainer = styled("li", {
|
|
85
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isDisabled"
|
|
86
|
-
})(({
|
|
87
|
-
odysseyDesignTokens,
|
|
88
|
-
isDisabled
|
|
89
|
-
}) => ({
|
|
90
|
-
display: "flex",
|
|
91
|
-
alignItems: "center",
|
|
92
|
-
cursor: isDisabled ? "default" : "pointer",
|
|
93
|
-
pointerEvents: isDisabled ? "none" : "auto",
|
|
94
|
-
color: `${isDisabled ? odysseyDesignTokens.TypographyColorDisabled : odysseyDesignTokens.TypographyColorHeading} !important`,
|
|
95
|
-
"& a": {
|
|
96
|
-
display: "flex",
|
|
97
|
-
alignItems: "center",
|
|
98
|
-
padding: `${odysseyDesignTokens.Spacing2} ${odysseyDesignTokens.Spacing4}`,
|
|
99
|
-
color: `${odysseyDesignTokens.TypographyColorHeading} !important`
|
|
100
|
-
},
|
|
101
|
-
"& a:hover": {
|
|
102
|
-
textDecoration: "none",
|
|
103
|
-
backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit"
|
|
104
|
-
},
|
|
105
|
-
"& div[role='button']:hover": {
|
|
106
|
-
backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit"
|
|
107
|
-
},
|
|
108
|
-
"& a:focus-visible": {
|
|
109
|
-
outlineOffset: 0,
|
|
110
|
-
borderRadius: 0,
|
|
111
|
-
outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
|
|
112
|
-
backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit"
|
|
113
|
-
}
|
|
114
|
-
}));
|
|
115
|
-
const NavItemContentClickContainer = styled("div", {
|
|
116
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
117
|
-
})(({
|
|
118
|
-
odysseyDesignTokens
|
|
119
|
-
}) => ({
|
|
120
|
-
display: "flex",
|
|
121
|
-
alignItems: "center",
|
|
122
|
-
width: "100%",
|
|
123
|
-
padding: `${odysseyDesignTokens.Spacing2} ${odysseyDesignTokens.Spacing4}`,
|
|
124
|
-
"&:focus-visible": {
|
|
125
|
-
borderRadius: 0,
|
|
126
|
-
outlineColor: odysseyDesignTokens.FocusOutlineColorPrimary,
|
|
127
|
-
outlineStyle: odysseyDesignTokens.FocusOutlineStyle,
|
|
128
|
-
outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
|
|
129
|
-
backgroundColor: odysseyDesignTokens.HueNeutral50,
|
|
130
|
-
textDecoration: "none"
|
|
131
|
-
}
|
|
132
|
-
}));
|
|
133
|
-
const TopNavItemContent = ({
|
|
134
|
-
id,
|
|
135
|
-
label,
|
|
136
|
-
href,
|
|
137
|
-
target,
|
|
138
|
-
onClick,
|
|
139
|
-
isDisabled
|
|
140
|
-
}) => {
|
|
141
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
142
|
-
const topNavItemContentKeyHandler = useCallback(event => {
|
|
143
|
-
if (event?.key === "Enter") {
|
|
144
|
-
event.preventDefault();
|
|
145
|
-
event.stopPropagation();
|
|
146
|
-
onClick?.(event);
|
|
147
|
-
}
|
|
148
|
-
}, [onClick]);
|
|
149
|
-
return _jsx(TopNavListItemContainer, {
|
|
150
|
-
id: id,
|
|
151
|
-
"aria-disabled": isDisabled,
|
|
152
|
-
isDisabled: isDisabled,
|
|
153
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
154
|
-
children: isDisabled ? _jsx(NavItemContentClickContainer, {
|
|
155
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
156
|
-
children: _jsx(TopNavItemLabelContainer, {
|
|
157
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
158
|
-
children: label
|
|
159
|
-
})
|
|
160
|
-
}) : !href ? _jsx(NavItemContentClickContainer, {
|
|
161
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
162
|
-
role: "button",
|
|
163
|
-
tabIndex: 0,
|
|
164
|
-
onClick: onClick,
|
|
165
|
-
onKeyDown: topNavItemContentKeyHandler,
|
|
166
|
-
children: _jsx(TopNavItemLabelContainer, {
|
|
167
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
168
|
-
children: label
|
|
169
|
-
})
|
|
170
|
-
}) : _jsx(Link, {
|
|
171
|
-
href: href,
|
|
172
|
-
target: target,
|
|
173
|
-
onClick: onClick,
|
|
174
|
-
children: _jsx(TopNavItemLabelContainer, {
|
|
175
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
176
|
-
children: label
|
|
177
|
-
})
|
|
178
|
-
})
|
|
179
|
-
}, id);
|
|
180
|
-
};
|
|
181
|
-
const LinkAndProfileWrapper = styled("div")(() => ({
|
|
182
|
-
display: "flex",
|
|
183
|
-
alignItems: "center",
|
|
184
|
-
marginLeft: "auto"
|
|
185
|
-
}));
|
|
186
|
-
const AdditionalLinkContainerWithBorder = styled("div", {
|
|
187
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
188
|
-
})(({
|
|
189
|
-
odysseyDesignTokens
|
|
190
|
-
}) => ({
|
|
191
|
-
display: "flex",
|
|
192
|
-
alignItems: "center",
|
|
193
|
-
marginRight: odysseyDesignTokens.Spacing3,
|
|
194
|
-
borderRight: `${odysseyDesignTokens.BorderWidthMain} solid ${odysseyDesignTokens.HueNeutral200}`
|
|
195
|
-
}));
|
|
196
|
-
const LinkContainer = styled("div", {
|
|
197
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
198
|
-
})(({
|
|
199
|
-
odysseyDesignTokens
|
|
200
|
-
}) => ({
|
|
201
|
-
paddingRight: odysseyDesignTokens.Spacing3,
|
|
202
|
-
"& a": {
|
|
203
|
-
color: `${odysseyDesignTokens.TypographyColorHeading} !important`
|
|
204
|
-
}
|
|
205
|
-
}));
|
|
206
|
-
const TopNavContainer = styled("div", {
|
|
207
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
208
|
-
})(({
|
|
209
|
-
odysseyDesignTokens
|
|
210
|
-
}) => ({
|
|
211
|
-
display: "flex",
|
|
212
|
-
alignItems: "center",
|
|
213
|
-
backgroundColor: odysseyDesignTokens.HueNeutralWhite,
|
|
214
|
-
height: odysseyDesignTokens[TOP_NAV_HEIGHT_TOKEN]
|
|
215
|
-
}));
|
|
216
|
-
const SearchFieldContainer = styled("div", {
|
|
217
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
218
|
-
})(({
|
|
219
|
-
odysseyDesignTokens
|
|
220
|
-
}) => ({
|
|
221
|
-
width: "350px",
|
|
222
|
-
padding: `${odysseyDesignTokens.Spacing2} ${odysseyDesignTokens.Spacing3}`
|
|
223
|
-
}));
|
|
224
|
-
const AdditionalNavItemContainer = styled("div", {
|
|
225
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
226
|
-
})(({
|
|
227
|
-
odysseyDesignTokens
|
|
228
|
-
}) => ({
|
|
229
|
-
padding: `0 ${odysseyDesignTokens.Spacing3}`
|
|
230
|
-
}));
|
|
231
|
-
const TopNav = ({
|
|
232
|
-
SearchFieldComponent,
|
|
233
|
-
topNavLinkItems,
|
|
234
|
-
AdditionalNavItemComponent,
|
|
235
|
-
settingsPageHref,
|
|
236
|
-
helpPageHref,
|
|
237
|
-
userProfile
|
|
238
|
-
}) => {
|
|
239
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
240
|
-
const processedNavItems = useMemo(() => topNavLinkItems.map(item => _createElement(TopNavItemContent, {
|
|
241
|
-
...item,
|
|
242
|
-
key: item.id
|
|
243
|
-
})), [topNavLinkItems]);
|
|
244
|
-
return _jsxs(TopNavContainer, {
|
|
245
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
246
|
-
children: [SearchFieldComponent && _jsx(SearchFieldContainer, {
|
|
247
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
248
|
-
children: SearchFieldComponent
|
|
249
|
-
}), _jsx(TopNavListContainer, {
|
|
250
|
-
children: processedNavItems?.map(item => item)
|
|
251
|
-
}), _jsxs(LinkAndProfileWrapper, {
|
|
252
|
-
children: [(AdditionalNavItemComponent || settingsPageHref || helpPageHref) && _jsxs(AdditionalLinkContainerWithBorder, {
|
|
253
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
254
|
-
children: [AdditionalNavItemComponent && _jsx(AdditionalNavItemContainer, {
|
|
255
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
256
|
-
children: AdditionalNavItemComponent
|
|
257
|
-
}), settingsPageHref && _jsx(LinkContainer, {
|
|
258
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
259
|
-
children: _jsx(Link, {
|
|
260
|
-
href: settingsPageHref,
|
|
261
|
-
ariaLabel: "settings page",
|
|
262
|
-
children: _jsx(SettingsIcon, {})
|
|
263
|
-
})
|
|
264
|
-
}), helpPageHref && _jsx(LinkContainer, {
|
|
265
|
-
odysseyDesignTokens: odysseyDesignTokens,
|
|
266
|
-
children: _jsx(Link, {
|
|
267
|
-
href: helpPageHref,
|
|
268
|
-
ariaLabel: "help page",
|
|
269
|
-
children: _jsx(QuestionCircleIcon, {})
|
|
270
|
-
})
|
|
271
|
-
})]
|
|
272
|
-
}), userProfile && _jsx(UserProfile, {
|
|
273
|
-
...userProfile
|
|
274
|
-
})]
|
|
275
|
-
})]
|
|
276
|
-
});
|
|
277
|
-
};
|
|
278
|
-
const MemoizedTopNav = memo(TopNav);
|
|
279
|
-
MemoizedTopNav.displayName = "TopNav";
|
|
280
|
-
export { MemoizedTopNav as TopNav };
|
|
281
|
-
//# sourceMappingURL=TopNav.js.map
|
package/dist/labs/TopNav.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopNav.js","names":["styled","memo","useMemo","useCallback","QuestionCircleIcon","SettingsIcon","Link","useOdysseyDesignTokens","Subordinate","jsx","_jsx","jsxs","_jsxs","createElement","_createElement","TOP_NAV_HEIGHT_TOKEN","UserProfileContainer","shouldForwardProp","prop","odysseyDesignTokens","display","alignItems","paddingRight","Spacing4","UserProfileIconContainer","Spacing2","UserProfileInfoContainer","flexDirection","UserProfile","profileIcon","userName","orgName","children","color","TopNavListContainer","padding","listStyle","listStyleType","TopNavItemLabelContainer","flexWrap","fontSize","TypographyScale0","fontWeight","TypographyWeightHeading","TopNavListItemContainer","isDisabled","cursor","pointerEvents","TypographyColorDisabled","TypographyColorHeading","textDecoration","backgroundColor","HueNeutral50","outlineOffset","borderRadius","outlineWidth","FocusOutlineWidthMain","NavItemContentClickContainer","width","outlineColor","FocusOutlineColorPrimary","outlineStyle","FocusOutlineStyle","TopNavItemContent","id","label","href","target","onClick","topNavItemContentKeyHandler","event","key","preventDefault","stopPropagation","role","tabIndex","onKeyDown","LinkAndProfileWrapper","marginLeft","AdditionalLinkContainerWithBorder","marginRight","Spacing3","borderRight","BorderWidthMain","HueNeutral200","LinkContainer","TopNavContainer","HueNeutralWhite","height","SearchFieldContainer","AdditionalNavItemContainer","TopNav","SearchFieldComponent","topNavLinkItems","AdditionalNavItemComponent","settingsPageHref","helpPageHref","userProfile","processedNavItems","map","item","ariaLabel","MemoizedTopNav","displayName"],"sources":["../../src/labs/TopNav.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport {\n memo,\n useMemo,\n ReactElement,\n useCallback,\n MouseEventHandler,\n KeyboardEventHandler,\n} from \"react\";\n\nimport type { HtmlProps } from \"../HtmlProps\";\nimport { QuestionCircleIcon, SettingsIcon } from \"../icons.generated\";\nimport { Link } from \"../Link\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext\";\nimport { Subordinate } from \"../Typography\";\n\nexport const TOP_NAV_HEIGHT_TOKEN = \"Spacing9\";\n\nexport type TopNavLinkItem = {\n id: string;\n label: string;\n /**\n * link added to the nav item. if it is undefined, static text will be displayed.\n * fires onClick event when it is passed\n */\n href?: string;\n /**\n * determines whether the link item is diabled\n */\n isDisabled?: boolean;\n /**\n * Event fired when the nav item is clicked\n */\n onClick?: MouseEventHandler<HTMLAnchorElement> &\n MouseEventHandler<HTMLDivElement> &\n KeyboardEventHandler<HTMLDivElement>;\n /**\n * The link target prop. e.g., \"_blank\"\n */\n target?: string;\n};\n\nexport type UserProfileProps = {\n /**\n * Logged in user profile icon to be displayed in the top nav\n */\n profileIcon?: ReactElement;\n /**\n * Logged in user info to be displayed in the top nav\n */\n userName: string;\n /**\n * Org name of the logged in user\n */\n orgName: string;\n};\n\nexport type TopNavProps = {\n /**\n * Pass in a SearchField component with the variant=\"filled\" prop set\n */\n SearchFieldComponent?: ReactElement;\n /**\n * Nav links in the top nav\n */\n topNavLinkItems: TopNavLinkItem[];\n /**\n * Pass in an additional component like `Button` that will be displayed after the nav link items\n */\n AdditionalNavItemComponent?: ReactElement;\n /**\n * URL to settings page.\n */\n settingsPageHref?: string;\n /**\n * URL to the help page.\n */\n helpPageHref?: string;\n /**\n * Displays user account info\n */\n userProfile?: UserProfileProps;\n} & Pick<HtmlProps, \"testId\">;\n\nconst UserProfileContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n paddingRight: odysseyDesignTokens.Spacing4,\n}));\n\nconst UserProfileIconContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({\n display: \"flex\",\n paddingRight: odysseyDesignTokens.Spacing2,\n}));\n\nconst UserProfileInfoContainer = styled(\"div\")(() => ({\n display: \"flex\",\n flexDirection: \"column\",\n}));\n\nconst UserProfile = ({ profileIcon, userName, orgName }: UserProfileProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <UserProfileContainer odysseyDesignTokens={odysseyDesignTokens}>\n {profileIcon && (\n <UserProfileIconContainer odysseyDesignTokens={odysseyDesignTokens}>\n {profileIcon}\n </UserProfileIconContainer>\n )}\n <UserProfileInfoContainer>\n <Subordinate color=\"textPrimary\">{userName}</Subordinate>\n <Subordinate color=\"textSecondary\">{orgName}</Subordinate>\n </UserProfileInfoContainer>\n </UserProfileContainer>\n );\n};\n\nconst TopNavListContainer = styled(\"ul\")(() => ({\n padding: 0,\n listStyle: \"none\",\n listStyleType: \"none\",\n display: \"flex\",\n alignItems: \"center\",\n}));\n\nconst TopNavItemLabelContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n flexWrap: \"wrap\",\n alignItems: \"center\",\n fontSize: odysseyDesignTokens.TypographyScale0,\n fontWeight: odysseyDesignTokens.TypographyWeightHeading,\n}));\n\nconst TopNavListItemContainer = styled(\"li\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isDisabled\",\n})<{\n odysseyDesignTokens: DesignTokens;\n isDisabled?: boolean;\n}>(({ odysseyDesignTokens, isDisabled }) => ({\n display: \"flex\",\n alignItems: \"center\",\n cursor: isDisabled ? \"default\" : \"pointer\",\n pointerEvents: isDisabled ? \"none\" : \"auto\",\n color: `${isDisabled ? odysseyDesignTokens.TypographyColorDisabled : odysseyDesignTokens.TypographyColorHeading} !important`,\n \"& a\": {\n display: \"flex\",\n alignItems: \"center\",\n padding: `${odysseyDesignTokens.Spacing2} ${odysseyDesignTokens.Spacing4}`,\n color: `${odysseyDesignTokens.TypographyColorHeading} !important`,\n },\n \"& a:hover\": {\n textDecoration: \"none\",\n backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : \"inherit\",\n },\n \"& div[role='button']:hover\": {\n backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : \"inherit\",\n },\n \"& a:focus-visible\": {\n outlineOffset: 0,\n borderRadius: 0,\n outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,\n backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : \"inherit\",\n },\n}));\n\nconst NavItemContentClickContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n padding: `${odysseyDesignTokens.Spacing2} ${odysseyDesignTokens.Spacing4}`,\n \"&:focus-visible\": {\n borderRadius: 0,\n outlineColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n outlineStyle: odysseyDesignTokens.FocusOutlineStyle,\n outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n textDecoration: \"none\",\n },\n}));\n\nconst TopNavItemContent = ({\n id,\n label,\n href,\n target,\n onClick,\n isDisabled,\n}: TopNavLinkItem) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const topNavItemContentKeyHandler = useCallback<\n KeyboardEventHandler<HTMLDivElement>\n >(\n (event) => {\n if (event?.key === \"Enter\") {\n event.preventDefault();\n event.stopPropagation();\n onClick?.(event);\n }\n },\n [onClick],\n );\n\n return (\n <TopNavListItemContainer\n id={id}\n key={id}\n aria-disabled={isDisabled}\n isDisabled={isDisabled}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {\n // Use Link for nav items with links and div for disabled or non-link items\n isDisabled ? (\n <NavItemContentClickContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <TopNavItemLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n {label}\n </TopNavItemLabelContainer>\n </NavItemContentClickContainer>\n ) : !href ? (\n <NavItemContentClickContainer\n odysseyDesignTokens={odysseyDesignTokens}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n onKeyDown={topNavItemContentKeyHandler}\n >\n <TopNavItemLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n {label}\n </TopNavItemLabelContainer>\n </NavItemContentClickContainer>\n ) : (\n <Link href={href} target={target} onClick={onClick}>\n <TopNavItemLabelContainer odysseyDesignTokens={odysseyDesignTokens}>\n {label}\n </TopNavItemLabelContainer>\n </Link>\n )\n }\n </TopNavListItemContainer>\n );\n};\n\nconst LinkAndProfileWrapper = styled(\"div\")(() => ({\n display: \"flex\",\n alignItems: \"center\",\n marginLeft: \"auto\",\n}));\n\nconst AdditionalLinkContainerWithBorder = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n marginRight: odysseyDesignTokens.Spacing3,\n borderRight: `${odysseyDesignTokens.BorderWidthMain} solid ${odysseyDesignTokens.HueNeutral200}`,\n}));\n\nconst LinkContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n paddingRight: odysseyDesignTokens.Spacing3,\n \"& a\": {\n color: `${odysseyDesignTokens.TypographyColorHeading} !important`,\n },\n}));\n\nconst TopNavContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n backgroundColor: odysseyDesignTokens.HueNeutralWhite,\n height: odysseyDesignTokens[TOP_NAV_HEIGHT_TOKEN],\n}));\n\nconst SearchFieldContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n width: \"350px\",\n padding: `${odysseyDesignTokens.Spacing2} ${odysseyDesignTokens.Spacing3}`,\n}));\n\nconst AdditionalNavItemContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n padding: `0 ${odysseyDesignTokens.Spacing3}`,\n}));\n\nconst TopNav = ({\n SearchFieldComponent,\n topNavLinkItems,\n AdditionalNavItemComponent,\n settingsPageHref,\n helpPageHref,\n userProfile,\n}: TopNavProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const processedNavItems = useMemo(\n () =>\n topNavLinkItems.map((item) => (\n <TopNavItemContent {...item} key={item.id} />\n )),\n [topNavLinkItems],\n );\n\n return (\n <TopNavContainer odysseyDesignTokens={odysseyDesignTokens}>\n {SearchFieldComponent && (\n <SearchFieldContainer odysseyDesignTokens={odysseyDesignTokens}>\n {SearchFieldComponent}\n </SearchFieldContainer>\n )}\n <TopNavListContainer>\n {processedNavItems?.map((item) => item)}\n </TopNavListContainer>\n <LinkAndProfileWrapper>\n {(AdditionalNavItemComponent || settingsPageHref || helpPageHref) && (\n <AdditionalLinkContainerWithBorder\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {AdditionalNavItemComponent && (\n <AdditionalNavItemContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {AdditionalNavItemComponent}\n </AdditionalNavItemContainer>\n )}\n {settingsPageHref && (\n <LinkContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Link href={settingsPageHref} ariaLabel=\"settings page\">\n <SettingsIcon />\n </Link>\n </LinkContainer>\n )}\n {helpPageHref && (\n <LinkContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Link href={helpPageHref} ariaLabel=\"help page\">\n <QuestionCircleIcon />\n </Link>\n </LinkContainer>\n )}\n </AdditionalLinkContainerWithBorder>\n )}\n {userProfile && <UserProfile {...userProfile} />}\n </LinkAndProfileWrapper>\n </TopNavContainer>\n );\n};\n\nconst MemoizedTopNav = memo(TopNav);\nMemoizedTopNav.displayName = \"TopNav\";\n\nexport { MemoizedTopNav as TopNav };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SACEC,IAAI,EACJC,OAAO,EAEPC,WAAW,QAGN,OAAO;AAAC,SAGNC,kBAAkB,EAAEC,YAAY;AAAA,SAChCC,IAAI;AAAA,SAGXC,sBAAsB;AAAA,SAEfC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,aAAA,IAAAC,cAAA;AAEpB,O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AAC8D,0BAA0B,IAAIC,gBAAgB,IAAIC,YAAY,KAC9DpF,KAAA,CAACmE,iCAAiC;QAChC5D,mBAAmB,EAAEA,mBAAoB;QAAAa,QAAA,GAExC8D,0BAA0B,IACzBpF,IAAA,CAACgF,0BAA0B;UACzBvE,mBAAmB,EAAEA,mBAAoB;UAAAa,QAAA,EAExC8D;QAA0B,CACD,CAC7B,EACAC,gBAAgB,IACfrF,IAAA,CAAC2E,aAAa;UAAClE,mBAAmB,EAAEA,mBAAoB;UAAAa,QAAA,EACtDtB,IAAA,CAACJ,IAAI;YAAC4D,IAAI,EAAE6B,gBAAiB;YAACM,SAAS,EAAC,eAAe;YAAArE,QAAA,EACrDtB,IAAA,CAACL,YAAY,IAAE;UAAC,CACZ;QAAC,CACM,CAChB,EACA2F,YAAY,IACXtF,IAAA,CAAC2E,aAAa;UAAClE,mBAAmB,EAAEA,mBAAoB;UAAAa,QAAA,EACtDtB,IAAA,CAACJ,IAAI;YAAC4D,IAAI,EAAE8B,YAAa;YAACK,SAAS,EAAC,WAAW;YAAArE,QAAA,EAC7CtB,IAAA,CAACN,kBAAkB,IAAE;UAAC,CAClB;QAAC,CACM,CAChB;MAAA,CACgC,CACpC,EACA6F,WAAW,IAAIvF,IAAA,CAACkB,WAAW;QAAA,GAAKqE;MAAW,CAAG,CAAC;IAAA,CAC3B,CAAC;EAAA,CACT,CAAC;AAEtB,CAAC;AAED,MAAMK,cAAc,GAAGrG,IAAI,CAAC0F,MAAM,CAAC;AACnCW,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIX,MAAM"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2023-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
|
-
import React, { ReactNode } from "react";
|
|
13
|
-
declare module "@mui/material/styles" {
|
|
14
|
-
interface Theme {
|
|
15
|
-
odysseyContrastMode: ContrastMode;
|
|
16
|
-
}
|
|
17
|
-
interface ThemeOptions {
|
|
18
|
-
odysseyContrastMode?: ContrastMode;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export type ContrastMode = "lowContrast" | "highContrast";
|
|
22
|
-
export type ContrastModeContextType = {
|
|
23
|
-
contrastMode: ContrastMode;
|
|
24
|
-
parentBackgroundColor: string;
|
|
25
|
-
};
|
|
26
|
-
export declare const useContrastContext: () => ContrastModeContextType;
|
|
27
|
-
export declare const useParentBackgroundColor: (ref: React.RefObject<HTMLElement>) => string;
|
|
28
|
-
type ContrastModeProviderProps = {
|
|
29
|
-
children: ReactNode;
|
|
30
|
-
contrastMode?: ContrastMode;
|
|
31
|
-
};
|
|
32
|
-
export declare const ContrastModeProvider: ({ children, contrastMode: explicitContrastMode, }: ContrastModeProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
-
export {};
|
|
34
|
-
//# sourceMappingURL=ContrastModeProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContrastModeProvider.d.ts","sourceRoot":"","sources":["../../src/ContrastModeProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAOZ,SAAS,EACV,MAAM,OAAO,CAAC;AAIf,OAAO,QAAQ,sBAAsB,CAAC;IACpC,UAAU,KAAK;QACb,mBAAmB,EAAE,YAAY,CAAC;KACnC;IACD,UAAU,YAAY;QACpB,mBAAmB,CAAC,EAAE,YAAY,CAAC;KACpC;CACF;AAED,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,cAAc,CAAC;AAE1D,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,YAAY,CAAC;IAC3B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAOF,eAAO,MAAM,kBAAkB,+BAAwC,CAAC;AAUxE,eAAO,MAAM,wBAAwB,QAAS,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,WAyBzE,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,sDAG9B,yBAAyB,4CAwC3B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createShadowDomElements.d.ts","sourceRoot":"","sources":["../../src/createShadowDomElements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,uBAAuB,qBAAsB,WAAW;;;CAmBpE,CAAC;AAEF,yDAAyD;AACzD,eAAO,MAAM,uBAAuB,qBAChB,WAAW,KAC5B,CAAC,gBAAgB,EAAE,cAAc,CAgBnC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NavAccordion.d.ts","sourceRoot":"","sources":["../../../src/labs/NavAccordion.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAIL,cAAc,IAAI,iBAAiB,EACpC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,SAAS,EAAQ,MAAM,OAAO,CAAC;AAExC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAS9C,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;IACzC;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,GAAG,WAAW,CAAC,CAAC;AAiE5C,QAAA,MAAM,oBAAoB,8IAxCvB,iBAAiB,6CAwC2B,CAAC;AAGhD,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
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
|
-
import { ReactElement, MouseEventHandler, KeyboardEventHandler } from "react";
|
|
13
|
-
import type { HtmlProps } from "../HtmlProps";
|
|
14
|
-
export declare const TOP_NAV_HEIGHT_TOKEN = "Spacing9";
|
|
15
|
-
export type TopNavLinkItem = {
|
|
16
|
-
id: string;
|
|
17
|
-
label: string;
|
|
18
|
-
/**
|
|
19
|
-
* link added to the nav item. if it is undefined, static text will be displayed.
|
|
20
|
-
* fires onClick event when it is passed
|
|
21
|
-
*/
|
|
22
|
-
href?: string;
|
|
23
|
-
/**
|
|
24
|
-
* determines whether the link item is diabled
|
|
25
|
-
*/
|
|
26
|
-
isDisabled?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Event fired when the nav item is clicked
|
|
29
|
-
*/
|
|
30
|
-
onClick?: MouseEventHandler<HTMLAnchorElement> & MouseEventHandler<HTMLDivElement> & KeyboardEventHandler<HTMLDivElement>;
|
|
31
|
-
/**
|
|
32
|
-
* The link target prop. e.g., "_blank"
|
|
33
|
-
*/
|
|
34
|
-
target?: string;
|
|
35
|
-
};
|
|
36
|
-
export type UserProfileProps = {
|
|
37
|
-
/**
|
|
38
|
-
* Logged in user profile icon to be displayed in the top nav
|
|
39
|
-
*/
|
|
40
|
-
profileIcon?: ReactElement;
|
|
41
|
-
/**
|
|
42
|
-
* Logged in user info to be displayed in the top nav
|
|
43
|
-
*/
|
|
44
|
-
userName: string;
|
|
45
|
-
/**
|
|
46
|
-
* Org name of the logged in user
|
|
47
|
-
*/
|
|
48
|
-
orgName: string;
|
|
49
|
-
};
|
|
50
|
-
export type TopNavProps = {
|
|
51
|
-
/**
|
|
52
|
-
* Pass in a SearchField component with the variant="filled" prop set
|
|
53
|
-
*/
|
|
54
|
-
SearchFieldComponent?: ReactElement;
|
|
55
|
-
/**
|
|
56
|
-
* Nav links in the top nav
|
|
57
|
-
*/
|
|
58
|
-
topNavLinkItems: TopNavLinkItem[];
|
|
59
|
-
/**
|
|
60
|
-
* Pass in an additional component like `Button` that will be displayed after the nav link items
|
|
61
|
-
*/
|
|
62
|
-
AdditionalNavItemComponent?: ReactElement;
|
|
63
|
-
/**
|
|
64
|
-
* URL to settings page.
|
|
65
|
-
*/
|
|
66
|
-
settingsPageHref?: string;
|
|
67
|
-
/**
|
|
68
|
-
* URL to the help page.
|
|
69
|
-
*/
|
|
70
|
-
helpPageHref?: string;
|
|
71
|
-
/**
|
|
72
|
-
* Displays user account info
|
|
73
|
-
*/
|
|
74
|
-
userProfile?: UserProfileProps;
|
|
75
|
-
} & Pick<HtmlProps, "testId">;
|
|
76
|
-
declare const MemoizedTopNav: import("react").MemoExoticComponent<({ SearchFieldComponent, topNavLinkItems, AdditionalNavItemComponent, settingsPageHref, helpPageHref, userProfile, }: TopNavProps) => import("react/jsx-runtime").JSX.Element>;
|
|
77
|
-
export { MemoizedTopNav as TopNav };
|
|
78
|
-
//# sourceMappingURL=TopNav.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopNav.d.ts","sourceRoot":"","sources":["../../../src/labs/TopNav.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAGL,YAAY,EAEZ,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAS9C,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAE/C,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,GAC5C,iBAAiB,CAAC,cAAc,CAAC,GACjC,oBAAoB,CAAC,cAAc,CAAC,CAAC;IACvC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,oBAAoB,CAAC,EAAE,YAAY,CAAC;IACpC;;OAEG;IACH,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC;;OAEG;IACH,0BAA0B,CAAC,EAAE,YAAY,CAAC;IAC1C;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AAuS9B,QAAA,MAAM,cAAc,4JAvDjB,WAAW,6CAuDqB,CAAC;AAGpC,OAAO,EAAE,cAAc,IAAI,MAAM,EAAE,CAAC"}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2023-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 React, {
|
|
14
|
-
createContext,
|
|
15
|
-
useContext,
|
|
16
|
-
useRef,
|
|
17
|
-
useLayoutEffect,
|
|
18
|
-
useState,
|
|
19
|
-
useMemo,
|
|
20
|
-
ReactNode,
|
|
21
|
-
} from "react";
|
|
22
|
-
import { createTheme, ThemeProvider, useTheme } from "@mui/material/styles";
|
|
23
|
-
import * as Tokens from "@okta/odyssey-design-tokens";
|
|
24
|
-
|
|
25
|
-
declare module "@mui/material/styles" {
|
|
26
|
-
interface Theme {
|
|
27
|
-
odysseyContrastMode: ContrastMode;
|
|
28
|
-
}
|
|
29
|
-
interface ThemeOptions {
|
|
30
|
-
odysseyContrastMode?: ContrastMode;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export type ContrastMode = "lowContrast" | "highContrast";
|
|
35
|
-
|
|
36
|
-
export type ContrastModeContextType = {
|
|
37
|
-
contrastMode: ContrastMode;
|
|
38
|
-
parentBackgroundColor: string;
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const ContrastModeContext = createContext<ContrastModeContextType>({
|
|
42
|
-
contrastMode: "highContrast",
|
|
43
|
-
parentBackgroundColor: "",
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export const useContrastContext = () => useContext(ContrastModeContext);
|
|
47
|
-
|
|
48
|
-
const hexToRgb = (hex: string): string => {
|
|
49
|
-
const bigint = parseInt(hex.slice(1), 16);
|
|
50
|
-
const r = (bigint >> 16) & 255;
|
|
51
|
-
const g = (bigint >> 8) & 255;
|
|
52
|
-
const b = bigint & 255;
|
|
53
|
-
return `rgb(${r}, ${g}, ${b})`;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
export const useParentBackgroundColor = (ref: React.RefObject<HTMLElement>) => {
|
|
57
|
-
const [backgroundColor, setBackgroundColor] = useState("");
|
|
58
|
-
|
|
59
|
-
const hueNeutral50Rgb = useMemo(() => hexToRgb(Tokens.HueNeutral50), []);
|
|
60
|
-
|
|
61
|
-
useLayoutEffect(() => {
|
|
62
|
-
if (ref.current) {
|
|
63
|
-
let element: HTMLElement | null = ref.current;
|
|
64
|
-
while (element) {
|
|
65
|
-
const bgColor = window.getComputedStyle(element).backgroundColor;
|
|
66
|
-
|
|
67
|
-
if (bgColor !== "rgba(0, 0, 0, 0)" && bgColor !== "transparent") {
|
|
68
|
-
if (bgColor === hueNeutral50Rgb) {
|
|
69
|
-
setBackgroundColor(Tokens.HueNeutral50);
|
|
70
|
-
} else {
|
|
71
|
-
setBackgroundColor(bgColor);
|
|
72
|
-
}
|
|
73
|
-
break;
|
|
74
|
-
}
|
|
75
|
-
element = element.parentElement;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}, [ref, hueNeutral50Rgb]);
|
|
79
|
-
|
|
80
|
-
return backgroundColor;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
type ContrastModeProviderProps = {
|
|
84
|
-
children: ReactNode;
|
|
85
|
-
contrastMode?: ContrastMode;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
export const ContrastModeProvider = ({
|
|
89
|
-
children,
|
|
90
|
-
contrastMode: explicitContrastMode,
|
|
91
|
-
}: ContrastModeProviderProps) => {
|
|
92
|
-
const ref = useRef<HTMLDivElement>(null);
|
|
93
|
-
const parentBackgroundColor = useParentBackgroundColor(ref);
|
|
94
|
-
const [contrastMode, setContrastMode] =
|
|
95
|
-
useState<ContrastMode>("highContrast");
|
|
96
|
-
|
|
97
|
-
useLayoutEffect(() => {
|
|
98
|
-
if (explicitContrastMode) {
|
|
99
|
-
setContrastMode(explicitContrastMode);
|
|
100
|
-
} else {
|
|
101
|
-
const isLowContrast = parentBackgroundColor === Tokens.HueNeutral50;
|
|
102
|
-
setContrastMode(isLowContrast ? "lowContrast" : "highContrast");
|
|
103
|
-
}
|
|
104
|
-
}, [parentBackgroundColor, explicitContrastMode]);
|
|
105
|
-
|
|
106
|
-
const contextValue = useMemo<ContrastModeContextType>(
|
|
107
|
-
() => ({
|
|
108
|
-
contrastMode,
|
|
109
|
-
parentBackgroundColor,
|
|
110
|
-
}),
|
|
111
|
-
[contrastMode, parentBackgroundColor],
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
const existingTheme = useTheme();
|
|
115
|
-
const theme = useMemo(
|
|
116
|
-
() =>
|
|
117
|
-
createTheme({
|
|
118
|
-
...existingTheme,
|
|
119
|
-
odysseyContrastMode: contrastMode,
|
|
120
|
-
}),
|
|
121
|
-
[existingTheme, contrastMode],
|
|
122
|
-
);
|
|
123
|
-
|
|
124
|
-
return (
|
|
125
|
-
<div ref={ref}>
|
|
126
|
-
<ContrastModeContext.Provider value={contextValue}>
|
|
127
|
-
<ThemeProvider theme={theme}>{children}</ThemeProvider>
|
|
128
|
-
</ContrastModeContext.Provider>
|
|
129
|
-
</div>
|
|
130
|
-
);
|
|
131
|
-
};
|