@okta/odyssey-react-mui 1.21.2 → 1.22.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 +15 -0
- package/dist/Autocomplete.js +76 -38
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Checkbox.js +26 -11
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.js +14 -3
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/DataTable/DataTable.js +10 -2
- package/dist/DataTable/DataTable.js.map +1 -1
- package/dist/DataTable/useScrollIndication.js +2 -2
- package/dist/DataTable/useScrollIndication.js.map +1 -1
- package/dist/Field.js +3 -1
- package/dist/Field.js.map +1 -1
- package/dist/OdysseyCacheProvider.js +4 -3
- package/dist/OdysseyCacheProvider.js.map +1 -1
- package/dist/OdysseyProvider.js +6 -3
- package/dist/OdysseyProvider.js.map +1 -1
- package/dist/OdysseyThemeProvider.js +3 -2
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/Radio.js +34 -7
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +17 -5
- package/dist/RadioGroup.js.map +1 -1
- package/dist/Select.js +53 -31
- package/dist/Select.js.map +1 -1
- package/dist/ToastStack.js.map +1 -1
- package/dist/{createShadowRootElement.js → createShadowDomElements.js} +22 -6
- package/dist/createShadowDomElements.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.scss +5 -5
- package/dist/labs/AppTile.js +124 -0
- package/dist/labs/AppTile.js.map +1 -0
- package/dist/labs/DataView/BulkActionsMenu.js.map +1 -0
- package/dist/labs/{DataComponents/StackContent.js → DataView/CardLayoutContent.js} +14 -14
- package/dist/labs/DataView/CardLayoutContent.js.map +1 -0
- package/dist/labs/{DataComponents/StackCard.js → DataView/DataCard.js} +6 -6
- package/dist/labs/DataView/DataCard.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/DataTable.js +6 -2
- package/dist/labs/DataView/DataTable.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/DataView.js +25 -15
- package/dist/labs/DataView/DataView.js.map +1 -0
- package/dist/labs/DataView/DetailPanel.js.map +1 -0
- package/dist/labs/DataView/LayoutSwitcher.js.map +1 -0
- package/dist/labs/DataView/RowActions.js.map +1 -0
- package/dist/labs/{DataComponents/TableContent.js → DataView/TableLayoutContent.js} +17 -17
- package/dist/labs/DataView/TableLayoutContent.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/TableSettings.js +2 -2
- package/dist/labs/DataView/TableSettings.js.map +1 -0
- package/dist/labs/DataView/componentTypes.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/constants.js +2 -2
- package/dist/labs/DataView/constants.js.map +1 -0
- package/dist/labs/DataView/dataTypes.js.map +1 -0
- package/dist/labs/DataView/fetchData.js.map +1 -0
- package/dist/labs/{DataComponents → DataView}/index.js +0 -1
- package/dist/labs/DataView/index.js.map +1 -0
- package/dist/labs/DataView/tableConstants.js.map +1 -0
- package/dist/labs/DataView/useFilterConversion.js.map +1 -0
- package/dist/labs/SideNav/CollapseIcon.js +44 -0
- package/dist/labs/SideNav/CollapseIcon.js.map +1 -0
- package/dist/labs/SideNav/SideNav.js +246 -0
- package/dist/labs/SideNav/SideNav.js.map +1 -0
- package/dist/labs/SideNav/SideNavFooterContent.js +49 -0
- package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -0
- package/dist/labs/SideNav/SideNavHeader.js +58 -0
- package/dist/labs/SideNav/SideNavHeader.js.map +1 -0
- package/dist/labs/SideNav/SideNavItemContent.js +157 -0
- package/dist/labs/SideNav/SideNavItemContent.js.map +1 -0
- package/dist/labs/SideNav/SideNavItemLinkContent.js +71 -0
- package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -0
- package/dist/labs/SideNav/index.js +14 -0
- package/dist/labs/SideNav/index.js.map +1 -0
- package/dist/labs/SideNav/types.js +2 -0
- package/dist/labs/SideNav/types.js.map +1 -0
- package/dist/labs/Switch.js +70 -16
- package/dist/labs/Switch.js.map +1 -1
- package/dist/labs/index.js +3 -2
- package/dist/labs/index.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_cs.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_da.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_de.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_el.js +18 -4
- package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_es.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_fi.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_fr.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ht.js +18 -4
- package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_hu.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_id.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_it.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ja.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ko.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ms.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_nb.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_nl_NL.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_pl.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_pt_BR.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ro.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ru.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_sv.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_th.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_tr.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_uk.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_vi.js +17 -3
- package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_zh_CN.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_zh_TW.js +16 -2
- package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +2 -2
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/CheckboxGroup.d.ts +3 -3
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/DataTable/DataTable.d.ts +9 -1
- package/dist/src/DataTable/DataTable.d.ts.map +1 -1
- package/dist/src/Field.d.ts +3 -2
- package/dist/src/Field.d.ts.map +1 -1
- package/dist/src/OdysseyCacheProvider.d.ts +7 -3
- package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
- package/dist/src/OdysseyProvider.d.ts +1 -1
- package/dist/src/OdysseyProvider.d.ts.map +1 -1
- package/dist/src/OdysseyThemeProvider.d.ts +3 -1
- package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/src/Radio.d.ts +6 -8
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts +4 -5
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/Select.d.ts +2 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/ToastStack.d.ts +2 -2
- package/dist/src/ToastStack.d.ts.map +1 -1
- package/dist/src/{createShadowRootElement.d.ts → createShadowDomElements.d.ts} +6 -1
- package/dist/src/createShadowDomElements.d.ts.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/labs/AppTile.d.ts +39 -0
- package/dist/src/labs/AppTile.d.ts.map +1 -0
- package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents/StackContent.d.ts → DataView/CardLayoutContent.d.ts} +7 -7
- package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents/StackCard.d.ts → DataView/DataCard.d.ts} +4 -4
- package/dist/src/labs/DataView/DataCard.d.ts.map +1 -0
- package/dist/src/labs/DataView/DataTable.d.ts +16 -0
- package/dist/src/labs/DataView/DataTable.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/DataView.d.ts +1 -1
- package/dist/src/labs/DataView/DataView.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/DetailPanel.d.ts +2 -2
- package/dist/src/labs/DataView/DetailPanel.d.ts.map +1 -0
- package/dist/src/labs/DataView/LayoutSwitcher.d.ts.map +1 -0
- package/dist/src/labs/DataView/RowActions.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents/TableContent.d.ts → DataView/TableLayoutContent.d.ts} +7 -7
- package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/TableSettings.d.ts +3 -3
- package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/componentTypes.d.ts +11 -9
- package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/constants.d.ts +1 -1
- package/dist/src/labs/DataView/constants.d.ts.map +1 -0
- package/dist/src/labs/DataView/dataTypes.d.ts.map +1 -0
- package/dist/src/labs/DataView/fetchData.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/index.d.ts +0 -1
- package/dist/src/labs/DataView/index.d.ts.map +1 -0
- package/dist/src/labs/DataView/tableConstants.d.ts.map +1 -0
- package/dist/src/labs/{DataComponents → DataView}/useFilterConversion.d.ts +2 -2
- package/dist/src/labs/DataView/useFilterConversion.d.ts.map +1 -0
- package/dist/src/labs/SideNav/CollapseIcon.d.ts +17 -0
- package/dist/src/labs/SideNav/CollapseIcon.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNav.d.ts +15 -0
- package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavFooterContent.d.ts +17 -0
- package/dist/src/labs/SideNav/SideNavFooterContent.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavHeader.d.ts +16 -0
- package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts +33 -0
- package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts +16 -0
- package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts.map +1 -0
- package/dist/src/labs/SideNav/index.d.ts +14 -0
- package/dist/src/labs/SideNav/index.d.ts.map +1 -0
- package/dist/src/labs/{SideNav.d.ts → SideNav/types.d.ts} +31 -33
- package/dist/src/labs/SideNav/types.d.ts.map +1 -0
- package/dist/src/labs/Switch.d.ts +5 -1
- package/dist/src/labs/Switch.d.ts.map +1 -1
- package/dist/src/labs/index.d.ts +2 -1
- package/dist/src/labs/index.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +16 -2
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- 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 +15 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
- package/dist/src/theme/components.d.ts +3 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/src/theme/createOdysseyMuiTheme.d.ts +3 -1
- package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
- package/dist/theme/components.js +232 -146
- 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/package.json +3 -4
- package/src/Autocomplete.tsx +108 -45
- package/src/Checkbox.tsx +39 -9
- package/src/CheckboxGroup.tsx +20 -4
- package/src/DataTable/DataTable.tsx +24 -1
- package/src/DataTable/useScrollIndication.tsx +2 -2
- package/src/Field.tsx +5 -2
- package/src/OdysseyCacheProvider.tsx +18 -4
- package/src/OdysseyProvider.tsx +6 -3
- package/src/OdysseyThemeProvider.tsx +6 -2
- package/src/Radio.tsx +42 -13
- package/src/RadioGroup.tsx +26 -7
- package/src/Select.tsx +78 -45
- package/src/ToastStack.tsx +2 -2
- package/src/{createShadowRootElement.ts → createShadowDomElements.ts} +24 -5
- package/src/index.ts +1 -1
- package/src/labs/AppTile.tsx +200 -0
- package/src/labs/{DataComponents/StackContent.tsx → DataView/CardLayoutContent.tsx} +24 -19
- package/src/labs/{DataComponents/StackCard.tsx → DataView/DataCard.tsx} +7 -7
- package/src/labs/{DataComponents → DataView}/DataTable.tsx +8 -4
- package/src/labs/{DataComponents → DataView}/DataView.tsx +46 -17
- package/src/labs/{DataComponents → DataView}/DetailPanel.tsx +2 -2
- package/src/labs/{DataComponents/TableContent.tsx → DataView/TableLayoutContent.tsx} +31 -26
- package/src/labs/{DataComponents → DataView}/TableSettings.tsx +5 -4
- package/src/labs/{DataComponents → DataView}/componentTypes.ts +11 -9
- package/src/labs/{DataComponents → DataView}/constants.tsx +2 -2
- package/src/labs/{DataComponents → DataView}/index.tsx +0 -1
- package/src/labs/{DataComponents → DataView}/useFilterConversion.ts +2 -2
- package/src/labs/SideNav/CollapseIcon.tsx +48 -0
- package/src/labs/SideNav/SideNav.tsx +350 -0
- package/src/labs/SideNav/SideNavFooterContent.tsx +64 -0
- package/src/labs/SideNav/SideNavHeader.tsx +65 -0
- package/src/labs/SideNav/SideNavItemContent.tsx +216 -0
- package/src/labs/SideNav/SideNavItemLinkContent.tsx +87 -0
- package/src/labs/SideNav/index.ts +15 -0
- package/src/labs/SideNav/types.ts +125 -0
- package/src/labs/Switch.tsx +85 -31
- package/src/labs/index.ts +3 -1
- package/src/properties/translations/odyssey-react-mui_cs.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_da.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_de.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_el.properties +16 -4
- package/src/properties/translations/odyssey-react-mui_es.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_fi.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_fr.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_ht.properties +17 -6
- package/src/properties/translations/odyssey-react-mui_hu.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_id.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_it.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_ja.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_ko.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_ms.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_nb.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_nl_NL.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_pl.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_pt_BR.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_ro.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_ru.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_sv.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_th.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_tr.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_uk.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_vi.properties +15 -3
- package/src/properties/translations/odyssey-react-mui_zh_CN.properties +14 -2
- package/src/properties/translations/odyssey-react-mui_zh_TW.properties +14 -2
- 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/theme/components.tsx +240 -150
- package/src/theme/createOdysseyMuiTheme.ts +4 -1
- package/dist/createShadowRootElement.js.map +0 -1
- package/dist/labs/DataComponents/BulkActionsMenu.js.map +0 -1
- package/dist/labs/DataComponents/DataStack.js +0 -85
- package/dist/labs/DataComponents/DataStack.js.map +0 -1
- package/dist/labs/DataComponents/DataTable.js.map +0 -1
- package/dist/labs/DataComponents/DataView.js.map +0 -1
- package/dist/labs/DataComponents/DetailPanel.js.map +0 -1
- package/dist/labs/DataComponents/LayoutSwitcher.js.map +0 -1
- package/dist/labs/DataComponents/RowActions.js.map +0 -1
- package/dist/labs/DataComponents/StackCard.js.map +0 -1
- package/dist/labs/DataComponents/StackContent.js.map +0 -1
- package/dist/labs/DataComponents/TableContent.js.map +0 -1
- package/dist/labs/DataComponents/TableSettings.js.map +0 -1
- package/dist/labs/DataComponents/componentTypes.js.map +0 -1
- package/dist/labs/DataComponents/constants.js.map +0 -1
- package/dist/labs/DataComponents/dataTypes.js.map +0 -1
- package/dist/labs/DataComponents/fetchData.js.map +0 -1
- package/dist/labs/DataComponents/index.js.map +0 -1
- package/dist/labs/DataComponents/tableConstants.js.map +0 -1
- package/dist/labs/DataComponents/useFilterConversion.js.map +0 -1
- package/dist/labs/SideNav.js +0 -478
- package/dist/labs/SideNav.js.map +0 -1
- package/dist/src/createShadowRootElement.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/BulkActionsMenu.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/DataStack.d.ts +0 -20
- package/dist/src/labs/DataComponents/DataStack.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/DataTable.d.ts +0 -16
- package/dist/src/labs/DataComponents/DataTable.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/DataView.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/DetailPanel.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/LayoutSwitcher.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/RowActions.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/StackCard.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/StackContent.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/TableContent.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/TableSettings.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/componentTypes.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/constants.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/dataTypes.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/fetchData.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/index.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/tableConstants.d.ts.map +0 -1
- package/dist/src/labs/DataComponents/useFilterConversion.d.ts.map +0 -1
- package/dist/src/labs/SideNav.d.ts.map +0 -1
- package/src/labs/DataComponents/DataStack.tsx +0 -105
- package/src/labs/SideNav.tsx +0 -745
- /package/dist/labs/{DataComponents → DataView}/BulkActionsMenu.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/DetailPanel.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/LayoutSwitcher.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/RowActions.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/componentTypes.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/dataTypes.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/fetchData.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/tableConstants.js +0 -0
- /package/dist/labs/{DataComponents → DataView}/useFilterConversion.js +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/BulkActionsMenu.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/LayoutSwitcher.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/RowActions.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/dataTypes.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/fetchData.d.ts +0 -0
- /package/dist/src/labs/{DataComponents → DataView}/tableConstants.d.ts +0 -0
- /package/src/labs/{DataComponents → DataView}/BulkActionsMenu.tsx +0 -0
- /package/src/labs/{DataComponents → DataView}/LayoutSwitcher.tsx +0 -0
- /package/src/labs/{DataComponents → DataView}/RowActions.tsx +0 -0
- /package/src/labs/{DataComponents → DataView}/dataTypes.ts +0 -0
- /package/src/labs/{DataComponents → DataView}/fetchData.ts +0 -0
- /package/src/labs/{DataComponents → DataView}/tableConstants.tsx +0 -0
package/src/labs/SideNav.tsx
DELETED
|
@@ -1,745 +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 {
|
|
15
|
-
memo,
|
|
16
|
-
useMemo,
|
|
17
|
-
useState,
|
|
18
|
-
ReactElement,
|
|
19
|
-
ReactNode,
|
|
20
|
-
useCallback,
|
|
21
|
-
KeyboardEvent,
|
|
22
|
-
} from "react";
|
|
23
|
-
|
|
24
|
-
import { Box } from "../Box";
|
|
25
|
-
import { Button } from "../Button";
|
|
26
|
-
import type { HtmlProps } from "../HtmlProps";
|
|
27
|
-
import { CollapseLeftIcon, ExpandLeftIcon } from "../icons.generated";
|
|
28
|
-
import { Link } from "../Link";
|
|
29
|
-
import { NavAccordion } from "./NavAccordion";
|
|
30
|
-
import {
|
|
31
|
-
DesignTokens,
|
|
32
|
-
useOdysseyDesignTokens,
|
|
33
|
-
} from "../OdysseyDesignTokensContext";
|
|
34
|
-
import { Status, statusSeverityValues } from "../Status";
|
|
35
|
-
import { Heading6 } from "../Typography";
|
|
36
|
-
|
|
37
|
-
export type SideNavItem = {
|
|
38
|
-
id: string;
|
|
39
|
-
label: string;
|
|
40
|
-
/**
|
|
41
|
-
* The icon element to display at the end of the Nav Item
|
|
42
|
-
*/
|
|
43
|
-
endIcon?: ReactElement;
|
|
44
|
-
/**
|
|
45
|
-
* Whether the item is disabled. When set to true the nav item is set to Disabled color,
|
|
46
|
-
* the link/item is not clickable, and item with children is not expandable.
|
|
47
|
-
*/
|
|
48
|
-
isDisabled?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Whether the item is active/selected
|
|
51
|
-
*/
|
|
52
|
-
isSelected?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Event fired when the nav item is clicked
|
|
55
|
-
*/
|
|
56
|
-
onClick?(): void;
|
|
57
|
-
/**
|
|
58
|
-
* The status element to display after the label
|
|
59
|
-
*/
|
|
60
|
-
severity?: (typeof statusSeverityValues)[number];
|
|
61
|
-
/**
|
|
62
|
-
* The icon element to display at the start of the Nav Item
|
|
63
|
-
*/
|
|
64
|
-
startIcon?: ReactElement;
|
|
65
|
-
/**
|
|
66
|
-
* The label to display inside the status
|
|
67
|
-
*/
|
|
68
|
-
statusLabel?: string;
|
|
69
|
-
/**
|
|
70
|
-
* The link target prop. e.g., "_blank"
|
|
71
|
-
*/
|
|
72
|
-
target?: string;
|
|
73
|
-
} & (
|
|
74
|
-
| {
|
|
75
|
-
/**
|
|
76
|
-
* Determines if the side nav item is a section header
|
|
77
|
-
*/
|
|
78
|
-
isSectionHeader: true;
|
|
79
|
-
href?: never;
|
|
80
|
-
children?: never;
|
|
81
|
-
isDefaultExpanded?: never;
|
|
82
|
-
isExpanded?: never;
|
|
83
|
-
}
|
|
84
|
-
| {
|
|
85
|
-
/**
|
|
86
|
-
* link added to the nav item. if it is undefined, static text will be displayed.
|
|
87
|
-
* fires onClick event when it is passed
|
|
88
|
-
*/
|
|
89
|
-
href: string;
|
|
90
|
-
children?: never;
|
|
91
|
-
isSectionHeader?: never;
|
|
92
|
-
isDefaultExpanded?: never;
|
|
93
|
-
isExpanded?: never;
|
|
94
|
-
}
|
|
95
|
-
| {
|
|
96
|
-
/**
|
|
97
|
-
* An array of side nav items to be displayed as children within Accordion
|
|
98
|
-
*/
|
|
99
|
-
children?: SideNavItem[];
|
|
100
|
-
/**
|
|
101
|
-
* Whether the accordion (nav item with children) is expanded by default
|
|
102
|
-
*/
|
|
103
|
-
isDefaultExpanded?: boolean;
|
|
104
|
-
/**
|
|
105
|
-
* If true, expands the accordion, otherwise collapse it.
|
|
106
|
-
* Setting this prop enables control over the accordion.
|
|
107
|
-
*/
|
|
108
|
-
isExpanded?: boolean;
|
|
109
|
-
isSectionHeader?: never;
|
|
110
|
-
href?: never;
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
|
|
114
|
-
export type SideNavFooterItem = {
|
|
115
|
-
href?: string;
|
|
116
|
-
id: string;
|
|
117
|
-
label: string;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
export type SideNavProps = {
|
|
121
|
-
/**
|
|
122
|
-
* Side Nav header text that is usually reserved to show the App name
|
|
123
|
-
*/
|
|
124
|
-
navHeaderText: string;
|
|
125
|
-
/**
|
|
126
|
-
* Determines whether the side nav is collapsible
|
|
127
|
-
*/
|
|
128
|
-
isCollapsible?: boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Footer items in the side nav
|
|
131
|
-
*/
|
|
132
|
-
footerItems?: SideNavFooterItem[];
|
|
133
|
-
/**
|
|
134
|
-
* Triggers when the side nav is collapsed
|
|
135
|
-
*/
|
|
136
|
-
onCollapse?(): void;
|
|
137
|
-
/**
|
|
138
|
-
* Triggers when the side nav is expanded
|
|
139
|
-
*/
|
|
140
|
-
onExpand?(): void;
|
|
141
|
-
/**
|
|
142
|
-
* Nav items in the side nav
|
|
143
|
-
*/
|
|
144
|
-
sideNavItems: SideNavItem[];
|
|
145
|
-
} & Pick<HtmlProps, "testId">;
|
|
146
|
-
|
|
147
|
-
const SideNavCollapsedContainer = styled("div", {
|
|
148
|
-
shouldForwardProp: (prop) =>
|
|
149
|
-
prop !== "odysseyDesignTokens" && prop !== "isSideNavCollapsed",
|
|
150
|
-
})(
|
|
151
|
-
({
|
|
152
|
-
odysseyDesignTokens,
|
|
153
|
-
isSideNavCollapsed,
|
|
154
|
-
}: {
|
|
155
|
-
odysseyDesignTokens: DesignTokens;
|
|
156
|
-
isSideNavCollapsed: boolean;
|
|
157
|
-
}) => ({
|
|
158
|
-
backgroundColor: odysseyDesignTokens.HueNeutral300,
|
|
159
|
-
paddingTop: odysseyDesignTokens.Spacing5,
|
|
160
|
-
cursor: "pointer",
|
|
161
|
-
width: isSideNavCollapsed ? "auto" : 0,
|
|
162
|
-
opacity: isSideNavCollapsed ? 1 : 0,
|
|
163
|
-
visibility: isSideNavCollapsed ? "visible" : "hidden",
|
|
164
|
-
transitionProperty: "opacity",
|
|
165
|
-
transitionDuration: odysseyDesignTokens.TransitionDurationMain,
|
|
166
|
-
transitionTimingFunction: odysseyDesignTokens.TransitionTimingMain,
|
|
167
|
-
}),
|
|
168
|
-
);
|
|
169
|
-
|
|
170
|
-
const SideNavExpandContainer = styled("div", {
|
|
171
|
-
shouldForwardProp: (prop) =>
|
|
172
|
-
prop !== "odysseyDesignTokens" && prop !== "isSideNavCollapsed",
|
|
173
|
-
})(
|
|
174
|
-
({
|
|
175
|
-
odysseyDesignTokens,
|
|
176
|
-
isSideNavCollapsed,
|
|
177
|
-
}: {
|
|
178
|
-
odysseyDesignTokens: DesignTokens;
|
|
179
|
-
isSideNavCollapsed: boolean;
|
|
180
|
-
}) => ({
|
|
181
|
-
backgroundColor: odysseyDesignTokens.HueNeutralWhite,
|
|
182
|
-
flexDirection: "column",
|
|
183
|
-
display: "flex",
|
|
184
|
-
opacity: isSideNavCollapsed ? 0 : 1,
|
|
185
|
-
visibility: isSideNavCollapsed ? "hidden" : "visible",
|
|
186
|
-
width: isSideNavCollapsed ? "0" : "100%",
|
|
187
|
-
transitionProperty: "opacity, width",
|
|
188
|
-
transitionDuration: odysseyDesignTokens.TransitionDurationMain,
|
|
189
|
-
transitionTimingFunction: odysseyDesignTokens.TransitionTimingMain,
|
|
190
|
-
}),
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
const SideNavHeaderContainer = styled("div", {
|
|
194
|
-
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
195
|
-
})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
|
|
196
|
-
display: "flex",
|
|
197
|
-
justifyContent: "space-between",
|
|
198
|
-
alignItems: "center",
|
|
199
|
-
paddingLeft: odysseyDesignTokens.Spacing4,
|
|
200
|
-
paddingRight: odysseyDesignTokens.Spacing4,
|
|
201
|
-
paddingTop: odysseyDesignTokens.Spacing3,
|
|
202
|
-
paddingBottom: odysseyDesignTokens.Spacing3,
|
|
203
|
-
}));
|
|
204
|
-
|
|
205
|
-
const CollapseIcon = ({ onClick }: { onClick?(): void }): ReactElement => {
|
|
206
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
207
|
-
|
|
208
|
-
const collapseButtonStyles = useMemo(
|
|
209
|
-
() => ({
|
|
210
|
-
"& > button": {
|
|
211
|
-
height: odysseyDesignTokens.Spacing6,
|
|
212
|
-
width: odysseyDesignTokens.Spacing6,
|
|
213
|
-
color: odysseyDesignTokens.HueNeutral400,
|
|
214
|
-
},
|
|
215
|
-
}),
|
|
216
|
-
[odysseyDesignTokens],
|
|
217
|
-
);
|
|
218
|
-
|
|
219
|
-
return (
|
|
220
|
-
<Box sx={collapseButtonStyles}>
|
|
221
|
-
<Button
|
|
222
|
-
tabIndex={0}
|
|
223
|
-
variant="secondary"
|
|
224
|
-
onClick={onClick}
|
|
225
|
-
startIcon={<CollapseLeftIcon />}
|
|
226
|
-
ariaLabel="collapse side navigation"
|
|
227
|
-
/>
|
|
228
|
-
</Box>
|
|
229
|
-
);
|
|
230
|
-
};
|
|
231
|
-
|
|
232
|
-
const SideNavHeader = ({
|
|
233
|
-
navHeaderText,
|
|
234
|
-
isCollapsible,
|
|
235
|
-
onCollapse,
|
|
236
|
-
}: Pick<
|
|
237
|
-
SideNavProps,
|
|
238
|
-
"navHeaderText" | "isCollapsible" | "onCollapse"
|
|
239
|
-
>): ReactNode => {
|
|
240
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
241
|
-
|
|
242
|
-
const sideNavHeaderStyles = useMemo(
|
|
243
|
-
() => ({
|
|
244
|
-
marginTop: odysseyDesignTokens.Spacing2,
|
|
245
|
-
}),
|
|
246
|
-
[odysseyDesignTokens],
|
|
247
|
-
);
|
|
248
|
-
|
|
249
|
-
return (
|
|
250
|
-
<SideNavHeaderContainer odysseyDesignTokens={odysseyDesignTokens}>
|
|
251
|
-
<Box sx={sideNavHeaderStyles}>
|
|
252
|
-
<Heading6>{navHeaderText}</Heading6>
|
|
253
|
-
</Box>
|
|
254
|
-
{isCollapsible && <CollapseIcon onClick={onCollapse} />}
|
|
255
|
-
</SideNavHeaderContainer>
|
|
256
|
-
);
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
const SideNavListContainer = styled.ul({
|
|
260
|
-
padding: 0,
|
|
261
|
-
listStyle: "none",
|
|
262
|
-
listStyleType: "none",
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
const SectionHeader = styled("li", {
|
|
266
|
-
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
267
|
-
})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
|
|
268
|
-
fontSize: odysseyDesignTokens.TypographySizeOverline,
|
|
269
|
-
fontWeight: odysseyDesignTokens.TypographyWeightHeadingBold,
|
|
270
|
-
color: odysseyDesignTokens.HueNeutral600,
|
|
271
|
-
paddingTop: odysseyDesignTokens.Spacing3,
|
|
272
|
-
paddingBottom: odysseyDesignTokens.Spacing3,
|
|
273
|
-
paddingLeft: odysseyDesignTokens.Spacing4,
|
|
274
|
-
textTransform: "uppercase",
|
|
275
|
-
}));
|
|
276
|
-
|
|
277
|
-
const SideNavItemLabelContainer = styled("div", {
|
|
278
|
-
shouldForwardProp: (prop) =>
|
|
279
|
-
prop !== "odysseyDesignTokens" && prop !== "isIconVisible",
|
|
280
|
-
})<{
|
|
281
|
-
odysseyDesignTokens: DesignTokens;
|
|
282
|
-
isIconVisible: boolean;
|
|
283
|
-
}>(({ odysseyDesignTokens, isIconVisible }) => ({
|
|
284
|
-
width: "100%",
|
|
285
|
-
display: "flex",
|
|
286
|
-
flexWrap: "wrap",
|
|
287
|
-
alignItems: "center",
|
|
288
|
-
fontSize: odysseyDesignTokens.TypographyScale0,
|
|
289
|
-
fontWeight: odysseyDesignTokens.TypographyWeightHeading,
|
|
290
|
-
marginLeft: isIconVisible ? odysseyDesignTokens.Spacing2 : 0,
|
|
291
|
-
"& a": {
|
|
292
|
-
color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
|
|
293
|
-
fontSize: odysseyDesignTokens.TypographyScale0,
|
|
294
|
-
},
|
|
295
|
-
"& a:hover": {
|
|
296
|
-
textDecoration: "none",
|
|
297
|
-
cursor: "pointer",
|
|
298
|
-
},
|
|
299
|
-
}));
|
|
300
|
-
|
|
301
|
-
const SideNavListItemContainer = styled("li", {
|
|
302
|
-
shouldForwardProp: (prop) =>
|
|
303
|
-
prop !== "odysseyDesignTokens" &&
|
|
304
|
-
prop !== "isSelected" &&
|
|
305
|
-
prop !== "isDisabled",
|
|
306
|
-
})<{
|
|
307
|
-
odysseyDesignTokens: DesignTokens;
|
|
308
|
-
isSelected?: boolean;
|
|
309
|
-
disabled?: boolean;
|
|
310
|
-
isDisabled?: boolean;
|
|
311
|
-
}>(({ odysseyDesignTokens, isSelected, isDisabled }) => ({
|
|
312
|
-
display: "flex",
|
|
313
|
-
alignItems: "center",
|
|
314
|
-
cursor: isDisabled ? "default" : "pointer",
|
|
315
|
-
pointerEvents: isDisabled ? "none" : "auto",
|
|
316
|
-
backgroundColor: isSelected ? odysseyDesignTokens.HueNeutral50 : "unset",
|
|
317
|
-
margin: `${odysseyDesignTokens.Spacing1} 0`,
|
|
318
|
-
"&:last-child": {
|
|
319
|
-
marginBottom: odysseyDesignTokens.Spacing2,
|
|
320
|
-
},
|
|
321
|
-
"& a": {
|
|
322
|
-
display: "flex",
|
|
323
|
-
alignItems: "center",
|
|
324
|
-
width: "100%",
|
|
325
|
-
minHeight: "48px",
|
|
326
|
-
padding: `${odysseyDesignTokens.Spacing3} ${odysseyDesignTokens.Spacing4}`,
|
|
327
|
-
color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
|
|
328
|
-
pointerEvents: isDisabled ? "none" : "auto",
|
|
329
|
-
},
|
|
330
|
-
"& a:hover": {
|
|
331
|
-
textDecoration: "none",
|
|
332
|
-
cursor: isDisabled ? "default" : "pointer",
|
|
333
|
-
backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit",
|
|
334
|
-
},
|
|
335
|
-
"& a:focus-visible": {
|
|
336
|
-
outlineOffset: 0,
|
|
337
|
-
borderRadius: 0,
|
|
338
|
-
outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
|
|
339
|
-
backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit",
|
|
340
|
-
},
|
|
341
|
-
}));
|
|
342
|
-
|
|
343
|
-
const SideNavFooterContainer = styled("div", {
|
|
344
|
-
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
345
|
-
})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
|
|
346
|
-
paddingTop: odysseyDesignTokens.Spacing2,
|
|
347
|
-
paddingBottom: odysseyDesignTokens.Spacing2,
|
|
348
|
-
display: "flex",
|
|
349
|
-
justifyContent: "center",
|
|
350
|
-
flexWrap: "wrap",
|
|
351
|
-
alignItems: "center",
|
|
352
|
-
fontSize: odysseyDesignTokens.TypographySizeOverline,
|
|
353
|
-
"& a": {
|
|
354
|
-
color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
|
|
355
|
-
},
|
|
356
|
-
"& a:hover": {
|
|
357
|
-
textDecoration: "none",
|
|
358
|
-
},
|
|
359
|
-
"& a:visited": {
|
|
360
|
-
color: odysseyDesignTokens.TypographyColorHeading,
|
|
361
|
-
},
|
|
362
|
-
}));
|
|
363
|
-
|
|
364
|
-
const SideNavItemLinkContent = ({
|
|
365
|
-
label,
|
|
366
|
-
startIcon,
|
|
367
|
-
endIcon,
|
|
368
|
-
severity,
|
|
369
|
-
statusLabel,
|
|
370
|
-
}: Pick<
|
|
371
|
-
SideNavItem,
|
|
372
|
-
"label" | "startIcon" | "endIcon" | "severity" | "statusLabel"
|
|
373
|
-
>): ReactNode => {
|
|
374
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
375
|
-
|
|
376
|
-
const sideNavItemContentStyles = useMemo(
|
|
377
|
-
() => ({
|
|
378
|
-
marginLeft: odysseyDesignTokens.Spacing2,
|
|
379
|
-
}),
|
|
380
|
-
[odysseyDesignTokens],
|
|
381
|
-
);
|
|
382
|
-
|
|
383
|
-
return (
|
|
384
|
-
<>
|
|
385
|
-
{startIcon && startIcon}
|
|
386
|
-
<SideNavItemLabelContainer
|
|
387
|
-
odysseyDesignTokens={odysseyDesignTokens}
|
|
388
|
-
isIconVisible={Boolean(startIcon)}
|
|
389
|
-
>
|
|
390
|
-
{label}
|
|
391
|
-
{severity && (
|
|
392
|
-
<Box sx={sideNavItemContentStyles}>
|
|
393
|
-
<Status severity={severity} label={statusLabel || ""} />
|
|
394
|
-
</Box>
|
|
395
|
-
)}
|
|
396
|
-
</SideNavItemLabelContainer>
|
|
397
|
-
{endIcon && endIcon}
|
|
398
|
-
</>
|
|
399
|
-
);
|
|
400
|
-
};
|
|
401
|
-
|
|
402
|
-
const SideNavItemContent = ({
|
|
403
|
-
id,
|
|
404
|
-
label,
|
|
405
|
-
href,
|
|
406
|
-
target,
|
|
407
|
-
startIcon,
|
|
408
|
-
severity,
|
|
409
|
-
statusLabel,
|
|
410
|
-
endIcon,
|
|
411
|
-
onClick,
|
|
412
|
-
isSelected,
|
|
413
|
-
isDisabled,
|
|
414
|
-
}: Pick<
|
|
415
|
-
SideNavItem,
|
|
416
|
-
| "id"
|
|
417
|
-
| "label"
|
|
418
|
-
| "href"
|
|
419
|
-
| "target"
|
|
420
|
-
| "startIcon"
|
|
421
|
-
| "severity"
|
|
422
|
-
| "statusLabel"
|
|
423
|
-
| "endIcon"
|
|
424
|
-
| "onClick"
|
|
425
|
-
| "isSelected"
|
|
426
|
-
| "isDisabled"
|
|
427
|
-
>) => {
|
|
428
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
429
|
-
|
|
430
|
-
const NavItemContentClickContainer = styled("div", {
|
|
431
|
-
shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
|
|
432
|
-
})(() => ({
|
|
433
|
-
display: "flex",
|
|
434
|
-
alignItems: "center",
|
|
435
|
-
width: "100%",
|
|
436
|
-
minHeight: "48px",
|
|
437
|
-
padding: `${odysseyDesignTokens.Spacing3} ${odysseyDesignTokens.Spacing4}`,
|
|
438
|
-
color: `${isDisabled ? odysseyDesignTokens.TypographyColorDisabled : odysseyDesignTokens.TypographyColorHeading} !important`,
|
|
439
|
-
"&:focus-visible": {
|
|
440
|
-
borderRadius: 0,
|
|
441
|
-
outlineColor: odysseyDesignTokens.FocusOutlineColorPrimary,
|
|
442
|
-
outlineStyle: odysseyDesignTokens.FocusOutlineStyle,
|
|
443
|
-
outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
|
|
444
|
-
backgroundColor: odysseyDesignTokens.HueNeutral50,
|
|
445
|
-
textDecoration: "none",
|
|
446
|
-
},
|
|
447
|
-
}));
|
|
448
|
-
|
|
449
|
-
const sideNavItemContentKeyHandler = useCallback(
|
|
450
|
-
(event: KeyboardEvent<HTMLDivElement>) => {
|
|
451
|
-
if (event?.key === "Enter") {
|
|
452
|
-
event.preventDefault();
|
|
453
|
-
onClick?.();
|
|
454
|
-
}
|
|
455
|
-
},
|
|
456
|
-
[onClick],
|
|
457
|
-
);
|
|
458
|
-
|
|
459
|
-
const sideNavItemContent = useMemo(() => {
|
|
460
|
-
return (
|
|
461
|
-
<SideNavListItemContainer
|
|
462
|
-
id={id}
|
|
463
|
-
key={id}
|
|
464
|
-
disabled={isDisabled}
|
|
465
|
-
aria-disabled={isDisabled}
|
|
466
|
-
isDisabled={isDisabled}
|
|
467
|
-
isSelected={isSelected}
|
|
468
|
-
odysseyDesignTokens={odysseyDesignTokens}
|
|
469
|
-
>
|
|
470
|
-
{
|
|
471
|
-
// Use Link for nav items with links and div for disabled or non-link items
|
|
472
|
-
isDisabled ? (
|
|
473
|
-
<NavItemContentClickContainer>
|
|
474
|
-
<SideNavItemLinkContent
|
|
475
|
-
label={label}
|
|
476
|
-
startIcon={startIcon}
|
|
477
|
-
endIcon={endIcon}
|
|
478
|
-
statusLabel={statusLabel}
|
|
479
|
-
severity={severity}
|
|
480
|
-
/>
|
|
481
|
-
</NavItemContentClickContainer>
|
|
482
|
-
) : !href ? (
|
|
483
|
-
<NavItemContentClickContainer
|
|
484
|
-
role="button"
|
|
485
|
-
tabIndex={0}
|
|
486
|
-
onClick={onClick}
|
|
487
|
-
onKeyDown={sideNavItemContentKeyHandler}
|
|
488
|
-
>
|
|
489
|
-
<SideNavItemLinkContent
|
|
490
|
-
label={label}
|
|
491
|
-
startIcon={startIcon}
|
|
492
|
-
endIcon={endIcon}
|
|
493
|
-
statusLabel={statusLabel}
|
|
494
|
-
severity={severity}
|
|
495
|
-
/>
|
|
496
|
-
</NavItemContentClickContainer>
|
|
497
|
-
) : (
|
|
498
|
-
<Link href={href} target={target} onClick={onClick}>
|
|
499
|
-
<SideNavItemLinkContent
|
|
500
|
-
label={label}
|
|
501
|
-
startIcon={startIcon}
|
|
502
|
-
endIcon={endIcon}
|
|
503
|
-
statusLabel={statusLabel}
|
|
504
|
-
severity={severity}
|
|
505
|
-
/>
|
|
506
|
-
</Link>
|
|
507
|
-
)
|
|
508
|
-
}
|
|
509
|
-
</SideNavListItemContainer>
|
|
510
|
-
);
|
|
511
|
-
}, [
|
|
512
|
-
id,
|
|
513
|
-
label,
|
|
514
|
-
href,
|
|
515
|
-
target,
|
|
516
|
-
startIcon,
|
|
517
|
-
severity,
|
|
518
|
-
statusLabel,
|
|
519
|
-
endIcon,
|
|
520
|
-
onClick,
|
|
521
|
-
isSelected,
|
|
522
|
-
isDisabled,
|
|
523
|
-
NavItemContentClickContainer,
|
|
524
|
-
sideNavItemContentKeyHandler,
|
|
525
|
-
odysseyDesignTokens,
|
|
526
|
-
]);
|
|
527
|
-
|
|
528
|
-
return sideNavItemContent;
|
|
529
|
-
};
|
|
530
|
-
|
|
531
|
-
const SideNavFooterContent = (footerItems: SideNavFooterItem[]): ReactNode => {
|
|
532
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
533
|
-
|
|
534
|
-
const footerContent = useMemo(() => {
|
|
535
|
-
return footerItems?.map((item, index) => (
|
|
536
|
-
<Box
|
|
537
|
-
key={`${item.id}-wrapper`}
|
|
538
|
-
sx={{
|
|
539
|
-
display: "flex",
|
|
540
|
-
}}
|
|
541
|
-
>
|
|
542
|
-
{item.href ? (
|
|
543
|
-
<Link key={item.id} href={item.href}>
|
|
544
|
-
{item.label}
|
|
545
|
-
</Link>
|
|
546
|
-
) : (
|
|
547
|
-
<Box component="span" key={item.id}>
|
|
548
|
-
{item.label}
|
|
549
|
-
</Box>
|
|
550
|
-
)}
|
|
551
|
-
{index < footerItems.length - 1 && (
|
|
552
|
-
<Box
|
|
553
|
-
key={`${item.id}-separator`}
|
|
554
|
-
sx={{
|
|
555
|
-
marginLeft: odysseyDesignTokens.Spacing4,
|
|
556
|
-
marginRight: odysseyDesignTokens.Spacing4,
|
|
557
|
-
color: odysseyDesignTokens.HueNeutral300,
|
|
558
|
-
}}
|
|
559
|
-
>
|
|
560
|
-
|
|
|
561
|
-
</Box>
|
|
562
|
-
)}
|
|
563
|
-
</Box>
|
|
564
|
-
));
|
|
565
|
-
}, [footerItems, odysseyDesignTokens]);
|
|
566
|
-
|
|
567
|
-
return footerContent;
|
|
568
|
-
};
|
|
569
|
-
|
|
570
|
-
const SideNav = ({
|
|
571
|
-
navHeaderText,
|
|
572
|
-
isCollapsible,
|
|
573
|
-
onCollapse,
|
|
574
|
-
onExpand,
|
|
575
|
-
sideNavItems,
|
|
576
|
-
footerItems,
|
|
577
|
-
}: SideNavProps) => {
|
|
578
|
-
const [isSideNavCollapsed, setSideNavCollapsed] = useState(false);
|
|
579
|
-
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
580
|
-
|
|
581
|
-
const processedSideNavItems = useMemo(
|
|
582
|
-
() =>
|
|
583
|
-
sideNavItems.map((item) => ({
|
|
584
|
-
...item,
|
|
585
|
-
children: item.children?.map((childProps) => (
|
|
586
|
-
<SideNavItemContent key={childProps.id} {...childProps} />
|
|
587
|
-
)),
|
|
588
|
-
})),
|
|
589
|
-
[sideNavItems],
|
|
590
|
-
);
|
|
591
|
-
|
|
592
|
-
const sideNavCollapseHandler = useCallback(() => {
|
|
593
|
-
setSideNavCollapsed(!isSideNavCollapsed);
|
|
594
|
-
onCollapse?.();
|
|
595
|
-
}, [isSideNavCollapsed, setSideNavCollapsed, onCollapse]);
|
|
596
|
-
|
|
597
|
-
const sideNavExpandClickHandler = useCallback(() => {
|
|
598
|
-
setSideNavCollapsed(!isSideNavCollapsed);
|
|
599
|
-
onExpand?.();
|
|
600
|
-
}, [isSideNavCollapsed, setSideNavCollapsed, onExpand]);
|
|
601
|
-
|
|
602
|
-
const sideNavExpandKeyHandler = useCallback(
|
|
603
|
-
(event: KeyboardEvent<HTMLDivElement>) => {
|
|
604
|
-
if (event?.key === "Enter" || event?.code === "Space") {
|
|
605
|
-
event.preventDefault();
|
|
606
|
-
setSideNavCollapsed(!isSideNavCollapsed);
|
|
607
|
-
onExpand?.();
|
|
608
|
-
}
|
|
609
|
-
},
|
|
610
|
-
[isSideNavCollapsed, setSideNavCollapsed, onExpand],
|
|
611
|
-
);
|
|
612
|
-
|
|
613
|
-
const sideNavStyles = useMemo(
|
|
614
|
-
() => ({
|
|
615
|
-
display: "flex",
|
|
616
|
-
height: "100vh",
|
|
617
|
-
}),
|
|
618
|
-
[],
|
|
619
|
-
);
|
|
620
|
-
|
|
621
|
-
const sideNavHeaderContainerStyles = useMemo(
|
|
622
|
-
() => ({
|
|
623
|
-
position: "sticky",
|
|
624
|
-
top: 0,
|
|
625
|
-
}),
|
|
626
|
-
[],
|
|
627
|
-
);
|
|
628
|
-
|
|
629
|
-
const sideNavListContainerStyles = useMemo(
|
|
630
|
-
() => ({
|
|
631
|
-
flex: 1,
|
|
632
|
-
overflowY: "auto",
|
|
633
|
-
}),
|
|
634
|
-
[],
|
|
635
|
-
);
|
|
636
|
-
|
|
637
|
-
const sideNavFooterContainerStyles = useMemo(
|
|
638
|
-
() => ({
|
|
639
|
-
position: "sticky",
|
|
640
|
-
bottom: 0,
|
|
641
|
-
paddingTop: odysseyDesignTokens.Spacing2,
|
|
642
|
-
}),
|
|
643
|
-
[odysseyDesignTokens],
|
|
644
|
-
);
|
|
645
|
-
|
|
646
|
-
const expandLeftIconStyles = useMemo(
|
|
647
|
-
() => ({
|
|
648
|
-
fontSize: "1em",
|
|
649
|
-
margin: `0 ${odysseyDesignTokens.Spacing1}`,
|
|
650
|
-
}),
|
|
651
|
-
[odysseyDesignTokens],
|
|
652
|
-
);
|
|
653
|
-
|
|
654
|
-
return (
|
|
655
|
-
<Box sx={sideNavStyles}>
|
|
656
|
-
<SideNavCollapsedContainer
|
|
657
|
-
tabIndex={0}
|
|
658
|
-
role="button"
|
|
659
|
-
odysseyDesignTokens={odysseyDesignTokens}
|
|
660
|
-
isSideNavCollapsed={isSideNavCollapsed}
|
|
661
|
-
onClick={sideNavExpandClickHandler}
|
|
662
|
-
onKeyDown={sideNavExpandKeyHandler}
|
|
663
|
-
data-testid="collapsed-region"
|
|
664
|
-
data-aria-label="expand side navigation"
|
|
665
|
-
>
|
|
666
|
-
<ExpandLeftIcon sx={expandLeftIconStyles} />
|
|
667
|
-
</SideNavCollapsedContainer>
|
|
668
|
-
<SideNavExpandContainer
|
|
669
|
-
odysseyDesignTokens={odysseyDesignTokens}
|
|
670
|
-
isSideNavCollapsed={isSideNavCollapsed}
|
|
671
|
-
data-testid="expanded-region"
|
|
672
|
-
>
|
|
673
|
-
<Box sx={sideNavHeaderContainerStyles}>
|
|
674
|
-
<SideNavHeader
|
|
675
|
-
navHeaderText={navHeaderText}
|
|
676
|
-
isCollapsible={isCollapsible}
|
|
677
|
-
onCollapse={sideNavCollapseHandler}
|
|
678
|
-
/>
|
|
679
|
-
</Box>
|
|
680
|
-
<Box sx={sideNavListContainerStyles}>
|
|
681
|
-
<SideNavListContainer>
|
|
682
|
-
{processedSideNavItems?.map((item) => {
|
|
683
|
-
const {
|
|
684
|
-
id,
|
|
685
|
-
label,
|
|
686
|
-
isSectionHeader,
|
|
687
|
-
startIcon,
|
|
688
|
-
children,
|
|
689
|
-
isDefaultExpanded,
|
|
690
|
-
isDisabled,
|
|
691
|
-
isExpanded,
|
|
692
|
-
} = item;
|
|
693
|
-
|
|
694
|
-
if (isSectionHeader) {
|
|
695
|
-
return (
|
|
696
|
-
<SectionHeader
|
|
697
|
-
id={id}
|
|
698
|
-
key={id}
|
|
699
|
-
odysseyDesignTokens={odysseyDesignTokens}
|
|
700
|
-
>
|
|
701
|
-
{label}
|
|
702
|
-
</SectionHeader>
|
|
703
|
-
);
|
|
704
|
-
} else if (children) {
|
|
705
|
-
return (
|
|
706
|
-
<SideNavListItemContainer
|
|
707
|
-
id={id}
|
|
708
|
-
key={id}
|
|
709
|
-
odysseyDesignTokens={odysseyDesignTokens}
|
|
710
|
-
>
|
|
711
|
-
<NavAccordion
|
|
712
|
-
label={label}
|
|
713
|
-
isDefaultExpanded={isDefaultExpanded}
|
|
714
|
-
isExpanded={isExpanded}
|
|
715
|
-
startIcon={startIcon}
|
|
716
|
-
isDisabled={isDisabled}
|
|
717
|
-
>
|
|
718
|
-
<SideNavListContainer id={`${id}-list`}>
|
|
719
|
-
{children}
|
|
720
|
-
</SideNavListContainer>
|
|
721
|
-
</NavAccordion>
|
|
722
|
-
</SideNavListItemContainer>
|
|
723
|
-
);
|
|
724
|
-
} else {
|
|
725
|
-
return <SideNavItemContent key={item.id} {...item} />;
|
|
726
|
-
}
|
|
727
|
-
})}
|
|
728
|
-
</SideNavListContainer>
|
|
729
|
-
</Box>
|
|
730
|
-
{footerItems && (
|
|
731
|
-
<Box sx={sideNavFooterContainerStyles}>
|
|
732
|
-
<SideNavFooterContainer odysseyDesignTokens={odysseyDesignTokens}>
|
|
733
|
-
{SideNavFooterContent(footerItems)}
|
|
734
|
-
</SideNavFooterContainer>
|
|
735
|
-
</Box>
|
|
736
|
-
)}
|
|
737
|
-
</SideNavExpandContainer>
|
|
738
|
-
</Box>
|
|
739
|
-
);
|
|
740
|
-
};
|
|
741
|
-
|
|
742
|
-
const MemoizedSideNav = memo(SideNav);
|
|
743
|
-
MemoizedSideNav.displayName = "SideNav";
|
|
744
|
-
|
|
745
|
-
export { MemoizedSideNav as SideNav };
|