@okta/odyssey-react-mui 1.13.11 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/dist/@types/properties.d.js +2 -0
- package/dist/@types/properties.d.js.map +1 -0
- package/dist/Accordion.js.map +1 -1
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Badge.js.map +1 -1
- package/dist/Banner.js.map +1 -1
- package/dist/Box.js.map +1 -1
- package/dist/Breadcrumbs.js.map +1 -1
- package/dist/Button.js +3 -3
- package/dist/Button.js.map +1 -1
- package/dist/Callout.js.map +1 -1
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/CircularProgress.js.map +1 -1
- package/dist/Dialog.js +8 -8
- package/dist/Dialog.js.map +1 -1
- package/dist/ErrorMessageList.js.map +1 -1
- package/dist/Field.js +1 -0
- package/dist/Field.js.map +1 -1
- package/dist/FieldComponentProps.js.map +1 -1
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldHint.js.map +1 -1
- package/dist/FieldLabel.js.map +1 -1
- package/dist/Fieldset.js.map +1 -1
- package/dist/Form.js.map +1 -1
- package/dist/FormCheckedProps.js.map +1 -1
- package/dist/HintLink.js.map +1 -1
- package/dist/HtmlProps.js.map +1 -1
- package/dist/Link.js.map +1 -1
- package/dist/MenuButton.js.map +1 -1
- package/dist/MenuItem.js.map +1 -1
- package/dist/MuiPropsChild.js.map +1 -1
- package/dist/NativeSelect.js.map +1 -1
- package/dist/OdysseyProvider.js +0 -2
- package/dist/OdysseyProvider.js.map +1 -1
- package/dist/OdysseyThemeProvider.js +1 -28
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/OdysseyTranslationProvider.js.map +1 -1
- package/dist/PasswordField.js.map +1 -1
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js.map +1 -1
- package/dist/ScreenReaderText.js.map +1 -1
- package/dist/SearchField.js +6 -2
- package/dist/SearchField.js.map +1 -1
- package/dist/Select.js +144 -44
- package/dist/Select.js.map +1 -1
- package/dist/Status.js +6 -1
- package/dist/Status.js.map +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/Tabs.js.map +1 -1
- package/dist/Tag.js.map +1 -1
- package/dist/TagList.js.map +1 -1
- package/dist/TextField.js.map +1 -1
- package/dist/Tile.js +53 -39
- package/dist/Tile.js.map +1 -1
- package/dist/Toast.js.map +1 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/Typography.js +11 -10
- package/dist/Typography.js.map +1 -1
- package/dist/createShadowRootElement.js.map +1 -1
- package/dist/getTypedObjectKeys.js.map +1 -1
- package/dist/icons.generated/AddCircle.js.map +1 -1
- package/dist/icons.generated/Apps.js.map +1 -1
- package/dist/icons.generated/ArrowBottom.js.map +1 -1
- package/dist/icons.generated/ArrowDown.js.map +1 -1
- package/dist/icons.generated/ArrowLeft.js.map +1 -1
- package/dist/icons.generated/ArrowRight.js.map +1 -1
- package/dist/icons.generated/ArrowTop.js.map +1 -1
- package/dist/icons.generated/ArrowUp.js.map +1 -1
- package/dist/icons.generated/Calendar.js.map +1 -1
- package/dist/icons.generated/Call.js.map +1 -1
- package/dist/icons.generated/Chat.js.map +1 -1
- package/dist/icons.generated/Check.js.map +1 -1
- package/dist/icons.generated/ChevronDown.js.map +1 -1
- package/dist/icons.generated/ChevronLeft.js.map +1 -1
- package/dist/icons.generated/ChevronUp.js.map +1 -1
- package/dist/icons.generated/Clock.js.map +1 -1
- package/dist/icons.generated/Close.js.map +1 -1
- package/dist/icons.generated/Copy.js.map +1 -1
- package/dist/icons.generated/Delete.js.map +1 -1
- package/dist/icons.generated/Deny.js.map +1 -1
- package/dist/icons.generated/Devices.js.map +1 -1
- package/dist/icons.generated/Directory.js.map +1 -1
- package/dist/icons.generated/Download.js.map +1 -1
- package/dist/icons.generated/Edit.js.map +1 -1
- package/dist/icons.generated/ExpandLeft.js.map +1 -1
- package/dist/icons.generated/ExpandRight.js.map +1 -1
- package/dist/icons.generated/Filter.js.map +1 -1
- package/dist/icons.generated/Folder.js.map +1 -1
- package/dist/icons.generated/Globe.js.map +1 -1
- package/dist/icons.generated/Grid.js.map +1 -1
- package/dist/icons.generated/Group.js.map +1 -1
- package/dist/icons.generated/Hide.js.map +1 -1
- package/dist/icons.generated/Home.js.map +1 -1
- package/dist/icons.generated/Link.js.map +1 -1
- package/dist/icons.generated/List.js.map +1 -1
- package/dist/icons.generated/Lock.js.map +1 -1
- package/dist/icons.generated/More.js.map +1 -1
- package/dist/icons.generated/Pause.js.map +1 -1
- package/dist/icons.generated/Refresh.js.map +1 -1
- package/dist/icons.generated/Reset.js.map +1 -1
- package/dist/icons.generated/Resume.js.map +1 -1
- package/dist/icons.generated/Search.js.map +1 -1
- package/dist/icons.generated/Server.js.map +1 -1
- package/dist/icons.generated/Settings.js.map +1 -1
- package/dist/icons.generated/Show.js.map +1 -1
- package/dist/icons.generated/Subtract.js.map +1 -1
- package/dist/icons.generated/Sync.js.map +1 -1
- package/dist/icons.generated/Unlock.js.map +1 -1
- package/dist/icons.generated/Upload.js.map +1 -1
- package/dist/icons.generated/User.js.map +1 -1
- package/dist/icons.generated/Video.js.map +1 -1
- package/dist/icons.generated/Warning.js.map +1 -1
- package/dist/icons.generated/index.js +1 -1
- package/dist/icons.generated/index.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/labs/DataFilters.js.map +1 -1
- package/dist/labs/DataTable.js.map +1 -1
- package/dist/labs/DatePicker.js.map +1 -1
- package/dist/labs/Drawer.js +172 -0
- package/dist/labs/Drawer.js.map +1 -0
- package/dist/labs/GroupPicker.js.map +1 -1
- package/dist/labs/PaginatedTable.js.map +1 -1
- package/dist/labs/StaticTable.js.map +1 -1
- package/dist/labs/Switch.js.map +1 -1
- package/dist/labs/VirtualizedAutocomplete.js.map +1 -1
- package/dist/labs/datePickerTheme.js.map +1 -1
- package/dist/labs/index.js +1 -0
- package/dist/labs/index.js.map +1 -1
- package/dist/labs/materialReactTableTypes.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_cs.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_da.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_de.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_el.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_es.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_fi.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_fr.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_hu.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_id.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_it.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ja.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ko.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ms.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_nb.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_nl_NL.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_pl.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_pt_BR.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ro.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_ru.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_sv.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_th.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_tr.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_uk.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_vi.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_zh_CN.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui_zh_TW.js +4 -2
- package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
- package/dist/scripts/properties-to-ts.d.ts +14 -0
- package/dist/scripts/properties-to-ts.d.ts.map +1 -0
- package/dist/src/Accordion.d.ts +2 -2
- package/dist/src/Accordion.d.ts.map +1 -1
- package/dist/src/Autocomplete.d.ts +2 -2
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Badge.d.ts +2 -2
- package/dist/src/Badge.d.ts.map +1 -1
- package/dist/src/Banner.d.ts +2 -2
- package/dist/src/Banner.d.ts.map +1 -1
- package/dist/src/Box.d.ts +2 -2
- package/dist/src/Box.d.ts.map +1 -1
- package/dist/src/Breadcrumbs.d.ts +3 -3
- package/dist/src/Breadcrumbs.d.ts.map +1 -1
- package/dist/src/Button.d.ts +3 -30
- package/dist/src/Button.d.ts.map +1 -1
- package/dist/src/Callout.d.ts +2 -2
- package/dist/src/Callout.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +3 -23
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/CheckboxGroup.d.ts +2 -2
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/CircularProgress.d.ts +2 -6
- package/dist/src/CircularProgress.d.ts.map +1 -1
- package/dist/src/CssBaseline.d.ts +1 -1
- package/dist/src/CssBaseline.d.ts.map +1 -1
- package/dist/src/Dialog.d.ts +5 -5
- package/dist/src/Dialog.d.ts.map +1 -1
- package/dist/src/ErrorMessageList.d.ts +1 -1
- package/dist/src/ErrorMessageList.d.ts.map +1 -1
- package/dist/src/Field.d.ts +2 -5
- package/dist/src/Field.d.ts.map +1 -1
- package/dist/src/FieldComponentProps.d.ts +7 -4
- package/dist/src/FieldComponentProps.d.ts.map +1 -1
- package/dist/src/FieldError.d.ts +2 -2
- package/dist/src/FieldError.d.ts.map +1 -1
- package/dist/src/FieldHint.d.ts +2 -2
- package/dist/src/FieldHint.d.ts.map +1 -1
- package/dist/src/FieldLabel.d.ts +2 -2
- package/dist/src/FieldLabel.d.ts.map +1 -1
- package/dist/src/Fieldset.d.ts +2 -2
- package/dist/src/Fieldset.d.ts.map +1 -1
- package/dist/src/Form.d.ts +2 -2
- package/dist/src/Form.d.ts.map +1 -1
- package/dist/src/HintLink.d.ts +1 -1
- package/dist/src/HintLink.d.ts.map +1 -1
- package/dist/src/HtmlProps.d.ts +59 -0
- package/dist/src/HtmlProps.d.ts.map +1 -1
- package/dist/src/Link.d.ts +2 -6
- package/dist/src/Link.d.ts.map +1 -1
- package/dist/src/MenuButton.d.ts +5 -23
- package/dist/src/MenuButton.d.ts.map +1 -1
- package/dist/src/MenuItem.d.ts +2 -2
- package/dist/src/MenuItem.d.ts.map +1 -1
- package/dist/src/NativeSelect.d.ts +2 -2
- package/dist/src/NativeSelect.d.ts.map +1 -1
- package/dist/src/OdysseyCacheProvider.d.ts +1 -1
- package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
- package/dist/src/OdysseyProvider.d.ts +1 -1
- package/dist/src/OdysseyProvider.d.ts.map +1 -1
- package/dist/src/OdysseyThemeProvider.d.ts +1 -3
- package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts +2 -2
- package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
- package/dist/src/PasswordField.d.ts +2 -2
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/src/Radio.d.ts +2 -2
- package/dist/src/Radio.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts +2 -2
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/ScreenReaderText.d.ts +2 -2
- package/dist/src/ScreenReaderText.d.ts.map +1 -1
- package/dist/src/SearchField.d.ts +11 -2
- package/dist/src/SearchField.d.ts.map +1 -1
- package/dist/src/Select.d.ts +2 -2
- package/dist/src/Select.d.ts.map +1 -1
- package/dist/src/Status.d.ts +4 -2
- package/dist/src/Status.d.ts.map +1 -1
- package/dist/src/Tabs.d.ts +2 -6
- package/dist/src/Tabs.d.ts.map +1 -1
- package/dist/src/Tag.d.ts +2 -2
- package/dist/src/Tag.d.ts.map +1 -1
- package/dist/src/TagList.d.ts +2 -2
- package/dist/src/TagList.d.ts.map +1 -1
- package/dist/src/TextField.d.ts +3 -3
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/src/Tile.d.ts +32 -11
- package/dist/src/Tile.d.ts.map +1 -1
- package/dist/src/Toast.d.ts +2 -2
- package/dist/src/Toast.d.ts.map +1 -1
- package/dist/src/ToastStack.d.ts +1 -1
- package/dist/src/ToastStack.d.ts.map +1 -1
- package/dist/src/Tooltip.d.ts +2 -2
- package/dist/src/Tooltip.d.ts.map +1 -1
- package/dist/src/Typography.d.ts +13 -25
- package/dist/src/Typography.d.ts.map +1 -1
- package/dist/src/icons.generated/Add.d.ts +1 -1
- package/dist/src/icons.generated/Add.d.ts.map +1 -1
- package/dist/src/icons.generated/AddCircle.d.ts +1 -1
- package/dist/src/icons.generated/AddCircle.d.ts.map +1 -1
- package/dist/src/icons.generated/Apps.d.ts +1 -1
- package/dist/src/icons.generated/Apps.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowBottom.d.ts +1 -1
- package/dist/src/icons.generated/ArrowBottom.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowDown.d.ts +1 -1
- package/dist/src/icons.generated/ArrowDown.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowLeft.d.ts +1 -1
- package/dist/src/icons.generated/ArrowLeft.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowLowerLeft.d.ts +1 -1
- package/dist/src/icons.generated/ArrowLowerLeft.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowLowerRight.d.ts +1 -1
- package/dist/src/icons.generated/ArrowLowerRight.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowRight.d.ts +1 -1
- package/dist/src/icons.generated/ArrowRight.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowTop.d.ts +1 -1
- package/dist/src/icons.generated/ArrowTop.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowUnsorted.d.ts +1 -1
- package/dist/src/icons.generated/ArrowUnsorted.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowUp.d.ts +1 -1
- package/dist/src/icons.generated/ArrowUp.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowUpperLeft.d.ts +1 -1
- package/dist/src/icons.generated/ArrowUpperLeft.d.ts.map +1 -1
- package/dist/src/icons.generated/ArrowUpperRight.d.ts +1 -1
- package/dist/src/icons.generated/ArrowUpperRight.d.ts.map +1 -1
- package/dist/src/icons.generated/Bug.d.ts +1 -1
- package/dist/src/icons.generated/Bug.d.ts.map +1 -1
- package/dist/src/icons.generated/Calendar.d.ts +1 -1
- package/dist/src/icons.generated/Calendar.d.ts.map +1 -1
- package/dist/src/icons.generated/Call.d.ts +1 -1
- package/dist/src/icons.generated/Call.d.ts.map +1 -1
- package/dist/src/icons.generated/Chat.d.ts +1 -1
- package/dist/src/icons.generated/Chat.d.ts.map +1 -1
- package/dist/src/icons.generated/Check.d.ts +1 -1
- package/dist/src/icons.generated/Check.d.ts.map +1 -1
- package/dist/src/icons.generated/CheckCircleFilled.d.ts +1 -1
- package/dist/src/icons.generated/CheckCircleFilled.d.ts.map +1 -1
- package/dist/src/icons.generated/ChevronDown.d.ts +1 -1
- package/dist/src/icons.generated/ChevronDown.d.ts.map +1 -1
- package/dist/src/icons.generated/ChevronLeft.d.ts +1 -1
- package/dist/src/icons.generated/ChevronLeft.d.ts.map +1 -1
- package/dist/src/icons.generated/ChevronRight.d.ts +1 -1
- package/dist/src/icons.generated/ChevronRight.d.ts.map +1 -1
- package/dist/src/icons.generated/ChevronUp.d.ts +1 -1
- package/dist/src/icons.generated/ChevronUp.d.ts.map +1 -1
- package/dist/src/icons.generated/Clock.d.ts +1 -1
- package/dist/src/icons.generated/Clock.d.ts.map +1 -1
- package/dist/src/icons.generated/Close.d.ts +1 -1
- package/dist/src/icons.generated/Close.d.ts.map +1 -1
- package/dist/src/icons.generated/CloseCircleFilled.d.ts +1 -1
- package/dist/src/icons.generated/CloseCircleFilled.d.ts.map +1 -1
- package/dist/src/icons.generated/CollapseLeft.d.ts +1 -1
- package/dist/src/icons.generated/CollapseLeft.d.ts.map +1 -1
- package/dist/src/icons.generated/CollapseRight.d.ts +1 -1
- package/dist/src/icons.generated/CollapseRight.d.ts.map +1 -1
- package/dist/src/icons.generated/Copy.d.ts +1 -1
- package/dist/src/icons.generated/Copy.d.ts.map +1 -1
- package/dist/src/icons.generated/DangerDiamond.d.ts +1 -1
- package/dist/src/icons.generated/DangerDiamond.d.ts.map +1 -1
- package/dist/src/icons.generated/DangerDiamondFilled.d.ts +1 -1
- package/dist/src/icons.generated/DangerDiamondFilled.d.ts.map +1 -1
- package/dist/src/icons.generated/Delete.d.ts +1 -1
- package/dist/src/icons.generated/Delete.d.ts.map +1 -1
- package/dist/src/icons.generated/Deny.d.ts +1 -1
- package/dist/src/icons.generated/Deny.d.ts.map +1 -1
- package/dist/src/icons.generated/Devices.d.ts +1 -1
- package/dist/src/icons.generated/Devices.d.ts.map +1 -1
- package/dist/src/icons.generated/Directory.d.ts +1 -1
- package/dist/src/icons.generated/Directory.d.ts.map +1 -1
- package/dist/src/icons.generated/Documentation.d.ts +1 -1
- package/dist/src/icons.generated/Documentation.d.ts.map +1 -1
- package/dist/src/icons.generated/Download.d.ts +1 -1
- package/dist/src/icons.generated/Download.d.ts.map +1 -1
- package/dist/src/icons.generated/DragIndicator.d.ts +1 -1
- package/dist/src/icons.generated/DragIndicator.d.ts.map +1 -1
- package/dist/src/icons.generated/Edit.d.ts +1 -1
- package/dist/src/icons.generated/Edit.d.ts.map +1 -1
- package/dist/src/icons.generated/ExpandLeft.d.ts +1 -1
- package/dist/src/icons.generated/ExpandLeft.d.ts.map +1 -1
- package/dist/src/icons.generated/ExpandRight.d.ts +1 -1
- package/dist/src/icons.generated/ExpandRight.d.ts.map +1 -1
- package/dist/src/icons.generated/ExternalLink.d.ts +1 -1
- package/dist/src/icons.generated/ExternalLink.d.ts.map +1 -1
- package/dist/src/icons.generated/Filter.d.ts +1 -1
- package/dist/src/icons.generated/Filter.d.ts.map +1 -1
- package/dist/src/icons.generated/Folder.d.ts +1 -1
- package/dist/src/icons.generated/Folder.d.ts.map +1 -1
- package/dist/src/icons.generated/Globe.d.ts +1 -1
- package/dist/src/icons.generated/Globe.d.ts.map +1 -1
- package/dist/src/icons.generated/Grid.d.ts +1 -1
- package/dist/src/icons.generated/Grid.d.ts.map +1 -1
- package/dist/src/icons.generated/Group.d.ts +1 -1
- package/dist/src/icons.generated/Group.d.ts.map +1 -1
- package/dist/src/icons.generated/Hide.d.ts +1 -1
- package/dist/src/icons.generated/Hide.d.ts.map +1 -1
- package/dist/src/icons.generated/Home.d.ts +1 -1
- package/dist/src/icons.generated/Home.d.ts.map +1 -1
- package/dist/src/icons.generated/InformationCircle.d.ts +1 -1
- package/dist/src/icons.generated/InformationCircle.d.ts.map +1 -1
- package/dist/src/icons.generated/InformationCircleFilled.d.ts +1 -1
- package/dist/src/icons.generated/InformationCircleFilled.d.ts.map +1 -1
- package/dist/src/icons.generated/Link.d.ts +1 -1
- package/dist/src/icons.generated/Link.d.ts.map +1 -1
- package/dist/src/icons.generated/List.d.ts +1 -1
- package/dist/src/icons.generated/List.d.ts.map +1 -1
- package/dist/src/icons.generated/Lock.d.ts +1 -1
- package/dist/src/icons.generated/Lock.d.ts.map +1 -1
- package/dist/src/icons.generated/More.d.ts +1 -1
- package/dist/src/icons.generated/More.d.ts.map +1 -1
- package/dist/src/icons.generated/Notification.d.ts +1 -1
- package/dist/src/icons.generated/Notification.d.ts.map +1 -1
- package/dist/src/icons.generated/Pause.d.ts +1 -1
- package/dist/src/icons.generated/Pause.d.ts.map +1 -1
- package/dist/src/icons.generated/QuestionCircle.d.ts +1 -1
- package/dist/src/icons.generated/QuestionCircle.d.ts.map +1 -1
- package/dist/src/icons.generated/QuestionCircleFilled.d.ts +1 -1
- package/dist/src/icons.generated/QuestionCircleFilled.d.ts.map +1 -1
- package/dist/src/icons.generated/Refresh.d.ts +1 -1
- package/dist/src/icons.generated/Refresh.d.ts.map +1 -1
- package/dist/src/icons.generated/Reset.d.ts +1 -1
- package/dist/src/icons.generated/Reset.d.ts.map +1 -1
- package/dist/src/icons.generated/Resume.d.ts +1 -1
- package/dist/src/icons.generated/Resume.d.ts.map +1 -1
- package/dist/src/icons.generated/Search.d.ts +1 -1
- package/dist/src/icons.generated/Search.d.ts.map +1 -1
- package/dist/src/icons.generated/Server.d.ts +1 -1
- package/dist/src/icons.generated/Server.d.ts.map +1 -1
- package/dist/src/icons.generated/Settings.d.ts +1 -1
- package/dist/src/icons.generated/Settings.d.ts.map +1 -1
- package/dist/src/icons.generated/Show.d.ts +1 -1
- package/dist/src/icons.generated/Show.d.ts.map +1 -1
- package/dist/src/icons.generated/Subtract.d.ts +1 -1
- package/dist/src/icons.generated/Subtract.d.ts.map +1 -1
- package/dist/src/icons.generated/Sync.d.ts +1 -1
- package/dist/src/icons.generated/Sync.d.ts.map +1 -1
- package/dist/src/icons.generated/Unlock.d.ts +1 -1
- package/dist/src/icons.generated/Unlock.d.ts.map +1 -1
- package/dist/src/icons.generated/Upload.d.ts +1 -1
- package/dist/src/icons.generated/Upload.d.ts.map +1 -1
- package/dist/src/icons.generated/User.d.ts +1 -1
- package/dist/src/icons.generated/User.d.ts.map +1 -1
- package/dist/src/icons.generated/Video.d.ts +1 -1
- package/dist/src/icons.generated/Video.d.ts.map +1 -1
- package/dist/src/icons.generated/Warning.d.ts +1 -1
- package/dist/src/icons.generated/Warning.d.ts.map +1 -1
- package/dist/src/icons.generated/WarningFilled.d.ts +1 -1
- package/dist/src/icons.generated/WarningFilled.d.ts.map +1 -1
- package/dist/src/icons.generated/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/labs/DataFilters.d.ts +1 -1
- package/dist/src/labs/DataFilters.d.ts.map +1 -1
- package/dist/src/labs/DataTable.d.ts +1 -1
- package/dist/src/labs/DataTable.d.ts.map +1 -1
- package/dist/src/labs/DataTablePagination.d.ts +1 -1
- package/dist/src/labs/DataTablePagination.d.ts.map +1 -1
- package/dist/src/labs/DatePicker.d.ts +1 -1
- package/dist/src/labs/DatePicker.d.ts.map +1 -1
- package/dist/src/labs/Drawer.d.ts +56 -0
- package/dist/src/labs/Drawer.d.ts.map +1 -0
- package/dist/src/labs/GroupPicker.d.ts +1 -1
- package/dist/src/labs/GroupPicker.d.ts.map +1 -1
- package/dist/src/labs/PaginatedTable.d.ts +1 -1
- package/dist/src/labs/PaginatedTable.d.ts.map +1 -1
- package/dist/src/labs/StaticTable.d.ts +1 -1
- package/dist/src/labs/StaticTable.d.ts.map +1 -1
- package/dist/src/labs/Switch.d.ts +2 -2
- package/dist/src/labs/Switch.d.ts.map +1 -1
- package/dist/src/labs/VirtualizedAutocomplete.d.ts +2 -2
- package/dist/src/labs/VirtualizedAutocomplete.d.ts.map +1 -1
- package/dist/src/labs/datePickerTheme.d.ts.map +1 -1
- package/dist/src/labs/index.d.ts +1 -0
- package/dist/src/labs/index.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +3 -1
- package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +60 -8
- package/dist/theme/components.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/scripts/generateIconsIndex.ts +2 -2
- package/scripts/{properties-to-ts.js → properties-to-ts.ts} +55 -41
- package/src/@types/properties.d.ts +292 -0
- package/src/Accordion.tsx +1 -1
- package/src/Autocomplete.tsx +17 -9
- package/src/Badge.tsx +1 -1
- package/src/Banner.tsx +1 -1
- package/src/Box.tsx +2 -2
- package/src/Breadcrumbs.tsx +2 -2
- package/src/Button.tsx +26 -38
- package/src/Callout.tsx +1 -1
- package/src/Checkbox.tsx +9 -29
- package/src/CheckboxGroup.tsx +20 -5
- package/src/CircularProgress.tsx +1 -5
- package/src/Dialog.tsx +18 -17
- package/src/ErrorMessageList.tsx +1 -1
- package/src/Field.tsx +6 -9
- package/src/FieldComponentProps.ts +8 -4
- package/src/FieldError.tsx +2 -2
- package/src/FieldHint.tsx +1 -1
- package/src/FieldLabel.tsx +2 -2
- package/src/Fieldset.tsx +2 -2
- package/src/Form.tsx +1 -1
- package/src/FormCheckedProps.ts +3 -3
- package/src/HintLink.tsx +1 -1
- package/src/HtmlProps.ts +60 -0
- package/src/Link.tsx +2 -6
- package/src/MenuButton.tsx +21 -36
- package/src/MenuItem.tsx +2 -2
- package/src/MuiPropsChild.tsx +2 -2
- package/src/NativeSelect.tsx +24 -13
- package/src/OdysseyCacheProvider.test.tsx +3 -3
- package/src/OdysseyProvider.tsx +1 -3
- package/src/OdysseyThemeProvider.tsx +8 -35
- package/src/OdysseyTranslationProvider.test.tsx +6 -6
- package/src/OdysseyTranslationProvider.tsx +7 -7
- package/src/PasswordField.tsx +23 -10
- package/src/Radio.tsx +4 -4
- package/src/RadioGroup.tsx +22 -7
- package/src/ScreenReaderText.tsx +1 -1
- package/src/SearchField.tsx +25 -12
- package/src/Select.tsx +219 -77
- package/src/Status.tsx +8 -2
- package/src/Tabs.tsx +7 -11
- package/src/Tag.tsx +4 -4
- package/src/TagList.tsx +2 -2
- package/src/TextField.tsx +22 -9
- package/src/Tile.tsx +74 -43
- package/src/Toast.tsx +1 -1
- package/src/Tooltip.tsx +1 -1
- package/src/Typography.tsx +20 -28
- package/src/createShadowRootElement.ts +1 -1
- package/src/getTypedObjectKeys.ts +1 -1
- package/src/icons.generated/AddCircle.tsx +1 -1
- package/src/icons.generated/Apps.tsx +1 -1
- package/src/icons.generated/ArrowBottom.tsx +1 -1
- package/src/icons.generated/ArrowDown.tsx +1 -1
- package/src/icons.generated/ArrowLeft.tsx +1 -1
- package/src/icons.generated/ArrowRight.tsx +1 -1
- package/src/icons.generated/ArrowTop.tsx +1 -1
- package/src/icons.generated/ArrowUp.tsx +1 -1
- package/src/icons.generated/Calendar.tsx +1 -1
- package/src/icons.generated/Call.tsx +1 -1
- package/src/icons.generated/Chat.tsx +1 -1
- package/src/icons.generated/Check.tsx +1 -1
- package/src/icons.generated/ChevronDown.tsx +1 -1
- package/src/icons.generated/ChevronLeft.tsx +1 -1
- package/src/icons.generated/ChevronUp.tsx +1 -1
- package/src/icons.generated/Clock.tsx +1 -1
- package/src/icons.generated/Close.tsx +1 -1
- package/src/icons.generated/Copy.tsx +1 -1
- package/src/icons.generated/Delete.tsx +1 -1
- package/src/icons.generated/Deny.tsx +1 -1
- package/src/icons.generated/Devices.tsx +1 -1
- package/src/icons.generated/Directory.tsx +1 -1
- package/src/icons.generated/Download.tsx +1 -1
- package/src/icons.generated/Edit.tsx +1 -1
- package/src/icons.generated/ExpandLeft.tsx +1 -1
- package/src/icons.generated/ExpandRight.tsx +1 -1
- package/src/icons.generated/Filter.tsx +1 -1
- package/src/icons.generated/Folder.tsx +1 -1
- package/src/icons.generated/Globe.tsx +1 -1
- package/src/icons.generated/Grid.tsx +1 -1
- package/src/icons.generated/Group.tsx +1 -1
- package/src/icons.generated/Hide.tsx +1 -1
- package/src/icons.generated/Home.tsx +1 -1
- package/src/icons.generated/Link.tsx +1 -1
- package/src/icons.generated/List.tsx +1 -1
- package/src/icons.generated/Lock.tsx +1 -1
- package/src/icons.generated/More.tsx +1 -1
- package/src/icons.generated/Pause.tsx +1 -1
- package/src/icons.generated/Refresh.tsx +1 -1
- package/src/icons.generated/Reset.tsx +1 -1
- package/src/icons.generated/Resume.tsx +1 -1
- package/src/icons.generated/Search.tsx +1 -1
- package/src/icons.generated/Server.tsx +1 -1
- package/src/icons.generated/Settings.tsx +1 -1
- package/src/icons.generated/Show.tsx +1 -1
- package/src/icons.generated/Subtract.tsx +1 -1
- package/src/icons.generated/Sync.tsx +1 -1
- package/src/icons.generated/Unlock.tsx +1 -1
- package/src/icons.generated/Upload.tsx +1 -1
- package/src/icons.generated/User.tsx +1 -1
- package/src/icons.generated/Video.tsx +1 -1
- package/src/icons.generated/Warning.tsx +1 -1
- package/src/icons.generated/index.ts +1 -1
- package/src/index.ts +0 -1
- package/src/labs/DataFilters.tsx +36 -30
- package/src/labs/DataTable.tsx +20 -20
- package/src/labs/DatePicker.tsx +3 -1
- package/src/labs/Drawer.tsx +254 -0
- package/src/labs/GroupPicker.tsx +34 -15
- package/src/labs/PaginatedTable.tsx +12 -10
- package/src/labs/StaticTable.tsx +3 -3
- package/src/labs/Switch.tsx +5 -5
- package/src/labs/VirtualizedAutocomplete.tsx +19 -16
- package/src/labs/datePickerTheme.tsx +4 -2
- package/src/labs/index.ts +2 -0
- package/src/labs/materialReactTableTypes.tsx +1 -1
- package/src/properties/translations/odyssey-react-mui_cs.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_da.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_de.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_el.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_es.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_fi.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_fr.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_hu.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_id.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_it.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_ja.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_ko.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_ms.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_nb.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_nl_NL.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_pl.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_pt_BR.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_ro.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_ru.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_sv.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_th.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_tr.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_uk.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_vi.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_zh_CN.properties +3 -1
- package/src/properties/translations/odyssey-react-mui_zh_TW.properties +3 -1
- package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
- package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
- package/src/theme/components.tsx +83 -16
- package/tsconfig.json +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","
|
|
1
|
+
{"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","jsx","_jsx","OdysseyThemeProvider","children","designTokensOverride","shadowDomElement","themeOverride","odysseyTokens","odysseyTheme","customOdysseyTheme","theme","Provider","value","MemoizedOdysseyThemeProvider"],"sources":["../src/OdysseyThemeProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { ThemeOptions } from \"@mui/material\";\nimport { deepmerge } from \"@mui/utils\";\nimport { createOdysseyMuiTheme, DesignTokensOverride } from \"./theme\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { OdysseyDesignTokensContext } from \"./OdysseyDesignTokensContext\";\n\nexport type OdysseyThemeProviderProps = {\n children: ReactNode;\n designTokensOverride?: DesignTokensOverride;\n shadowDomElement?: HTMLDivElement | HTMLElement | undefined;\n themeOverride?: ThemeOptions;\n};\n\n/**\n * This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.\n *\n * Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.\n */\nconst OdysseyThemeProvider = ({\n children,\n designTokensOverride,\n shadowDomElement,\n themeOverride,\n}: OdysseyThemeProviderProps) => {\n const odysseyTokens = useMemo(\n () => ({ ...Tokens, ...designTokensOverride }),\n [designTokensOverride],\n );\n const odysseyTheme = useMemo(\n () =>\n createOdysseyMuiTheme({\n odysseyTokens,\n shadowDomElement,\n }),\n [odysseyTokens, shadowDomElement],\n );\n\n const customOdysseyTheme = useMemo(\n () => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)),\n [odysseyTheme, themeOverride],\n );\n\n return (\n <MuiThemeProvider theme={customOdysseyTheme ?? odysseyTheme}>\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </MuiThemeProvider>\n );\n};\n\nconst MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);\n\nexport { MemoizedOd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|
|
1
|
-
{"version":3,"file":"OdysseyTranslationProvider.js","names":["useEffect","i18n","defaultNS","resources","I18nextProvider","getTypedObjectKeys","jsx","_jsx","odysseyI18nResourceKeysList","mergeBundleOverrides","languageCode","translationOverrides","translationStrings","translationStringOverrides","formatLanguageCodeToHyphenated","replaceAll","OdysseyTranslationProvider","children","normalizedLanguageCode","changeHtmlElementLanguageAttribute","window","document","documentElement","setAttribute","changeLanguage","navigator","language","forEach","bundle","addResourceBundle"],"sources":["../src/OdysseyTranslationProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 { ReactNode, useEffect } from \"react\";\n\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nimport { i18n, defaultNS, resources } from \"./i18n\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { getTypedObjectKeys } from \"./getTypedObjectKeys\";\n\nexport type OdysseyI18nResourceKeys = (typeof resources)[\"en\"];\nexport const odysseyI18nResourceKeysList = getTypedObjectKeys(resources[\"en\"]);\n\nexport type TranslationOverrides<\n SupportedLanguages extends string = DefaultSupportedLanguages
|
|
1
|
+
{"version":3,"file":"OdysseyTranslationProvider.js","names":["useEffect","i18n","defaultNS","resources","I18nextProvider","getTypedObjectKeys","jsx","_jsx","odysseyI18nResourceKeysList","mergeBundleOverrides","languageCode","translationOverrides","translationStrings","translationStringOverrides","formatLanguageCodeToHyphenated","replaceAll","OdysseyTranslationProvider","children","normalizedLanguageCode","changeHtmlElementLanguageAttribute","window","document","documentElement","setAttribute","changeLanguage","navigator","language","forEach","bundle","addResourceBundle"],"sources":["../src/OdysseyTranslationProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-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 { ReactNode, useEffect } from \"react\";\n\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nimport { i18n, defaultNS, resources } from \"./i18n\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { getTypedObjectKeys } from \"./getTypedObjectKeys\";\n\nexport type OdysseyI18nResourceKeys = (typeof resources)[\"en\"];\nexport const odysseyI18nResourceKeysList = getTypedObjectKeys(resources[\"en\"]);\n\nexport type TranslationOverrides<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = Record<SupportedLanguages, Partial<OdysseyI18nResourceKeys>>;\n\nconst mergeBundleOverrides = <SupportedLanguages extends string>(\n languageCode: SupportedLanguages,\n translationOverrides: TranslationOverrides<SupportedLanguages>,\n) => {\n const translationStrings = resources[languageCode] || {};\n const translationStringOverrides = translationOverrides[languageCode];\n return {\n ...translationStrings,\n ...translationStringOverrides,\n };\n};\n\nexport type OdysseyTranslationProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = {\n children: ReactNode;\n languageCode?: SupportedLanguages | DefaultSupportedLanguages;\n translationOverrides?: TranslationOverrides<SupportedLanguages>;\n};\n\nconst formatLanguageCodeToHyphenated = <SupportedLanguages extends string>(\n languageCode: OdysseyTranslationProviderProps<SupportedLanguages>[\"languageCode\"],\n) => languageCode?.replaceAll(\"_\", \"-\");\n\nexport const OdysseyTranslationProvider = <SupportedLanguages extends string>({\n children,\n languageCode,\n translationOverrides,\n}: OdysseyTranslationProviderProps<SupportedLanguages>) => {\n useEffect(() => {\n const normalizedLanguageCode =\n formatLanguageCodeToHyphenated<SupportedLanguages>(languageCode);\n\n const changeHtmlElementLanguageAttribute = () => {\n window.document.documentElement.setAttribute(\n \"lang\",\n normalizedLanguageCode || \"en\",\n );\n };\n // Defaults to the browser's language if available otherwise `en` will be used\n i18n.changeLanguage(\n languageCode || window.navigator.language,\n changeHtmlElementLanguageAttribute,\n );\n }, [languageCode]);\n\n useEffect(() => {\n if (translationOverrides) {\n getTypedObjectKeys(translationOverrides).forEach((language) => {\n const bundle = mergeBundleOverrides<SupportedLanguages>(\n language,\n translationOverrides,\n );\n i18n.addResourceBundle(language, defaultNS, bundle);\n });\n }\n }, [translationOverrides]);\n\n return <I18nextProvider i18n={i18n}>{children}</I18nextProvider>;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,SAAS,QAAQ,OAAO;AAAC,SAIpCC,IAAI,EAAEC,SAAS,EAAEC,SAAS;AACnC,SAASC,eAAe,QAAQ,eAAe;AAAC,SACvCC,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG3B,OAAO,MAAMC,2BAA2B,GAAGH,kBAAkB,CAACF,SAAS,CAAC,IAAI,CAAC,CAAC;AAM9E,MAAMM,oBAAoB,GAAGA,CAC3BC,YAAgC,EAChCC,oBAA8D,KAC3D;EACH,MAAMC,kBAAkB,GAAGT,SAAS,CAACO,YAAY,CAAC,IAAI,CAAC,CAAC;EACxD,MAAMG,0BAA0B,GAAGF,oBAAoB,CAACD,YAAY,CAAC;EACrE,OAAO;IACL,GAAGE,kBAAkB;IACrB,GAAGC;EACL,CAAC;AACH,CAAC;AAUD,MAAMC,8BAA8B,GAClCJ,YAAiF,IAC9EA,YAAY,EAAEK,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;AAEvC,OAAO,MAAMC,0BAA0B,GAAGA,CAAoC;EAC5EC,QAAQ;EACRP,YAAY;EACZC;AACmD,CAAC,KAAK;EACzDX,SAAS,CAAC,MAAM;IACd,MAAMkB,sBAAsB,GAC1BJ,8BAA8B,CAAqBJ,YAAY,CAAC;IAElE,MAAMS,kCAAkC,GAAGA,CAAA,KAAM;MAC/CC,MAAM,CAACC,QAAQ,CAACC,eAAe,CAACC,YAAY,CAC1C,MAAM,EACNL,sBAAsB,IAAI,IAC5B,CAAC;IACH,CAAC;IAEDjB,IAAI,CAACuB,cAAc,CACjBd,YAAY,IAAIU,MAAM,CAACK,SAAS,CAACC,QAAQ,EACzCP,kCACF,CAAC;EACH,CAAC,EAAE,CAACT,YAAY,CAAC,CAAC;EAElBV,SAAS,CAAC,MAAM;IACd,IAAIW,oBAAoB,EAAE;MACxBN,kBAAkB,CAACM,oBAAoB,CAAC,CAACgB,OAAO,CAAED,QAAQ,IAAK;QAC7D,MAAME,MAAM,GAAGnB,oBAAoB,CACjCiB,QAAQ,EACRf,oBACF,CAAC;QACDV,IAAI,CAAC4B,iBAAiB,CAACH,QAAQ,EAAExB,SAAS,EAAE0B,MAAM,CAAC;MACrD,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACjB,oBAAoB,CAAC,CAAC;EAE1B,OAAOJ,IAAA,CAACH,eAAe;IAACH,IAAI,EAAEA,IAAK;IAAAgB,QAAA,EAAEA;EAAQ,CAAkB,CAAC;AAClE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","useState","ShowIcon","HideIcon","Field","useTranslation","getControlState","useInputValues","jsx","_jsx","PasswordField","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","inputType","setInputType","togglePasswordVisibility","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","endAdornment","_InputAdornment","position","children","_IconButton","onClick","inputProps","role","readOnly","required","type","fieldType","hasVisibleLabel","MemoizedPasswordField","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\";\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { useTranslation } from \"react-i18next\";\nimport { FocusHandle, getControlState, useInputValues } from \"./inputUtils\";\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 HtmlProps;\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(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\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 ({ ariaDescribedBy, errorMessageElementId, id, labelElementId }) => (\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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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MAAM;MAEjB8B,IAAI,EAAE;IACR,CAAE;IACF5C,QAAQ,EAAE4B,aAAc;IACxBrB,IAAI,EAAEC,YAAY,IAAIV,EAAG;IACzBW,QAAQ,EAAEA,QAAS;IACnBE,OAAO,EAAEA,OAAQ;IACjBC,MAAM,EAAEA,MAAO;IACfC,WAAW,EAAEA,WAAY;IACzBgC,QAAQ,EAAExC,UAAW;IACrBY,GAAG,EAAEA,GAAI;IACT6B,QAAQ,EAAE,CAAC3C,UAAW;IACtBY,SAAS,EAAEA,SAAU;IACrBgC,IAAI,EAAE5B;EAAU,CACjB,CACF,EACD,CACE3B,gBAAgB,EAChBI,eAAe,EACf6B,WAAW,EACXP,CAAC,EACDG,wBAAwB,EACxBF,SAAS,EACTX,YAAY,EACZC,QAAQ,EACRE,OAAO,EACPC,MAAM,EACNC,WAAW,EACXV,UAAU,EACVE,UAAU,EACVD,eAAe,EACfa,GAAG,EACHH,MAAM,EACNC,SAAS,CAEb,CAAC;EAED,OACE1B,IAAA,CAACL,KAAK;IACJO,eAAe,EAAEA,eAAgB;IACjCG,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCqD,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACfpD,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBC,UAAU,EAAEA,UAAW;IACvBG,KAAK,EAAEA,KAAM;IACbyB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMmB,qBAAqB,GAAGzE,IAAI,CAACa,aAAa,CAAC;AACjD4D,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAI5D,aAAa"}
|
|
1
|
+
{"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","useState","ShowIcon","HideIcon","Field","useTranslation","getControlState","useInputValues","jsx","_jsx","PasswordField","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","inputType","setInputType","togglePasswordVisibility","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","endAdornment","_InputAdornment","position","children","_IconButton","onClick","inputProps","role","readOnly","required","type","fieldType","hasVisibleLabel","MemoizedPasswordField","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\";\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { useTranslation } from \"react-i18next\";\nimport { FocusHandle, getControlState, useInputValues } from \"./inputUtils\";\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(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAGEA,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACH,OAAO;AAAC,SAENC,QAAQ,EAAEC,QAAQ;AAAA,SAClBC,KAAK;AAMd,SAASC,cAAc,QAAQ,eAAe;AAAC,SACzBC,eAAe,EAAEC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAyDrD,MAAMC,aAAa,GAAGd,UAAU,CAC9B,CACE;EACEe,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,GAAGjC,cAAc,CAAC,CAAC;EAC9B,MAAM,CAACkC,SAAS,EAAEC,YAAY,CAAC,GAAGvC,QAAQ,CAAC,UAAU,CAAC;EAEtD,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,WAAW,EAAEA,WAAY;IACzBC,UAAU,EAAEA,UAAW;IACvBG,KAAK,EAAEA,KAAM;IACbyB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMmB,qBAAqB,GAAGzE,IAAI,CAACa,aAAa,CAAC;AACjD4D,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAI5D,aAAa"}
|
package/dist/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","names":["memo","useCallback","useRef","useImperativeHandle","jsx","_jsx","Radio","inputRef","isChecked","isDisabled","isInvalid","label","name","testId","translate","value","onChange","onChangeProp","onBlur","onBlurProp","localInputRef","focus","current","event","checked","_FormControlLabel","className","control","_Radio","inputProps","disabled","MemoizedRadio","displayName"],"sources":["../src/Radio.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n Radio as MuiRadio,\n RadioProps as MuiRadioProps,\n} from \"@mui/material\";\nimport { memo, useCallback, useRef, useImperativeHandle } from \"react\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\n\nexport type RadioProps = {\n /**\n * The ref forwarded to the Radio\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * If `true`, the Radio is selected\n */\n isChecked?: boolean;\n /**\n * If `true`, the Radio has an invalid value\n */\n isInvalid?: boolean;\n /**\n * The label text for the Radio\n */\n label: string;\n /**\n * The value attribute of the Radio\n */\n value: string;\n /**\n * Callback fired when the state is changed. Provides event and checked value.\n */\n onChange?: MuiRadioProps[\"onChange\"];\n /**\n * Callback fired when the blur event happens. Provides event value.\n */\n onBlur?: MuiFormControlLabelProps[\"onBlur\"];\n} & Pick<FieldComponentProps, \"isDisabled\" | \"name\"> &\n HtmlProps
|
|
1
|
+
{"version":3,"file":"Radio.js","names":["memo","useCallback","useRef","useImperativeHandle","jsx","_jsx","Radio","inputRef","isChecked","isDisabled","isInvalid","label","name","testId","translate","value","onChange","onChangeProp","onBlur","onBlurProp","localInputRef","focus","current","event","checked","_FormControlLabel","className","control","_Radio","inputProps","disabled","MemoizedRadio","displayName"],"sources":["../src/Radio.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n Radio as MuiRadio,\n RadioProps as MuiRadioProps,\n} from \"@mui/material\";\nimport { memo, useCallback, useRef, useImperativeHandle } from \"react\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\n\nexport type RadioProps = {\n /**\n * The ref forwarded to the Radio\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * If `true`, the Radio is selected\n */\n isChecked?: boolean;\n /**\n * If `true`, the Radio has an invalid value\n */\n isInvalid?: boolean;\n /**\n * The label text for the Radio\n */\n label: string;\n /**\n * The value attribute of the Radio\n */\n value: string;\n /**\n * Callback fired when the state is changed. Provides event and checked value.\n */\n onChange?: MuiRadioProps[\"onChange\"];\n /**\n * Callback fired when the blur event happens. Provides event value.\n */\n onBlur?: MuiFormControlLabelProps[\"onBlur\"];\n} & Pick<FieldComponentProps, \"isDisabled\" | \"name\"> &\n Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Radio = ({\n inputRef,\n isChecked,\n isDisabled,\n isInvalid,\n label,\n name,\n testId,\n translate,\n value,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n}: RadioProps) => {\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n const onChange = useCallback<NonNullable<MuiRadioProps[\"onChange\"]>>(\n (event, checked) => {\n onChangeProp?.(event, checked);\n },\n [onChangeProp],\n );\n\n const onBlur = useCallback<NonNullable<MuiFormControlLabelProps[\"onBlur\"]>>(\n (event) => {\n onBlurProp?.(event);\n },\n [onBlurProp],\n );\n\n return (\n <FormControlLabel\n checked={isChecked}\n className={isInvalid ? \"Mui-error\" : \"\"}\n control={\n <MuiRadio\n inputProps={{\n \"data-se\": testId,\n }}\n inputRef={localInputRef}\n onChange={onChange}\n />\n }\n disabled={isDisabled}\n label={label}\n name={name}\n translate={translate}\n value={value}\n onBlur={onBlur}\n />\n );\n};\n\nconst MemoizedRadio = memo(Radio);\nMemoizedRadio.displayName = \"Radio\";\n\nexport { MemoizedRadio as Radio };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA,SAASA,IAAI,EAAEC,WAAW,EAAEC,MAAM,EAAEC,mBAAmB,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAsCvE,MAAMC,KAAK,GAAGA,CAAC;EACbC,QAAQ;EACRC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,KAAK;EACL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 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["memo","useCallback","useRef","Field","getControlState","useInputValues","jsx","_jsx","RadioGroup","ariaDescribedBy","children","defaultValue","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","isDisabled","label","name","nameOverride","onChange","onChangeProp","testId","translate","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","event","renderFieldComponent","errorMessageElementId","labelElementId","_RadioGroup","fieldType","hasVisibleLabel","MemoizedRadioGroup","displayName"],"sources":["../src/RadioGroup.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n RadioGroup as MuiRadioGroup,\n type RadioGroupProps as MuiRadioGroupProps,\n} from \"@mui/material\";\nimport { memo, ReactElement, useCallback, useRef } from \"react\";\n\nimport { Radio, RadioProps } from \"./Radio\";\nimport { Field } from \"./Field\";\nimport {
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["memo","useCallback","useRef","Field","getControlState","useInputValues","jsx","_jsx","RadioGroup","ariaDescribedBy","children","defaultValue","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","isDisabled","label","name","nameOverride","onChange","onChangeProp","testId","translate","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","event","renderFieldComponent","errorMessageElementId","labelElementId","_RadioGroup","fieldType","hasVisibleLabel","MemoizedRadioGroup","displayName"],"sources":["../src/RadioGroup.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n RadioGroup as MuiRadioGroup,\n type RadioGroupProps as MuiRadioGroupProps,\n} from \"@mui/material\";\nimport { memo, ReactElement, useCallback, useRef } from \"react\";\n\nimport { Radio, RadioProps } from \"./Radio\";\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { getControlState, useInputValues } from \"./inputUtils\";\n\nexport type RadioGroupProps = {\n /**\n * The Radio components within the group. Must include two or more.\n */\n children: Array<ReactElement<typeof Radio>>;\n /**\n * The text value of the Radio that should be selected by default\n */\n defaultValue?: string;\n /**\n * The text label for the RadioGroup\n */\n label: string;\n /**\n * Listen for changes in the browser that change `value`\n */\n onChange?: MuiRadioGroupProps[\"onChange\"];\n /**\n * The `value` on the selected Radio\n */\n value?: RadioProps[\"value\"];\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst RadioGroup = ({\n ariaDescribedBy,\n children,\n defaultValue,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n testId,\n translate,\n value,\n}: RadioGroupProps) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiRadioGroupProps[\"onChange\"]>>(\n (event, value) => {\n onChangeProp?.(event, value);\n },\n [onChangeProp],\n );\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <MuiRadioGroup\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n data-se={testId}\n id={id}\n name={nameOverride ?? id}\n onChange={onChange}\n translate={translate}\n >\n {children}\n </MuiRadioGroup>\n ),\n [children, inputValues, nameOverride, onChange, testId, translate],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"group\"\n hasVisibleLabel={false}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\nMemoizedRadioGroup.displayName = \"RadioGroup\";\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,IAAI,EAAgBC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAAC,SAGvDC,KAAK;AAAA,SAMLC,eAAe,EAAEC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAwCxC,MAAMC,UAAU,GAAGA,CAAC;EAClBC,eAAe;EACfC,QAAQ;EACRC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,KAAK;EACL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IACrCC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbe,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMM,kBAAkB,GAAGxC,IAAI,CAACQ,UAAU,CAAC;AAC3CgC,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIhC,UAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenReaderText.js","names":["memo","visuallyHidden","jsx","_jsx","style","ScreenReaderText","children","translate","_Box","sx","component","MemoizedScreenReaderText","displayName"],"sources":["../src/ScreenReaderText.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { Box } from \"@mui/material\";\nimport { visuallyHidden } from \"@mui/utils\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type ScreenReaderTextProps = {\n /**\n * The visually-hidden text.\n */\n children: ReactNode;\n} & HtmlProps
|
|
1
|
+
{"version":3,"file":"ScreenReaderText.js","names":["memo","visuallyHidden","jsx","_jsx","style","ScreenReaderText","children","translate","_Box","sx","component","MemoizedScreenReaderText","displayName"],"sources":["../src/ScreenReaderText.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { Box } from \"@mui/material\";\nimport { visuallyHidden } from \"@mui/utils\";\nimport { HtmlProps } from \"./HtmlProps\";\n\nexport type ScreenReaderTextProps = {\n /**\n * The visually-hidden text.\n */\n children: ReactNode;\n} & Pick<HtmlProps, \"translate\">;\n\n/**\n * MUI sx expects you pass in a CSS object, not an object with CSS.\n * They seem identical, but only if you create a new object like this will MUI be happy with the type of visuallyHidden.\n * It's otherwise a regular object with CSS properties.\n */\nconst style = { ...visuallyHidden };\n\nconst ScreenReaderText = ({ children, translate }: ScreenReaderTextProps) => (\n <Box sx={style} component=\"span\" translate={translate}>\n {children}\n </Box>\n);\n\nconst MemoizedScreenReaderText = memo(ScreenReaderText);\nMemoizedScreenReaderText.displayName = \"ScreenReaderText\";\n\nexport { MemoizedScreenReaderText as ScreenReaderText };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAEvC,SAASC,cAAc,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAe5C,MAAMC,KAAK,GAAG;EAAE,GAAGH;AAAe,CAAC;AAEnC,MAAMI,gBAAgB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAiC,CAAC,KACtEJ,IAAA,CAAAK,IAAA;EAAKC,EAAE,EAAEL,KAAM;EAACM,SAAS,EAAC,MAAM;EAACH,SAAS,EAAEA,SAAU;EAAAD,QAAA,EACnDA;AAAQ,CACN,CACN;AAED,MAAMK,wBAAwB,GAAGX,IAAI,CAACK,gBAAgB,CAAC;AACvDM,wBAAwB,CAACC,WAAW,GAAG,kBAAkB;AAEzD,SAASD,wBAAwB,IAAIN,gBAAgB"}
|
package/dist/SearchField.js
CHANGED
|
@@ -17,6 +17,7 @@ import { CloseCircleFilledIcon, SearchIcon } from "./icons.generated/index.js";
|
|
|
17
17
|
import { Field } from "./Field.js";
|
|
18
18
|
import { getControlState, useInputValues } from "./inputUtils.js";
|
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
20
|
+
export const searchVariantValues = ["outline", "filled"];
|
|
20
21
|
const SearchField = forwardRef(({
|
|
21
22
|
ariaDescribedBy,
|
|
22
23
|
autoCompleteType,
|
|
@@ -35,7 +36,8 @@ const SearchField = forwardRef(({
|
|
|
35
36
|
tabIndex,
|
|
36
37
|
testId,
|
|
37
38
|
translate,
|
|
38
|
-
value
|
|
39
|
+
value,
|
|
40
|
+
variant = "outline"
|
|
39
41
|
}, ref) => {
|
|
40
42
|
const onChange = useCallback(event => {
|
|
41
43
|
onChangeProp?.(event);
|
|
@@ -75,6 +77,8 @@ const SearchField = forwardRef(({
|
|
|
75
77
|
})
|
|
76
78
|
}),
|
|
77
79
|
id: id,
|
|
80
|
+
"data-ods-type": "search",
|
|
81
|
+
"data-ods-variant": variant,
|
|
78
82
|
name: nameOverride ?? id,
|
|
79
83
|
onBlur: onBlur,
|
|
80
84
|
onChange: onChange,
|
|
@@ -87,7 +91,7 @@ const SearchField = forwardRef(({
|
|
|
87
91
|
}),
|
|
88
92
|
translate: translate,
|
|
89
93
|
type: "search"
|
|
90
|
-
}), [autoCompleteType, defaultValue, hasInitialFocus, inputValues, isDisabled, nameOverride, onBlur, onChange, onClear, onFocus, placeholder, ref, tabIndex, testId, translate]);
|
|
94
|
+
}), [autoCompleteType, defaultValue, hasInitialFocus, inputValues, isDisabled, nameOverride, onBlur, onChange, onClear, onFocus, placeholder, ref, tabIndex, testId, translate, variant]);
|
|
91
95
|
return _jsx(Field, {
|
|
92
96
|
ariaDescribedBy: ariaDescribedBy,
|
|
93
97
|
fieldType: "single",
|
package/dist/SearchField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.js","names":["forwardRef","memo","useCallback","useRef","CloseCircleFilledIcon","SearchIcon","Field","getControlState","useInputValues","jsx","_jsx","SearchField","ariaDescribedBy","autoCompleteType","defaultValue","hasInitialFocus","id","idOverride","isDisabled","isFullWidth","label","name","nameOverride","onChange","onChangeProp","onFocus","onBlur","onClear","onClearProp","placeholder","tabIndex","testId","translate","value","ref","event","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","renderFieldComponent","_InputBase","inputProps","autoComplete","autoFocus","endAdornment","_InputAdornment","position","children","_IconButton","disabled","onClick","size","startAdornment","type","fieldType","hasVisibleLabel","isOptional","MemoizedSearchField","displayName"],"sources":["../src/SearchField.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 HTMLAttributes,\n InputHTMLAttributes,\n memo,\n useCallback,\n useRef,\n} from \"react\";\n\nimport { CloseCircleFilledIcon, SearchIcon } from \"./icons.generated\";\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { getControlState, useInputValues } from \"./inputUtils\";\n\nexport type SearchFieldProps = {\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?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The value of the `input` element to use when uncontrolled.\n */\n defaultValue?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * This label won't show up visually, but it's required for accessibility.\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 clear button is pressed.\n */\n onClear?: () => void;\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 tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * The value of the `input` element, to use when controlled.\n */\n value?: string;\n} & Pick<\n FieldComponentProps,\n \"ariaDescribedBy\" | \"id\" | \"isDisabled\" | \"name\" | \"isFullWidth\"\n> &\n HtmlProps;\n\nconst SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n id: idOverride,\n isDisabled = false,\n isFullWidth = false,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n onClear: onClearProp,\n placeholder,\n tabIndex,\n testId,\n translate,\n value,\n },\n ref\n ) => {\n const onChange: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement> =\n useCallback(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp]\n );\n\n const onClear = useCallback(() => {\n onClearProp?.();\n }, [onClearProp]);\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 renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\n {...inputValues}\n inputProps={{\n tabIndex,\n }}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n data-se={testId}\n endAdornment={\n defaultValue && (\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"Clear\"\n disabled={isDisabled}\n onClick={onClear}\n size=\"small\"\n >\n <CloseCircleFilledIcon />\n </IconButton>\n </InputAdornment>\n )\n }\n id={id}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n ref={ref}\n startAdornment={\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n }\n translate={translate}\n type=\"search\"\n />\n ),\n [\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n inputValues,\n isDisabled,\n nameOverride,\n onBlur,\n onChange,\n onClear,\n onFocus,\n placeholder,\n ref,\n tabIndex,\n testId,\n translate,\n ]\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n fieldType=\"single\"\n hasVisibleLabel={false}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={true}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedSearchField = memo(SearchField);\nMemoizedSearchField.displayName = \"SearchField\";\n\nexport { MemoizedSearchField as SearchField };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAGEA,UAAU,EAGVC,IAAI,EACJC,WAAW,EACXC,MAAM,QACD,OAAO;AAAC,SAENC,qBAAqB,EAAEC,UAAU;AAAA,SACjCC,KAAK;AAAA,SAGLC,eAAe,EAAEC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AA6DxC,MAAMC,WAAW,GAAG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{"version":3,"file":"SearchField.js","names":["forwardRef","memo","useCallback","useRef","CloseCircleFilledIcon","SearchIcon","Field","getControlState","useInputValues","jsx","_jsx","searchVariantValues","SearchField","ariaDescribedBy","autoCompleteType","defaultValue","hasInitialFocus","id","idOverride","isDisabled","isFullWidth","label","name","nameOverride","onChange","onChangeProp","onFocus","onBlur","onClear","onClearProp","placeholder","tabIndex","testId","translate","value","variant","ref","event","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","renderFieldComponent","_InputBase","inputProps","autoComplete","autoFocus","endAdornment","_InputAdornment","position","children","_IconButton","disabled","onClick","size","startAdornment","type","fieldType","hasVisibleLabel","isOptional","MemoizedSearchField","displayName"],"sources":["../src/SearchField.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 HTMLAttributes,\n InputHTMLAttributes,\n memo,\n useCallback,\n useRef,\n} from \"react\";\n\nimport { CloseCircleFilledIcon, SearchIcon } from \"./icons.generated\";\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { getControlState, useInputValues } from \"./inputUtils\";\n\nexport const searchVariantValues = [\"outline\", \"filled\"] as const;\n\nexport type SearchFieldProps = {\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?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n /**\n * The value of the `input` element to use when uncontrolled.\n */\n defaultValue?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The id of the `input` element.\n */\n id?: string;\n /**\n * If `true`, the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * This label won't show up visually, but it's required for accessibility.\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 clear button is pressed.\n */\n onClear?: () => void;\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 tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * The value of the `input` element, to use when controlled.\n */\n value?: string;\n /**\n * Whether the SearchField has a gray or white background\n */\n variant?: (typeof searchVariantValues)[number];\n} & Pick<FieldComponentProps, \"id\" | \"isDisabled\" | \"name\" | \"isFullWidth\"> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<Pick<HtmlProps, \"ariaDescribedBy\">> &\n Pick<FieldComponentRenderProps, \"id\">;\n\nconst SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n id: idOverride,\n isDisabled = false,\n isFullWidth = false,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n onClear: onClearProp,\n placeholder,\n tabIndex,\n testId,\n translate,\n value,\n variant = \"outline\",\n },\n ref,\n ) => {\n const onChange: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement> =\n useCallback(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp],\n );\n\n const onClear = useCallback(() => {\n onClearProp?.();\n }, [onClearProp]);\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 renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }: FieldRenderProps) => (\n <InputBase\n {...inputValues}\n inputProps={{\n tabIndex,\n }}\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n data-se={testId}\n endAdornment={\n defaultValue && (\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"Clear\"\n disabled={isDisabled}\n onClick={onClear}\n size=\"small\"\n >\n <CloseCircleFilledIcon />\n </IconButton>\n </InputAdornment>\n )\n }\n id={id}\n data-ods-type=\"search\"\n data-ods-variant={variant}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n ref={ref}\n startAdornment={\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n }\n translate={translate}\n type=\"search\"\n />\n ),\n [\n autoCompleteType,\n defaultValue,\n hasInitialFocus,\n inputValues,\n isDisabled,\n nameOverride,\n onBlur,\n onChange,\n onClear,\n onFocus,\n placeholder,\n ref,\n tabIndex,\n testId,\n translate,\n variant,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n fieldType=\"single\"\n hasVisibleLabel={false}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={true}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n },\n);\n\nconst MemoizedSearchField = memo(SearchField);\nMemoizedSearchField.displayName = \"SearchField\";\n\nexport { MemoizedSear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ACEzB,IAAA,CAACJ,KAAK;IACJO,eAAe,EAAEA,eAAgB;IACjC8C,SAAS,EAAC,QAAQ;IAClBC,eAAe,EAAE,KAAM;IACvB3C,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzByC,UAAU,EAAE,IAAK;IACjBxC,KAAK,EAAEA,KAAM;IACbuB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMkB,mBAAmB,GAAG7D,IAAI,CAACW,WAAW,CAAC;AAC7CkD,mBAAmB,CAACC,WAAW,GAAG,aAAa;AAE/C,SAASD,mBAAmB,IAAIlD,WAAW"}
|
package/dist/Select.js
CHANGED
|
@@ -3,8 +3,8 @@ import _MenuItem from "@mui/material/MenuItem";
|
|
|
3
3
|
import _ListItemSecondaryAction from "@mui/material/ListItemSecondaryAction";
|
|
4
4
|
import _Checkbox from "@mui/material/Checkbox";
|
|
5
5
|
import _ListSubheader from "@mui/material/ListSubheader";
|
|
6
|
-
import _Box from "@mui/material/Box";
|
|
7
6
|
import _Chip from "@mui/material/Chip";
|
|
7
|
+
import _Box from "@mui/material/Box";
|
|
8
8
|
/*!
|
|
9
9
|
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
10
10
|
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
@@ -19,11 +19,80 @@ import _Chip from "@mui/material/Chip";
|
|
|
19
19
|
|
|
20
20
|
import { memo, useCallback, useEffect, useMemo, useRef, useState, useImperativeHandle } from "react";
|
|
21
21
|
import { Field } from "./Field.js";
|
|
22
|
-
import { CheckIcon } from "./icons.generated/index.js";
|
|
22
|
+
import { CheckIcon, CloseCircleFilledIcon } from "./icons.generated/index.js";
|
|
23
23
|
import { ComponentControlledState, useInputValues, getControlState } from "./inputUtils.js";
|
|
24
24
|
import { normalizedKey } from "./useNormalizedKey.js";
|
|
25
|
+
import styled from "@emotion/styled";
|
|
26
|
+
import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
|
|
25
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
28
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
26
29
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
const SelectContainer = styled.div`
|
|
31
|
+
position: relative;
|
|
32
|
+
width: 100%;
|
|
33
|
+
display: flex;
|
|
34
|
+
`;
|
|
35
|
+
const ChipsPositioningContainer = styled("div", {
|
|
36
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
37
|
+
})`
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: ${({
|
|
42
|
+
odysseyDesignTokens
|
|
43
|
+
}) => odysseyDesignTokens.Spacing0};
|
|
44
|
+
right: ${({
|
|
45
|
+
odysseyDesignTokens
|
|
46
|
+
}) => odysseyDesignTokens.Spacing5};
|
|
47
|
+
bottom: ${({
|
|
48
|
+
odysseyDesignTokens
|
|
49
|
+
}) => odysseyDesignTokens.Spacing0};
|
|
50
|
+
left: ${({
|
|
51
|
+
odysseyDesignTokens
|
|
52
|
+
}) => odysseyDesignTokens.Spacing1};
|
|
53
|
+
margin-inline-start: ${({
|
|
54
|
+
odysseyDesignTokens
|
|
55
|
+
}) => odysseyDesignTokens.BorderWidthMain};
|
|
56
|
+
opacity: 1;
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
`;
|
|
59
|
+
const NonInteractiveIcon = styled(CloseCircleFilledIcon, {
|
|
60
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
61
|
+
})`
|
|
62
|
+
font-size: 1em;
|
|
63
|
+
margin-inline-start: ${({
|
|
64
|
+
odysseyDesignTokens
|
|
65
|
+
}) => odysseyDesignTokens.Spacing2};
|
|
66
|
+
margin-inline-end: -${({
|
|
67
|
+
odysseyDesignTokens
|
|
68
|
+
}) => odysseyDesignTokens.Spacing1};
|
|
69
|
+
`;
|
|
70
|
+
const ChipsInnerContainer = styled(_Box, {
|
|
71
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isInteractive"
|
|
72
|
+
})`
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-wrap: wrap;
|
|
75
|
+
gap: ${({
|
|
76
|
+
odysseyDesignTokens
|
|
77
|
+
}) => odysseyDesignTokens.Spacing1};
|
|
78
|
+
pointer-events: ${({
|
|
79
|
+
isInteractive
|
|
80
|
+
}) => isInteractive ? "auto" : "none"};
|
|
81
|
+
opacity: ${({
|
|
82
|
+
isInteractive
|
|
83
|
+
}) => isInteractive ? 1 : 0};
|
|
84
|
+
`;
|
|
85
|
+
const ChipsSpacer = styled("div", {
|
|
86
|
+
shouldForwardProp: prop => prop !== "odysseyDesignTokens"
|
|
87
|
+
})`
|
|
88
|
+
display: inline-block;
|
|
89
|
+
border-color: transparent;
|
|
90
|
+
border-style: solid none;
|
|
91
|
+
border-width: 1px;
|
|
92
|
+
height: ${({
|
|
93
|
+
odysseyDesignTokens
|
|
94
|
+
}) => odysseyDesignTokens.Spacing6};
|
|
95
|
+
`;
|
|
27
96
|
const {
|
|
28
97
|
CONTROLLED
|
|
29
98
|
} = ComponentControlledState;
|
|
@@ -58,6 +127,7 @@ const Select = ({
|
|
|
58
127
|
}));
|
|
59
128
|
const [internalSelectedValues, setInternalSelectedValues] = useState(controlledStateRef.current === CONTROLLED ? value : defaultValue);
|
|
60
129
|
const localInputRef = useRef(null);
|
|
130
|
+
const odysseyDesignTokens = useOdysseyDesignTokens();
|
|
61
131
|
useImperativeHandle(inputRef, () => {
|
|
62
132
|
return {
|
|
63
133
|
focus: () => {
|
|
@@ -101,67 +171,97 @@ const Select = ({
|
|
|
101
171
|
type: "option"
|
|
102
172
|
};
|
|
103
173
|
}), [options]);
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
174
|
+
const Chips = useCallback(({
|
|
175
|
+
selection,
|
|
176
|
+
isInteractive
|
|
177
|
+
}) => {
|
|
178
|
+
const removeSelection = itemToRemove => {
|
|
179
|
+
if (Array.isArray(internalSelectedValues)) {
|
|
180
|
+
const newValue = internalSelectedValues.filter(item => item !== itemToRemove);
|
|
181
|
+
const syntheticEvent = {
|
|
182
|
+
target: {
|
|
183
|
+
value: newValue
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
onChange(syntheticEvent, null);
|
|
112
187
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
188
|
+
};
|
|
189
|
+
const stopPropagation = event => event.stopPropagation();
|
|
190
|
+
return _jsxs(ChipsInnerContainer, {
|
|
191
|
+
isInteractive: isInteractive,
|
|
192
|
+
odysseyDesignTokens: odysseyDesignTokens,
|
|
193
|
+
children: [_jsx(ChipsSpacer, {
|
|
194
|
+
odysseyDesignTokens: odysseyDesignTokens
|
|
195
|
+
}), selection.map(item => item?.length > 0 && _jsx(_Chip, {
|
|
196
|
+
label: _jsxs(_Fragment, {
|
|
197
|
+
children: [item, !isInteractive && controlledStateRef.current === CONTROLLED && hasMultipleChoices && _jsx(NonInteractiveIcon, {
|
|
198
|
+
odysseyDesignTokens: odysseyDesignTokens
|
|
199
|
+
})]
|
|
200
|
+
}),
|
|
201
|
+
tabIndex: -1,
|
|
202
|
+
onDelete: isInteractive && controlledStateRef.current === CONTROLLED ? () => removeSelection(item) : undefined,
|
|
203
|
+
deleteIcon: _jsx(CloseCircleFilledIcon, {
|
|
204
|
+
sx: {
|
|
205
|
+
pointerEvents: "auto"
|
|
206
|
+
},
|
|
207
|
+
onMouseDown: stopPropagation
|
|
208
|
+
})
|
|
209
|
+
}, item))]
|
|
122
210
|
});
|
|
123
|
-
}, [
|
|
211
|
+
}, [controlledStateRef, hasMultipleChoices, internalSelectedValues, odysseyDesignTokens, onChange]);
|
|
124
212
|
const children = useMemo(() => normalizedOptions.map((option, index) => {
|
|
125
213
|
if (option.type === "heading") {
|
|
126
|
-
return
|
|
127
|
-
children: option.text
|
|
214
|
+
return _jsxs(_ListSubheader, {
|
|
215
|
+
children: [" ", option.text, " "]
|
|
128
216
|
}, option.text);
|
|
129
217
|
}
|
|
218
|
+
const isSelected = hasMultipleChoices ? internalSelectedValues?.includes(option.value) : internalSelectedValues === option.value;
|
|
130
219
|
return _jsxs(_MenuItem, {
|
|
131
220
|
value: option.value,
|
|
221
|
+
selected: isSelected,
|
|
132
222
|
children: [hasMultipleChoices && _jsx(_Checkbox, {
|
|
133
|
-
checked:
|
|
223
|
+
checked: isSelected
|
|
134
224
|
}), option.text, !hasMultipleChoices && (internalSelectedValues?.includes(option.value) || internalSelectedValues === option.value) && _jsx(_ListItemSecondaryAction, {
|
|
135
225
|
children: _jsx(CheckIcon, {})
|
|
136
226
|
})]
|
|
137
227
|
}, normalizedKey(option.text, index.toString()));
|
|
138
228
|
}), [hasMultipleChoices, normalizedOptions, internalSelectedValues]);
|
|
229
|
+
const renderValue = useCallback(value => Array.isArray(value) && _jsx(Chips, {
|
|
230
|
+
selection: value,
|
|
231
|
+
isInteractive: false
|
|
232
|
+
}), [Chips]);
|
|
139
233
|
const renderFieldComponent = useCallback(({
|
|
140
234
|
ariaDescribedBy,
|
|
141
235
|
errorMessageElementId,
|
|
142
236
|
id,
|
|
143
237
|
labelElementId
|
|
144
|
-
}) =>
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
238
|
+
}) => _jsxs(SelectContainer, {
|
|
239
|
+
children: [_jsx(_Select, {
|
|
240
|
+
...inputValues,
|
|
241
|
+
"aria-describedby": ariaDescribedBy,
|
|
242
|
+
"aria-errormessage": errorMessageElementId,
|
|
243
|
+
children: children,
|
|
244
|
+
id: id,
|
|
245
|
+
inputProps: {
|
|
246
|
+
"data-se": testId
|
|
247
|
+
},
|
|
248
|
+
inputRef: localInputRef,
|
|
249
|
+
labelId: labelElementId,
|
|
250
|
+
multiple: hasMultipleChoices,
|
|
251
|
+
name: nameOverride ?? id,
|
|
252
|
+
onBlur: onBlur,
|
|
253
|
+
onChange: onChange,
|
|
254
|
+
onFocus: onFocus,
|
|
255
|
+
renderValue: hasMultipleChoices ? renderValue : undefined,
|
|
256
|
+
translate: translate
|
|
257
|
+
}), hasMultipleChoices && Array.isArray(value) && _jsx(ChipsPositioningContainer, {
|
|
258
|
+
odysseyDesignTokens: odysseyDesignTokens,
|
|
259
|
+
children: _jsx(Chips, {
|
|
260
|
+
selection: value,
|
|
261
|
+
isInteractive: true
|
|
262
|
+
})
|
|
263
|
+
})]
|
|
264
|
+
}), [children, Chips, inputValues, hasMultipleChoices, nameOverride, odysseyDesignTokens, onBlur, onChange, onFocus, renderValue, testId, translate, value]);
|
|
165
265
|
return _jsx(Field, {
|
|
166
266
|
ariaDescribedBy: ariaDescribedBy,
|
|
167
267
|
errorMessage: errorMessage,
|