@okta/odyssey-react-mui 1.41.1 → 1.43.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/dist/cjs/DataTable/DataTable.cjs +67 -42
- package/dist/cjs/DataTable/DataTable.cjs.map +1 -1
- package/dist/cjs/Drawer.cjs +16 -14
- package/dist/cjs/Drawer.cjs.map +1 -1
- package/dist/cjs/PasswordField.cjs +1 -1
- package/dist/cjs/PasswordField.cjs.map +1 -1
- package/dist/cjs/Select.cjs +35 -44
- package/dist/cjs/Select.cjs.map +1 -1
- package/dist/cjs/Status.cjs +2 -0
- package/dist/cjs/Status.cjs.map +1 -1
- package/dist/cjs/Typography.cjs +32 -8
- package/dist/cjs/Typography.cjs.map +1 -1
- package/dist/cjs/createContrastColors.cjs +6 -2
- package/dist/cjs/createContrastColors.cjs.map +1 -1
- package/dist/cjs/getLogicalBoundaries.cjs +33 -0
- package/dist/cjs/getLogicalBoundaries.cjs.map +1 -0
- package/dist/cjs/labs/DataFilters.cjs +1 -0
- package/dist/cjs/labs/DataFilters.cjs.map +1 -1
- package/dist/cjs/labs/DataView/BulkActionsMenu.cjs.map +1 -1
- package/dist/cjs/labs/DataView/CardLayoutContent.cjs.map +1 -1
- package/dist/cjs/labs/DataView/DataView.cjs +10 -1
- package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
- package/dist/cjs/labs/DataView/RowActions.cjs +3 -4
- package/dist/cjs/labs/DataView/RowActions.cjs.map +1 -1
- package/dist/cjs/labs/DataView/TableLayoutContent.cjs +2 -4
- package/dist/cjs/labs/DataView/TableLayoutContent.cjs.map +1 -1
- package/dist/cjs/labs/DataView/useFilterConversion.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/Picker.cjs +17 -11
- package/dist/cjs/labs/OdysseyPickers/Picker.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs +2 -1
- package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs +2 -3
- package/dist/cjs/labs/OdysseyPickers/SearchDropdown.cjs.map +1 -1
- package/dist/cjs/labs/PageTemplate/PageTemplate.cjs +15 -4
- package/dist/cjs/labs/PageTemplate/PageTemplate.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs +136 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs.map +1 -0
- package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs +4 -2
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs +129 -126
- package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs.map +1 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs +0 -1
- package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs.map +1 -1
- package/dist/cjs/theme/components.cjs +7 -1
- package/dist/cjs/theme/components.cjs.map +1 -1
- package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +0 -1
- package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNav.cjs +24 -18
- package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
- package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs +4 -3
- package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs.map +1 -1
- package/dist/cjs/ui-shell/UiShell.cjs +2 -0
- package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
- package/dist/cjs/ui-shell/UiShellProvider.cjs +6 -1
- package/dist/cjs/ui-shell/UiShellProvider.cjs.map +1 -1
- package/dist/cjs/ui-shell/renderUiShell.cjs +2 -0
- package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
- package/dist/cjs/ui-shell/useElementAtContainerEdge.cjs +74 -0
- package/dist/cjs/ui-shell/useElementAtContainerEdge.cjs.map +1 -0
- package/dist/cjs/useMountLifecycleEffect.cjs +3 -3
- package/dist/cjs/useMountLifecycleEffect.cjs.map +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
- package/dist/esm/DataTable/DataTable.js +67 -40
- package/dist/esm/DataTable/DataTable.js.map +1 -1
- package/dist/esm/Drawer.js +16 -14
- package/dist/esm/Drawer.js.map +1 -1
- package/dist/esm/PasswordField.js +1 -1
- package/dist/esm/PasswordField.js.map +1 -1
- package/dist/esm/Select.js +35 -44
- package/dist/esm/Select.js.map +1 -1
- package/dist/esm/Status.js +2 -0
- package/dist/esm/Status.js.map +1 -1
- package/dist/esm/Typography.js +32 -8
- package/dist/esm/Typography.js.map +1 -1
- package/dist/esm/createContrastColors.js +6 -2
- package/dist/esm/createContrastColors.js.map +1 -1
- package/dist/esm/getLogicalBoundaries.js +26 -0
- package/dist/esm/getLogicalBoundaries.js.map +1 -0
- package/dist/esm/labs/DataFilters.js +1 -0
- package/dist/esm/labs/DataFilters.js.map +1 -1
- package/dist/esm/labs/DataView/BulkActionsMenu.js.map +1 -1
- package/dist/esm/labs/DataView/CardLayoutContent.js.map +1 -1
- package/dist/esm/labs/DataView/DataView.js +10 -1
- package/dist/esm/labs/DataView/DataView.js.map +1 -1
- package/dist/esm/labs/DataView/RowActions.js +2 -1
- package/dist/esm/labs/DataView/RowActions.js.map +1 -1
- package/dist/esm/labs/DataView/TableLayoutContent.js +2 -4
- package/dist/esm/labs/DataView/TableLayoutContent.js.map +1 -1
- package/dist/esm/labs/DataView/useFilterConversion.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/ComposablePicker.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/Picker.js +19 -13
- package/dist/esm/labs/OdysseyPickers/Picker.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js +2 -1
- package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/SearchDropdown.js +2 -3
- package/dist/esm/labs/OdysseyPickers/SearchDropdown.js.map +1 -1
- package/dist/esm/labs/PageTemplate/PageTemplate.js +16 -5
- package/dist/esm/labs/PageTemplate/PageTemplate.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_cs.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_cs.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_da.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_da.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_de.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_de.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_el.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_el.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_es.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_es.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_eu.js +130 -0
- package/dist/esm/properties/ts/odyssey-react-mui_eu.js.map +1 -0
- package/dist/esm/properties/ts/odyssey-react-mui_fi.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_fi.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_fr.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_fr.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ht.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ht.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_hu.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_hu.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_id.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_id.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_it.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_it.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ja.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ja.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ko.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ko.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ms.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ms.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nb.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nb.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js +4 -2
- package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js +129 -126
- package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pl.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pl.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ro.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ro.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ru.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_ru.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_sv.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_sv.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_th.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_th.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_tr.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_tr.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_uk.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_uk.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_vi.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_vi.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js +0 -1
- package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
- package/dist/esm/theme/components.js +7 -1
- package/dist/esm/theme/components.js.map +1 -1
- package/dist/esm/ui-shell/NarrowUiShellContent.js +0 -1
- package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNav.js +24 -18
- package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
- package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js +4 -3
- package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js.map +1 -1
- package/dist/esm/ui-shell/UiShell.js +2 -0
- package/dist/esm/ui-shell/UiShell.js.map +1 -1
- package/dist/esm/ui-shell/UiShellProvider.js +6 -1
- package/dist/esm/ui-shell/UiShellProvider.js.map +1 -1
- package/dist/esm/ui-shell/renderUiShell.js +2 -0
- package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
- package/dist/esm/ui-shell/useElementAtContainerEdge.js +68 -0
- package/dist/esm/ui-shell/useElementAtContainerEdge.js.map +1 -0
- package/dist/esm/useMountLifecycleEffect.js +3 -3
- package/dist/esm/useMountLifecycleEffect.js.map +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.mjs +1 -1
- package/dist/index.scss +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/DataTable/DataTable.d.ts +2 -2
- package/dist/types/DataTable/DataTable.d.ts.map +1 -1
- package/dist/types/Drawer.d.ts +24 -6
- package/dist/types/Drawer.d.ts.map +1 -1
- package/dist/types/OdysseyTranslationProvider.d.ts +1 -1
- package/dist/types/OdysseyTranslationProvider.d.ts.map +1 -1
- package/dist/types/PasswordField.d.ts.map +1 -1
- package/dist/types/Select.d.ts.map +1 -1
- package/dist/types/Status.d.ts +2 -2
- package/dist/types/Status.d.ts.map +1 -1
- package/dist/types/Typography.d.ts +16 -12
- package/dist/types/Typography.d.ts.map +1 -1
- package/dist/types/createContrastColors.d.ts +5 -1
- package/dist/types/createContrastColors.d.ts.map +1 -1
- package/dist/types/getLogicalBoundaries.d.ts +24 -0
- package/dist/types/getLogicalBoundaries.d.ts.map +1 -0
- package/dist/types/i18n.d.ts +6 -29
- package/dist/types/i18n.d.ts.map +1 -1
- package/dist/types/labs/DataFilters.d.ts.map +1 -1
- package/dist/types/labs/DataView/BulkActionsMenu.d.ts +1 -1
- package/dist/types/labs/DataView/BulkActionsMenu.d.ts.map +1 -1
- package/dist/types/labs/DataView/CardLayoutContent.d.ts.map +1 -1
- package/dist/types/labs/DataView/DataView.d.ts.map +1 -1
- package/dist/types/labs/DataView/RowActions.d.ts +5 -4
- package/dist/types/labs/DataView/RowActions.d.ts.map +1 -1
- package/dist/types/labs/DataView/TableLayoutContent.d.ts +1 -1
- package/dist/types/labs/DataView/TableLayoutContent.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/ComposablePicker.d.ts +4 -1
- package/dist/types/labs/OdysseyPickers/ComposablePicker.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/Picker.d.ts +7 -7
- package/dist/types/labs/OdysseyPickers/Picker.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/SearchDropdown.d.ts.map +1 -1
- package/dist/types/labs/PageTemplate/PageTemplate.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_da.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_de.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_el.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_es.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts +130 -0
- package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts.map +1 -0
- package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_id.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_it.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts +3 -1
- package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts +3 -0
- package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_th.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
- package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts +0 -1
- package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
- package/dist/types/theme/components.d.ts.map +1 -1
- package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
- package/dist/types/ui-shell/SideNav/SideNavItemLinkContent.d.ts.map +1 -1
- package/dist/types/ui-shell/UiShell.d.ts +1 -1
- package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
- package/dist/types/ui-shell/UiShellProvider.d.ts +10 -4
- package/dist/types/ui-shell/UiShellProvider.d.ts.map +1 -1
- package/dist/types/ui-shell/renderUiShell.d.ts +2 -2
- package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
- package/dist/types/ui-shell/useElementAtContainerEdge.d.ts +43 -0
- package/dist/types/ui-shell/useElementAtContainerEdge.d.ts.map +1 -0
- package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
- package/package.json +9 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordField.cjs","names":["_react","require","_index","_Field","_reactI18next","_inputUtils","_jsxRuntime","_interopRequireDefault","e","__esModule","default","PasswordField","forwardRef","ariaDescribedBy","autoCompleteType","defaultValue","errorMessage","errorMessageList","hasInitialFocus","hint","id","idOverride","inputRef","isDisabled","isFullWidth","isOptional","hasShowPassword","isReadOnly","label","name","nameOverride","onChange","onChangeProp","onFocus","onBlur","placeholder","testId","translate","value","ref","t","useTranslation","inputType","setInputType","useState","togglePasswordVisibility","useCallback","controlledStateRef","useRef","getControlState","controlledValue","uncontrolledValue","inputValues","useInputValues","controlState","current","localInputRef","useImperativeHandle","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","jsx","_InputBase2","autoComplete","autoFocus","endAdornment","_InputAdornment2","position","children","_IconButton2","onClick","ShowIcon","HideIcon","inputProps","role","readOnly","required","type","Field","fieldType","hasVisibleLabel","MemoizedPasswordField","exports","memo","displayName"],"sources":["../../src/PasswordField.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 { InputAdornment, InputBase, IconButton } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n memo,\n useCallback,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\n\nimport { ShowIcon, HideIcon } from \"./icons.generated/index.js\";\nimport { Field } from \"./Field.js\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport type { HtmlProps } from \"./HtmlProps.js\";\nimport { useTranslation } from \"react-i18next\";\nimport { FocusHandle, getControlState, useInputValues } from \"./inputUtils.js\";\n\nexport type PasswordFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: \"current-password\" | \"new-password\";\n /**\n * initial value for input. Use when component in uncontrolled.\n */\n defaultValue?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * If `true`, the show/hide icon is not shown to the user\n */\n hasShowPassword?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * The value of the `input` element. Use when component is controlled.\n */\n value?: string;\n} & FieldComponentProps &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasInitialFocus,\n hint,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isOptional = false,\n hasShowPassword = true,\n isReadOnly,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n placeholder,\n testId,\n translate,\n value,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [inputType, setInputType] = useState(\"password\");\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((inputType) =>\n inputType === \"password\" ? \"text\" : \"password\",\n );\n }, []);\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(inputRef, () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n }, []);\n\n const onChange = useCallback<\n ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={inputType === \"password\" ? autoCompleteType : \"off\"}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n hasShowPassword && (\n <InputAdornment position=\"end\">\n <IconButton\n aria-controls={id}\n aria-label={\n inputType === \"password\"\n ? t(\"passwordfield.icon.label.show\")\n : t(\"passwordfield.icon.label.hide\")\n }\n aria-pressed={inputType === \"text\"}\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <ShowIcon /> : <HideIcon />}\n </IconButton>\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n // role: \"textbox\" Added because password inputs don't have an implicit role assigned. This causes problems with element selection.\n role: \"textbox\",\n }}\n inputRef={localInputRef}\n name={nameOverride ?? id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n translate={translate}\n type={inputType}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n inputValues,\n t,\n togglePasswordVisibility,\n inputType,\n nameOverride,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n hasShowPassword,\n ref,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n },\n);\n\nconst MemoizedPasswordField = memo(PasswordField);\nMemoizedPasswordField.displayName = \"PasswordField\";\n\nexport { MemoizedPasswordField as PasswordField };\n"],"mappings":";;;;;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AAWA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAMA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAA+E,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAhC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+EA,MAAMG,aAAa,GAAG,IAAAC,iBAAU,EAC9B,CACE;EACEC,eAAe;EACfC,gBAAgB;EAChBC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,eAAe;EACfC,IAAI;EACJC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,UAAU,GAAG,KAAK;EAClBC,WAAW,GAAG,KAAK;EACnBC,UAAU,GAAG,KAAK;EAClBC,eAAe,GAAG,IAA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Q,EAAE,CAACrD,UAAW;IACtBY,SAAS,EAAEA,SAAU;IACrB0C,IAAI,EAAErC;EAAU,CACjB,CACF,EACD,CACE5B,gBAAgB,EAChBI,eAAe,EACfkC,WAAW,EACXZ,CAAC,EACDK,wBAAwB,EACxBH,SAAS,EACTZ,YAAY,EACZC,QAAQ,EACRE,OAAO,EACPC,MAAM,EACNC,WAAW,EACXV,UAAU,EACVE,UAAU,EACVD,eAAe,EACfa,GAAG,EACHH,MAAM,EACNC,SAAS,CAEb,CAAC;EAED,OACE,IAAA/B,WAAA,CAAAyD,GAAA,EAAC5D,MAAA,CAAA6E,KAAK;IACJnE,eAAe,EAAEA,eAAgB;IACjCG,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCgE,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACf/D,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBC,UAAU,EAAEA,UAAW;IACvBG,KAAK,EAAEA,KAAM;IACbgC,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMuB,qBAAqB,GAAAC,OAAA,CAAAzE,aAAA,GAAG,IAAA0E,WAAI,EAAC1E,aAAa,CAAC;AACjDwE,qBAAqB,CAACG,WAAW,GAAG,eAAe","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"PasswordField.cjs","names":["_react","require","_index","_Field","_reactI18next","_inputUtils","_jsxRuntime","_interopRequireDefault","e","__esModule","default","PasswordField","forwardRef","ariaDescribedBy","autoCompleteType","defaultValue","errorMessage","errorMessageList","hasInitialFocus","hint","id","idOverride","inputRef","isDisabled","isFullWidth","isOptional","hasShowPassword","isReadOnly","label","name","nameOverride","onChange","onChangeProp","onFocus","onBlur","placeholder","testId","translate","value","ref","t","useTranslation","inputType","setInputType","useState","togglePasswordVisibility","useCallback","controlledStateRef","useRef","getControlState","controlledValue","uncontrolledValue","inputValues","useInputValues","controlState","current","localInputRef","useImperativeHandle","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","jsx","_InputBase2","autoComplete","autoFocus","endAdornment","_InputAdornment2","position","children","_IconButton2","onClick","ShowIcon","HideIcon","inputProps","role","readOnly","required","type","Field","fieldType","hasVisibleLabel","MemoizedPasswordField","exports","memo","displayName"],"sources":["../../src/PasswordField.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 { InputAdornment, InputBase, IconButton } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n memo,\n useCallback,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\n\nimport { ShowIcon, HideIcon } from \"./icons.generated/index.js\";\nimport { Field } from \"./Field.js\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport type { HtmlProps } from \"./HtmlProps.js\";\nimport { useTranslation } from \"react-i18next\";\nimport { FocusHandle, getControlState, useInputValues } from \"./inputUtils.js\";\n\nexport type PasswordFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: \"current-password\" | \"new-password\";\n /**\n * initial value for input. Use when component in uncontrolled.\n */\n defaultValue?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * If `true`, the show/hide icon is not shown to the user\n */\n hasShowPassword?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * The value of the `input` element. Use when component is controlled.\n */\n value?: string;\n} & FieldComponentProps &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasInitialFocus,\n hint,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isOptional = false,\n hasShowPassword = true,\n isReadOnly,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n placeholder,\n testId,\n translate,\n value,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [inputType, setInputType] = useState(\"password\");\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((inputType) =>\n inputType === \"password\" ? \"text\" : \"password\",\n );\n }, []);\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(inputRef, () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n }, []);\n\n const onChange = useCallback<\n ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={inputType === \"password\" ? autoCompleteType : \"off\"}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n hasShowPassword && (\n <InputAdornment position=\"end\">\n <IconButton\n aria-controls={id}\n aria-label={t(\"passwordfield.icon.label.show\")}\n aria-pressed={inputType === \"text\"}\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <ShowIcon /> : <HideIcon />}\n </IconButton>\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n // role: \"textbox\" Added because password inputs don't have an implicit role assigned. This causes problems with element selection.\n role: \"textbox\",\n }}\n inputRef={localInputRef}\n name={nameOverride ?? id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n translate={translate}\n type={inputType}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n inputValues,\n t,\n togglePasswordVisibility,\n inputType,\n nameOverride,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n hasShowPassword,\n ref,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n },\n);\n\nconst MemoizedPasswordField = memo(PasswordField);\nMemoizedPasswordField.displayName = \"PasswordField\";\n\nexport { MemoizedPasswordField as PasswordField };\n"],"mappings":";;;;;;;;;AAaA,IAAAA,MAAA,GAAAC,OAAA;AAWA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAMA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAA+E,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAhC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA+EA,MAAMG,aAAa,GAAG,IAAAC,iBAAU,EAC9B,CACE;EACEC,eAAe;EACfC,gBAAgB;EAChBC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,eAAe;EACfC,IAAI;EACJC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,UAAU,GAAG,KAAK;EAClBC,WAAW,GAAG,KAAK;EACnBC,UAAU,GAAG,KAAK;EAClBC,eAAe,GAAG,IAAI;EACtBC,UAAU;EACVC,KAAK;EACLC,IAAI,EAAEC,YAAY;EAClBC,QAAQ,EAAEC,YAAY;EACtBC,OAAO;EACPC,MAAM;EACNC,WAAW;EACXC,MAAM;EACNC,SAAS;EACTC;AACF,CAAC,EACDC,GAAG,KACA;EACH,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAAC,CAAC;EAC9B,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAG,IAAAC,eAAQ,EAAC,UAAU,CAAC;EAEtD,MAAMC,wBAAwB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACjDH,YAAY,CAAED,SAAS,IACrBA,SAAS,KAAK,UAAU,GAAG,MAAM,GAAG,UACtC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AClBC,eAAe;IACf/D,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBC,UAAU,EAAEA,UAAW;IACvBG,KAAK,EAAEA,KAAM;IACbgC,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMuB,qBAAqB,GAAAC,OAAA,CAAAzE,aAAA,GAAG,IAAA0E,WAAI,EAAC1E,aAAa,CAAC;AACjDwE,qBAAqB,CAACG,WAAW,GAAG,eAAe","ignoreList":[]}
|
package/dist/cjs/Select.cjs
CHANGED
|
@@ -75,57 +75,48 @@ const SelectContainer = _styled.default.div`
|
|
|
75
75
|
`;
|
|
76
76
|
const ChipsPositioningContainer = (0, _styled.default)("div", {
|
|
77
77
|
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
78
|
-
})
|
|
79
|
-
display: flex;
|
|
80
|
-
align-items: center;
|
|
81
|
-
position: absolute;
|
|
82
|
-
top: ${({
|
|
83
|
-
odysseyDesignTokens
|
|
84
|
-
}) => odysseyDesignTokens.Spacing0};
|
|
85
|
-
right: ${({
|
|
86
|
-
odysseyDesignTokens
|
|
87
|
-
}) => odysseyDesignTokens.Spacing5};
|
|
88
|
-
bottom: ${({
|
|
89
|
-
odysseyDesignTokens
|
|
90
|
-
}) => odysseyDesignTokens.Spacing0};
|
|
91
|
-
left: ${({
|
|
78
|
+
})(({
|
|
92
79
|
odysseyDesignTokens
|
|
93
|
-
}) =>
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
80
|
+
}) => {
|
|
81
|
+
return {
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
display: "flex",
|
|
84
|
+
insetBlockEnd: 0,
|
|
85
|
+
insetBlockStart: 0,
|
|
86
|
+
insetInlineEnd: "25px",
|
|
87
|
+
insetInlineStart: "4px",
|
|
88
|
+
marginInlineStart: odysseyDesignTokens.BorderWidthMain,
|
|
89
|
+
opacity: 1,
|
|
90
|
+
pointerEvents: "none",
|
|
91
|
+
position: "absolute"
|
|
92
|
+
};
|
|
93
|
+
});
|
|
100
94
|
const NonInteractiveIcon = (0, _styled.default)(_index.CloseCircleFilledIcon, {
|
|
101
95
|
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
102
|
-
})
|
|
103
|
-
font-size: 1em;
|
|
104
|
-
margin-inline-start: ${({
|
|
105
|
-
odysseyDesignTokens
|
|
106
|
-
}) => odysseyDesignTokens.Spacing2};
|
|
107
|
-
margin-inline-end: -${({
|
|
96
|
+
})(({
|
|
108
97
|
odysseyDesignTokens
|
|
109
|
-
}) =>
|
|
110
|
-
|
|
111
|
-
|
|
98
|
+
}) => ({
|
|
99
|
+
fontSize: "1em",
|
|
100
|
+
marginBlockEnd: "-1px",
|
|
101
|
+
marginInlineEnd: `-${odysseyDesignTokens.Spacing1}`,
|
|
102
|
+
marginInlineStart: odysseyDesignTokens.Spacing2
|
|
103
|
+
}));
|
|
112
104
|
const ChipsInnerContainer = (0, _styled.default)(_Box2.default, {
|
|
113
105
|
shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isInteractive" && prop !== "isReadOnly"
|
|
114
|
-
})
|
|
115
|
-
display: flex;
|
|
116
|
-
flex-wrap: wrap;
|
|
117
|
-
gap: ${({
|
|
118
|
-
odysseyDesignTokens
|
|
119
|
-
}) => odysseyDesignTokens.Spacing1};
|
|
120
|
-
pointer-events: none;
|
|
121
|
-
opacity: ${({
|
|
106
|
+
})(({
|
|
122
107
|
isInteractive,
|
|
123
|
-
isReadOnly
|
|
124
|
-
}) => isInteractive || isReadOnly ? 1 : 0};
|
|
125
|
-
min-height: ${({
|
|
108
|
+
isReadOnly,
|
|
126
109
|
odysseyDesignTokens
|
|
127
|
-
}) =>
|
|
128
|
-
|
|
110
|
+
}) => ({
|
|
111
|
+
display: "flex",
|
|
112
|
+
flexWrap: "wrap",
|
|
113
|
+
gap: odysseyDesignTokens.Spacing1,
|
|
114
|
+
marginBlock: `-${odysseyDesignTokens.Spacing2}`,
|
|
115
|
+
marginInlineEnd: odysseyDesignTokens.Spacing1,
|
|
116
|
+
minHeight: odysseyDesignTokens.Spacing6,
|
|
117
|
+
opacity: isInteractive || isReadOnly ? 1 : 0,
|
|
118
|
+
pointerEvents: "none"
|
|
119
|
+
}));
|
|
129
120
|
const {
|
|
130
121
|
CONTROLLED
|
|
131
122
|
} = _inputUtils.ComponentControlledState;
|
|
@@ -231,7 +222,7 @@ const Select = ({
|
|
|
231
222
|
isReadOnly
|
|
232
223
|
}) => {
|
|
233
224
|
const stopPropagation = event => event.stopPropagation();
|
|
234
|
-
const hasNonInteractiveIcon = !isInteractive && controlledStateRef.current === CONTROLLED && hasMultipleChoices;
|
|
225
|
+
const hasNonInteractiveIcon = !isInteractive && !isReadOnly && controlledStateRef.current === CONTROLLED && hasMultipleChoices;
|
|
235
226
|
return Array.isArray(internalSelectedValues) && (0, _jsxRuntime.jsx)(ChipsInnerContainer, {
|
|
236
227
|
isInteractive: isInteractive,
|
|
237
228
|
isReadOnly: isReadOnly,
|
package/dist/cjs/Select.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.cjs","names":["_react","require","_styled","_interopRequireDefault","_Field","_index","_inputUtils","_OdysseyDesignTokensContext","_useNormalizedKey","_jsxRuntime","e","__esModule","default","SelectTestSelector","exports","accessibleText","errorMessage","hint","label","children","list","listItem","elementSelector","method","options","role","isControlledElement","SelectContainer","styled","div","ChipsPositioningContainer","shouldForwardProp","prop","odysseyDesignTokens","Spacing0","Spacing5","Spacing1","BorderWidthMain","NonInteractiveIcon","CloseCircleFilledIcon","Spacing2","ChipsInnerContainer","_Box2","isInteractive","isReadOnly","Spacing6","CONTROLLED","ComponentControlledState","Select","ariaDescribedBy","defaultValue","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","testId","translate","value","selectRef","useRef","useMemo","undefined","controlledStateRef","getControlState","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","useState","current","localInputRef","useOdysseyDesignTokens","useImperativeHandle","focus","useEffect","inputValues","useInputValues","controlState","useCallback","event","child","preventDefault","target","split","normalizedOptions","normalizedOptionsMap","map","option","text","type","lang","language","Map","removeSelectedValue","selectedValue","Array","isArray","newValue","filter","internalSelectedValue","syntheticEvent","Chips","stopPropagation","hasNonInteractiveIcon","jsx","item","length","_Chip2","jsxs","Fragment","get","tabIndex","onDelete","deleteIcon","sx","pointerEvents","onMouseDown","renderedOptions","index","_ListSubheader2","isSelected","includes","_MenuItem2","selected","_Checkbox2","checked","_ListItemSecondaryAction2","CheckIcon","normalizedKey","toString","renderValue","renderFieldComponent","errorMessageElementId","labelElementId","_Select2","displayEmpty","inputProps","readOnly","el","labelId","MenuProps","maxHeight","multiple","Field","fieldType","hasVisibleLabel","MemoizedSelect","memo","displayName"],"sources":["../../src/Select.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 memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from \"react\";\nimport styled from \"@emotion/styled\";\nimport {\n Box as MuiBox,\n Checkbox as MuiCheckbox,\n Chip as MuiChip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem as MuiMenuItem,\n Select as MuiSelect,\n SelectProps as MuiSelectProps,\n SelectChangeEvent,\n} from \"@mui/material\";\n\nimport { Field } from \"./Field.js\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport { CheckIcon, CloseCircleFilledIcon } from \"./icons.generated/index.js\";\nimport type { HtmlProps } from \"./HtmlProps.js\";\nimport {\n ComponentControlledState,\n FocusHandle,\n useInputValues,\n getControlState,\n} from \"./inputUtils.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\nimport { TestSelector } from \"./test-selectors/index.js\";\nimport { normalizedKey } from \"./useNormalizedKey.js\";\n\nexport const SelectTestSelector = {\n accessibleText: {\n errorMessage: \"errorMessage\",\n hint: \"description\",\n label: \"label\",\n },\n children: {\n list: {\n accessibleText: {\n label: \"label\",\n },\n children: {\n listItem: {\n accessibleText: {\n label: \"label\",\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"option\",\n },\n },\n },\n isControlledElement: true,\n },\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"combobox\",\n },\n} as const satisfies TestSelector;\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n language?: string;\n};\n\nconst SelectContainer = styled.div`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nconst ChipsPositioningContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n align-items: center;\n position: absolute;\n top: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n right: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing5};\n bottom: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n left: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.BorderWidthMain};\n opacity: 1;\n pointer-events: none;\n`;\n\nconst NonInteractiveIcon = styled(CloseCircleFilledIcon, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n font-size: 1em;\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.Spacing2};\n margin-inline-end: -${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-block-end: -1px;\n`;\n\nconst ChipsInnerContainer = styled(MuiBox, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isInteractive\" &&\n prop !== \"isReadOnly\",\n})<{\n isInteractive?: boolean;\n isReadOnly?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n pointer-events: none;\n opacity: ${({ isInteractive, isReadOnly }) =>\n isInteractive || isReadOnly ? 1 : 0};\n min-height: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing6};\n`;\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype SelectRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n isReadOnly = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const selectRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect],\n );\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue,\n );\n\n const localInputRef = useRef<HTMLSelectElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n useImperativeHandle(inputRef, () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n }, []);\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n if (isReadOnly) {\n event.preventDefault();\n } else {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" && hasMultipleChoices\n ? value.split(\",\")\n : value) as Value,\n );\n }\n onChangeProp?.(event, child);\n }\n },\n [hasMultipleChoices, onChangeProp, isReadOnly],\n );\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {\n const normalizedOptions = options.map((option) => {\n if (typeof option === \"object\") {\n /**\n * If the value of `option?.value is an empty string, we need to make sure that we\n * set an empty string to `value` in the normalized option so that the select component\n * can potentially set it as the selected one in the text input\n */\n const value =\n option?.value === \"\" ? option.value : option.value || option.text;\n return {\n text: option.text,\n value,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n lang: option.language,\n };\n }\n\n return { text: option, value: option, type: \"option\" };\n });\n\n const normalizedOptionsMap = new Map(\n normalizedOptions.map((option) => [option.value, option]),\n );\n return [normalizedOptions, normalizedOptionsMap];\n }, [options]);\n\n const removeSelectedValue = useCallback(\n (selectedValue: string) => {\n if (Array.isArray(internalSelectedValues)) {\n const newValue = internalSelectedValues.filter(\n (internalSelectedValue) => internalSelectedValue !== selectedValue,\n );\n\n const syntheticEvent = {\n target: { value: newValue },\n } as SelectChangeEvent<Value>;\n\n onChange(syntheticEvent, null);\n }\n },\n [internalSelectedValues, onChange],\n );\n\n const Chips = useCallback(\n ({\n isInteractive,\n isReadOnly,\n }: {\n isInteractive: boolean;\n isReadOnly?: boolean;\n }) => {\n const stopPropagation = (event: React.MouseEvent<SVGSVGElement>) =>\n event.stopPropagation();\n\n const hasNonInteractiveIcon =\n !isInteractive &&\n controlledStateRef.current === CONTROLLED &&\n hasMultipleChoices;\n return (\n Array.isArray(internalSelectedValues) && (\n <ChipsInnerContainer\n isInteractive={isInteractive}\n isReadOnly={isReadOnly}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {internalSelectedValues.map(\n (item) =>\n item?.length > 0 && (\n <MuiChip\n key={item}\n label={\n <>\n {normalizedOptionsMap.get(item)?.text}\n {hasNonInteractiveIcon && (\n <NonInteractiveIcon\n odysseyDesignTokens={odysseyDesignTokens}\n />\n )}\n </>\n }\n tabIndex={-1}\n onDelete={\n isInteractive && controlledStateRef.current === CONTROLLED\n ? () => removeSelectedValue(item)\n : undefined\n }\n deleteIcon={\n <CloseCircleFilledIcon\n sx={{ pointerEvents: \"auto\" }}\n // We need to stop event propagation on mouse down to prevent the deletion\n // from being blocked by the Select list opening, and also ensure that\n // the pointerEvent is registered even when the parent's are not\n onMouseDown={stopPropagation}\n />\n }\n />\n ),\n )}\n </ChipsInnerContainer>\n )\n );\n },\n [\n controlledStateRef,\n hasMultipleChoices,\n internalSelectedValues,\n odysseyDesignTokens,\n removeSelectedValue,\n normalizedOptionsMap,\n ],\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const renderedOptions = useMemo(\n () =>\n normalizedOptions.map((option, index) => {\n if (option.type === \"heading\") {\n return (\n <ListSubheader key={option.text}> {option.text} </ListSubheader>\n );\n }\n\n const isSelected = hasMultipleChoices\n ? internalSelectedValues?.includes(option.value)\n : internalSelectedValues === option.value;\n\n return (\n <MuiMenuItem\n data-empty={!option.text}\n key={normalizedKey(option.text, index.toString())}\n value={option.value}\n selected={isSelected}\n lang={option.lang}\n >\n {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}\n {option.text}\n {!hasMultipleChoices && internalSelectedValues === option.value && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MuiMenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues],\n );\n\n const renderValue = useCallback(\n (value: Value) => Array.isArray(value) && <Chips isInteractive={false} />,\n [Chips],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: SelectRenderProps) => (\n <SelectContainer>\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n displayEmpty\n id={id}\n inputProps={{\n \"data-se\": testId,\n \"aria-disabled\": isDisabled || isReadOnly,\n readOnly: isReadOnly,\n }}\n inputRef={(el: HTMLInputElement | HTMLTextAreaElement | null) => {\n if (localInputRef.current !== el) {\n (localInputRef as React.MutableRefObject<typeof el>).current = el;\n }\n selectRef.current = el;\n }}\n labelId={labelElementId}\n MenuProps={{\n sx: {\n \".MuiPaper-root\": {\n maxHeight: \"50vh\",\n },\n },\n }}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n >\n {renderedOptions}\n </MuiSelect>\n {hasMultipleChoices && (\n <>\n <ChipsPositioningContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Chips isInteractive={!isReadOnly} isReadOnly={isReadOnly} />\n </ChipsPositioningContainer>\n </>\n )}\n </SelectContainer>\n ),\n [\n Chips,\n inputValues,\n hasMultipleChoices,\n isDisabled,\n isReadOnly,\n nameOverride,\n odysseyDesignTokens,\n onBlur,\n onChange,\n onFocus,\n renderedOptions,\n renderValue,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAaA,IAAAG,MAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAL,OAAA;AAMA,IAAAM,2BAAA,GAAAN,OAAA;AAKA,IAAAO,iBAAA,GAAAP,OAAA;AAAsD,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAE,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AApDtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CO,MAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,cAAc,EAAE;IACdC,YAAY,EAAE,cAAc;IAC5BC,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAE;EACT,CAAC;EACDC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJL,cAAc,EAAE;QACdG,KAAK,EAAE;MACT,CAAC;MACDC,QAAQ,EAAE;QACRE,QAAQ,EAAE;UACRN,cAAc,EAAE;YACdG,KAAK,EAAE;UACT,CAAC;UACDI,eAAe,EAAE;YACfC,MAAM,EAAE,QAAQ;YAChBC,OAAO,EAAE;cACPN,KAAK,EAAE;YACT,CAAC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vB3C,KAAK,EAAEA,KAAM;IACb8H,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMe,cAAc,GAAAjJ,OAAA,CAAAkC,MAAA,GAAG,IAAAgH,WAAI,EAAChH,MAAM,CAAC;AACnC+G,cAAc,CAACE,WAAW,GAAG,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Select.cjs","names":["_react","require","_styled","_interopRequireDefault","_Field","_index","_inputUtils","_OdysseyDesignTokensContext","_useNormalizedKey","_jsxRuntime","e","__esModule","default","SelectTestSelector","exports","accessibleText","errorMessage","hint","label","children","list","listItem","elementSelector","method","options","role","isControlledElement","SelectContainer","styled","div","ChipsPositioningContainer","shouldForwardProp","prop","odysseyDesignTokens","alignItems","display","insetBlockEnd","insetBlockStart","insetInlineEnd","insetInlineStart","marginInlineStart","BorderWidthMain","opacity","pointerEvents","position","NonInteractiveIcon","CloseCircleFilledIcon","fontSize","marginBlockEnd","marginInlineEnd","Spacing1","Spacing2","ChipsInnerContainer","_Box2","isInteractive","isReadOnly","flexWrap","gap","marginBlock","minHeight","Spacing6","CONTROLLED","ComponentControlledState","Select","ariaDescribedBy","defaultValue","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","testId","translate","value","selectRef","useRef","useMemo","undefined","controlledStateRef","getControlState","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","useState","current","localInputRef","useOdysseyDesignTokens","useImperativeHandle","focus","useEffect","inputValues","useInputValues","controlState","useCallback","event","child","preventDefault","target","split","normalizedOptions","normalizedOptionsMap","map","option","text","type","lang","language","Map","removeSelectedValue","selectedValue","Array","isArray","newValue","filter","internalSelectedValue","syntheticEvent","Chips","stopPropagation","hasNonInteractiveIcon","jsx","item","length","_Chip2","jsxs","Fragment","get","tabIndex","onDelete","deleteIcon","sx","onMouseDown","renderedOptions","index","_ListSubheader2","isSelected","includes","_MenuItem2","selected","_Checkbox2","checked","_ListItemSecondaryAction2","CheckIcon","normalizedKey","toString","renderValue","renderFieldComponent","errorMessageElementId","labelElementId","_Select2","displayEmpty","inputProps","readOnly","el","labelId","MenuProps","maxHeight","multiple","Field","fieldType","hasVisibleLabel","MemoizedSelect","memo","displayName"],"sources":["../../src/Select.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 memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from \"react\";\nimport styled from \"@emotion/styled\";\nimport {\n Box as MuiBox,\n Checkbox as MuiCheckbox,\n Chip as MuiChip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem as MuiMenuItem,\n Select as MuiSelect,\n SelectProps as MuiSelectProps,\n SelectChangeEvent,\n} from \"@mui/material\";\n\nimport { Field } from \"./Field.js\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport { CheckIcon, CloseCircleFilledIcon } from \"./icons.generated/index.js\";\nimport type { HtmlProps } from \"./HtmlProps.js\";\nimport {\n ComponentControlledState,\n FocusHandle,\n useInputValues,\n getControlState,\n} from \"./inputUtils.js\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\nimport { TestSelector } from \"./test-selectors/index.js\";\nimport { normalizedKey } from \"./useNormalizedKey.js\";\n\nexport const SelectTestSelector = {\n accessibleText: {\n errorMessage: \"errorMessage\",\n hint: \"description\",\n label: \"label\",\n },\n children: {\n list: {\n accessibleText: {\n label: \"label\",\n },\n children: {\n listItem: {\n accessibleText: {\n label: \"label\",\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"option\",\n },\n },\n },\n isControlledElement: true,\n },\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"combobox\",\n },\n} as const satisfies TestSelector;\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n language?: string;\n};\n\nconst SelectContainer = styled.div`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nconst ChipsPositioningContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => {\n return {\n alignItems: \"center\",\n display: \"flex\",\n insetBlockEnd: 0,\n insetBlockStart: 0,\n insetInlineEnd: \"25px\", // This 25px is used to align with MUI's default chip positioning logic.\n insetInlineStart: \"4px\",\n marginInlineStart: odysseyDesignTokens.BorderWidthMain,\n opacity: 1,\n pointerEvents: \"none\",\n position: \"absolute\",\n };\n});\n\nconst NonInteractiveIcon = styled(CloseCircleFilledIcon, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>(({ odysseyDesignTokens }) => ({\n fontSize: \"1em\",\n marginBlockEnd: \"-1px\",\n marginInlineEnd: `-${odysseyDesignTokens.Spacing1}`,\n marginInlineStart: odysseyDesignTokens.Spacing2,\n}));\n\nconst ChipsInnerContainer = styled(MuiBox, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isInteractive\" &&\n prop !== \"isReadOnly\",\n})<{\n isInteractive?: boolean;\n isReadOnly?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(({ isInteractive, isReadOnly, odysseyDesignTokens }) => ({\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: odysseyDesignTokens.Spacing1,\n marginBlock: `-${odysseyDesignTokens.Spacing2}`,\n marginInlineEnd: odysseyDesignTokens.Spacing1,\n minHeight: odysseyDesignTokens.Spacing6,\n opacity: isInteractive || isReadOnly ? 1 : 0,\n pointerEvents: \"none\",\n}));\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype SelectRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n isReadOnly = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const selectRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect],\n );\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue,\n );\n\n const localInputRef = useRef<HTMLSelectElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n useImperativeHandle(inputRef, () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n }, []);\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n if (isReadOnly) {\n event.preventDefault();\n } else {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" && hasMultipleChoices\n ? value.split(\",\")\n : value) as Value,\n );\n }\n onChangeProp?.(event, child);\n }\n },\n [hasMultipleChoices, onChangeProp, isReadOnly],\n );\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {\n const normalizedOptions = options.map((option) => {\n if (typeof option === \"object\") {\n /**\n * If the value of `option?.value is an empty string, we need to make sure that we\n * set an empty string to `value` in the normalized option so that the select component\n * can potentially set it as the selected one in the text input\n */\n const value =\n option?.value === \"\" ? option.value : option.value || option.text;\n return {\n text: option.text,\n value,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n lang: option.language,\n };\n }\n\n return { text: option, value: option, type: \"option\" };\n });\n\n const normalizedOptionsMap = new Map(\n normalizedOptions.map((option) => [option.value, option]),\n );\n return [normalizedOptions, normalizedOptionsMap];\n }, [options]);\n\n const removeSelectedValue = useCallback(\n (selectedValue: string) => {\n if (Array.isArray(internalSelectedValues)) {\n const newValue = internalSelectedValues.filter(\n (internalSelectedValue) => internalSelectedValue !== selectedValue,\n );\n\n const syntheticEvent = {\n target: { value: newValue },\n } as SelectChangeEvent<Value>;\n\n onChange(syntheticEvent, null);\n }\n },\n [internalSelectedValues, onChange],\n );\n\n const Chips = useCallback(\n ({\n isInteractive,\n isReadOnly,\n }: {\n isInteractive: boolean;\n isReadOnly?: boolean;\n }) => {\n const stopPropagation = (event: React.MouseEvent<SVGSVGElement>) =>\n event.stopPropagation();\n\n const hasNonInteractiveIcon =\n !isInteractive &&\n !isReadOnly &&\n controlledStateRef.current === CONTROLLED &&\n hasMultipleChoices;\n\n return (\n Array.isArray(internalSelectedValues) && (\n <ChipsInnerContainer\n isInteractive={isInteractive}\n isReadOnly={isReadOnly}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {internalSelectedValues.map(\n (item) =>\n item?.length > 0 && (\n <MuiChip\n key={item}\n label={\n <>\n {normalizedOptionsMap.get(item)?.text}\n {hasNonInteractiveIcon && (\n <NonInteractiveIcon\n odysseyDesignTokens={odysseyDesignTokens}\n />\n )}\n </>\n }\n tabIndex={-1}\n onDelete={\n isInteractive && controlledStateRef.current === CONTROLLED\n ? () => removeSelectedValue(item)\n : undefined\n }\n deleteIcon={\n <CloseCircleFilledIcon\n sx={{ pointerEvents: \"auto\" }}\n // We need to stop event propagation on mouse down to prevent the deletion\n // from being blocked by the Select list opening, and also ensure that\n // the pointerEvent is registered even when the parent's are not\n onMouseDown={stopPropagation}\n />\n }\n />\n ),\n )}\n </ChipsInnerContainer>\n )\n );\n },\n [\n controlledStateRef,\n hasMultipleChoices,\n internalSelectedValues,\n odysseyDesignTokens,\n removeSelectedValue,\n normalizedOptionsMap,\n ],\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const renderedOptions = useMemo(\n () =>\n normalizedOptions.map((option, index) => {\n if (option.type === \"heading\") {\n return (\n <ListSubheader key={option.text}> {option.text} </ListSubheader>\n );\n }\n\n const isSelected = hasMultipleChoices\n ? internalSelectedValues?.includes(option.value)\n : internalSelectedValues === option.value;\n\n return (\n <MuiMenuItem\n data-empty={!option.text}\n key={normalizedKey(option.text, index.toString())}\n value={option.value}\n selected={isSelected}\n lang={option.lang}\n >\n {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}\n {option.text}\n {!hasMultipleChoices && internalSelectedValues === option.value && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MuiMenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues],\n );\n\n const renderValue = useCallback(\n (value: Value) => Array.isArray(value) && <Chips isInteractive={false} />,\n [Chips],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: SelectRenderProps) => (\n <SelectContainer>\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n displayEmpty\n id={id}\n inputProps={{\n \"data-se\": testId,\n \"aria-disabled\": isDisabled || isReadOnly,\n readOnly: isReadOnly,\n }}\n inputRef={(el: HTMLInputElement | HTMLTextAreaElement | null) => {\n if (localInputRef.current !== el) {\n (localInputRef as React.MutableRefObject<typeof el>).current = el;\n }\n selectRef.current = el;\n }}\n labelId={labelElementId}\n MenuProps={{\n sx: {\n \".MuiPaper-root\": {\n maxHeight: \"50vh\",\n },\n },\n }}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n >\n {renderedOptions}\n </MuiSelect>\n {hasMultipleChoices && (\n <>\n <ChipsPositioningContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Chips isInteractive={!isReadOnly} isReadOnly={isReadOnly} />\n </ChipsPositioningContainer>\n </>\n )}\n </SelectContainer>\n ),\n [\n Chips,\n inputValues,\n hasMultipleChoices,\n isDisabled,\n isReadOnly,\n nameOverride,\n odysseyDesignTokens,\n onBlur,\n onChange,\n onFocus,\n renderedOptions,\n renderValue,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AASA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAA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package/dist/cjs/Status.cjs
CHANGED
|
@@ -24,6 +24,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
24
24
|
const statusSeverityValues = exports.statusSeverityValues = ["default", "error", "info", "success", "warning"];
|
|
25
25
|
const statusVariantValues = exports.statusVariantValues = ["lamp", "pill"];
|
|
26
26
|
const Status = ({
|
|
27
|
+
ariaDescribedBy,
|
|
27
28
|
label,
|
|
28
29
|
severity,
|
|
29
30
|
testId,
|
|
@@ -33,6 +34,7 @@ const Status = ({
|
|
|
33
34
|
const muiProps = (0, _MuiPropsContext.useMuiProps)();
|
|
34
35
|
return (0, _jsxRuntime.jsx)(_Chip2.default, {
|
|
35
36
|
...muiProps,
|
|
37
|
+
"aria-describedby": ariaDescribedBy,
|
|
36
38
|
color: severity,
|
|
37
39
|
"data-se": testId,
|
|
38
40
|
label: label,
|
package/dist/cjs/Status.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Status.cjs","names":["_react","require","_MuiPropsContext","_jsxRuntime","_interopRequireDefault","e","__esModule","default","statusSeverityValues","exports","statusVariantValues","Status","label","severity","testId","translate","variant","muiProps","useMuiProps","jsx","_Chip2","color","MemoizedStatus","memo","displayName"],"sources":["../../src/Status.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 } from \"react\";\nimport { Chip } from \"@mui/material\";\n\nimport { useMuiProps } from \"./MuiPropsContext.js\";\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nexport const statusSeverityValues = [\n \"default\",\n \"error\",\n \"info\",\n \"success\",\n \"warning\",\n] as const;\nexport const statusVariantValues = [\"lamp\", \"pill\"] as const;\n\nexport type StatusProps = {\n /**\n * The text content of the Status\n */\n label: string;\n /**\n * Determine the color and icon of the Status\n */\n severity: (typeof statusSeverityValues)[number];\n /**\n * The style of the Status indicator\n */\n variant?: (typeof statusVariantValues)[number];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Status = ({\n label,\n severity,\n testId,\n translate,\n variant = \"pill\",\n}: StatusProps) => {\n const muiProps = useMuiProps();\n\n return (\n <Chip\n {...muiProps}\n color={severity}\n data-se={testId}\n label={label}\n translate={translate}\n variant={variant}\n />\n );\n};\n\nconst MemoizedStatus = memo(Status);\nMemoizedStatus.displayName = \"Status\";\n\nexport { MemoizedStatus as Status };\n"],"mappings":";;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,gBAAA,GAAAD,OAAA;AAAmD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAfnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQO,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,CAClC,SAAS,EACT,OAAO,EACP,MAAM,EACN,SAAS,EACT,SAAS,CACD;AACH,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU;AAiB5D,MAAMC,MAAM,GAAGA,CAAC;EACdC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,SAAS;EACTC,OAAO,GAAG;AACC,CAAC,KAAK;EACjB,MAAMC,QAAQ,GAAG,IAAAC,4BAAW,EAAC,CAAC;EAE9B,OACE,
|
|
1
|
+
{"version":3,"file":"Status.cjs","names":["_react","require","_MuiPropsContext","_jsxRuntime","_interopRequireDefault","e","__esModule","default","statusSeverityValues","exports","statusVariantValues","Status","ariaDescribedBy","label","severity","testId","translate","variant","muiProps","useMuiProps","jsx","_Chip2","color","MemoizedStatus","memo","displayName"],"sources":["../../src/Status.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 } from \"react\";\nimport { Chip } from \"@mui/material\";\n\nimport { useMuiProps } from \"./MuiPropsContext.js\";\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nexport const statusSeverityValues = [\n \"default\",\n \"error\",\n \"info\",\n \"success\",\n \"warning\",\n] as const;\nexport const statusVariantValues = [\"lamp\", \"pill\"] as const;\n\nexport type StatusProps = {\n /**\n * The text content of the Status\n */\n label: string;\n /**\n * Determine the color and icon of the Status\n */\n severity: (typeof statusSeverityValues)[number];\n /**\n * The style of the Status indicator\n */\n variant?: (typeof statusVariantValues)[number];\n} & Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\nconst Status = ({\n ariaDescribedBy,\n label,\n severity,\n testId,\n translate,\n variant = \"pill\",\n}: StatusProps) => {\n const muiProps = useMuiProps();\n\n return (\n <Chip\n {...muiProps}\n aria-describedby={ariaDescribedBy}\n color={severity}\n data-se={testId}\n label={label}\n translate={translate}\n variant={variant}\n />\n );\n};\n\nconst MemoizedStatus = memo(Status);\nMemoizedStatus.displayName = \"Status\";\n\nexport { MemoizedStatus as Status };\n"],"mappings":";;;;;;;AAYA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,gBAAA,GAAAD,OAAA;AAAmD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAfnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQO,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,CAClC,SAAS,EACT,OAAO,EACP,MAAM,EACN,SAAS,EACT,SAAS,CACD;AACH,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU;AAiB5D,MAAMC,MAAM,GAAGA,CAAC;EACdC,eAAe;EACfC,KAAK;EACLC,QAAQ;EACRC,MAAM;EACNC,SAAS;EACTC,OAAO,GAAG;AACC,CAAC,KAAK;EACjB,MAAMC,QAAQ,GAAG,IAAAC,4BAAW,EAAC,CAAC;EAE9B,OACE,IAAAhB,WAAA,CAAAiB,GAAA,EAAAC,MAAA,CAAAd,OAAA;IAAA,GACMW,QAAQ;IACZ,oBAAkBN,eAAgB;IAClCU,KAAK,EAAER,QAAS;IAChB,WAASC,MAAO;IAChBF,KAAK,EAAEA,KAAM;IACbG,SAAS,EAAEA,SAAU;IACrBC,OAAO,EAAEA;EAAQ,CAClB,CAAC;AAEN,CAAC;AAED,MAAMM,cAAc,GAAAd,OAAA,CAAAE,MAAA,GAAG,IAAAa,WAAI,EAACb,MAAM,CAAC;AACnCY,cAAc,CAACE,WAAW,GAAG,QAAQ","ignoreList":[]}
|
package/dist/cjs/Typography.cjs
CHANGED
|
@@ -42,11 +42,12 @@ const Typography = ({
|
|
|
42
42
|
children,
|
|
43
43
|
color,
|
|
44
44
|
component: componentProp,
|
|
45
|
+
id,
|
|
46
|
+
isPresentational,
|
|
45
47
|
testId,
|
|
46
48
|
translate,
|
|
47
49
|
typographyRef,
|
|
48
|
-
variant = "body"
|
|
49
|
-
isPresentational
|
|
50
|
+
variant = "body"
|
|
50
51
|
}) => {
|
|
51
52
|
const component = (0, _react.useMemo)(() => {
|
|
52
53
|
if (!componentProp) {
|
|
@@ -75,11 +76,12 @@ const Typography = ({
|
|
|
75
76
|
color: color,
|
|
76
77
|
component: component,
|
|
77
78
|
"data-se": testId,
|
|
79
|
+
id: id,
|
|
78
80
|
ref: localTypographyRef,
|
|
81
|
+
role: isPresentational ? "presentation" : undefined,
|
|
79
82
|
tabIndex: -1,
|
|
80
83
|
translate: translate,
|
|
81
|
-
variant: typographyVariantMapping[variant]
|
|
82
|
-
role: isPresentational ? "presentation" : undefined
|
|
84
|
+
variant: typographyVariantMapping[variant]
|
|
83
85
|
});
|
|
84
86
|
};
|
|
85
87
|
const MemoizedTypography = exports.Typography = (0, _react.memo)(Typography);
|
|
@@ -92,9 +94,10 @@ const Heading1 = ({
|
|
|
92
94
|
children,
|
|
93
95
|
color,
|
|
94
96
|
component,
|
|
97
|
+
id,
|
|
98
|
+
isPresentational,
|
|
95
99
|
testId,
|
|
96
|
-
translate
|
|
97
|
-
isPresentational
|
|
100
|
+
translate
|
|
98
101
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
99
102
|
ariaCurrent: ariaCurrent,
|
|
100
103
|
ariaDescribedBy: ariaDescribedBy,
|
|
@@ -103,10 +106,11 @@ const Heading1 = ({
|
|
|
103
106
|
children: children,
|
|
104
107
|
color: color,
|
|
105
108
|
component: component,
|
|
109
|
+
id: id,
|
|
110
|
+
isPresentational: isPresentational,
|
|
106
111
|
testId: testId,
|
|
107
112
|
translate: translate,
|
|
108
|
-
variant: "h1"
|
|
109
|
-
isPresentational: isPresentational
|
|
113
|
+
variant: "h1"
|
|
110
114
|
});
|
|
111
115
|
const MemoizedHeading1 = exports.Heading1 = (0, _react.memo)(Heading1);
|
|
112
116
|
MemoizedHeading1.displayName = "Heading1";
|
|
@@ -118,6 +122,7 @@ const Heading2 = ({
|
|
|
118
122
|
children,
|
|
119
123
|
color,
|
|
120
124
|
component,
|
|
125
|
+
id,
|
|
121
126
|
testId,
|
|
122
127
|
translate
|
|
123
128
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -128,6 +133,7 @@ const Heading2 = ({
|
|
|
128
133
|
children: children,
|
|
129
134
|
color: color,
|
|
130
135
|
component: component,
|
|
136
|
+
id: id,
|
|
131
137
|
testId: testId,
|
|
132
138
|
translate: translate,
|
|
133
139
|
variant: "h2"
|
|
@@ -142,6 +148,7 @@ const Heading3 = ({
|
|
|
142
148
|
children,
|
|
143
149
|
color,
|
|
144
150
|
component,
|
|
151
|
+
id,
|
|
145
152
|
testId,
|
|
146
153
|
translate
|
|
147
154
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -152,6 +159,7 @@ const Heading3 = ({
|
|
|
152
159
|
children: children,
|
|
153
160
|
color: color,
|
|
154
161
|
component: component,
|
|
162
|
+
id: id,
|
|
155
163
|
testId: testId,
|
|
156
164
|
translate: translate,
|
|
157
165
|
variant: "h3"
|
|
@@ -166,6 +174,7 @@ const Heading4 = ({
|
|
|
166
174
|
children,
|
|
167
175
|
color,
|
|
168
176
|
component,
|
|
177
|
+
id,
|
|
169
178
|
testId,
|
|
170
179
|
translate
|
|
171
180
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -176,6 +185,7 @@ const Heading4 = ({
|
|
|
176
185
|
children: children,
|
|
177
186
|
color: color,
|
|
178
187
|
component: component,
|
|
188
|
+
id: id,
|
|
179
189
|
testId: testId,
|
|
180
190
|
translate: translate,
|
|
181
191
|
variant: "h4"
|
|
@@ -190,6 +200,7 @@ const Heading5 = ({
|
|
|
190
200
|
children,
|
|
191
201
|
color,
|
|
192
202
|
component,
|
|
203
|
+
id,
|
|
193
204
|
testId,
|
|
194
205
|
translate
|
|
195
206
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -200,6 +211,7 @@ const Heading5 = ({
|
|
|
200
211
|
children: children,
|
|
201
212
|
color: color,
|
|
202
213
|
component: component,
|
|
214
|
+
id: id,
|
|
203
215
|
testId: testId,
|
|
204
216
|
translate: translate,
|
|
205
217
|
variant: "h5"
|
|
@@ -214,6 +226,7 @@ const Heading6 = ({
|
|
|
214
226
|
children,
|
|
215
227
|
color,
|
|
216
228
|
component,
|
|
229
|
+
id,
|
|
217
230
|
testId,
|
|
218
231
|
translate
|
|
219
232
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -224,6 +237,7 @@ const Heading6 = ({
|
|
|
224
237
|
children: children,
|
|
225
238
|
color: color,
|
|
226
239
|
component: component,
|
|
240
|
+
id: id,
|
|
227
241
|
testId: testId,
|
|
228
242
|
translate: translate,
|
|
229
243
|
variant: "h6"
|
|
@@ -238,6 +252,7 @@ const Paragraph = ({
|
|
|
238
252
|
children,
|
|
239
253
|
color,
|
|
240
254
|
component,
|
|
255
|
+
id,
|
|
241
256
|
testId,
|
|
242
257
|
translate
|
|
243
258
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -248,6 +263,7 @@ const Paragraph = ({
|
|
|
248
263
|
children: children,
|
|
249
264
|
color: color,
|
|
250
265
|
component: component,
|
|
266
|
+
id: id,
|
|
251
267
|
testId: testId,
|
|
252
268
|
translate: translate,
|
|
253
269
|
variant: "body"
|
|
@@ -262,6 +278,7 @@ const Subordinate = ({
|
|
|
262
278
|
children,
|
|
263
279
|
color,
|
|
264
280
|
component,
|
|
281
|
+
id,
|
|
265
282
|
testId,
|
|
266
283
|
translate
|
|
267
284
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -272,6 +289,7 @@ const Subordinate = ({
|
|
|
272
289
|
children: children,
|
|
273
290
|
color: color,
|
|
274
291
|
component: component,
|
|
292
|
+
id: id,
|
|
275
293
|
testId: testId,
|
|
276
294
|
translate: translate,
|
|
277
295
|
variant: "subordinate"
|
|
@@ -286,6 +304,7 @@ const Support = ({
|
|
|
286
304
|
children,
|
|
287
305
|
color,
|
|
288
306
|
component,
|
|
307
|
+
id,
|
|
289
308
|
testId,
|
|
290
309
|
translate
|
|
291
310
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -296,6 +315,7 @@ const Support = ({
|
|
|
296
315
|
children: children,
|
|
297
316
|
color: color,
|
|
298
317
|
component: component,
|
|
318
|
+
id: id,
|
|
299
319
|
testId: testId,
|
|
300
320
|
translate: translate,
|
|
301
321
|
variant: "support"
|
|
@@ -309,6 +329,7 @@ const Legend = ({
|
|
|
309
329
|
children,
|
|
310
330
|
color,
|
|
311
331
|
component,
|
|
332
|
+
id,
|
|
312
333
|
testId,
|
|
313
334
|
translate
|
|
314
335
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -318,6 +339,7 @@ const Legend = ({
|
|
|
318
339
|
children: children,
|
|
319
340
|
color: color,
|
|
320
341
|
component: component,
|
|
342
|
+
id: id,
|
|
321
343
|
testId: testId,
|
|
322
344
|
translate: translate,
|
|
323
345
|
variant: "legend"
|
|
@@ -331,6 +353,7 @@ const Overline = ({
|
|
|
331
353
|
children,
|
|
332
354
|
color,
|
|
333
355
|
component,
|
|
356
|
+
id,
|
|
334
357
|
testId,
|
|
335
358
|
translate
|
|
336
359
|
}) => (0, _jsxRuntime.jsx)(Typography, {
|
|
@@ -340,6 +363,7 @@ const Overline = ({
|
|
|
340
363
|
children: children,
|
|
341
364
|
color: color,
|
|
342
365
|
component: component,
|
|
366
|
+
id: id,
|
|
343
367
|
testId: testId,
|
|
344
368
|
translate: translate,
|
|
345
369
|
variant: "overline"
|