@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
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
import { Box } from "../Box";
|
|
24
24
|
import { paginationTypeValues } from "./constants";
|
|
25
25
|
import { usePagination } from "./usePagination";
|
|
26
|
+
import { useTranslation } from "react-i18next";
|
|
26
27
|
|
|
27
28
|
const PaginationContainer = styled("div")({
|
|
28
29
|
display: "flex",
|
|
@@ -68,11 +69,25 @@ export type PaginationProps = {
|
|
|
68
69
|
/**
|
|
69
70
|
* The labeled rendered for the current page index
|
|
70
71
|
*/
|
|
71
|
-
currentPageLabel
|
|
72
|
+
currentPageLabel?: string;
|
|
72
73
|
/**
|
|
73
74
|
* The number of items currently visible on the page
|
|
74
75
|
*/
|
|
75
76
|
currentRowsCount?: number;
|
|
77
|
+
/**
|
|
78
|
+
* If true, the page input will be visible and the user can directly manipulate which page
|
|
79
|
+
* is visible.
|
|
80
|
+
*/
|
|
81
|
+
hasPageInput?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* If true, the row count input will be visible and the user can directly manipulate how many rows
|
|
84
|
+
* are visible.
|
|
85
|
+
*/
|
|
86
|
+
hasRowCountInput?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* If true, the "X - X of total X" label will be visible
|
|
89
|
+
*/
|
|
90
|
+
hasRowCountLabel?: boolean;
|
|
76
91
|
/**
|
|
77
92
|
* If true, the pagination controls will be disabled
|
|
78
93
|
*/
|
|
@@ -84,11 +99,11 @@ export type PaginationProps = {
|
|
|
84
99
|
/**
|
|
85
100
|
* The current page last row index
|
|
86
101
|
*/
|
|
87
|
-
lastRow
|
|
102
|
+
lastRow?: number;
|
|
88
103
|
/**
|
|
89
104
|
* If the pagination is of "loadMore" variant, then this is the the load more label
|
|
90
105
|
*/
|
|
91
|
-
loadMoreLabel
|
|
106
|
+
loadMoreLabel?: string;
|
|
92
107
|
/**
|
|
93
108
|
* The max page
|
|
94
109
|
*/
|
|
@@ -100,7 +115,7 @@ export type PaginationProps = {
|
|
|
100
115
|
/**
|
|
101
116
|
* The label for the next control
|
|
102
117
|
*/
|
|
103
|
-
nextLabel
|
|
118
|
+
nextLabel?: string;
|
|
104
119
|
/**
|
|
105
120
|
* Page index and page size setter
|
|
106
121
|
*/
|
|
@@ -122,11 +137,11 @@ export type PaginationProps = {
|
|
|
122
137
|
/**
|
|
123
138
|
* The label for the previous control
|
|
124
139
|
*/
|
|
125
|
-
previousLabel
|
|
140
|
+
previousLabel?: string;
|
|
126
141
|
/**
|
|
127
142
|
* The label that shows how many results are rendered per page
|
|
128
143
|
*/
|
|
129
|
-
rowsPerPageLabel
|
|
144
|
+
rowsPerPageLabel?: string;
|
|
130
145
|
/**
|
|
131
146
|
* Total rows count
|
|
132
147
|
*/
|
|
@@ -139,34 +154,51 @@ export type PaginationProps = {
|
|
|
139
154
|
};
|
|
140
155
|
|
|
141
156
|
const Pagination = ({
|
|
142
|
-
currentPageLabel,
|
|
157
|
+
currentPageLabel: currentPageLabelProp,
|
|
158
|
+
currentRowsCount,
|
|
159
|
+
hasPageInput = true,
|
|
160
|
+
hasRowCountInput = true,
|
|
161
|
+
hasRowCountLabel = true,
|
|
143
162
|
isDisabled,
|
|
144
163
|
isMoreDisabled,
|
|
145
164
|
lastRow,
|
|
146
|
-
loadMoreLabel,
|
|
165
|
+
loadMoreLabel: loadMoreLabelProp,
|
|
147
166
|
maxPageIndex,
|
|
148
167
|
maxPageSize,
|
|
149
|
-
nextLabel,
|
|
150
|
-
onPaginationChange,
|
|
168
|
+
nextLabel: nextLabelProp,
|
|
169
|
+
onPaginationChange: onPaginationChangeProp,
|
|
151
170
|
pageIndex,
|
|
152
171
|
pageSize,
|
|
153
|
-
previousLabel,
|
|
154
|
-
rowsPerPageLabel,
|
|
172
|
+
previousLabel: previousLabelProp,
|
|
173
|
+
rowsPerPageLabel: rowsPerPageLabelProp,
|
|
155
174
|
totalRows,
|
|
156
|
-
currentRowsCount,
|
|
157
175
|
variant,
|
|
158
176
|
}: PaginationProps) => {
|
|
159
177
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
178
|
+
const { t } = useTranslation();
|
|
160
179
|
|
|
161
180
|
const [page, setPage] = useState<number>(pageIndex);
|
|
162
181
|
const [rowsPerPage, setRowsPerPage] = useState<number>(pageSize);
|
|
163
182
|
const initialRowsPerPage = useRef<number>(pageSize);
|
|
164
183
|
|
|
184
|
+
const currentPageLabel = currentPageLabelProp ?? t("pagination.page");
|
|
185
|
+
const loadMoreLabel = loadMoreLabelProp ?? t("pagination.loadmore");
|
|
186
|
+
const nextLabel = nextLabelProp ?? t("pagination.next");
|
|
187
|
+
const previousLabel = previousLabelProp ?? t("pagination.previous");
|
|
188
|
+
const rowsPerPageLabel = rowsPerPageLabelProp ?? t("pagination.rowsperpage");
|
|
189
|
+
|
|
165
190
|
useEffect(() => {
|
|
166
191
|
setPage(pageIndex);
|
|
167
192
|
setRowsPerPage(pageSize);
|
|
168
193
|
}, [pageIndex, pageSize]);
|
|
169
194
|
|
|
195
|
+
const onPaginationChange = useCallback(
|
|
196
|
+
({ pageIndex, pageSize }: { pageIndex: number; pageSize: number }) => {
|
|
197
|
+
onPaginationChangeProp({ pageIndex, pageSize });
|
|
198
|
+
},
|
|
199
|
+
[onPaginationChangeProp],
|
|
200
|
+
);
|
|
201
|
+
|
|
170
202
|
const { totalRowsLabel } = usePagination({
|
|
171
203
|
pageIndex,
|
|
172
204
|
pageSize,
|
|
@@ -175,18 +207,30 @@ const Pagination = ({
|
|
|
175
207
|
});
|
|
176
208
|
|
|
177
209
|
const handlePaginationChange = useCallback(() => {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
210
|
+
let updatedPage = page;
|
|
211
|
+
let updatedRowsPerPage = rowsPerPage;
|
|
212
|
+
|
|
213
|
+
if (totalRows) {
|
|
214
|
+
const maxPageIndex = Math.ceil(totalRows / updatedRowsPerPage);
|
|
215
|
+
|
|
216
|
+
// Ensure rowsPerPage does not exceed totalRows
|
|
217
|
+
if (updatedRowsPerPage > totalRows) {
|
|
218
|
+
updatedRowsPerPage = totalRows;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Ensure page is within valid range
|
|
222
|
+
if (updatedPage > maxPageIndex) {
|
|
223
|
+
updatedPage = maxPageIndex;
|
|
224
|
+
} else if (updatedPage < 1) {
|
|
225
|
+
updatedPage = 1;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
184
228
|
|
|
185
229
|
onPaginationChange({
|
|
186
230
|
pageIndex: updatedPage,
|
|
187
231
|
pageSize: updatedRowsPerPage,
|
|
188
232
|
});
|
|
189
|
-
}, [page, rowsPerPage,
|
|
233
|
+
}, [page, rowsPerPage, onPaginationChange, totalRows]);
|
|
190
234
|
|
|
191
235
|
// The following handlers use React.KeyboardEvent (rather than just KeyboardEvent) becuase React.KeyboardEvent
|
|
192
236
|
// is generic, while plain KeyboardEvent is not. We need this generic so we can specify the HTMLInputElement,
|
|
@@ -259,7 +303,7 @@ const Pagination = ({
|
|
|
259
303
|
const nextButtonDisabled = useMemo(
|
|
260
304
|
() =>
|
|
261
305
|
isMoreDisabled ||
|
|
262
|
-
(totalRows ? lastRow >= totalRows : false) ||
|
|
306
|
+
(lastRow && (totalRows ? lastRow >= totalRows : false)) ||
|
|
263
307
|
isDisabled,
|
|
264
308
|
[isMoreDisabled, totalRows, lastRow, isDisabled],
|
|
265
309
|
);
|
|
@@ -288,28 +332,32 @@ const Pagination = ({
|
|
|
288
332
|
return variant === "paged" ? (
|
|
289
333
|
<PaginationContainer>
|
|
290
334
|
<PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>
|
|
291
|
-
|
|
335
|
+
{hasRowCountInput && (
|
|
336
|
+
<Box>
|
|
337
|
+
<Paragraph component="span" color="textSecondary">
|
|
338
|
+
{rowsPerPageLabel}
|
|
339
|
+
</Paragraph>
|
|
340
|
+
<PaginationInput
|
|
341
|
+
odysseyDesignTokens={odysseyDesignTokens}
|
|
342
|
+
type="number"
|
|
343
|
+
value={rowsPerPage}
|
|
344
|
+
onChange={setRowsPerPageFromEvent}
|
|
345
|
+
onBlur={handlePaginationChange}
|
|
346
|
+
onKeyDown={handleRowsPerPageSubmit}
|
|
347
|
+
disabled={isDisabled}
|
|
348
|
+
inputProps={rowsPerPageInputProps}
|
|
349
|
+
/>
|
|
350
|
+
</Box>
|
|
351
|
+
)}
|
|
352
|
+
{hasRowCountLabel && (
|
|
292
353
|
<Paragraph component="span" color="textSecondary">
|
|
293
|
-
{
|
|
354
|
+
{totalRowsLabel}
|
|
294
355
|
</Paragraph>
|
|
295
|
-
|
|
296
|
-
odysseyDesignTokens={odysseyDesignTokens}
|
|
297
|
-
type="number"
|
|
298
|
-
value={rowsPerPage}
|
|
299
|
-
onChange={setRowsPerPageFromEvent}
|
|
300
|
-
onBlur={handlePaginationChange}
|
|
301
|
-
onKeyDown={handleRowsPerPageSubmit}
|
|
302
|
-
disabled={isDisabled}
|
|
303
|
-
inputProps={rowsPerPageInputProps}
|
|
304
|
-
/>
|
|
305
|
-
</Box>
|
|
306
|
-
<Paragraph component="span" color="textSecondary">
|
|
307
|
-
{totalRowsLabel}
|
|
308
|
-
</Paragraph>
|
|
356
|
+
)}
|
|
309
357
|
</PaginationSegment>
|
|
310
358
|
|
|
311
359
|
<PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>
|
|
312
|
-
{totalRows && (
|
|
360
|
+
{totalRows && hasPageInput && (
|
|
313
361
|
<Box>
|
|
314
362
|
<Paragraph component="span" color="textSecondary">
|
|
315
363
|
{currentPageLabel}
|
package/src/Surface.tsx
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
DesignTokens,
|
|
19
19
|
useOdysseyDesignTokens,
|
|
20
20
|
} from "./OdysseyDesignTokensContext";
|
|
21
|
+
import { OdysseyThemeProvider } from "./OdysseyThemeProvider";
|
|
21
22
|
|
|
22
23
|
const StyledContainer = styled(MuiPaper, {
|
|
23
24
|
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
@@ -37,7 +38,7 @@ const Surface = ({ children }: SurfaceProps) => {
|
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
40
|
<StyledContainer odysseyDesignTokens={odysseyDesignTokens}>
|
|
40
|
-
{children}
|
|
41
|
+
<OdysseyThemeProvider>{children}</OdysseyThemeProvider>
|
|
41
42
|
</StyledContainer>
|
|
42
43
|
);
|
|
43
44
|
};
|
package/src/Tag.tsx
CHANGED
|
@@ -13,26 +13,30 @@
|
|
|
13
13
|
import { Chip as MuiChip, ChipProps as MuiChipProps } from "@mui/material";
|
|
14
14
|
import { memo, ReactElement, useCallback, useContext } from "react";
|
|
15
15
|
import styled from "@emotion/styled";
|
|
16
|
-
|
|
17
|
-
import {
|
|
16
|
+
|
|
17
|
+
import { CloseCircleFilledIcon } from "./icons.generated";
|
|
18
18
|
import { HtmlProps } from "./HtmlProps";
|
|
19
|
+
import { MuiPropsContext, MuiPropsContextType } from "./MuiPropsContext";
|
|
19
20
|
import {
|
|
20
21
|
DesignTokens,
|
|
21
22
|
useOdysseyDesignTokens,
|
|
22
23
|
} from "./OdysseyDesignTokensContext";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
24
|
+
import { TagListContext } from "./TagListContext";
|
|
25
|
+
import { ContrastMode, useContrastModeContext } from "./useContrastMode";
|
|
26
|
+
|
|
27
|
+
const tagSizeValues = ["medium", "small"] as const;
|
|
25
28
|
|
|
26
29
|
export const tagColorVariants = [
|
|
27
|
-
"
|
|
28
|
-
"info",
|
|
30
|
+
"accentFour",
|
|
29
31
|
"accentOne",
|
|
30
|
-
"accentTwo",
|
|
31
32
|
"accentThree",
|
|
32
|
-
"
|
|
33
|
+
"accentTwo",
|
|
34
|
+
"default",
|
|
35
|
+
"info",
|
|
33
36
|
] as const;
|
|
34
37
|
|
|
35
38
|
type TagColorVariant = (typeof tagColorVariants)[number];
|
|
39
|
+
type TagSize = (typeof tagSizeValues)[number];
|
|
36
40
|
|
|
37
41
|
export type TagProps = {
|
|
38
42
|
icon?: ReactElement;
|
|
@@ -53,21 +57,29 @@ export type TagProps = {
|
|
|
53
57
|
* Color variant of the Tag, affecting its appearance
|
|
54
58
|
*/
|
|
55
59
|
colorVariant?: TagColorVariant;
|
|
60
|
+
/*
|
|
61
|
+
* Size variant of the Tag
|
|
62
|
+
*/
|
|
63
|
+
size?: TagSize;
|
|
56
64
|
} & Pick<HtmlProps, "testId" | "translate">;
|
|
57
65
|
|
|
58
|
-
const getChipColors = (
|
|
59
|
-
colorVariant
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
const getChipColors = ({
|
|
67
|
+
colorVariant,
|
|
68
|
+
contrastMode,
|
|
69
|
+
odysseyDesignTokens,
|
|
70
|
+
}: {
|
|
71
|
+
colorVariant: TagColorVariant;
|
|
72
|
+
contrastMode: ContrastMode;
|
|
73
|
+
odysseyDesignTokens: DesignTokens;
|
|
74
|
+
}) => {
|
|
63
75
|
const colors = {
|
|
64
76
|
default: {
|
|
65
|
-
...(contrastMode === "
|
|
77
|
+
...(contrastMode === "highContrast" && {
|
|
66
78
|
background: odysseyDesignTokens.HueNeutral200,
|
|
67
79
|
text: odysseyDesignTokens.HueNeutral700,
|
|
68
80
|
textDisabled: odysseyDesignTokens.HueNeutral400,
|
|
69
81
|
}),
|
|
70
|
-
...(contrastMode === "
|
|
82
|
+
...(contrastMode === "lowContrast" && {
|
|
71
83
|
background: odysseyDesignTokens.HueNeutral100,
|
|
72
84
|
text: odysseyDesignTokens.HueNeutral700,
|
|
73
85
|
textDisabled: odysseyDesignTokens.HueNeutral300,
|
|
@@ -81,12 +93,12 @@ const getChipColors = (
|
|
|
81
93
|
iconDisabled: odysseyDesignTokens.HueNeutral300,
|
|
82
94
|
},
|
|
83
95
|
info: {
|
|
84
|
-
...(contrastMode === "
|
|
96
|
+
...(contrastMode === "highContrast" && {
|
|
85
97
|
background: odysseyDesignTokens.HueBlue200,
|
|
86
98
|
text: odysseyDesignTokens.HueBlue700,
|
|
87
99
|
textDisabled: odysseyDesignTokens.HueBlue400,
|
|
88
100
|
}),
|
|
89
|
-
...(contrastMode === "
|
|
101
|
+
...(contrastMode === "lowContrast" && {
|
|
90
102
|
background: odysseyDesignTokens.HueBlue100,
|
|
91
103
|
text: odysseyDesignTokens.HueBlue700,
|
|
92
104
|
textDisabled: odysseyDesignTokens.HueBlue300,
|
|
@@ -100,12 +112,12 @@ const getChipColors = (
|
|
|
100
112
|
iconDisabled: odysseyDesignTokens.HueBlue300,
|
|
101
113
|
},
|
|
102
114
|
accentOne: {
|
|
103
|
-
...(contrastMode === "
|
|
115
|
+
...(contrastMode === "highContrast" && {
|
|
104
116
|
background: odysseyDesignTokens.HueAccentOne200,
|
|
105
117
|
text: odysseyDesignTokens.HueAccentOne700,
|
|
106
118
|
textDisabled: odysseyDesignTokens.HueAccentOne400,
|
|
107
119
|
}),
|
|
108
|
-
...(contrastMode === "
|
|
120
|
+
...(contrastMode === "lowContrast" && {
|
|
109
121
|
background: odysseyDesignTokens.HueAccentOne100,
|
|
110
122
|
text: odysseyDesignTokens.HueAccentOne700,
|
|
111
123
|
textDisabled: odysseyDesignTokens.HueAccentOne300,
|
|
@@ -119,12 +131,12 @@ const getChipColors = (
|
|
|
119
131
|
iconDisabled: odysseyDesignTokens.HueAccentOne300,
|
|
120
132
|
},
|
|
121
133
|
accentTwo: {
|
|
122
|
-
...(contrastMode === "
|
|
134
|
+
...(contrastMode === "highContrast" && {
|
|
123
135
|
background: odysseyDesignTokens.HueAccentTwo200,
|
|
124
136
|
text: odysseyDesignTokens.HueAccentTwo800,
|
|
125
137
|
textDisabled: odysseyDesignTokens.HueAccentTwo400,
|
|
126
138
|
}),
|
|
127
|
-
...(contrastMode === "
|
|
139
|
+
...(contrastMode === "lowContrast" && {
|
|
128
140
|
background: odysseyDesignTokens.HueAccentTwo100,
|
|
129
141
|
text: odysseyDesignTokens.HueAccentTwo700,
|
|
130
142
|
textDisabled: odysseyDesignTokens.HueAccentTwo300,
|
|
@@ -138,12 +150,12 @@ const getChipColors = (
|
|
|
138
150
|
iconDisabled: odysseyDesignTokens.HueAccentTwo300,
|
|
139
151
|
},
|
|
140
152
|
accentThree: {
|
|
141
|
-
...(contrastMode === "
|
|
153
|
+
...(contrastMode === "highContrast" && {
|
|
142
154
|
background: odysseyDesignTokens.HueAccentThree200,
|
|
143
155
|
text: odysseyDesignTokens.HueAccentThree700,
|
|
144
156
|
textDisabled: odysseyDesignTokens.HueAccentThree400,
|
|
145
157
|
}),
|
|
146
|
-
...(contrastMode === "
|
|
158
|
+
...(contrastMode === "lowContrast" && {
|
|
147
159
|
background: odysseyDesignTokens.HueAccentThree100,
|
|
148
160
|
text: odysseyDesignTokens.HueAccentThree700,
|
|
149
161
|
textDisabled: odysseyDesignTokens.HueAccentThree300,
|
|
@@ -157,12 +169,12 @@ const getChipColors = (
|
|
|
157
169
|
iconDisabled: odysseyDesignTokens.HueAccentThree300,
|
|
158
170
|
},
|
|
159
171
|
accentFour: {
|
|
160
|
-
...(contrastMode === "
|
|
172
|
+
...(contrastMode === "highContrast" && {
|
|
161
173
|
background: odysseyDesignTokens.HueAccentFour200,
|
|
162
174
|
text: odysseyDesignTokens.HueAccentFour700,
|
|
163
175
|
textDisabled: odysseyDesignTokens.HueAccentFour400,
|
|
164
176
|
}),
|
|
165
|
-
...(contrastMode === "
|
|
177
|
+
...(contrastMode === "lowContrast" && {
|
|
166
178
|
background: odysseyDesignTokens.HueAccentFour100,
|
|
167
179
|
text: odysseyDesignTokens.HueAccentFour700,
|
|
168
180
|
textDisabled: odysseyDesignTokens.HueAccentFour300,
|
|
@@ -182,17 +194,22 @@ const getChipColors = (
|
|
|
182
194
|
|
|
183
195
|
const StyledTag = styled(MuiChip, {
|
|
184
196
|
shouldForwardProp: (prop) =>
|
|
185
|
-
!["colorVariant", "contrastMode", "odysseyDesignTokens"].includes(
|
|
197
|
+
!["colorVariant", "contrastMode", "odysseyDesignTokens", "size"].includes(
|
|
186
198
|
prop as string,
|
|
187
199
|
),
|
|
188
200
|
})<{
|
|
201
|
+
as?: React.ElementType; // Allow the 'as' prop to be forwarded
|
|
202
|
+
clickable?: boolean;
|
|
189
203
|
colorVariant: TagColorVariant;
|
|
190
204
|
contrastMode: ContrastMode;
|
|
191
205
|
odysseyDesignTokens: DesignTokens;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
206
|
+
size?: TagSize;
|
|
207
|
+
}>(({ colorVariant, contrastMode, odysseyDesignTokens, clickable, size }) => {
|
|
208
|
+
const colors = getChipColors({
|
|
209
|
+
colorVariant,
|
|
210
|
+
odysseyDesignTokens,
|
|
211
|
+
contrastMode,
|
|
212
|
+
});
|
|
196
213
|
|
|
197
214
|
return {
|
|
198
215
|
backgroundColor: colors.background,
|
|
@@ -206,6 +223,10 @@ const StyledTag = styled(MuiChip, {
|
|
|
206
223
|
borderColor: "transparent",
|
|
207
224
|
}),
|
|
208
225
|
|
|
226
|
+
...(size === "small" && {
|
|
227
|
+
paddingBlock: `calc(${odysseyDesignTokens.Spacing1})`,
|
|
228
|
+
}),
|
|
229
|
+
|
|
209
230
|
"&.MuiChip-clickable:hover": {
|
|
210
231
|
backgroundColor: colors.hover,
|
|
211
232
|
},
|
|
@@ -225,6 +246,7 @@ const StyledTag = styled(MuiChip, {
|
|
|
225
246
|
"& .MuiChip-icon": {
|
|
226
247
|
color: colors.icon,
|
|
227
248
|
},
|
|
249
|
+
|
|
228
250
|
"& .MuiChip-deleteIcon": {
|
|
229
251
|
color: colors.deleteIcon,
|
|
230
252
|
"&:hover": {
|
|
@@ -241,45 +263,48 @@ const Tag = ({
|
|
|
241
263
|
label,
|
|
242
264
|
onClick,
|
|
243
265
|
onRemove,
|
|
266
|
+
size = "medium",
|
|
244
267
|
testId,
|
|
245
268
|
translate,
|
|
246
269
|
}: TagProps) => {
|
|
247
270
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
248
271
|
const { chipElementType } = useContext(TagListContext);
|
|
249
|
-
const { contrastMode } =
|
|
272
|
+
const { contrastMode } = useContrastModeContext();
|
|
250
273
|
|
|
251
274
|
const renderTag = useCallback(
|
|
252
275
|
(muiProps: MuiPropsContextType) => (
|
|
253
276
|
<StyledTag
|
|
254
277
|
{...muiProps}
|
|
255
|
-
as={chipElementType}
|
|
256
278
|
aria-disabled={isDisabled}
|
|
279
|
+
as={chipElementType}
|
|
257
280
|
clickable={Boolean(onClick)}
|
|
258
|
-
data-se={testId}
|
|
259
281
|
colorVariant={colorVariant}
|
|
260
|
-
|
|
261
|
-
|
|
282
|
+
contrastMode={contrastMode}
|
|
283
|
+
data-se={testId}
|
|
284
|
+
deleteIcon={<CloseCircleFilledIcon />}
|
|
262
285
|
disabled={isDisabled}
|
|
263
286
|
icon={icon}
|
|
264
287
|
label={label}
|
|
288
|
+
odysseyDesignTokens={odysseyDesignTokens}
|
|
265
289
|
onClick={onClick}
|
|
266
290
|
onDelete={onRemove}
|
|
267
|
-
|
|
291
|
+
size={size}
|
|
268
292
|
translate={translate}
|
|
269
293
|
/>
|
|
270
294
|
),
|
|
271
295
|
[
|
|
272
296
|
chipElementType,
|
|
297
|
+
colorVariant,
|
|
298
|
+
contrastMode,
|
|
273
299
|
icon,
|
|
274
300
|
isDisabled,
|
|
275
301
|
label,
|
|
302
|
+
odysseyDesignTokens,
|
|
276
303
|
onClick,
|
|
277
304
|
onRemove,
|
|
305
|
+
size,
|
|
278
306
|
testId,
|
|
279
307
|
translate,
|
|
280
|
-
colorVariant,
|
|
281
|
-
odysseyDesignTokens,
|
|
282
|
-
contrastMode,
|
|
283
308
|
],
|
|
284
309
|
);
|
|
285
310
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { createUniqueAlphabeticalId } from "./createUniqueAlphabeticalId";
|
|
14
14
|
|
|
15
15
|
describe("createUniqueAlphabeticalId", () => {
|
|
16
|
-
|
|
16
|
+
test("only has lowercase letters", () => {
|
|
17
17
|
const uniqueAlphabeticalId = createUniqueAlphabeticalId();
|
|
18
18
|
|
|
19
19
|
expect(uniqueAlphabeticalId.match(/[a-z]/)).not.toBeNull();
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { createUniqueId, uniqueIdLength } from "./createUniqueId";
|
|
14
14
|
|
|
15
15
|
describe("createUniqueId", () => {
|
|
16
|
-
|
|
16
|
+
test("returns a nice id string", () => {
|
|
17
17
|
const result = createUniqueId();
|
|
18
18
|
|
|
19
19
|
expect(typeof result).toBe("string");
|
package/src/index.ts
CHANGED
|
@@ -65,21 +65,19 @@ export * from "./Banner";
|
|
|
65
65
|
export * from "./Box";
|
|
66
66
|
export * from "./Breadcrumbs";
|
|
67
67
|
export * from "./Button";
|
|
68
|
-
export * from "./Card";
|
|
69
68
|
export * from "./Callout";
|
|
69
|
+
export * from "./Card";
|
|
70
70
|
export * from "./Checkbox";
|
|
71
71
|
export * from "./CheckboxGroup";
|
|
72
72
|
export * from "./CircularProgress";
|
|
73
|
-
export * from "./ContrastModeProvider";
|
|
74
|
-
export * from "./CssBaseline";
|
|
75
|
-
export * from "./createShadowDomElements";
|
|
76
73
|
export * from "./createUniqueId";
|
|
74
|
+
export * from "./CssBaseline";
|
|
77
75
|
export * from "./DataTable";
|
|
78
76
|
export * from "./Dialog";
|
|
79
77
|
export * from "./Drawer";
|
|
80
78
|
export * from "./EmptyState";
|
|
81
|
-
export * from "./Fieldset";
|
|
82
79
|
export * from "./FieldComponentProps";
|
|
80
|
+
export * from "./Fieldset";
|
|
83
81
|
export {
|
|
84
82
|
FileUploader,
|
|
85
83
|
fileUploadTypes,
|
|
@@ -97,6 +95,7 @@ export * from "./OdysseyCacheProvider";
|
|
|
97
95
|
export * from "./OdysseyProvider";
|
|
98
96
|
export * from "./OdysseyThemeProvider";
|
|
99
97
|
export * from "./OdysseyTranslationProvider";
|
|
98
|
+
export * from "./Pagination";
|
|
100
99
|
export * from "./PasswordField";
|
|
101
100
|
export * from "./Radio";
|
|
102
101
|
export * from "./RadioGroup";
|
|
@@ -106,6 +105,7 @@ export * from "./Select";
|
|
|
106
105
|
export * from "./Stack";
|
|
107
106
|
export * from "./Status";
|
|
108
107
|
export * from "./Surface";
|
|
108
|
+
export * from "./Switch";
|
|
109
109
|
export * from "./Tabs";
|
|
110
110
|
export * from "./Tag";
|
|
111
111
|
export * from "./TagList";
|
|
@@ -113,8 +113,7 @@ export * from "./TextField";
|
|
|
113
113
|
export * from "./theme";
|
|
114
114
|
export * from "./Toast";
|
|
115
115
|
export * from "./ToastStack";
|
|
116
|
-
export * from "./Switch";
|
|
117
116
|
export * from "./Tooltip";
|
|
118
117
|
export * from "./Typography";
|
|
119
118
|
export * from "./useUniqueId";
|
|
120
|
-
export * from "./
|
|
119
|
+
export * from "./web-component";
|