@okta/odyssey-react-mui 1.21.2 → 1.23.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 +34 -0
- package/dist/@types/i18next.d.js.map +1 -1
- package/dist/Autocomplete.js +106 -38
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Callout.js +12 -24
- package/dist/Callout.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 +9 -5
- package/dist/DataTable/useScrollIndication.js.map +1 -1
- package/dist/Field.js +3 -1
- package/dist/Field.js.map +1 -1
- package/dist/FileUploader/FileUploadIllustration.js.map +1 -0
- package/dist/FileUploader/FileUploadPreview.js.map +1 -0
- package/dist/{labs/FileUpload.js → FileUploader/FileUploader.js} +6 -5
- package/dist/FileUploader/FileUploader.js.map +1 -0
- package/dist/FileUploader/index.js +13 -0
- package/dist/FileUploader/index.js.map +1 -0
- package/dist/OdysseyCacheProvider.js +4 -3
- package/dist/OdysseyCacheProvider.js.map +1 -1
- package/dist/OdysseyProvider.js +10 -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 +33 -6
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +17 -5
- package/dist/RadioGroup.js.map +1 -1
- package/dist/Select.js +89 -31
- package/dist/Select.js.map +1 -1
- package/dist/{labs/Switch.js → Switch.js} +77 -23
- package/dist/Switch.js.map +1 -0
- package/dist/Tabs.js +7 -9
- package/dist/Tabs.js.map +1 -1
- package/dist/Tag.js +102 -4
- package/dist/Tag.js.map +1 -1
- package/dist/TextField.js +16 -39
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.js +2 -2
- package/dist/Toast.js.map +1 -1
- package/dist/ToastStack.js.map +1 -1
- package/dist/createShadowDomElements.js +43 -0
- package/dist/createShadowDomElements.js.map +1 -0
- package/dist/i18n.js +1 -1
- package/dist/i18n.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/index.scss +96 -8
- 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 +79 -30
- 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} +34 -20
- 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/DateField.js +2 -0
- package/dist/labs/DateField.js.map +1 -1
- package/dist/labs/DatePicker.js +5 -1
- package/dist/labs/DatePicker.js.map +1 -1
- package/dist/labs/SideNav/CollapseIcon.js +44 -0
- package/dist/labs/SideNav/CollapseIcon.js.map +1 -0
- package/dist/labs/SideNav/OktaLogo.js +36 -0
- package/dist/labs/SideNav/OktaLogo.js.map +1 -0
- package/dist/labs/SideNav/SideNav.js +335 -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 +81 -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/TopNav.js +2 -1
- package/dist/labs/TopNav.js.map +1 -1
- package/dist/labs/index.js +3 -4
- package/dist/labs/index.js.map +1 -1
- package/dist/labs/useDateFieldsTranslations.js +1 -1
- package/dist/labs/useDateFieldsTranslations.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui.js +3 -1
- package/dist/properties/ts/odyssey-react-mui.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 +30 -0
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Callout.d.ts +11 -23
- package/dist/src/Callout.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/DataTable/useScrollIndication.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/FileUploader/FileUploadIllustration.d.ts.map +1 -0
- package/dist/src/{labs → FileUploader}/FileUploadPreview.d.ts +2 -2
- package/dist/src/FileUploader/FileUploadPreview.d.ts.map +1 -0
- package/dist/src/{labs/FileUpload.d.ts → FileUploader/FileUploader.d.ts} +5 -4
- package/dist/src/FileUploader/FileUploader.d.ts.map +1 -0
- package/dist/src/FileUploader/index.d.ts +13 -0
- package/dist/src/FileUploader/index.d.ts.map +1 -0
- package/dist/src/NativeSelect.d.ts +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/OdysseyTranslationProvider.d.ts +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts +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/SearchField.d.ts +1 -1
- package/dist/src/Select.d.ts +38 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/{labs/Switch.d.ts → Switch.d.ts} +8 -4
- package/dist/src/Switch.d.ts.map +1 -0
- package/dist/src/Tabs.d.ts +6 -8
- package/dist/src/Tabs.d.ts.map +1 -1
- package/dist/src/Tag.d.ts +7 -1
- package/dist/src/Tag.d.ts.map +1 -1
- package/dist/src/TextField.d.ts +17 -40
- package/dist/src/TextField.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/i18n.d.ts +2 -2
- package/dist/src/i18n.d.ts.map +1 -1
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.d.ts.map +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} +8 -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 +21 -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/DateField.d.ts +2 -2
- package/dist/src/labs/DateField.d.ts.map +1 -1
- package/dist/src/labs/DatePicker.d.ts +2 -2
- package/dist/src/labs/DatePicker.d.ts.map +1 -1
- 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/OktaLogo.d.ts +14 -0
- package/dist/src/labs/SideNav/OktaLogo.d.ts.map +1 -0
- package/dist/src/labs/SideNav/SideNav.d.ts +16 -0
- package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -0
- package/dist/{test-selectors/odysseyTestSelectors.js → src/labs/SideNav/SideNavFooterContent.d.ts} +6 -9
- 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} +54 -33
- package/dist/src/labs/SideNav/types.d.ts.map +1 -0
- package/dist/src/labs/TopNav.d.ts +1 -0
- package/dist/src/labs/TopNav.d.ts.map +1 -1
- package/dist/src/labs/index.d.ts +2 -3
- package/dist/src/labs/index.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui.d.ts +2 -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 +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/test-selectors/getByQuerySelector.d.ts +148 -0
- package/dist/src/test-selectors/getByQuerySelector.d.ts.map +1 -0
- package/dist/src/test-selectors/getComputedAccessibleErrorMessageText.d.ts +14 -0
- package/dist/src/test-selectors/getComputedAccessibleErrorMessageText.d.ts.map +1 -0
- package/dist/src/test-selectors/getComputedAccessibleText.d.ts +23 -0
- package/dist/src/test-selectors/getComputedAccessibleText.d.ts.map +1 -0
- package/dist/src/test-selectors/index.d.ts +2 -2
- package/dist/src/test-selectors/index.d.ts.map +1 -1
- package/{src/test-selectors/odysseyTestSelectors.ts → dist/src/test-selectors/interpolateString.d.ts} +4 -11
- package/dist/src/test-selectors/interpolateString.d.ts.map +1 -0
- package/dist/src/test-selectors/linkedHtmlSelectors.d.ts +24 -0
- package/dist/src/test-selectors/linkedHtmlSelectors.d.ts.map +1 -0
- package/dist/src/test-selectors/queryOdysseySelector.d.ts +5755 -0
- package/dist/src/test-selectors/queryOdysseySelector.d.ts.map +1 -0
- package/dist/src/test-selectors/querySelector.d.ts +59 -3613
- package/dist/src/test-selectors/querySelector.d.ts.map +1 -1
- package/dist/src/test-selectors/sanityChecks.d.ts +18 -0
- package/dist/src/test-selectors/sanityChecks.d.ts.map +1 -0
- package/dist/src/test-selectors/testSelector.d.ts +46 -0
- package/dist/src/test-selectors/testSelector.d.ts.map +1 -0
- 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/test-selectors/getByQuerySelector.js +64 -0
- package/dist/test-selectors/getByQuerySelector.js.map +1 -0
- package/dist/test-selectors/getComputedAccessibleErrorMessageText.js +25 -0
- package/dist/test-selectors/getComputedAccessibleErrorMessageText.js.map +1 -0
- package/dist/test-selectors/getComputedAccessibleText.js +24 -0
- package/dist/test-selectors/getComputedAccessibleText.js.map +1 -0
- package/dist/test-selectors/index.js +2 -2
- package/dist/test-selectors/index.js.map +1 -1
- package/dist/test-selectors/interpolateString.js +25 -0
- package/dist/test-selectors/interpolateString.js.map +1 -0
- package/dist/test-selectors/linkedHtmlSelectors.js +34 -0
- package/dist/test-selectors/linkedHtmlSelectors.js.map +1 -0
- package/dist/test-selectors/queryOdysseySelector.js +26 -0
- package/dist/test-selectors/queryOdysseySelector.js.map +1 -0
- package/dist/test-selectors/querySelector.js +82 -58
- package/dist/test-selectors/querySelector.js.map +1 -1
- package/dist/test-selectors/sanityChecks.js +33 -0
- package/dist/test-selectors/sanityChecks.js.map +1 -0
- package/dist/test-selectors/testSelector.js +2 -0
- package/dist/test-selectors/testSelector.js.map +1 -0
- package/dist/test-selectors/testSelectors.json +1 -1
- package/dist/theme/components.js +231 -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/dist/tsconfig.tsbuildinfo +1 -1
- package/jest.setup.js +3 -0
- package/package.json +5 -5
- package/scripts/generateTestSelectorsJson.ts +1 -1
- package/src/@types/i18next.d.ts +1 -1
- package/src/Autocomplete.tsx +140 -45
- package/src/Callout.tsx +13 -25
- package/src/Checkbox.tsx +39 -9
- package/src/CheckboxGroup.tsx +20 -4
- package/src/DataTable/DataTable.tsx +24 -1
- package/src/DataTable/useScrollIndication.tsx +11 -4
- package/src/Field.tsx +5 -2
- package/src/{labs → FileUploader}/FileUploadPreview.tsx +3 -3
- package/src/{labs/FileUpload.tsx → FileUploader/FileUploader.tsx} +7 -6
- package/src/FileUploader/index.ts +13 -0
- package/src/OdysseyCacheProvider.test.tsx +1 -0
- package/src/OdysseyCacheProvider.tsx +18 -4
- package/src/OdysseyProvider.tsx +12 -4
- package/src/OdysseyThemeProvider.tsx +6 -2
- package/src/Radio.tsx +41 -12
- package/src/RadioGroup.tsx +26 -7
- package/src/Select.tsx +116 -45
- package/src/{labs/Switch.tsx → Switch.tsx} +95 -41
- package/src/Tabs.tsx +8 -10
- package/src/Tag.tsx +134 -3
- package/src/TextField.tsx +18 -41
- package/src/Toast.tsx +1 -1
- package/src/ToastStack.tsx +2 -2
- package/src/createShadowDomElements.ts +53 -0
- package/src/i18n.ts +3 -3
- package/src/index.ts +7 -2
- 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/DataView/DataView.test.tsx +158 -0
- package/src/labs/{DataComponents → DataView}/DataView.tsx +119 -42
- package/src/labs/{DataComponents → DataView}/DetailPanel.tsx +2 -2
- package/src/labs/{DataComponents/TableContent.tsx → DataView/TableLayoutContent.tsx} +59 -27
- package/src/labs/{DataComponents → DataView}/TableSettings.tsx +5 -4
- package/src/labs/{DataComponents → DataView}/componentTypes.ts +24 -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/DateField.tsx +3 -0
- package/src/labs/DatePicker.tsx +12 -1
- package/src/labs/SideNav/CollapseIcon.tsx +48 -0
- package/src/labs/SideNav/OktaLogo.tsx +39 -0
- package/src/labs/SideNav/SideNav.tsx +486 -0
- package/src/labs/SideNav/SideNavFooterContent.tsx +64 -0
- package/src/labs/SideNav/SideNavHeader.tsx +88 -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 +152 -0
- package/src/labs/TopNav.tsx +3 -1
- package/src/labs/index.ts +3 -4
- package/src/labs/useDateFieldsTranslations.ts +1 -1
- package/src/properties/odyssey-react-mui.properties +2 -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.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/getByQuerySelector.ts +176 -0
- package/src/test-selectors/getComputedAccessibleErrorMessageText.ts +52 -0
- package/src/test-selectors/getComputedAccessibleText.ts +36 -0
- package/src/test-selectors/index.ts +2 -2
- package/src/test-selectors/interpolateString.ts +41 -0
- package/src/test-selectors/linkedHtmlSelectors.ts +73 -0
- package/src/test-selectors/queryOdysseySelector.ts +36 -0
- package/src/test-selectors/querySelector.ts +221 -170
- package/src/test-selectors/sanityChecks.ts +53 -0
- package/src/test-selectors/testSelector.ts +143 -0
- package/src/theme/components.tsx +238 -150
- package/src/theme/createOdysseyMuiTheme.ts +4 -1
- package/dist/createShadowRootElement.js +0 -26
- 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/FileUpload.js.map +0 -1
- package/dist/labs/FileUploadIllustration.js.map +0 -1
- package/dist/labs/FileUploadPreview.js.map +0 -1
- package/dist/labs/SideNav.js +0 -478
- package/dist/labs/SideNav.js.map +0 -1
- package/dist/labs/Switch.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/FileUpload.d.ts.map +0 -1
- package/dist/src/labs/FileUploadIllustration.d.ts.map +0 -1
- package/dist/src/labs/FileUploadPreview.d.ts.map +0 -1
- package/dist/src/labs/SideNav.d.ts.map +0 -1
- package/dist/src/labs/Switch.d.ts.map +0 -1
- package/dist/src/test-selectors/featureTestSelector.d.ts +0 -31
- package/dist/src/test-selectors/featureTestSelector.d.ts.map +0 -1
- package/dist/src/test-selectors/odysseyTestSelectors.d.ts +0 -120
- package/dist/src/test-selectors/odysseyTestSelectors.d.ts.map +0 -1
- package/dist/test-selectors/featureTestSelector.js +0 -2
- package/dist/test-selectors/featureTestSelector.js.map +0 -1
- package/dist/test-selectors/odysseyTestSelectors.js.map +0 -1
- package/src/createShadowRootElement.ts +0 -31
- package/src/labs/DataComponents/DataStack.tsx +0 -105
- package/src/labs/SideNav.tsx +0 -745
- package/src/test-selectors/featureTestSelector.ts +0 -41
- /package/dist/{labs → FileUploader}/FileUploadIllustration.js +0 -0
- /package/dist/{labs → FileUploader}/FileUploadPreview.js +0 -0
- /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 → FileUploader}/FileUploadIllustration.d.ts +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 → FileUploader}/FileUploadIllustration.tsx +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
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export * from "./FileUploader.js";
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/FileUploader/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport * from \"./FileUploader\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA"}
|
|
@@ -18,6 +18,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
18
18
|
const OdysseyCacheProvider = ({
|
|
19
19
|
children,
|
|
20
20
|
emotionRoot,
|
|
21
|
+
emotionRootElement,
|
|
21
22
|
hasShadowDom: hasShadowDomProp,
|
|
22
23
|
nonce,
|
|
23
24
|
shadowDomElement,
|
|
@@ -27,8 +28,8 @@ const OdysseyCacheProvider = ({
|
|
|
27
28
|
const hasShadowDom = hasShadowDomProp || shadowDomElement;
|
|
28
29
|
const emotionCache = useMemo(() => {
|
|
29
30
|
return createCache({
|
|
30
|
-
...(emotionRoot && {
|
|
31
|
-
container: emotionRoot
|
|
31
|
+
...((emotionRootElement || emotionRoot) && {
|
|
32
|
+
container: emotionRootElement || emotionRoot
|
|
32
33
|
}),
|
|
33
34
|
key: uniqueAlphabeticalId,
|
|
34
35
|
nonce: nonce ?? window.cspNonce,
|
|
@@ -38,7 +39,7 @@ const OdysseyCacheProvider = ({
|
|
|
38
39
|
stylisPlugins
|
|
39
40
|
})
|
|
40
41
|
});
|
|
41
|
-
}, [emotionRoot, hasShadowDom, nonce, stylisPlugins, uniqueAlphabeticalId]);
|
|
42
|
+
}, [emotionRoot, emotionRootElement, hasShadowDom, nonce, stylisPlugins, uniqueAlphabeticalId]);
|
|
42
43
|
return _jsx(CacheProvider, {
|
|
43
44
|
value: emotionCache,
|
|
44
45
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","memo","useMemo","useUniqueAlphabeticalId","CacheProvider","jsx","_jsx","OdysseyCacheProvider","children","emotionRoot","hasShadowDom","hasShadowDomProp","nonce","shadowDomElement","stylisPlugins","uniqueAlphabeticalId","emotionCache","container","key","window","cspNonce","prepend","speedy","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../src/OdysseyCacheProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\ndeclare global {\n interface Window {\n cspNonce: string;\n }\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { memo, useMemo, ReactNode } from \"react\";\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId\";\nimport { CacheProvider } from \"@emotion/react\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n /**\n * Emotion caches styles into the style element.\n * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.\n */\n emotionRoot?: HTMLStyleElement;\n hasShadowDom?: boolean;\n nonce?: string;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n
|
|
1
|
+
{"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","memo","useMemo","useUniqueAlphabeticalId","CacheProvider","jsx","_jsx","OdysseyCacheProvider","children","emotionRoot","emotionRootElement","hasShadowDom","hasShadowDomProp","nonce","shadowDomElement","stylisPlugins","uniqueAlphabeticalId","emotionCache","container","key","window","cspNonce","prepend","speedy","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../src/OdysseyCacheProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\ndeclare global {\n interface Window {\n cspNonce: string;\n }\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { memo, useMemo, ReactNode } from \"react\";\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId\";\nimport { CacheProvider } from \"@emotion/react\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n /**\n * Emotion caches styles into the style element.\n * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.\n * @deprecated Use `EmotionRootElement` instead. This was incorrectly configured as an `HTMLStyleElement`, but then we're rendering `<style>` inside `<style>`. We need this to be a `<div>` instead.\n */\n emotionRoot?: HTMLStyleElement;\n /**\n * Emotion adds `<style>` elements into this DOM node. Normally, Emotion puts these in `document.head`.\n * This is useful if you want to render into a Shadow DOM or iframe.\n */\n emotionRootElement?: HTMLElement;\n hasShadowDom?: boolean;\n nonce?: string;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n * @deprecated Will be removed in a future Odyssey version. Use `hasShadowDomElement` instead.\n */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n emotionRoot,\n emotionRootElement,\n hasShadowDom: hasShadowDomProp,\n nonce,\n shadowDomElement,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const hasShadowDom = hasShadowDomProp || shadowDomElement;\n\n const emotionCache = useMemo(() => {\n return createCache({\n ...((emotionRootElement || emotionRoot) && {\n container: emotionRootElement || emotionRoot,\n }),\n key: uniqueAlphabeticalId,\n nonce: nonce ?? window.cspNonce,\n prepend: true,\n speedy: hasShadowDom ? false : true, // <-- Needs to be set to false when shadow-dom is used!! https://github.com/emotion-js/emotion/issues/2053#issuecomment-713429122\n ...(stylisPlugins && { stylisPlugins }),\n });\n }, [\n emotionRoot,\n emotionRootElement,\n hasShadowDom,\n nonce,\n stylisPlugins,\n uniqueAlphabeticalId,\n ]);\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,WAAW,MAAwB,gBAAgB;AAC1D,SAASC,IAAI,EAAEC,OAAO,QAAmB,OAAO;AAAC,SACxCC,uBAAuB;AAChC,SAASC,aAAa,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AA0B/C,MAAMC,oBAAoB,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,WAAW;EACXC,kBAAkB;EAClBC,YAAY,EAAEC,gBAAgB;EAC9BC,KAAK;EACLC,gBAAgB;EAChBC;AACyB,CAAC,KAAK;EAC/B,MAAMC,oBAAoB,GAAGb,uBAAuB,CAAC,CAAC;EAEtD,MAAMQ,YAAY,GAAGC,gBAAgB,IAAIE,gBAAgB;EAEzD,MAAMG,YAAY,GAAGf,OAAO,CAAC,MAAM;IACjC,OAAOF,WAAW,CAAC;MACjB,IAAI,CAACU,kBAAkB,IAAID,WAAW,KAAK;QACzCS,SAAS,EAAER,kBAAkB,IAAID;MACnC,CAAC,CAAC;MACFU,GAAG,EAAEH,oBAAoB;MACzBH,KAAK,EAAEA,KAAK,IAAIO,MAAM,CAACC,QAAQ;MAC/BC,OAAO,EAAE,IAAI;MACbC,MAAM,EAAEZ,YAAY,GAAG,KAAK,GAAG,IAAI;MACnC,IAAII,aAAa,IAAI;QAAEA;MAAc,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,EAAE,CACDN,WAAW,EACXC,kBAAkB,EAClBC,YAAY,EACZE,KAAK,EACLE,aAAa,EACbC,oBAAoB,CACrB,CAAC;EAEF,OAAOV,IAAA,CAACF,aAAa;IAACoB,KAAK,EAAEP,YAAa;IAAAT,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AACvE,CAAC;AAED,MAAMiB,4BAA4B,GAAGxB,IAAI,CAACM,oBAAoB,CAAC;AAC/DkB,4BAA4B,CAACC,WAAW,GAAG,sBAAsB;AAEjE,SAASD,4BAA4B,IAAIlB,oBAAoB"}
|
package/dist/OdysseyProvider.js
CHANGED
|
@@ -16,26 +16,33 @@ import { OdysseyCacheProvider } from "./OdysseyCacheProvider.js";
|
|
|
16
16
|
import { OdysseyThemeProvider } from "./OdysseyThemeProvider.js";
|
|
17
17
|
import { OdysseyTranslationProvider } from "./OdysseyTranslationProvider.js";
|
|
18
18
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
const scopedCssBaselineStyles = {
|
|
20
|
+
height: "inherit"
|
|
21
|
+
};
|
|
19
22
|
const OdysseyProvider = ({
|
|
20
23
|
children,
|
|
21
24
|
designTokensOverride,
|
|
22
25
|
emotionRoot,
|
|
26
|
+
emotionRootElement,
|
|
23
27
|
shadowDomElement,
|
|
28
|
+
shadowRootElement,
|
|
24
29
|
languageCode,
|
|
25
30
|
nonce,
|
|
26
31
|
stylisPlugins,
|
|
27
32
|
themeOverride,
|
|
28
33
|
translationOverrides
|
|
29
34
|
}) => _jsx(OdysseyCacheProvider, {
|
|
30
|
-
nonce: nonce,
|
|
31
35
|
emotionRoot: emotionRoot,
|
|
32
|
-
|
|
36
|
+
emotionRootElement: emotionRootElement,
|
|
37
|
+
hasShadowDom: Boolean(shadowRootElement || shadowDomElement),
|
|
38
|
+
nonce: nonce,
|
|
33
39
|
stylisPlugins: stylisPlugins,
|
|
34
40
|
children: _jsx(OdysseyThemeProvider, {
|
|
35
41
|
designTokensOverride: designTokensOverride,
|
|
36
|
-
|
|
42
|
+
shadowRootElement: shadowRootElement || shadowDomElement,
|
|
37
43
|
themeOverride: themeOverride,
|
|
38
44
|
children: _jsx(_ScopedCssBaseline, {
|
|
45
|
+
sx: scopedCssBaselineStyles,
|
|
39
46
|
children: _jsx(OdysseyTranslationProvider, {
|
|
40
47
|
languageCode: languageCode,
|
|
41
48
|
translationOverrides: translationOverrides,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","OdysseyProvider","children","designTokensOverride","emotionRoot","shadowDomElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","hasShadowDom","Boolean","_ScopedCssBaseline","MemoizedThemeProvider"],"sources":["../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { ScopedCssBaseline } from \"@mui/material\";\n\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider\";\nimport {\n OdysseyTranslationProvider,\n OdysseyTranslationProviderProps,\n} from \"./OdysseyTranslationProvider\";\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n designTokensOverride,\n emotionRoot,\n shadowDomElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n
|
|
1
|
+
{"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","scopedCssBaselineStyles","height","OdysseyProvider","children","designTokensOverride","emotionRoot","emotionRootElement","shadowDomElement","shadowRootElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","hasShadowDom","Boolean","_ScopedCssBaseline","sx","MemoizedThemeProvider"],"sources":["../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { ScopedCssBaseline } from \"@mui/material\";\n\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider\";\nimport {\n OdysseyTranslationProvider,\n OdysseyTranslationProviderProps,\n} from \"./OdysseyTranslationProvider\";\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nconst scopedCssBaselineStyles = {\n height: \"inherit\",\n};\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n designTokensOverride,\n emotionRoot,\n emotionRootElement,\n shadowDomElement,\n shadowRootElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n emotionRoot={emotionRoot}\n emotionRootElement={emotionRootElement}\n hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}\n nonce={nonce}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n designTokensOverride={designTokensOverride}\n shadowRootElement={shadowRootElement || shadowDomElement}\n themeOverride={themeOverride}\n >\n {/* This component creates a div; for flexibility of layout of children, make it inherit its parent's height */}\n <ScopedCssBaseline sx={scopedCssBaselineStyles}>\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n </ScopedCssBaseline>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\n\nconst MemoizedThemeProvider = memo(OdysseyProvider) as typeof OdysseyProvider;\n\nexport { MemoizedThemeProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAItCC,oBAAoB;AAAA,SAIpBC,oBAAoB;AAAA,SAIpBC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAK5B,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE;AACV,CAAC;AAUD,MAAMC,eAAe,GAAGA,CAAoC;EAC1DC,QAAQ;EACRC,oBAAoB;EACpBC,WAAW;EACXC,kBAAkB;EAClBC,gBAAgB;EAChBC,iBAAiB;EACjBC,YAAY;EACZC,KAAK;EACLC,aAAa;EACbC,aAAa;EACbC;AACwC,CAAC,KACzCd,IAAA,CAACJ,oBAAoB;EACnBU,WAAW,EAAEA,WAAY;EACzBC,kBAAkB,EAAEA,kBAAmB;EACvCQ,YAAY,EAAEC,OAAO,CAACP,iBAAiB,IAAID,gBAAgB,CAAE;EAC7DG,KAAK,EAAEA,KAAM;EACbC,aAAa,EAAEA,aAAc;EAAAR,QAAA,EAE7BJ,IAAA,CAACH,oBAAoB;IACnBQ,oBAAoB,EAAEA,oBAAqB;IAC3CI,iBAAiB,EAAEA,iBAAiB,IAAID,gBAAiB;IACzDK,aAAa,EAAEA,aAAc;IAAAT,QAAA,EAG7BJ,IAAA,CAAAiB,kBAAA;MAAmBC,EAAE,EAAEjB,uBAAwB;MAAAG,QAAA,EAC7CJ,IAAA,CAACF,0BAA0B;QACzBY,YAAY,EAAEA,YAAa;QAC3BI,oBAAoB,EAAEA,oBAAqB;QAAAV,QAAA,EAE1CA;MAAQ,CACiB;IAAC,CACZ;EAAC,CACA;AAAC,CACH,CACvB;AAED,MAAMe,qBAAqB,GAAGxB,IAAI,CAACQ,eAAe,CAA2B;AAE7E,SAASgB,qBAAqB,IAAIhB,eAAe"}
|
|
@@ -21,6 +21,7 @@ const OdysseyThemeProvider = ({
|
|
|
21
21
|
children,
|
|
22
22
|
designTokensOverride,
|
|
23
23
|
shadowDomElement,
|
|
24
|
+
shadowRootElement,
|
|
24
25
|
themeOverride
|
|
25
26
|
}) => {
|
|
26
27
|
const odysseyTokens = useMemo(() => ({
|
|
@@ -29,8 +30,8 @@ const OdysseyThemeProvider = ({
|
|
|
29
30
|
}), [designTokensOverride]);
|
|
30
31
|
const odysseyTheme = useMemo(() => createOdysseyMuiTheme({
|
|
31
32
|
odysseyTokens,
|
|
32
|
-
shadowDomElement
|
|
33
|
-
}), [odysseyTokens, shadowDomElement]);
|
|
33
|
+
shadowRootElement: shadowRootElement || shadowDomElement
|
|
34
|
+
}), [odysseyTokens, shadowDomElement, shadowRootElement]);
|
|
34
35
|
const customOdysseyTheme = useMemo(() => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)), [odysseyTheme, themeOverride]);
|
|
35
36
|
return _jsx(MuiThemeProvider, {
|
|
36
37
|
theme: customOdysseyTheme ?? odysseyTheme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","jsx","_jsx","OdysseyThemeProvider","children","designTokensOverride","shadowDomElement","themeOverride","odysseyTokens","odysseyTheme","customOdysseyTheme","theme","Provider","value","MemoizedOdysseyThemeProvider"],"sources":["../src/OdysseyThemeProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { ThemeOptions } from \"@mui/material\";\nimport { deepmerge } from \"@mui/utils\";\nimport { createOdysseyMuiTheme, DesignTokensOverride } from \"./theme\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { OdysseyDesignTokensContext } from \"./OdysseyDesignTokensContext\";\n\nexport type OdysseyThemeProviderProps = {\n children: ReactNode;\n designTokensOverride?: DesignTokensOverride;\n shadowDomElement?: HTMLDivElement | HTMLElement | undefined;\n themeOverride?: ThemeOptions;\n};\n\n/**\n * This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.\n *\n * Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.\n */\nconst OdysseyThemeProvider = ({\n children,\n designTokensOverride,\n shadowDomElement,\n themeOverride,\n}: OdysseyThemeProviderProps) => {\n const odysseyTokens = useMemo(\n () => ({ ...Tokens, ...designTokensOverride }),\n [designTokensOverride],\n );\n const odysseyTheme = useMemo(\n () =>\n createOdysseyMuiTheme({\n odysseyTokens,\n shadowDomElement,\n }),\n [odysseyTokens, shadowDomElement],\n );\n\n const customOdysseyTheme = useMemo(\n () => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)),\n [odysseyTheme, themeOverride],\n );\n\n return (\n <MuiThemeProvider theme={customOdysseyTheme ?? odysseyTheme}>\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </MuiThemeProvider>\n );\n};\n\nconst MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);\n\nexport { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,WAAW,EACXC,aAAa,IAAIC,gBAAgB,QAC5B,sBAAsB;AAC7B,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAGhD,SAASC,SAAS,QAAQ,YAAY;AAAC,SAC9BC,qBAAqB;AAC9B,OAAO,KAAKC,MAAM,MAAM,6BAA6B;AAAC,SAC7CC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;
|
|
1
|
+
{"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","jsx","_jsx","OdysseyThemeProvider","children","designTokensOverride","shadowDomElement","shadowRootElement","themeOverride","odysseyTokens","odysseyTheme","customOdysseyTheme","theme","Provider","value","MemoizedOdysseyThemeProvider"],"sources":["../src/OdysseyThemeProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { ThemeOptions } from \"@mui/material\";\nimport { deepmerge } from \"@mui/utils\";\nimport { createOdysseyMuiTheme, DesignTokensOverride } from \"./theme\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { OdysseyDesignTokensContext } from \"./OdysseyDesignTokensContext\";\n\nexport type OdysseyThemeProviderProps = {\n children: ReactNode;\n designTokensOverride?: DesignTokensOverride;\n /** @deprecated Use `shadowRootElement` instead. */\n shadowDomElement?: HTMLDivElement | HTMLElement | undefined;\n shadowRootElement?: HTMLDivElement | HTMLElement;\n themeOverride?: ThemeOptions;\n};\n\n/**\n * This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.\n *\n * Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.\n */\nconst OdysseyThemeProvider = ({\n children,\n designTokensOverride,\n shadowDomElement,\n shadowRootElement,\n themeOverride,\n}: OdysseyThemeProviderProps) => {\n const odysseyTokens = useMemo(\n () => ({ ...Tokens, ...designTokensOverride }),\n [designTokensOverride],\n );\n\n const odysseyTheme = useMemo(\n () =>\n createOdysseyMuiTheme({\n odysseyTokens,\n shadowRootElement: shadowRootElement || shadowDomElement,\n }),\n [odysseyTokens, shadowDomElement, shadowRootElement],\n );\n\n const customOdysseyTheme = useMemo(\n () => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)),\n [odysseyTheme, themeOverride],\n );\n\n return (\n <MuiThemeProvider theme={customOdysseyTheme ?? odysseyTheme}>\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </MuiThemeProvider>\n );\n};\n\nconst MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);\n\nexport { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,WAAW,EACXC,aAAa,IAAIC,gBAAgB,QAC5B,sBAAsB;AAC7B,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAGhD,SAASC,SAAS,QAAQ,YAAY;AAAC,SAC9BC,qBAAqB;AAC9B,OAAO,KAAKC,MAAM,MAAM,6BAA6B;AAAC,SAC7CC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAgBnC,MAAMC,oBAAoB,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,oBAAoB;EACpBC,gBAAgB;EAChBC,iBAAiB;EACjBC;AACyB,CAAC,KAAK;EAC/B,MAAMC,aAAa,GAAGb,OAAO,CAC3B,OAAO;IAAE,GAAGG,MAAM;IAAE,GAAGM;EAAqB,CAAC,CAAC,EAC9C,CAACA,oBAAoB,CACvB,CAAC;EAED,MAAMK,YAAY,GAAGd,OAAO,CAC1B,MACEE,qBAAqB,CAAC;IACpBW,aAAa;IACbF,iBAAiB,EAAEA,iBAAiB,IAAID;EAC1C,CAAC,CAAC,EACJ,CAACG,aAAa,EAAEH,gBAAgB,EAAEC,iBAAiB,CACrD,CAAC;EAED,MAAMI,kBAAkB,GAAGf,OAAO,CAChC,MAAMY,aAAa,IAAIhB,WAAW,CAACK,SAAS,CAACa,YAAY,EAAEF,aAAa,CAAC,CAAC,EAC1E,CAACE,YAAY,EAAEF,aAAa,CAC9B,CAAC;EAED,OACEN,IAAA,CAACR,gBAAgB;IAACkB,KAAK,EAAED,kBAAkB,IAAID,YAAa;IAAAN,QAAA,EAC1DF,IAAA,CAACF,0BAA0B,CAACa,QAAQ;MAACC,KAAK,EAAEL,aAAc;MAAAL,QAAA,EACvDA;IAAQ,CAC0B;EAAC,CACtB,CAAC;AAEvB,CAAC;AAED,MAAMW,4BAA4B,GAAGpB,IAAI,CAACQ,oBAAoB,CAAC;AAE/D,SAASY,4BAA4B,IAAIZ,oBAAoB"}
|
package/dist/Radio.js
CHANGED
|
@@ -28,8 +28,10 @@ const Radio = ({
|
|
|
28
28
|
testId,
|
|
29
29
|
translate,
|
|
30
30
|
value,
|
|
31
|
+
isReadOnly,
|
|
31
32
|
onChange: onChangeProp,
|
|
32
|
-
onBlur: onBlurProp
|
|
33
|
+
onBlur: onBlurProp,
|
|
34
|
+
onClick
|
|
33
35
|
}) => {
|
|
34
36
|
const localInputRef = useRef(null);
|
|
35
37
|
useImperativeHandle(inputRef, () => {
|
|
@@ -48,7 +50,19 @@ const Radio = ({
|
|
|
48
50
|
children: hint
|
|
49
51
|
})]
|
|
50
52
|
}), [labelProp, hint, translate]);
|
|
51
|
-
const onChange = useCallback((event, checked) =>
|
|
53
|
+
const onChange = useCallback((event, checked) => {
|
|
54
|
+
if (isReadOnly) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
} else {
|
|
57
|
+
onChangeProp?.(event, checked);
|
|
58
|
+
}
|
|
59
|
+
}, [onChangeProp, isReadOnly]);
|
|
60
|
+
const handleClick = useCallback(event => {
|
|
61
|
+
if (isReadOnly) {
|
|
62
|
+
event.stopPropagation();
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
}
|
|
65
|
+
}, [isReadOnly]);
|
|
52
66
|
const onBlur = useCallback(event => {
|
|
53
67
|
onBlurProp?.(event);
|
|
54
68
|
}, [onBlurProp]);
|
|
@@ -57,17 +71,30 @@ const Radio = ({
|
|
|
57
71
|
className: isInvalid ? "Mui-error" : "",
|
|
58
72
|
control: _jsx(_Radio, {
|
|
59
73
|
inputProps: {
|
|
60
|
-
"data-se": testId
|
|
74
|
+
"data-se": testId,
|
|
75
|
+
"aria-disabled": isDisabled || isReadOnly,
|
|
76
|
+
readOnly: isReadOnly,
|
|
77
|
+
tabIndex: isReadOnly ? 0 : undefined
|
|
61
78
|
},
|
|
62
79
|
inputRef: localInputRef,
|
|
63
|
-
onChange: onChange
|
|
80
|
+
onChange: onChange,
|
|
81
|
+
onClick: onClick || handleClick,
|
|
82
|
+
disabled: isDisabled
|
|
64
83
|
}),
|
|
65
|
-
disabled: isDisabled,
|
|
66
84
|
label: label,
|
|
67
85
|
name: name,
|
|
68
86
|
translate: translate,
|
|
69
87
|
value: value,
|
|
70
|
-
onBlur: onBlur
|
|
88
|
+
onBlur: onBlur,
|
|
89
|
+
disabled: isDisabled,
|
|
90
|
+
sx: {
|
|
91
|
+
...(isReadOnly && {
|
|
92
|
+
cursor: "default",
|
|
93
|
+
"& .MuiTypography-root": {
|
|
94
|
+
cursor: "default"
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
}
|
|
71
98
|
});
|
|
72
99
|
};
|
|
73
100
|
const MemoizedRadio = memo(Radio);
|
package/dist/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","names":["memo","useCallback","useMemo","useRef","useImperativeHandle","Typography","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Radio","hint","inputRef","isChecked","isDisabled","isInvalid","label","labelProp","name","testId","translate","value","onChange","onChangeProp","onBlur","onBlurProp","localInputRef","focus","current","children","component","_FormHelperText","event","checked","_FormControlLabel","className","control","_Radio","inputProps","disabled","MemoizedRadio","displayName"],"sources":["../src/Radio.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n FormHelperText,\n Radio as MuiRadio,\n RadioProps as MuiRadioProps,\n} from \"@mui/material\";\
|
|
1
|
+
{"version":3,"file":"Radio.js","names":["memo","useCallback","useMemo","useRef","useImperativeHandle","Typography","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Radio","hint","inputRef","isChecked","isDisabled","isInvalid","label","labelProp","name","testId","translate","value","isReadOnly","onChange","onChangeProp","onBlur","onBlurProp","onClick","localInputRef","focus","current","children","component","_FormHelperText","event","checked","preventDefault","handleClick","stopPropagation","_FormControlLabel","className","control","_Radio","inputProps","readOnly","tabIndex","undefined","disabled","sx","cursor","MemoizedRadio","displayName"],"sources":["../src/Radio.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n FormHelperText,\n Radio as MuiRadio,\n RadioProps as MuiRadioProps,\n} from \"@mui/material\";\nimport { memo, useCallback, useMemo, useRef, useImperativeHandle } from \"react\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\nimport { Typography } from \"./Typography\";\n\nexport type RadioProps = {\n /**\n * The ref forwarded to the Radio\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Determines whether the Radio button is checked\n */\n isChecked?: boolean;\n /**\n * If `true`, the radio button has an invalid value\n */\n isInvalid?: boolean;\n /**\n * The label text for the Radio\n */\n label: string;\n /**\n * The value attribute of the Radio\n */\n value: string;\n /**\n * Callback fired when the blur event happens. Provides event value.\n */\n onChange?: MuiRadioProps[\"onChange\"];\n onBlur?: MuiFormControlLabelProps[\"onBlur\"];\n onClick?: React.MouseEventHandler<HTMLSpanElement>;\n} & Pick<\n FieldComponentProps,\n \"hint\" | \"id\" | \"isDisabled\" | \"isReadOnly\" | \"name\"\n> &\n Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Radio = ({\n hint,\n inputRef,\n isChecked,\n isDisabled,\n isInvalid,\n label: labelProp,\n name,\n testId,\n translate,\n value,\n isReadOnly,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n onClick,\n}: RadioProps) => {\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n const label = useMemo(\n () => (\n <>\n <Typography component=\"span\">{labelProp}</Typography>\n {hint && <FormHelperText translate={translate}>{hint}</FormHelperText>}\n </>\n ),\n [labelProp, hint, translate],\n );\n\n const onChange = useCallback<NonNullable<MuiRadioProps[\"onChange\"]>>(\n (event, checked) => {\n if (isReadOnly) {\n event.preventDefault();\n } else {\n onChangeProp?.(event, checked);\n }\n },\n [onChangeProp, isReadOnly],\n );\n\n const handleClick = useCallback<React.MouseEventHandler<HTMLSpanElement>>(\n (event) => {\n if (isReadOnly) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n [isReadOnly],\n );\n const onBlur = useCallback<NonNullable<MuiFormControlLabelProps[\"onBlur\"]>>(\n (event) => {\n onBlurProp?.(event);\n },\n [onBlurProp],\n );\n\n return (\n <FormControlLabel\n checked={isChecked}\n className={isInvalid ? \"Mui-error\" : \"\"}\n control={\n <MuiRadio\n inputProps={{\n \"data-se\": testId,\n \"aria-disabled\": isDisabled || isReadOnly,\n readOnly: isReadOnly,\n tabIndex: isReadOnly ? 0 : undefined,\n }}\n inputRef={localInputRef}\n onChange={onChange}\n onClick={onClick || handleClick}\n disabled={isDisabled}\n />\n }\n label={label}\n name={name}\n translate={translate}\n value={value}\n onBlur={onBlur}\n disabled={isDisabled}\n sx={{\n ...(isReadOnly && {\n cursor: \"default\",\n \"& .MuiTypography-root\": {\n cursor: \"default\",\n },\n }),\n }}\n />\n );\n};\n\nconst MemoizedRadio = memo(Radio);\nMemoizedRadio.displayName = \"Radio\";\n\nexport { MemoizedRadio as Radio };\n"],"mappings":"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"}
|
package/dist/RadioGroup.js
CHANGED
|
@@ -10,9 +10,10 @@ import _RadioGroup from "@mui/material/RadioGroup";
|
|
|
10
10
|
*
|
|
11
11
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
12
12
|
*/
|
|
13
|
-
import { memo, useCallback, useRef } from "react";
|
|
13
|
+
import React, { memo, useCallback, useRef, useMemo } from "react";
|
|
14
14
|
import { Field } from "./Field.js";
|
|
15
15
|
import { getControlState, useInputValues } from "./inputUtils.js";
|
|
16
|
+
import { Radio } from "./Radio.js";
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
const RadioGroup = ({
|
|
18
19
|
ariaDescribedBy,
|
|
@@ -24,6 +25,7 @@ const RadioGroup = ({
|
|
|
24
25
|
HintLinkComponent,
|
|
25
26
|
id: idOverride,
|
|
26
27
|
isDisabled,
|
|
28
|
+
isReadOnly = false,
|
|
27
29
|
label,
|
|
28
30
|
name: nameOverride,
|
|
29
31
|
onChange: onChangeProp,
|
|
@@ -40,9 +42,18 @@ const RadioGroup = ({
|
|
|
40
42
|
value,
|
|
41
43
|
controlState: controlledStateRef.current
|
|
42
44
|
});
|
|
43
|
-
const onChange = useCallback((event,
|
|
44
|
-
onChangeProp?.(event,
|
|
45
|
+
const onChange = useCallback((event, newValue) => {
|
|
46
|
+
onChangeProp?.(event, newValue);
|
|
45
47
|
}, [onChangeProp]);
|
|
48
|
+
const memoizedChildren = useMemo(() => React.Children.map(children, child => {
|
|
49
|
+
if (React.isValidElement(child) && child.type === Radio) {
|
|
50
|
+
return React.cloneElement(child, {
|
|
51
|
+
isDisabled: isDisabled,
|
|
52
|
+
isReadOnly: isReadOnly
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return child;
|
|
56
|
+
}), [children, isDisabled, isReadOnly]);
|
|
46
57
|
const renderFieldComponent = useCallback(({
|
|
47
58
|
ariaDescribedBy,
|
|
48
59
|
errorMessageElementId,
|
|
@@ -58,8 +69,8 @@ const RadioGroup = ({
|
|
|
58
69
|
name: nameOverride ?? id,
|
|
59
70
|
onChange: onChange,
|
|
60
71
|
translate: translate,
|
|
61
|
-
children:
|
|
62
|
-
}), [
|
|
72
|
+
children: memoizedChildren
|
|
73
|
+
}), [inputValues, nameOverride, onChange, memoizedChildren, testId, translate]);
|
|
63
74
|
return _jsx(Field, {
|
|
64
75
|
ariaDescribedBy: ariaDescribedBy,
|
|
65
76
|
errorMessage: errorMessage,
|
|
@@ -70,6 +81,7 @@ const RadioGroup = ({
|
|
|
70
81
|
HintLinkComponent: HintLinkComponent,
|
|
71
82
|
id: idOverride,
|
|
72
83
|
isDisabled: isDisabled,
|
|
84
|
+
isReadOnly: isReadOnly,
|
|
73
85
|
label: label,
|
|
74
86
|
renderFieldComponent: renderFieldComponent
|
|
75
87
|
});
|
package/dist/RadioGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["memo","useCallback","useRef","Field","getControlState","useInputValues","jsx","_jsx","RadioGroup","ariaDescribedBy","children","defaultValue","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","isDisabled","label","name","nameOverride","onChange","onChangeProp","testId","translate","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","event","renderFieldComponent","errorMessageElementId","labelElementId","_RadioGroup","fieldType","hasVisibleLabel","MemoizedRadioGroup","displayName"],"sources":["../src/RadioGroup.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n RadioGroup as MuiRadioGroup,\n type RadioGroupProps as MuiRadioGroupProps,\n} from \"@mui/material\";\nimport { memo, ReactNode, useCallback, useRef } from \"react\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["React","memo","useCallback","useRef","useMemo","Field","getControlState","useInputValues","Radio","jsx","_jsx","RadioGroup","ariaDescribedBy","children","defaultValue","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","isDisabled","isReadOnly","label","name","nameOverride","onChange","onChangeProp","testId","translate","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","event","newValue","memoizedChildren","Children","map","child","isValidElement","type","cloneElement","renderFieldComponent","errorMessageElementId","labelElementId","_RadioGroup","fieldType","hasVisibleLabel","MemoizedRadioGroup","displayName"],"sources":["../src/RadioGroup.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n RadioGroup as MuiRadioGroup,\n type RadioGroupProps as MuiRadioGroupProps,\n} from \"@mui/material\";\nimport React, { memo, ReactNode, useCallback, useRef, useMemo } from \"react\";\n\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { getControlState, useInputValues } from \"./inputUtils\";\nimport { Radio, RadioProps } from \"./Radio\";\n\nexport type RadioGroupProps = {\n /**\n * The Radio components within the group. Must include two or more.\n */\n children: ReactNode;\n /**\n * The text value of the Radio that should be selected by default\n */\n defaultValue?: string;\n /**\n * The text label for the RadioGroup\n */\n label: string;\n /**\n * Listen for changes in the browser that change `value`\n */\n onChange?: MuiRadioGroupProps[\"onChange\"];\n /**\n * The `value` on the selected Radio\n */\n value?: string;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst RadioGroup = ({\n ariaDescribedBy,\n children,\n defaultValue,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled,\n isReadOnly = false,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n testId,\n translate,\n value,\n}: RadioGroupProps) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiRadioGroupProps[\"onChange\"]>>(\n (event, newValue) => {\n onChangeProp?.(event, newValue);\n },\n [onChangeProp],\n );\n\n const memoizedChildren = useMemo(\n () =>\n React.Children.map(children, (child) => {\n if (React.isValidElement<RadioProps>(child) && child.type === Radio) {\n return React.cloneElement(child, {\n isDisabled: isDisabled,\n isReadOnly: isReadOnly,\n });\n }\n return child;\n }),\n [children, isDisabled, isReadOnly],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <MuiRadioGroup\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n data-se={testId}\n id={id}\n name={nameOverride ?? id}\n onChange={onChange}\n translate={translate}\n >\n {memoizedChildren}\n </MuiRadioGroup>\n ),\n [inputValues, nameOverride, onChange, memoizedChildren, testId, translate],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"group\"\n hasVisibleLabel={false}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\nMemoizedRadioGroup.displayName = \"RadioGroup\";\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":"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"}
|
package/dist/Select.js
CHANGED
|
@@ -27,6 +27,42 @@ import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
|
|
|
27
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
28
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
29
29
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
export const SelectTestSelector = {
|
|
31
|
+
accessibleText: {
|
|
32
|
+
errorMessage: "errorMessage",
|
|
33
|
+
hint: "description",
|
|
34
|
+
label: "label"
|
|
35
|
+
},
|
|
36
|
+
children: {
|
|
37
|
+
list: {
|
|
38
|
+
accessibleText: {
|
|
39
|
+
label: "label"
|
|
40
|
+
},
|
|
41
|
+
children: {
|
|
42
|
+
listItem: {
|
|
43
|
+
accessibleText: {
|
|
44
|
+
label: "label"
|
|
45
|
+
},
|
|
46
|
+
elementSelector: {
|
|
47
|
+
method: "ByRole",
|
|
48
|
+
options: {
|
|
49
|
+
label: "name"
|
|
50
|
+
},
|
|
51
|
+
role: "option"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
isControlledElement: true
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
elementSelector: {
|
|
59
|
+
method: "ByRole",
|
|
60
|
+
options: {
|
|
61
|
+
label: "name"
|
|
62
|
+
},
|
|
63
|
+
role: "combobox"
|
|
64
|
+
}
|
|
65
|
+
};
|
|
30
66
|
const SelectContainer = styled.div`
|
|
31
67
|
position: relative;
|
|
32
68
|
width: 100%;
|
|
@@ -69,7 +105,7 @@ const NonInteractiveIcon = styled(CloseCircleFilledIcon, {
|
|
|
69
105
|
margin-block-end: -1px;
|
|
70
106
|
`;
|
|
71
107
|
const ChipsInnerContainer = styled(_Box, {
|
|
72
|
-
shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isInteractive"
|
|
108
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isInteractive" && prop !== "isReadOnly"
|
|
73
109
|
})`
|
|
74
110
|
display: flex;
|
|
75
111
|
flex-wrap: wrap;
|
|
@@ -78,8 +114,9 @@ const ChipsInnerContainer = styled(_Box, {
|
|
|
78
114
|
}) => odysseyDesignTokens.Spacing1};
|
|
79
115
|
pointer-events: none;
|
|
80
116
|
opacity: ${({
|
|
81
|
-
isInteractive
|
|
82
|
-
|
|
117
|
+
isInteractive,
|
|
118
|
+
isReadOnly
|
|
119
|
+
}) => isInteractive || isReadOnly ? 1 : 0};
|
|
83
120
|
min-height: ${({
|
|
84
121
|
odysseyDesignTokens
|
|
85
122
|
}) => odysseyDesignTokens.Spacing6};
|
|
@@ -101,6 +138,7 @@ const Select = ({
|
|
|
101
138
|
isFullWidth = false,
|
|
102
139
|
isMultiSelect,
|
|
103
140
|
isOptional = false,
|
|
141
|
+
isReadOnly = false,
|
|
104
142
|
label,
|
|
105
143
|
name: nameOverride,
|
|
106
144
|
onBlur,
|
|
@@ -111,6 +149,7 @@ const Select = ({
|
|
|
111
149
|
translate,
|
|
112
150
|
value
|
|
113
151
|
}) => {
|
|
152
|
+
const selectRef = useRef(null);
|
|
114
153
|
const hasMultipleChoices = useMemo(() => hasMultipleChoicesProp === undefined ? isMultiSelect : hasMultipleChoicesProp, [hasMultipleChoicesProp, isMultiSelect]);
|
|
115
154
|
const controlledStateRef = useRef(getControlState({
|
|
116
155
|
controlledValue: value,
|
|
@@ -137,31 +176,39 @@ const Select = ({
|
|
|
137
176
|
controlState: controlledStateRef.current
|
|
138
177
|
});
|
|
139
178
|
const onChange = useCallback((event, child) => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
179
|
+
if (isReadOnly) {
|
|
180
|
+
event.preventDefault();
|
|
181
|
+
} else {
|
|
182
|
+
const {
|
|
183
|
+
target: {
|
|
184
|
+
value
|
|
185
|
+
}
|
|
186
|
+
} = event;
|
|
187
|
+
if (controlledStateRef.current !== CONTROLLED) {
|
|
188
|
+
setInternalSelectedValues(typeof value === "string" && hasMultipleChoices ? value.split(",") : value);
|
|
143
189
|
}
|
|
144
|
-
|
|
145
|
-
if (controlledStateRef.current !== CONTROLLED) {
|
|
146
|
-
setInternalSelectedValues(typeof value === "string" && hasMultipleChoices ? value.split(",") : value);
|
|
190
|
+
onChangeProp?.(event, child);
|
|
147
191
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
192
|
+
}, [hasMultipleChoices, onChangeProp, isReadOnly]);
|
|
193
|
+
const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {
|
|
194
|
+
const normalizedOptions = options.map(option => {
|
|
195
|
+
if (typeof option === "object") {
|
|
196
|
+
const value = option?.value === "" ? option.value : option.value || option.text;
|
|
197
|
+
return {
|
|
198
|
+
text: option.text,
|
|
199
|
+
value,
|
|
200
|
+
type: option.type === "heading" ? "heading" : "option"
|
|
201
|
+
};
|
|
202
|
+
}
|
|
153
203
|
return {
|
|
154
|
-
text: option
|
|
155
|
-
value,
|
|
156
|
-
type:
|
|
204
|
+
text: option,
|
|
205
|
+
value: option,
|
|
206
|
+
type: "option"
|
|
157
207
|
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
type: "option"
|
|
163
|
-
};
|
|
164
|
-
}), [options]);
|
|
208
|
+
});
|
|
209
|
+
const normalizedOptionsMap = new Map(normalizedOptions.map(option => [option.value, option]));
|
|
210
|
+
return [normalizedOptions, normalizedOptionsMap];
|
|
211
|
+
}, [options]);
|
|
165
212
|
const removeSelectedValue = useCallback(selectedValue => {
|
|
166
213
|
if (Array.isArray(internalSelectedValues)) {
|
|
167
214
|
const newValue = internalSelectedValues.filter(internalSelectedValue => internalSelectedValue !== selectedValue);
|
|
@@ -174,16 +221,18 @@ const Select = ({
|
|
|
174
221
|
}
|
|
175
222
|
}, [internalSelectedValues, onChange]);
|
|
176
223
|
const Chips = useCallback(({
|
|
177
|
-
isInteractive
|
|
224
|
+
isInteractive,
|
|
225
|
+
isReadOnly
|
|
178
226
|
}) => {
|
|
179
227
|
const stopPropagation = event => event.stopPropagation();
|
|
180
228
|
const hasNonInteractiveIcon = !isInteractive && controlledStateRef.current === CONTROLLED && hasMultipleChoices;
|
|
181
229
|
return Array.isArray(internalSelectedValues) && _jsx(ChipsInnerContainer, {
|
|
182
230
|
isInteractive: isInteractive,
|
|
231
|
+
isReadOnly: isReadOnly,
|
|
183
232
|
odysseyDesignTokens: odysseyDesignTokens,
|
|
184
233
|
children: internalSelectedValues.map(item => item?.length > 0 && _jsx(_Chip, {
|
|
185
234
|
label: _jsxs(_Fragment, {
|
|
186
|
-
children: [item, hasNonInteractiveIcon && _jsx(NonInteractiveIcon, {
|
|
235
|
+
children: [normalizedOptionsMap.get(item)?.text, hasNonInteractiveIcon && _jsx(NonInteractiveIcon, {
|
|
187
236
|
odysseyDesignTokens: odysseyDesignTokens
|
|
188
237
|
})]
|
|
189
238
|
}),
|
|
@@ -197,7 +246,7 @@ const Select = ({
|
|
|
197
246
|
})
|
|
198
247
|
}, item))
|
|
199
248
|
});
|
|
200
|
-
}, [controlledStateRef, hasMultipleChoices, internalSelectedValues, odysseyDesignTokens, removeSelectedValue]);
|
|
249
|
+
}, [controlledStateRef, hasMultipleChoices, internalSelectedValues, odysseyDesignTokens, removeSelectedValue, normalizedOptionsMap]);
|
|
201
250
|
const renderedOptions = useMemo(() => normalizedOptions.map((option, index) => {
|
|
202
251
|
if (option.type === "heading") {
|
|
203
252
|
return _jsxs(_ListSubheader, {
|
|
@@ -206,6 +255,7 @@ const Select = ({
|
|
|
206
255
|
}
|
|
207
256
|
const isSelected = hasMultipleChoices ? internalSelectedValues?.includes(option.value) : internalSelectedValues === option.value;
|
|
208
257
|
return _jsxs(_MenuItem, {
|
|
258
|
+
"data-empty": !option.text,
|
|
209
259
|
value: option.value,
|
|
210
260
|
selected: isSelected,
|
|
211
261
|
children: [hasMultipleChoices && _jsx(_Checkbox, {
|
|
@@ -231,9 +281,16 @@ const Select = ({
|
|
|
231
281
|
displayEmpty: true,
|
|
232
282
|
id: id,
|
|
233
283
|
inputProps: {
|
|
234
|
-
"data-se": testId
|
|
284
|
+
"data-se": testId,
|
|
285
|
+
"aria-disabled": isDisabled || isReadOnly,
|
|
286
|
+
readOnly: isReadOnly
|
|
287
|
+
},
|
|
288
|
+
inputRef: el => {
|
|
289
|
+
if (localInputRef.current !== el) {
|
|
290
|
+
localInputRef.current = el;
|
|
291
|
+
}
|
|
292
|
+
selectRef.current = el;
|
|
235
293
|
},
|
|
236
|
-
inputRef: localInputRef,
|
|
237
294
|
labelId: labelElementId,
|
|
238
295
|
multiple: hasMultipleChoices,
|
|
239
296
|
name: nameOverride ?? id,
|
|
@@ -247,11 +304,12 @@ const Select = ({
|
|
|
247
304
|
children: _jsx(ChipsPositioningContainer, {
|
|
248
305
|
odysseyDesignTokens: odysseyDesignTokens,
|
|
249
306
|
children: _jsx(Chips, {
|
|
250
|
-
isInteractive:
|
|
307
|
+
isInteractive: !isReadOnly,
|
|
308
|
+
isReadOnly: isReadOnly
|
|
251
309
|
})
|
|
252
310
|
})
|
|
253
311
|
})]
|
|
254
|
-
}), [Chips, inputValues, hasMultipleChoices, nameOverride, odysseyDesignTokens, onBlur, onChange, onFocus, renderedOptions, renderValue, testId, translate]);
|
|
312
|
+
}), [Chips, inputValues, hasMultipleChoices, isDisabled, isReadOnly, nameOverride, odysseyDesignTokens, onBlur, onChange, onFocus, renderedOptions, renderValue, testId, translate]);
|
|
255
313
|
return _jsx(Field, {
|
|
256
314
|
ariaDescribedBy: ariaDescribedBy,
|
|
257
315
|
errorMessage: errorMessage,
|