@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
|
@@ -23,19 +23,19 @@ import { SwitchProps as MuiSwitchProps, FormLabel } from "@mui/material";
|
|
|
23
23
|
import { useTranslation } from "react-i18next";
|
|
24
24
|
import styled from "@emotion/styled";
|
|
25
25
|
|
|
26
|
-
import { Box } from "
|
|
27
|
-
import { FieldComponentProps } from "
|
|
28
|
-
import { FieldHint } from "
|
|
29
|
-
import { CheckedFieldProps } from "
|
|
30
|
-
import type { HtmlProps } from "
|
|
31
|
-
import { CheckIcon } from "
|
|
32
|
-
import { ComponentControlledState, getControlState } from "
|
|
26
|
+
import { Box } from "./Box";
|
|
27
|
+
import { FieldComponentProps } from "./FieldComponentProps";
|
|
28
|
+
import { FieldHint } from "./FieldHint";
|
|
29
|
+
import { CheckedFieldProps } from "./FormCheckedProps";
|
|
30
|
+
import type { HtmlProps } from "./HtmlProps";
|
|
31
|
+
import { CheckIcon } from "./icons.generated";
|
|
32
|
+
import { ComponentControlledState, getControlState } from "./inputUtils";
|
|
33
33
|
import {
|
|
34
34
|
DesignTokens,
|
|
35
35
|
useOdysseyDesignTokens,
|
|
36
|
-
} from "
|
|
37
|
-
import { stripRem, toRem } from "
|
|
38
|
-
import { useUniqueId } from "
|
|
36
|
+
} from "./OdysseyDesignTokensContext";
|
|
37
|
+
import { stripRem, toRem } from "./remUtils";
|
|
38
|
+
import { useUniqueId } from "./useUniqueId";
|
|
39
39
|
|
|
40
40
|
const { CONTROLLED } = ComponentControlledState;
|
|
41
41
|
|
|
@@ -43,13 +43,14 @@ const nonForwardedProps = [
|
|
|
43
43
|
"isChecked",
|
|
44
44
|
"isDisabled",
|
|
45
45
|
"isFullWidth",
|
|
46
|
+
"isReadOnly",
|
|
46
47
|
"odysseyDesignTokens",
|
|
47
48
|
];
|
|
48
49
|
|
|
49
50
|
const SwitchAndLabelContainer = styled("div", {
|
|
50
51
|
shouldForwardProp: (prop) => !nonForwardedProps.includes(prop),
|
|
51
52
|
})<
|
|
52
|
-
Pick<SwitchProps, "isFullWidth" | "isDisabled"> & {
|
|
53
|
+
Pick<SwitchProps, "isFullWidth" | "isDisabled" | "isReadOnly"> & {
|
|
53
54
|
odysseyDesignTokens: DesignTokens;
|
|
54
55
|
}
|
|
55
56
|
>(({ isFullWidth, odysseyDesignTokens }) => ({
|
|
@@ -66,17 +67,16 @@ const SwitchContainer = styled.div({
|
|
|
66
67
|
const StyledSwitchLabel = styled(FormLabel, {
|
|
67
68
|
shouldForwardProp: (prop) => !nonForwardedProps.includes(prop),
|
|
68
69
|
})<
|
|
69
|
-
Pick<SwitchLabelComponentProps, "isDisabled"> & {
|
|
70
|
+
Pick<SwitchLabelComponentProps, "isDisabled" | "isReadOnly"> & {
|
|
70
71
|
odysseyDesignTokens: DesignTokens;
|
|
71
72
|
}
|
|
72
|
-
>(({ isDisabled, odysseyDesignTokens }) => ({
|
|
73
|
+
>(({ isDisabled, isReadOnly, odysseyDesignTokens }) => ({
|
|
73
74
|
display: "block",
|
|
74
75
|
margin: 0,
|
|
75
|
-
color:
|
|
76
|
-
? odysseyDesignTokens.TypographyColorDisabled
|
|
77
|
-
: odysseyDesignTokens.PaletteNeutralDark,
|
|
76
|
+
color: odysseyDesignTokens.PaletteNeutralDark,
|
|
78
77
|
|
|
79
78
|
...(isDisabled && {
|
|
79
|
+
color: odysseyDesignTokens.TypographyColorDisabled,
|
|
80
80
|
p: {
|
|
81
81
|
color: odysseyDesignTokens.TypographyColorDisabled,
|
|
82
82
|
},
|
|
@@ -84,38 +84,57 @@ const StyledSwitchLabel = styled(FormLabel, {
|
|
|
84
84
|
color: `${odysseyDesignTokens.TypographyColorDisabled} !important`,
|
|
85
85
|
},
|
|
86
86
|
}),
|
|
87
|
+
|
|
88
|
+
...(isReadOnly && {
|
|
89
|
+
color: odysseyDesignTokens.HueNeutral700,
|
|
90
|
+
p: {
|
|
91
|
+
color: odysseyDesignTokens.HueNeutral700,
|
|
92
|
+
},
|
|
93
|
+
a: {
|
|
94
|
+
color: `${odysseyDesignTokens.HueNeutral700} !important`,
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
87
97
|
}));
|
|
88
98
|
|
|
89
99
|
const SwitchTrack = styled("div", {
|
|
90
100
|
shouldForwardProp: (prop) => !nonForwardedProps.includes(prop),
|
|
91
101
|
})<
|
|
92
|
-
Pick<SwitchProps, "isChecked" | "isDisabled"> & {
|
|
102
|
+
Pick<SwitchProps, "isChecked" | "isDisabled" | "isReadOnly"> & {
|
|
93
103
|
odysseyDesignTokens: DesignTokens;
|
|
94
104
|
}
|
|
95
|
-
>(({ isChecked, isDisabled, odysseyDesignTokens }) => ({
|
|
105
|
+
>(({ isChecked, isDisabled, isReadOnly, odysseyDesignTokens }) => ({
|
|
96
106
|
position: "relative",
|
|
97
107
|
width: odysseyDesignTokens.Spacing7,
|
|
98
108
|
height: `calc(${odysseyDesignTokens.Spacing4} + ${odysseyDesignTokens.Spacing1})`,
|
|
99
109
|
borderRadius: odysseyDesignTokens.BorderRadiusOuter,
|
|
100
|
-
backgroundColor:
|
|
101
|
-
? odysseyDesignTokens.HueNeutral200
|
|
102
|
-
: isChecked
|
|
103
|
-
? odysseyDesignTokens.PaletteSuccessLight
|
|
104
|
-
: odysseyDesignTokens.HueNeutral300,
|
|
110
|
+
backgroundColor: odysseyDesignTokens.HueNeutral300,
|
|
105
111
|
transition: `background-color ${odysseyDesignTokens.TransitionDurationMain}`,
|
|
112
|
+
|
|
113
|
+
...(isDisabled && {
|
|
114
|
+
backgroundColor: odysseyDesignTokens.HueNeutral200,
|
|
115
|
+
}),
|
|
116
|
+
|
|
117
|
+
...(isReadOnly && {
|
|
118
|
+
backgroundColor: odysseyDesignTokens.HueNeutral600,
|
|
119
|
+
}),
|
|
120
|
+
|
|
121
|
+
...(isChecked &&
|
|
122
|
+
!isDisabled &&
|
|
123
|
+
!isReadOnly && {
|
|
124
|
+
backgroundColor: odysseyDesignTokens.PaletteSuccessLight,
|
|
125
|
+
}),
|
|
106
126
|
}));
|
|
107
127
|
|
|
108
128
|
const SwitchThumb = styled("span", {
|
|
109
129
|
shouldForwardProp: (prop) => !nonForwardedProps.includes(prop),
|
|
110
130
|
})<
|
|
111
|
-
Pick<SwitchProps, "isChecked" | "isDisabled"> & {
|
|
131
|
+
Pick<SwitchProps, "isChecked" | "isDisabled" | "isReadOnly"> & {
|
|
112
132
|
odysseyDesignTokens: DesignTokens;
|
|
113
133
|
}
|
|
114
|
-
>(({ isChecked, isDisabled, odysseyDesignTokens }) => {
|
|
134
|
+
>(({ isChecked, isDisabled, isReadOnly, odysseyDesignTokens }) => {
|
|
115
135
|
const thumbOffset = toRem(3);
|
|
116
136
|
const trackWidth = stripRem(odysseyDesignTokens.Spacing7);
|
|
117
137
|
const thumbWidth = stripRem(odysseyDesignTokens.Spacing4) - toRem(2);
|
|
118
|
-
|
|
119
138
|
const transformDistance = trackWidth - thumbWidth - thumbOffset * 2;
|
|
120
139
|
|
|
121
140
|
return {
|
|
@@ -125,40 +144,57 @@ const SwitchThumb = styled("span", {
|
|
|
125
144
|
width: `calc(${odysseyDesignTokens.Spacing4} - ${toRem(2)}rem)`,
|
|
126
145
|
height: `calc(${odysseyDesignTokens.Spacing4} - ${toRem(2)}rem)`,
|
|
127
146
|
borderRadius: odysseyDesignTokens.BorderRadiusRound,
|
|
128
|
-
backgroundColor:
|
|
129
|
-
|
|
130
|
-
: odysseyDesignTokens.HueNeutralWhite,
|
|
131
|
-
transform: isChecked
|
|
132
|
-
? `translate3d(${transformDistance}rem, -50%, 0)`
|
|
133
|
-
: "translate3d(0, -50%, 0)",
|
|
147
|
+
backgroundColor: odysseyDesignTokens.HueNeutralWhite,
|
|
148
|
+
transform: "translate3d(0, -50%, 0)",
|
|
134
149
|
transition: `transform ${odysseyDesignTokens.TransitionDurationMain}`,
|
|
150
|
+
|
|
151
|
+
...(isDisabled && {
|
|
152
|
+
backgroundColor: odysseyDesignTokens.HueNeutral50,
|
|
153
|
+
}),
|
|
154
|
+
|
|
155
|
+
...(isReadOnly && {
|
|
156
|
+
backgroundColor: odysseyDesignTokens.HueNeutral400,
|
|
157
|
+
}),
|
|
158
|
+
|
|
159
|
+
...(isChecked && {
|
|
160
|
+
transform: `translate3d(${transformDistance}rem, -50%, 0)`,
|
|
161
|
+
}),
|
|
135
162
|
};
|
|
136
163
|
});
|
|
137
164
|
|
|
138
165
|
const SwitchCheckMark = styled(CheckIcon, {
|
|
139
166
|
shouldForwardProp: (prop) => !nonForwardedProps.includes(prop),
|
|
140
167
|
})<
|
|
141
|
-
Pick<SwitchProps, "isChecked" | "isDisabled"> & {
|
|
168
|
+
Pick<SwitchProps, "isChecked" | "isDisabled" | "isReadOnly"> & {
|
|
142
169
|
odysseyDesignTokens: DesignTokens;
|
|
143
170
|
}
|
|
144
|
-
>(({ isChecked, isDisabled, odysseyDesignTokens }) => ({
|
|
171
|
+
>(({ isChecked, isDisabled, isReadOnly, odysseyDesignTokens }) => ({
|
|
145
172
|
position: "absolute",
|
|
146
173
|
top: "50%",
|
|
147
174
|
left: 3,
|
|
148
175
|
width: odysseyDesignTokens.Spacing4,
|
|
149
176
|
transform: "translateY(-50%)",
|
|
150
177
|
transition: `opacity ${odysseyDesignTokens.TransitionDurationMain}`,
|
|
151
|
-
opacity:
|
|
178
|
+
opacity: 0,
|
|
152
179
|
path: {
|
|
153
|
-
fill:
|
|
154
|
-
? odysseyDesignTokens.HueNeutral50
|
|
155
|
-
: odysseyDesignTokens.HueNeutralWhite,
|
|
180
|
+
fill: odysseyDesignTokens.HueNeutralWhite,
|
|
156
181
|
},
|
|
182
|
+
|
|
183
|
+
...(isChecked && {
|
|
184
|
+
opacity: 1,
|
|
185
|
+
}),
|
|
186
|
+
|
|
187
|
+
...((isDisabled || isReadOnly) && {
|
|
188
|
+
path: {
|
|
189
|
+
fill: odysseyDesignTokens.HueNeutral50,
|
|
190
|
+
},
|
|
191
|
+
}),
|
|
157
192
|
}));
|
|
158
193
|
|
|
159
194
|
const HiddenCheckbox = styled.input<{
|
|
160
195
|
odysseyDesignTokens: DesignTokens;
|
|
161
|
-
|
|
196
|
+
isReadOnly?: boolean;
|
|
197
|
+
}>(({ odysseyDesignTokens, isReadOnly }) => ({
|
|
162
198
|
position: "absolute",
|
|
163
199
|
top: 0,
|
|
164
200
|
left: 0,
|
|
@@ -166,7 +202,7 @@ const HiddenCheckbox = styled.input<{
|
|
|
166
202
|
height: "100%",
|
|
167
203
|
margin: 0,
|
|
168
204
|
opacity: 0,
|
|
169
|
-
cursor: "pointer",
|
|
205
|
+
cursor: isReadOnly ? "default" : "pointer",
|
|
170
206
|
zIndex: 2,
|
|
171
207
|
|
|
172
208
|
"&:focus-visible": {
|
|
@@ -194,6 +230,10 @@ export type SwitchProps = {
|
|
|
194
230
|
* The value attribute of the Switch
|
|
195
231
|
*/
|
|
196
232
|
value: string;
|
|
233
|
+
/**
|
|
234
|
+
* Determines whether the Switch is read-only
|
|
235
|
+
*/
|
|
236
|
+
isReadOnly?: boolean;
|
|
197
237
|
} & Pick<
|
|
198
238
|
FieldComponentProps,
|
|
199
239
|
"hint" | "HintLinkComponent" | "id" | "isFullWidth" | "isDisabled" | "name"
|
|
@@ -209,6 +249,7 @@ type SwitchLabelComponentProps = {
|
|
|
209
249
|
isDisabled: SwitchProps["isDisabled"];
|
|
210
250
|
isFullWidth: SwitchProps["isFullWidth"];
|
|
211
251
|
label: SwitchProps["label"];
|
|
252
|
+
isReadOnly: SwitchProps["isReadOnly"];
|
|
212
253
|
};
|
|
213
254
|
|
|
214
255
|
const SwitchLabel = ({
|
|
@@ -218,6 +259,7 @@ const SwitchLabel = ({
|
|
|
218
259
|
inputId,
|
|
219
260
|
isDisabled,
|
|
220
261
|
label,
|
|
262
|
+
isReadOnly,
|
|
221
263
|
}: SwitchLabelComponentProps) => {
|
|
222
264
|
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
223
265
|
|
|
@@ -226,6 +268,7 @@ const SwitchLabel = ({
|
|
|
226
268
|
<StyledSwitchLabel
|
|
227
269
|
htmlFor={inputId}
|
|
228
270
|
isDisabled={isDisabled}
|
|
271
|
+
isReadOnly={isReadOnly}
|
|
229
272
|
odysseyDesignTokens={odysseyDesignTokens}
|
|
230
273
|
>
|
|
231
274
|
{label}
|
|
@@ -252,6 +295,7 @@ const Switch = ({
|
|
|
252
295
|
isDefaultChecked,
|
|
253
296
|
isDisabled,
|
|
254
297
|
isFullWidth = false,
|
|
298
|
+
isReadOnly = false,
|
|
255
299
|
label,
|
|
256
300
|
name,
|
|
257
301
|
onChange,
|
|
@@ -292,12 +336,16 @@ const Switch = ({
|
|
|
292
336
|
|
|
293
337
|
const handleOnChange = useCallback<ChangeEventHandler<HTMLInputElement>>(
|
|
294
338
|
(event) => {
|
|
339
|
+
if (isReadOnly) {
|
|
340
|
+
event.preventDefault();
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
295
343
|
const target = event.target;
|
|
296
344
|
const { checked, value } = target;
|
|
297
345
|
setInternalSwitchChecked(checked);
|
|
298
346
|
onChange?.({ checked, value });
|
|
299
347
|
},
|
|
300
|
-
[onChange, setInternalSwitchChecked],
|
|
348
|
+
[onChange, setInternalSwitchChecked, isReadOnly],
|
|
301
349
|
);
|
|
302
350
|
|
|
303
351
|
return (
|
|
@@ -321,6 +369,7 @@ const Switch = ({
|
|
|
321
369
|
isDisabled={isDisabled}
|
|
322
370
|
isFullWidth={isFullWidth}
|
|
323
371
|
label={label}
|
|
372
|
+
isReadOnly={isReadOnly}
|
|
324
373
|
/>
|
|
325
374
|
<SwitchContainer>
|
|
326
375
|
<HiddenCheckbox
|
|
@@ -341,21 +390,26 @@ const Switch = ({
|
|
|
341
390
|
odysseyDesignTokens={odysseyDesignTokens}
|
|
342
391
|
type="checkbox"
|
|
343
392
|
value={value}
|
|
393
|
+
readOnly={isReadOnly}
|
|
394
|
+
isReadOnly={isReadOnly}
|
|
344
395
|
/>
|
|
345
396
|
<SwitchTrack
|
|
346
397
|
data-switch-track
|
|
347
398
|
isChecked={internalSwitchChecked}
|
|
348
399
|
isDisabled={isDisabled}
|
|
400
|
+
isReadOnly={isReadOnly}
|
|
349
401
|
odysseyDesignTokens={odysseyDesignTokens}
|
|
350
402
|
>
|
|
351
403
|
<SwitchThumb
|
|
352
404
|
isChecked={internalSwitchChecked}
|
|
353
405
|
isDisabled={isDisabled}
|
|
406
|
+
isReadOnly={isReadOnly}
|
|
354
407
|
odysseyDesignTokens={odysseyDesignTokens}
|
|
355
408
|
/>
|
|
356
409
|
<SwitchCheckMark
|
|
357
410
|
isChecked={internalSwitchChecked}
|
|
358
411
|
isDisabled={isDisabled}
|
|
412
|
+
isReadOnly={isReadOnly}
|
|
359
413
|
odysseyDesignTokens={odysseyDesignTokens}
|
|
360
414
|
/>
|
|
361
415
|
</SwitchTrack>
|
package/src/Tabs.tsx
CHANGED
|
@@ -30,30 +30,28 @@ import { Badge, BadgeProps } from "./Badge";
|
|
|
30
30
|
import { Box } from "./Box";
|
|
31
31
|
import { HtmlProps } from "./HtmlProps";
|
|
32
32
|
import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext";
|
|
33
|
-
import { type
|
|
33
|
+
import { type TestSelector } from "./test-selectors";
|
|
34
34
|
|
|
35
|
-
export const
|
|
36
|
-
|
|
35
|
+
export const TabsTestSelector = {
|
|
36
|
+
children: {
|
|
37
37
|
tabItem: {
|
|
38
|
-
|
|
38
|
+
elementSelector: {
|
|
39
39
|
method: "ByRole",
|
|
40
40
|
options: {
|
|
41
|
-
|
|
41
|
+
label: "name",
|
|
42
42
|
},
|
|
43
|
-
templateVariableNames: ["label"],
|
|
44
43
|
role: "tab",
|
|
45
44
|
},
|
|
46
45
|
},
|
|
47
46
|
},
|
|
48
|
-
|
|
47
|
+
elementSelector: {
|
|
49
48
|
method: "ByRole",
|
|
50
49
|
options: {
|
|
51
|
-
|
|
50
|
+
label: "name",
|
|
52
51
|
},
|
|
53
52
|
role: "tablist",
|
|
54
|
-
templateVariableNames: ["ariaLabel"],
|
|
55
53
|
},
|
|
56
|
-
} as const satisfies
|
|
54
|
+
} as const satisfies TestSelector;
|
|
57
55
|
|
|
58
56
|
export type TabItemProps = {
|
|
59
57
|
/**
|
package/src/Tag.tsx
CHANGED
|
@@ -12,9 +12,26 @@
|
|
|
12
12
|
|
|
13
13
|
import { Chip as MuiChip, ChipProps as MuiChipProps } from "@mui/material";
|
|
14
14
|
import { memo, ReactElement, useCallback, useContext } from "react";
|
|
15
|
+
import styled from "@emotion/styled";
|
|
15
16
|
import { TagListContext } from "./TagListContext";
|
|
16
17
|
import { MuiPropsContext, MuiPropsContextType } from "./MuiPropsContext";
|
|
17
18
|
import { HtmlProps } from "./HtmlProps";
|
|
19
|
+
import {
|
|
20
|
+
DesignTokens,
|
|
21
|
+
useOdysseyDesignTokens,
|
|
22
|
+
} from "./OdysseyDesignTokensContext";
|
|
23
|
+
import { CloseCircleFilledIcon } from "./icons.generated";
|
|
24
|
+
|
|
25
|
+
export const tagColorVariants = [
|
|
26
|
+
"default",
|
|
27
|
+
"info",
|
|
28
|
+
"accentOne",
|
|
29
|
+
"accentTwo",
|
|
30
|
+
"accentThree",
|
|
31
|
+
"accentFour",
|
|
32
|
+
] as const;
|
|
33
|
+
|
|
34
|
+
type TagColorVariant = (typeof tagColorVariants)[number];
|
|
18
35
|
|
|
19
36
|
export type TagProps = {
|
|
20
37
|
icon?: ReactElement;
|
|
@@ -31,9 +48,117 @@ export type TagProps = {
|
|
|
31
48
|
* Callback fired when the remove button of the Tag is clicked
|
|
32
49
|
*/
|
|
33
50
|
onRemove?: MuiChipProps["onDelete"];
|
|
51
|
+
/**
|
|
52
|
+
* Color variant of the Tag, affecting its appearance
|
|
53
|
+
*/
|
|
54
|
+
colorVariant?: TagColorVariant;
|
|
34
55
|
} & Pick<HtmlProps, "testId" | "translate">;
|
|
35
56
|
|
|
57
|
+
const getChipColors = (
|
|
58
|
+
colorVariant: TagColorVariant,
|
|
59
|
+
odysseyDesignTokens: DesignTokens,
|
|
60
|
+
) => {
|
|
61
|
+
const colors = {
|
|
62
|
+
default: {
|
|
63
|
+
background: odysseyDesignTokens.HueNeutral100,
|
|
64
|
+
hover: odysseyDesignTokens.HueNeutral200,
|
|
65
|
+
active: odysseyDesignTokens.HueNeutral300,
|
|
66
|
+
text: odysseyDesignTokens.HueNeutral700,
|
|
67
|
+
border: odysseyDesignTokens.HueNeutral200,
|
|
68
|
+
deleteIcon: odysseyDesignTokens.HueNeutral500,
|
|
69
|
+
deleteIconHover: odysseyDesignTokens.HueNeutral600,
|
|
70
|
+
},
|
|
71
|
+
info: {
|
|
72
|
+
background: odysseyDesignTokens.HueBlue100,
|
|
73
|
+
hover: odysseyDesignTokens.HueBlue200,
|
|
74
|
+
active: odysseyDesignTokens.HueBlue300,
|
|
75
|
+
text: odysseyDesignTokens.HueBlue700,
|
|
76
|
+
border: odysseyDesignTokens.HueBlue200,
|
|
77
|
+
deleteIcon: odysseyDesignTokens.HueBlue500,
|
|
78
|
+
deleteIconHover: odysseyDesignTokens.HueBlue600,
|
|
79
|
+
},
|
|
80
|
+
accentOne: {
|
|
81
|
+
background: odysseyDesignTokens.HueAccentOne100,
|
|
82
|
+
hover: odysseyDesignTokens.HueAccentOne200,
|
|
83
|
+
active: odysseyDesignTokens.HueAccentOne300,
|
|
84
|
+
text: odysseyDesignTokens.HueAccentOne700,
|
|
85
|
+
border: odysseyDesignTokens.HueAccentOne200,
|
|
86
|
+
deleteIcon: odysseyDesignTokens.HueAccentOne500,
|
|
87
|
+
deleteIconHover: odysseyDesignTokens.HueAccentOne600,
|
|
88
|
+
},
|
|
89
|
+
accentTwo: {
|
|
90
|
+
background: odysseyDesignTokens.HueAccentTwo100,
|
|
91
|
+
hover: odysseyDesignTokens.HueAccentTwo200,
|
|
92
|
+
active: odysseyDesignTokens.HueAccentTwo300,
|
|
93
|
+
text: odysseyDesignTokens.HueAccentTwo700,
|
|
94
|
+
border: odysseyDesignTokens.HueAccentTwo200,
|
|
95
|
+
deleteIcon: odysseyDesignTokens.HueAccentTwo500,
|
|
96
|
+
deleteIconHover: odysseyDesignTokens.HueAccentTwo600,
|
|
97
|
+
},
|
|
98
|
+
accentThree: {
|
|
99
|
+
background: odysseyDesignTokens.HueAccentThree100,
|
|
100
|
+
hover: odysseyDesignTokens.HueAccentThree200,
|
|
101
|
+
active: odysseyDesignTokens.HueAccentThree300,
|
|
102
|
+
text: odysseyDesignTokens.HueAccentThree700,
|
|
103
|
+
border: odysseyDesignTokens.HueAccentThree200,
|
|
104
|
+
deleteIcon: odysseyDesignTokens.HueAccentThree500,
|
|
105
|
+
deleteIconHover: odysseyDesignTokens.HueAccentThree600,
|
|
106
|
+
},
|
|
107
|
+
accentFour: {
|
|
108
|
+
background: odysseyDesignTokens.HueAccentFour100,
|
|
109
|
+
hover: odysseyDesignTokens.HueAccentFour200,
|
|
110
|
+
active: odysseyDesignTokens.HueAccentFour300,
|
|
111
|
+
text: odysseyDesignTokens.HueAccentFour700,
|
|
112
|
+
border: odysseyDesignTokens.HueAccentFour200,
|
|
113
|
+
deleteIcon: odysseyDesignTokens.HueAccentFour500,
|
|
114
|
+
deleteIconHover: odysseyDesignTokens.HueAccentFour600,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return colors[colorVariant] || colors.default;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const StyledTag = styled(MuiChip, {
|
|
122
|
+
shouldForwardProp: (prop) =>
|
|
123
|
+
!["colorVariant", "odysseyDesignTokens"].includes(prop as string),
|
|
124
|
+
})<{
|
|
125
|
+
colorVariant: TagColorVariant;
|
|
126
|
+
odysseyDesignTokens: DesignTokens;
|
|
127
|
+
as?: React.ElementType; // Allow the 'as' prop to be forwarded
|
|
128
|
+
}>(({ colorVariant, odysseyDesignTokens }) => {
|
|
129
|
+
const colors = getChipColors(colorVariant, odysseyDesignTokens);
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
backgroundColor: colors.background,
|
|
133
|
+
color: colors.text,
|
|
134
|
+
borderColor: colors.border,
|
|
135
|
+
|
|
136
|
+
"&.MuiChip-clickable:hover": {
|
|
137
|
+
backgroundColor: colors.hover,
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
"&.MuiChip-clickable:active": {
|
|
141
|
+
backgroundColor: colors.active,
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
"&.Mui-disabled": {
|
|
145
|
+
"& .MuiChip-deleteIcon": {
|
|
146
|
+
color: odysseyDesignTokens.HueNeutral300,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
"& .MuiChip-deleteIcon": {
|
|
151
|
+
color: colors.deleteIcon,
|
|
152
|
+
|
|
153
|
+
"&:hover": {
|
|
154
|
+
color: colors.deleteIconHover,
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
});
|
|
159
|
+
|
|
36
160
|
const Tag = ({
|
|
161
|
+
colorVariant = "default",
|
|
37
162
|
icon,
|
|
38
163
|
isDisabled,
|
|
39
164
|
label,
|
|
@@ -42,21 +167,25 @@ const Tag = ({
|
|
|
42
167
|
testId,
|
|
43
168
|
translate,
|
|
44
169
|
}: TagProps) => {
|
|
170
|
+
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
45
171
|
const { chipElementType } = useContext(TagListContext);
|
|
46
172
|
|
|
47
173
|
const renderTag = useCallback(
|
|
48
174
|
(muiProps: MuiPropsContextType) => (
|
|
49
|
-
<
|
|
175
|
+
<StyledTag
|
|
50
176
|
{...muiProps}
|
|
177
|
+
as={chipElementType}
|
|
51
178
|
aria-disabled={isDisabled}
|
|
52
|
-
clickable={onClick
|
|
53
|
-
component={chipElementType}
|
|
179
|
+
clickable={Boolean(onClick)}
|
|
54
180
|
data-se={testId}
|
|
181
|
+
colorVariant={colorVariant}
|
|
182
|
+
odysseyDesignTokens={odysseyDesignTokens}
|
|
55
183
|
disabled={isDisabled}
|
|
56
184
|
icon={icon}
|
|
57
185
|
label={label}
|
|
58
186
|
onClick={onClick}
|
|
59
187
|
onDelete={onRemove}
|
|
188
|
+
deleteIcon={<CloseCircleFilledIcon />}
|
|
60
189
|
translate={translate}
|
|
61
190
|
/>
|
|
62
191
|
),
|
|
@@ -69,6 +198,8 @@ const Tag = ({
|
|
|
69
198
|
onRemove,
|
|
70
199
|
testId,
|
|
71
200
|
translate,
|
|
201
|
+
colorVariant,
|
|
202
|
+
odysseyDesignTokens,
|
|
72
203
|
],
|
|
73
204
|
);
|
|
74
205
|
|
package/src/TextField.tsx
CHANGED
|
@@ -30,56 +30,33 @@ import {
|
|
|
30
30
|
import { Field } from "./Field";
|
|
31
31
|
import { HtmlProps } from "./HtmlProps";
|
|
32
32
|
import { FocusHandle, useInputValues, getControlState } from "./inputUtils";
|
|
33
|
-
import { type
|
|
33
|
+
import { type TestSelector } from "./test-selectors";
|
|
34
34
|
|
|
35
|
-
export const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
errorMessage: {
|
|
45
|
-
selector: {
|
|
46
|
-
method: "ByText",
|
|
47
|
-
templateVariableNames: ["errorMessage"],
|
|
48
|
-
text: "${errorMessage}",
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
input: {
|
|
52
|
-
selector: {
|
|
53
|
-
method: "ByRole",
|
|
54
|
-
options: {
|
|
55
|
-
name: "${label}",
|
|
56
|
-
},
|
|
57
|
-
role: "textbox",
|
|
58
|
-
templateVariableNames: ["label"],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
label: {
|
|
62
|
-
selector: {
|
|
63
|
-
method: "ByRole",
|
|
64
|
-
options: {
|
|
65
|
-
name: "${label}",
|
|
66
|
-
},
|
|
67
|
-
role: "LabelText",
|
|
68
|
-
templateVariableNames: ["label"],
|
|
69
|
-
},
|
|
70
|
-
},
|
|
35
|
+
export const TextFieldTestSelector = {
|
|
36
|
+
accessibleText: {
|
|
37
|
+
errorMessage: "errorMessage",
|
|
38
|
+
hint: "description",
|
|
39
|
+
label: "label",
|
|
40
|
+
},
|
|
41
|
+
children: {
|
|
71
42
|
link: {
|
|
72
|
-
|
|
43
|
+
elementSelector: {
|
|
73
44
|
method: "ByRole",
|
|
74
45
|
options: {
|
|
75
|
-
|
|
46
|
+
label: "name",
|
|
76
47
|
},
|
|
77
|
-
templateVariableNames: ["label"],
|
|
78
48
|
role: "link",
|
|
79
49
|
},
|
|
80
50
|
},
|
|
81
51
|
},
|
|
82
|
-
|
|
52
|
+
elementSelector: {
|
|
53
|
+
method: "ByRole",
|
|
54
|
+
options: {
|
|
55
|
+
label: "name",
|
|
56
|
+
},
|
|
57
|
+
role: "textbox",
|
|
58
|
+
},
|
|
59
|
+
} as const satisfies TestSelector;
|
|
83
60
|
|
|
84
61
|
export const textFieldTypeValues = [
|
|
85
62
|
"email",
|
package/src/Toast.tsx
CHANGED
package/src/ToastStack.tsx
CHANGED
|
@@ -14,14 +14,14 @@ import { memo, ReactElement } from "react";
|
|
|
14
14
|
import { Box, Snackbar } from "@mui/material";
|
|
15
15
|
import { Toast } from "./Toast";
|
|
16
16
|
|
|
17
|
-
export type
|
|
17
|
+
export type ToastListProps = {
|
|
18
18
|
/**
|
|
19
19
|
* The Toast or array of Toasts within the ToastStack
|
|
20
20
|
*/
|
|
21
21
|
children: ReactElement<typeof Toast> | Array<ReactElement<typeof Toast>>;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
const ToastStack = ({ children }:
|
|
24
|
+
const ToastStack = ({ children }: ToastListProps) => {
|
|
25
25
|
return (
|
|
26
26
|
<Snackbar open={true}>
|
|
27
27
|
<Box
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const createShadowDomElements = (containerElement: HTMLElement) => {
|
|
14
|
+
const shadowRoot = containerElement.attachShadow({ mode: "open" });
|
|
15
|
+
|
|
16
|
+
// Container for Emotion `<style>` elements.
|
|
17
|
+
const emotionRootElement = document.createElement("div");
|
|
18
|
+
emotionRootElement.setAttribute("id", "style-root");
|
|
19
|
+
emotionRootElement.setAttribute("nonce", window.cspNonce);
|
|
20
|
+
|
|
21
|
+
// React app root component.
|
|
22
|
+
const shadowRootElement = document.createElement("div");
|
|
23
|
+
shadowRootElement.setAttribute("id", "shadow-root");
|
|
24
|
+
// This div could cause issues with layout of children.
|
|
25
|
+
// For flexibility, make it inherit its parent's height
|
|
26
|
+
shadowRootElement.style.setProperty("height", "inherit");
|
|
27
|
+
|
|
28
|
+
shadowRoot.appendChild(emotionRootElement);
|
|
29
|
+
shadowRoot.appendChild(shadowRootElement);
|
|
30
|
+
|
|
31
|
+
return { emotionRootElement, shadowRootElement };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @deprecated Use `createShadowDomElements` instead. */
|
|
35
|
+
export const createShadowRootElement = (
|
|
36
|
+
containerElement: HTMLElement,
|
|
37
|
+
): [HTMLStyleElement, HTMLDivElement] => {
|
|
38
|
+
const shadowRoot = containerElement.attachShadow({ mode: "open" });
|
|
39
|
+
|
|
40
|
+
// the element that styles will be cached into
|
|
41
|
+
const emotionRootElement = document.createElement("style");
|
|
42
|
+
emotionRootElement.setAttribute("id", "style-root");
|
|
43
|
+
emotionRootElement.setAttribute("nonce", window.cspNonce);
|
|
44
|
+
|
|
45
|
+
// the element that emotion renders html into
|
|
46
|
+
const shadowRootElement = document.createElement("div");
|
|
47
|
+
shadowRootElement.setAttribute("id", "shadow-root");
|
|
48
|
+
|
|
49
|
+
shadowRoot.appendChild(emotionRootElement);
|
|
50
|
+
shadowRoot.appendChild(shadowRootElement);
|
|
51
|
+
|
|
52
|
+
return [emotionRootElement, shadowRootElement];
|
|
53
|
+
};
|