@okta/odyssey-react-mui 0.22.0 → 0.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/README.md +43 -7
- package/dist/@types/i18next.d.js +14 -0
- package/dist/@types/i18next.d.js.map +1 -0
- package/dist/Autocomplete.js +18 -4
- package/dist/Autocomplete.js.map +1 -1
- package/dist/Banner.js +9 -6
- package/dist/Banner.js.map +1 -1
- package/dist/Button.js +20 -10
- package/dist/Button.js.map +1 -1
- package/dist/Checkbox.js +44 -10
- package/dist/Checkbox.js.map +1 -1
- package/dist/CheckboxGroup.js +25 -26
- package/dist/CheckboxGroup.js.map +1 -1
- package/dist/CircularProgress.js +11 -0
- package/dist/CircularProgress.js.map +1 -1
- package/dist/Dialog.js +72 -0
- package/dist/Dialog.js.map +1 -0
- package/dist/Field.js +28 -10
- package/dist/Field.js.map +1 -1
- package/dist/FieldError.js +6 -3
- package/dist/FieldError.js.map +1 -1
- package/dist/FieldHint.js +1 -2
- package/dist/FieldHint.js.map +1 -1
- package/dist/FieldLabel.js +19 -7
- package/dist/FieldLabel.js.map +1 -1
- package/dist/Fieldset.js +55 -0
- package/dist/Fieldset.js.map +1 -0
- package/dist/Form.js +69 -0
- package/dist/Form.js.map +1 -0
- package/dist/Icon.js +8 -8
- package/dist/Icon.js.map +1 -1
- package/dist/Infobox.js +7 -4
- package/dist/Infobox.js.map +1 -1
- package/dist/Link.js +10 -3
- package/dist/Link.js.map +1 -1
- package/dist/MenuButton.js +3 -7
- package/dist/MenuButton.js.map +1 -1
- package/dist/MenuItem.js +4 -2
- package/dist/MenuItem.js.map +1 -1
- package/dist/MuiPropsChild.js +32 -0
- package/dist/MuiPropsChild.js.map +1 -0
- package/dist/MuiPropsContext.js +15 -0
- package/dist/MuiPropsContext.js.map +1 -0
- package/dist/NativeSelect.js +61 -0
- package/dist/NativeSelect.js.map +1 -0
- package/dist/OdysseyCacheProvider.js +1 -2
- package/dist/OdysseyCacheProvider.js.map +1 -1
- package/dist/OdysseyI18n.js +93 -0
- package/dist/OdysseyI18n.js.map +1 -0
- package/dist/OdysseyProvider.js +42 -0
- package/dist/OdysseyProvider.js.map +1 -0
- package/dist/OdysseyThemeProvider.js +11 -5
- package/dist/OdysseyThemeProvider.js.map +1 -1
- package/dist/OdysseyTranslationProvider.js +47 -0
- package/dist/OdysseyTranslationProvider.js.map +1 -0
- package/dist/OdysseyTranslationProvider.types.js +14 -0
- package/dist/OdysseyTranslationProvider.types.js.map +1 -0
- package/dist/PasswordField.js +20 -3
- package/dist/PasswordField.js.map +1 -1
- package/dist/Radio.js +11 -2
- package/dist/Radio.js.map +1 -1
- package/dist/RadioGroup.js +36 -28
- package/dist/RadioGroup.js.map +1 -1
- package/dist/ScreenReaderText.js +3 -3
- package/dist/ScreenReaderText.js.map +1 -1
- package/dist/SearchField.js +17 -4
- package/dist/SearchField.js.map +1 -1
- package/dist/Select.js +131 -0
- package/dist/Select.js.map +1 -0
- package/dist/Status.js.map +1 -1
- package/dist/Tabs.js +46 -0
- package/dist/Tabs.js.map +1 -0
- package/dist/Tag.js +11 -2
- package/dist/Tag.js.map +1 -1
- package/dist/TagList.js +11 -2
- package/dist/TagList.js.map +1 -1
- package/dist/TagListContext.js +1 -0
- package/dist/TagListContext.js.map +1 -1
- package/dist/TextField.js +28 -9
- package/dist/TextField.js.map +1 -1
- package/dist/Toast.js +78 -0
- package/dist/Toast.js.map +1 -0
- package/dist/{ThemeProvider.js → ToastStack.js} +12 -10
- package/dist/ToastStack.js.map +1 -0
- package/dist/Tooltip.js +31 -0
- package/dist/Tooltip.js.map +1 -0
- package/dist/a11yCheck.js +1 -2
- package/dist/a11yCheck.js.map +1 -1
- package/dist/createUniqueAlphabeticalId.js +1 -2
- package/dist/createUniqueAlphabeticalId.js.map +1 -1
- package/dist/createUniqueId.js +1 -2
- package/dist/createUniqueId.js.map +1 -1
- package/dist/iconDictionary/Add.js +5 -6
- package/dist/iconDictionary/Add.js.map +1 -1
- package/dist/iconDictionary/AddCircle.js +5 -6
- package/dist/iconDictionary/AddCircle.js.map +1 -1
- package/dist/iconDictionary/AlertCircle.js +5 -6
- package/dist/iconDictionary/AlertCircle.js.map +1 -1
- package/dist/iconDictionary/AlertCircleFilled.js +5 -6
- package/dist/iconDictionary/AlertCircleFilled.js.map +1 -1
- package/dist/iconDictionary/AlertTriangleFilled.js +5 -6
- package/dist/iconDictionary/AlertTriangleFilled.js.map +1 -1
- package/dist/iconDictionary/Anchor.js +6 -7
- package/dist/iconDictionary/Anchor.js.map +1 -1
- package/dist/iconDictionary/ArrowDown.js +5 -6
- package/dist/iconDictionary/ArrowDown.js.map +1 -1
- package/dist/iconDictionary/ArrowLeft.js +5 -6
- package/dist/iconDictionary/ArrowLeft.js.map +1 -1
- package/dist/iconDictionary/ArrowRight.js +5 -6
- package/dist/iconDictionary/ArrowRight.js.map +1 -1
- package/dist/iconDictionary/ArrowUp.js +5 -6
- package/dist/iconDictionary/ArrowUp.js.map +1 -1
- package/dist/iconDictionary/ArrowUpDown.js +5 -6
- package/dist/iconDictionary/ArrowUpDown.js.map +1 -1
- package/dist/iconDictionary/Calendar.js +5 -6
- package/dist/iconDictionary/Calendar.js.map +1 -1
- package/dist/iconDictionary/Check.js +5 -6
- package/dist/iconDictionary/Check.js.map +1 -1
- package/dist/iconDictionary/CheckCircleFilled.js +5 -6
- package/dist/iconDictionary/CheckCircleFilled.js.map +1 -1
- package/dist/iconDictionary/ChevronDown.js +5 -6
- package/dist/iconDictionary/ChevronDown.js.map +1 -1
- package/dist/iconDictionary/ChevronUp.js +5 -6
- package/dist/iconDictionary/ChevronUp.js.map +1 -1
- package/dist/iconDictionary/Close.js +5 -6
- package/dist/iconDictionary/Close.js.map +1 -1
- package/dist/iconDictionary/CloseCircleFilled.js +5 -6
- package/dist/iconDictionary/CloseCircleFilled.js.map +1 -1
- package/dist/iconDictionary/Copy.js +5 -6
- package/dist/iconDictionary/Copy.js.map +1 -1
- package/dist/iconDictionary/Delete.js +5 -6
- package/dist/iconDictionary/Delete.js.map +1 -1
- package/dist/iconDictionary/Download.js +5 -6
- package/dist/iconDictionary/Download.js.map +1 -1
- package/dist/iconDictionary/DragHandle.js +5 -6
- package/dist/iconDictionary/DragHandle.js.map +1 -1
- package/dist/iconDictionary/Edit.js +5 -6
- package/dist/iconDictionary/Edit.js.map +1 -1
- package/dist/iconDictionary/ExternalLink.js +5 -6
- package/dist/iconDictionary/ExternalLink.js.map +1 -1
- package/dist/iconDictionary/Eye.js +5 -6
- package/dist/iconDictionary/Eye.js.map +1 -1
- package/dist/iconDictionary/EyeOff.js +5 -6
- package/dist/iconDictionary/EyeOff.js.map +1 -1
- package/dist/iconDictionary/Filter.js +5 -6
- package/dist/iconDictionary/Filter.js.map +1 -1
- package/dist/iconDictionary/Globe.js +5 -6
- package/dist/iconDictionary/Globe.js.map +1 -1
- package/dist/iconDictionary/Home.js +5 -6
- package/dist/iconDictionary/Home.js.map +1 -1
- package/dist/iconDictionary/InformationCircle.js +5 -6
- package/dist/iconDictionary/InformationCircle.js.map +1 -1
- package/dist/iconDictionary/InformationCircleFilled.js +5 -6
- package/dist/iconDictionary/InformationCircleFilled.js.map +1 -1
- package/dist/iconDictionary/Notification.js +5 -6
- package/dist/iconDictionary/Notification.js.map +1 -1
- package/dist/iconDictionary/OverflowVertical.js +5 -6
- package/dist/iconDictionary/OverflowVertical.js.map +1 -1
- package/dist/iconDictionary/QuestionCircle.js +5 -6
- package/dist/iconDictionary/QuestionCircle.js.map +1 -1
- package/dist/iconDictionary/QuestionCircleFilled.js +5 -6
- package/dist/iconDictionary/QuestionCircleFilled.js.map +1 -1
- package/dist/iconDictionary/Search.js +5 -6
- package/dist/iconDictionary/Search.js.map +1 -1
- package/dist/iconDictionary/Settings.js +4 -5
- package/dist/iconDictionary/Settings.js.map +1 -1
- package/dist/iconDictionary/Subtract.js +5 -6
- package/dist/iconDictionary/Subtract.js.map +1 -1
- package/dist/iconDictionary/SvgIcon.js +1 -0
- package/dist/iconDictionary/SvgIcon.js.map +1 -1
- package/dist/iconDictionary/User.js +5 -6
- package/dist/iconDictionary/User.js.map +1 -1
- package/dist/iconDictionary/UserGroup.js +5 -6
- package/dist/iconDictionary/UserGroup.js.map +1 -1
- package/dist/iconDictionary/index.js.map +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/properties/ts/odyssey-react-mui.js +11 -0
- package/dist/properties/ts/odyssey-react-mui.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_cs.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_da.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_de.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_el.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_es.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_fi.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_fr.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_hu.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_id.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_it.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_ja.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_ko.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_ms.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_nb.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_nl-NL.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_nl-NL.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_pl.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_pt-BR.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_pt-BR.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_ro.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_ru.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_sv.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_th.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_tr.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_uk.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_zh-CN.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_zh-CN.js.map +1 -0
- package/dist/properties/ts/odyssey-react-mui_zh-TW.js +2 -0
- package/dist/properties/ts/odyssey-react-mui_zh-TW.js.map +1 -0
- package/dist/src/Autocomplete.d.ts +2 -1
- package/dist/src/Autocomplete.d.ts.map +1 -1
- package/dist/src/Banner.d.ts +19 -19
- package/dist/src/Banner.d.ts.map +1 -1
- package/dist/src/Button.d.ts +4 -3
- package/dist/src/Button.d.ts.map +1 -1
- package/dist/src/Checkbox.d.ts +4 -2
- package/dist/src/Checkbox.d.ts.map +1 -1
- package/dist/src/CheckboxGroup.d.ts +8 -4
- package/dist/src/CheckboxGroup.d.ts.map +1 -1
- package/dist/src/Dialog.d.ts +25 -0
- package/dist/src/Dialog.d.ts.map +1 -0
- package/dist/src/Field.d.ts +18 -7
- package/dist/src/Field.d.ts.map +1 -1
- package/dist/src/FieldError.d.ts.map +1 -1
- package/dist/src/FieldLabel.d.ts +2 -3
- package/dist/src/FieldLabel.d.ts.map +1 -1
- package/dist/src/Fieldset.d.ts +42 -0
- package/dist/src/Fieldset.d.ts.map +1 -0
- package/dist/src/Form.d.ts +73 -0
- package/dist/src/Form.d.ts.map +1 -0
- package/dist/src/Icon.d.ts +9 -8
- package/dist/src/Icon.d.ts.map +1 -1
- package/dist/src/Infobox.d.ts +7 -7
- package/dist/src/Infobox.d.ts.map +1 -1
- package/dist/src/Link.d.ts +9 -4
- package/dist/src/Link.d.ts.map +1 -1
- package/dist/src/MenuButton.d.ts +7 -3
- package/dist/src/MenuButton.d.ts.map +1 -1
- package/dist/src/MenuItem.d.ts +1 -1
- package/dist/src/MenuItem.d.ts.map +1 -1
- package/dist/src/MuiPropsChild.d.ts +18 -0
- package/dist/src/MuiPropsChild.d.ts.map +1 -0
- package/dist/src/MuiPropsContext.d.ts +15 -0
- package/dist/src/MuiPropsContext.d.ts.map +1 -0
- package/dist/src/NativeSelect.d.ts +36 -0
- package/dist/src/NativeSelect.d.ts.map +1 -0
- package/dist/src/OdysseyI18n.d.ts +54 -0
- package/dist/src/OdysseyI18n.d.ts.map +1 -0
- package/dist/src/OdysseyProvider.d.ts +27 -0
- package/dist/src/OdysseyProvider.d.ts.map +1 -0
- package/dist/src/OdysseyThemeProvider.d.ts +4 -2
- package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
- package/dist/src/OdysseyTranslationProvider.d.ts +25 -0
- package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -0
- package/dist/src/OdysseyTranslationProvider.types.d.ts +14 -0
- package/dist/src/OdysseyTranslationProvider.types.d.ts.map +1 -0
- package/dist/src/PasswordField.d.ts +8 -8
- package/dist/src/PasswordField.d.ts.map +1 -1
- package/dist/src/RadioGroup.d.ts +8 -8
- package/dist/src/RadioGroup.d.ts.map +1 -1
- package/dist/src/SearchField.d.ts +4 -4
- package/dist/src/SearchField.d.ts.map +1 -1
- package/dist/src/Select.d.ts +35 -0
- package/dist/src/Select.d.ts.map +1 -0
- package/dist/src/Status.d.ts +2 -2
- package/dist/src/Status.d.ts.map +1 -1
- package/dist/src/Tabs.d.ts +27 -0
- package/dist/src/Tabs.d.ts.map +1 -0
- package/dist/src/TextField.d.ts +12 -15
- package/dist/src/TextField.d.ts.map +1 -1
- package/dist/src/Toast.d.ts +60 -0
- package/dist/src/Toast.d.ts.map +1 -0
- package/dist/src/ToastStack.d.ts +19 -0
- package/dist/src/ToastStack.d.ts.map +1 -0
- package/dist/src/{ThemeProvider.d.ts → Tooltip.d.ts} +8 -4
- package/dist/src/Tooltip.d.ts.map +1 -0
- package/dist/src/iconDictionary/Add.d.ts +2 -2
- package/dist/src/iconDictionary/AddCircle.d.ts +2 -2
- package/dist/src/iconDictionary/AlertCircle.d.ts +2 -2
- package/dist/src/iconDictionary/AlertCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/AlertTriangleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/Anchor.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowDown.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowLeft.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowRight.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowUp.d.ts +2 -2
- package/dist/src/iconDictionary/ArrowUpDown.d.ts +2 -2
- package/dist/src/iconDictionary/Calendar.d.ts +2 -2
- package/dist/src/iconDictionary/Check.d.ts +2 -2
- package/dist/src/iconDictionary/CheckCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/ChevronDown.d.ts +2 -2
- package/dist/src/iconDictionary/ChevronUp.d.ts +2 -2
- package/dist/src/iconDictionary/Close.d.ts +2 -2
- package/dist/src/iconDictionary/CloseCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/Copy.d.ts +2 -2
- package/dist/src/iconDictionary/Delete.d.ts +2 -2
- package/dist/src/iconDictionary/Download.d.ts +2 -2
- package/dist/src/iconDictionary/DragHandle.d.ts +2 -2
- package/dist/src/iconDictionary/Edit.d.ts +2 -2
- package/dist/src/iconDictionary/ExternalLink.d.ts +2 -2
- package/dist/src/iconDictionary/Eye.d.ts +2 -2
- package/dist/src/iconDictionary/EyeOff.d.ts +2 -2
- package/dist/src/iconDictionary/Filter.d.ts +2 -2
- package/dist/src/iconDictionary/Globe.d.ts +2 -2
- package/dist/src/iconDictionary/Home.d.ts +2 -2
- package/dist/src/iconDictionary/InformationCircle.d.ts +2 -2
- package/dist/src/iconDictionary/InformationCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/Notification.d.ts +2 -2
- package/dist/src/iconDictionary/OverflowVertical.d.ts +2 -2
- package/dist/src/iconDictionary/QuestionCircle.d.ts +2 -2
- package/dist/src/iconDictionary/QuestionCircleFilled.d.ts +2 -2
- package/dist/src/iconDictionary/Search.d.ts +2 -2
- package/dist/src/iconDictionary/Settings.d.ts +2 -2
- package/dist/src/iconDictionary/Subtract.d.ts +2 -2
- package/dist/src/iconDictionary/User.d.ts +2 -2
- package/dist/src/iconDictionary/UserGroup.d.ts +2 -2
- package/dist/src/iconDictionary/index.d.ts +40 -40
- package/dist/src/index.d.ts +15 -10
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/properties/ts/odyssey-react-mui.d.ts +11 -0
- package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_nl-NL.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_nl-NL.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_pt-BR.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_pt-BR.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_zh-CN.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_zh-CN.d.ts.map +1 -0
- package/dist/src/properties/ts/odyssey-react-mui_zh-TW.d.ts +2 -0
- package/dist/src/properties/ts/odyssey-react-mui_zh-TW.d.ts.map +1 -0
- package/dist/src/theme/components.d.ts.map +1 -1
- package/dist/src/theme/index.d.ts +3 -1
- package/dist/src/theme/index.d.ts.map +1 -1
- package/dist/src/theme/mixins.d.ts +2 -1
- package/dist/src/theme/mixins.d.ts.map +1 -1
- package/dist/src/theme/palette.d.ts +2 -1
- package/dist/src/theme/palette.d.ts.map +1 -1
- package/dist/src/theme/shape.d.ts +2 -1
- package/dist/src/theme/shape.d.ts.map +1 -1
- package/dist/src/theme/spacing.d.ts +2 -1
- package/dist/src/theme/spacing.d.ts.map +1 -1
- package/dist/src/theme/theme.d.ts +3 -2
- package/dist/src/theme/theme.d.ts.map +1 -1
- package/dist/src/theme/typography.d.ts +2 -1
- package/dist/src/theme/typography.d.ts.map +1 -1
- package/dist/theme/components.js +123 -85
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/components.types.js +1 -0
- package/dist/theme/components.types.js.map +1 -1
- package/dist/theme/index.js +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/mixins.js +8 -6
- package/dist/theme/mixins.js.map +1 -1
- package/dist/theme/mixins.types.js +1 -0
- package/dist/theme/mixins.types.js.map +1 -1
- package/dist/theme/palette.js +89 -86
- package/dist/theme/palette.js.map +1 -1
- package/dist/theme/palette.types.js +1 -0
- package/dist/theme/palette.types.js.map +1 -1
- package/dist/theme/shape.js +6 -4
- package/dist/theme/shape.js.map +1 -1
- package/dist/theme/spacing.js +4 -1
- package/dist/theme/spacing.js.map +1 -1
- package/dist/theme/temp.js +1 -0
- package/dist/theme/temp.js.map +1 -1
- package/dist/theme/theme.js +12 -9
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/typography.js +85 -83
- package/dist/theme/typography.js.map +1 -1
- package/dist/theme/typography.types.js +1 -0
- package/dist/theme/typography.types.js.map +1 -1
- package/dist/theme/useTheme.js +1 -0
- package/dist/theme/useTheme.js.map +1 -1
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/useUniqueAlphabeticalId.js +1 -0
- package/dist/useUniqueAlphabeticalId.js.map +1 -1
- package/dist/useUniqueId.js +1 -0
- package/dist/useUniqueId.js.map +1 -1
- package/i18n.config.json +8 -0
- package/package.json +9 -4
- package/scripts/properties-to-ts.js +103 -0
- package/src/@types/i18next.d.ts +22 -0
- package/src/Autocomplete.tsx +10 -1
- package/src/Banner.tsx +37 -32
- package/src/Button.tsx +38 -18
- package/src/Checkbox.tsx +47 -21
- package/src/CheckboxGroup.tsx +30 -34
- package/src/Dialog.tsx +110 -0
- package/src/Field.tsx +56 -24
- package/src/FieldError.tsx +6 -1
- package/src/FieldLabel.tsx +13 -10
- package/src/Fieldset.tsx +95 -0
- package/src/Form.tsx +142 -0
- package/src/Icon.test.tsx +1 -1
- package/src/Icon.tsx +27 -13
- package/src/Infobox.tsx +18 -13
- package/src/Link.tsx +14 -6
- package/src/MenuButton.tsx +8 -3
- package/src/MenuItem.tsx +1 -0
- package/src/MuiPropsChild.tsx +41 -0
- package/src/MuiPropsContext.ts +17 -0
- package/src/NativeSelect.tsx +107 -0
- package/src/OdysseyI18n.ts +101 -0
- package/src/OdysseyProvider.tsx +59 -0
- package/src/OdysseyThemeProvider.tsx +9 -3
- package/src/OdysseyTranslationProvider.test.tsx +63 -0
- package/src/OdysseyTranslationProvider.tsx +65 -0
- package/src/OdysseyTranslationProvider.types.ts +42 -0
- package/src/PasswordField.tsx +18 -11
- package/src/RadioGroup.tsx +31 -46
- package/src/SearchField.tsx +10 -8
- package/src/Select.tsx +226 -0
- package/src/Status.tsx +2 -2
- package/src/Tabs.tsx +70 -0
- package/src/TextField.tsx +31 -25
- package/src/Toast.tsx +140 -0
- package/src/{ThemeProvider.tsx → ToastStack.tsx} +16 -9
- package/src/Tooltip.tsx +39 -0
- package/src/iconDictionary/Add.tsx +3 -3
- package/src/iconDictionary/AddCircle.tsx +3 -3
- package/src/iconDictionary/AlertCircle.tsx +3 -3
- package/src/iconDictionary/AlertCircleFilled.tsx +3 -3
- package/src/iconDictionary/AlertTriangleFilled.tsx +3 -3
- package/src/iconDictionary/Anchor.tsx +3 -3
- package/src/iconDictionary/ArrowDown.tsx +3 -3
- package/src/iconDictionary/ArrowLeft.tsx +3 -3
- package/src/iconDictionary/ArrowRight.tsx +3 -3
- package/src/iconDictionary/ArrowUp.tsx +3 -3
- package/src/iconDictionary/ArrowUpDown.tsx +3 -3
- package/src/iconDictionary/Calendar.tsx +3 -3
- package/src/iconDictionary/Check.tsx +3 -3
- package/src/iconDictionary/CheckCircleFilled.tsx +3 -3
- package/src/iconDictionary/ChevronDown.tsx +3 -3
- package/src/iconDictionary/ChevronUp.tsx +3 -3
- package/src/iconDictionary/Close.tsx +3 -3
- package/src/iconDictionary/CloseCircleFilled.tsx +3 -3
- package/src/iconDictionary/Copy.tsx +3 -3
- package/src/iconDictionary/Delete.tsx +3 -3
- package/src/iconDictionary/Download.tsx +3 -3
- package/src/iconDictionary/DragHandle.tsx +3 -3
- package/src/iconDictionary/Edit.tsx +3 -3
- package/src/iconDictionary/ExternalLink.tsx +3 -3
- package/src/iconDictionary/Eye.tsx +3 -3
- package/src/iconDictionary/EyeOff.tsx +3 -3
- package/src/iconDictionary/Filter.tsx +3 -3
- package/src/iconDictionary/Globe.tsx +3 -3
- package/src/iconDictionary/Home.tsx +3 -3
- package/src/iconDictionary/InformationCircle.tsx +3 -3
- package/src/iconDictionary/InformationCircleFilled.tsx +3 -3
- package/src/iconDictionary/Notification.tsx +3 -3
- package/src/iconDictionary/OverflowVertical.tsx +3 -3
- package/src/iconDictionary/QuestionCircle.tsx +3 -3
- package/src/iconDictionary/QuestionCircleFilled.tsx +3 -3
- package/src/iconDictionary/Search.tsx +3 -3
- package/src/iconDictionary/Settings.tsx +2 -2
- package/src/iconDictionary/Subtract.tsx +3 -3
- package/src/iconDictionary/User.tsx +3 -3
- package/src/iconDictionary/UserGroup.tsx +3 -3
- package/src/iconDictionary/index.ts +1 -1
- package/src/index.ts +11 -23
- package/src/properties/odyssey-react-mui.properties +8 -0
- package/src/properties/translations/odyssey-react-mui_cs.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_da.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_de.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_el.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_es.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_fi.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_fr.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_hu.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_id.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_it.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_ja.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_ko.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_ms.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_nb.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_nl-NL.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_pl.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_pt-BR.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_ro.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_ru.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_sv.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_th.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_tr.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_uk.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_zh-CN.properties +0 -0
- package/src/properties/translations/odyssey-react-mui_zh-TW.properties +0 -0
- package/src/properties/ts/odyssey-react-mui.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_cs.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_da.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_de.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_el.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_es.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_fi.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_fr.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_hu.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_id.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_it.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_ja.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_ko.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_ms.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_nb.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_nl-NL.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_pl.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_pt-BR.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_ro.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_ru.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_sv.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_th.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_tr.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_uk.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_zh-CN.ts +1 -0
- package/src/properties/ts/odyssey-react-mui_zh-TW.ts +1 -0
- package/src/theme/components.tsx +44 -13
- package/src/theme/index.ts +5 -1
- package/src/theme/mixins.ts +10 -6
- package/src/theme/palette.ts +95 -88
- package/src/theme/shape.ts +12 -8
- package/src/theme/spacing.ts +17 -12
- package/src/theme/theme.ts +14 -10
- package/src/theme/typography.ts +87 -83
- package/dist/ThemeProvider.js.map +0 -1
- package/dist/src/ThemeProvider.d.ts.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { useEffect } from "react";
|
|
14
|
+
import i18n, { defaultNS, resources } from "./OdysseyI18n.js";
|
|
15
|
+
import { I18nextProvider } from "react-i18next";
|
|
16
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
const mergeBundleOverrides = (languageCode, translationOverrides) => {
|
|
18
|
+
const bundle = resources[languageCode];
|
|
19
|
+
const overrides = translationOverrides[languageCode];
|
|
20
|
+
return {
|
|
21
|
+
...bundle,
|
|
22
|
+
...overrides
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export const OdysseyTranslationProvider = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
children,
|
|
28
|
+
languageCode,
|
|
29
|
+
translationOverrides
|
|
30
|
+
} = _ref;
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
i18n.changeLanguage(languageCode || window.navigator.language);
|
|
33
|
+
}, [languageCode]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (translationOverrides) {
|
|
36
|
+
Object.keys(translationOverrides).forEach(language => {
|
|
37
|
+
const bundle = mergeBundleOverrides(language, translationOverrides);
|
|
38
|
+
i18n.addResourceBundle(language, defaultNS, bundle);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}, [translationOverrides]);
|
|
42
|
+
return _jsx(I18nextProvider, {
|
|
43
|
+
i18n: i18n,
|
|
44
|
+
children: children
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=OdysseyTranslationProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OdysseyTranslationProvider.js","names":["useEffect","i18n","defaultNS","resources","I18nextProvider","jsx","_jsx","mergeBundleOverrides","languageCode","translationOverrides","bundle","overrides","OdysseyTranslationProvider","_ref","children","changeLanguage","window","navigator","language","Object","keys","forEach","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 { ReactElement, useEffect } from \"react\";\n\nimport { SupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nimport i18n, { defaultNS, resources } from \"./OdysseyI18n\";\nimport { I18nextProvider } from \"react-i18next\";\n\nexport type TranslationOverrides = {\n [key in SupportedLanguages]?: Partial<(typeof resources)[\"en\"]>;\n};\n\ntype OdysseyTranslationProviderProps = {\n children: ReactElement;\n languageCode?: SupportedLanguages;\n translationOverrides?: TranslationOverrides;\n};\n\nconst mergeBundleOverrides = (\n languageCode: SupportedLanguages,\n translationOverrides: TranslationOverrides\n) => {\n const bundle = resources[languageCode];\n const overrides = translationOverrides[languageCode];\n return {\n ...bundle,\n ...overrides,\n };\n};\n\nexport const OdysseyTranslationProvider = ({\n children,\n languageCode,\n translationOverrides,\n}: OdysseyTranslationProviderProps) => {\n useEffect(() => {\n // Defaults to the browser's language if available otherwise `en` will be used\n i18n.changeLanguage(languageCode || window.navigator.language);\n }, [languageCode]);\n\n useEffect(() => {\n if (translationOverrides) {\n Object.keys(translationOverrides).forEach((language) => {\n const bundle = mergeBundleOverrides(\n language as SupportedLanguages,\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,SAAuBA,SAAS,QAAQ,OAAO;AAAC,OAIzCC,IAAI,IAAIC,SAAS,EAAEC,SAAS;AACnC,SAASC,eAAe,QAAQ,eAAe;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAYhD,MAAMC,oBAAoB,GAAGA,CAC3BC,YAAgC,EAChCC,oBAA0C,KACvC;EACH,MAAMC,MAAM,GAAGP,SAAS,CAACK,YAAY,CAAC;EACtC,MAAMG,SAAS,GAAGF,oBAAoB,CAACD,YAAY,CAAC;EACpD,OAAO;IACL,GAAGE,MAAM;IACT,GAAGC;EACL,CAAC;AACH,CAAC;AAED,OAAO,MAAMC,0BAA0B,GAAGC,IAAA,IAIH;EAAA,IAJI;IACzCC,QAAQ;IACRN,YAAY;IACZC;EAC+B,CAAC,GAAAI,IAAA;EAChCb,SAAS,CAAC,MAAM;IAEdC,IAAI,CAACc,cAAc,CAACP,YAAY,IAAIQ,MAAM,CAACC,SAAS,CAACC,QAAQ,CAAC;EAChE,CAAC,EAAE,CAACV,YAAY,CAAC,CAAC;EAElBR,SAAS,CAAC,MAAM;IACd,IAAIS,oBAAoB,EAAE;MACxBU,MAAM,CAACC,IAAI,CAACX,oBAAoB,CAAC,CAACY,OAAO,CAAEH,QAAQ,IAAK;QACtD,MAAMR,MAAM,GAAGH,oBAAoB,CACjCW,QAAQ,EACRT,oBACF,CAAC;QACDR,IAAI,CAACqB,iBAAiB,CAACJ,QAAQ,EAAEhB,SAAS,EAAEQ,MAAM,CAAC;MACrD,CAAC,CAAC;IACJ;EACF,CAAC,EAAE,CAACD,oBAAoB,CAAC,CAAC;EAE1B,OAAOH,IAAA,CAACF,eAAe;IAACH,IAAI,EAAEA,IAAK;IAAAa,QAAA,EAAEA;EAAQ,CAAkB,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const supportedLanguages = ["cs", "da", "de", "el", "en", "es", "fi", "fr", "hu", "id", "it", "ja", "ko", "ms", "nb", "nl-NL", "pl", "pt-BR", "ro", "ru", "sv", "th", "tr", "uk", "zh-CN", "zh-TW"];
|
|
14
|
+
//# sourceMappingURL=OdysseyTranslationProvider.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OdysseyTranslationProvider.types.js","names":["supportedLanguages"],"sources":["../src/OdysseyTranslationProvider.types.ts"],"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\nexport const supportedLanguages = [\n \"cs\", // Czech\n \"da\", // Danish\n \"de\", // German\n \"el\", // Greek\n \"en\", // English\n \"es\", // Spanish\n \"fi\", // Finnish\n \"fr\", // French\n \"hu\", // Hungarian\n \"id\", // Indonesian\n \"it\", // Italian\n \"ja\", // Japanese\n \"ko\", // Korean\n \"ms\", // Malaysian\n \"nb\", // Norwegian\n \"nl-NL\", // Dutch\n \"pl\", // Polish\n \"pt-BR\", // Portuguese (Brazil)\n \"ro\", // Romanian\n \"ru\", // Russian\n \"sv\", // Swedish\n \"th\", // Thai\n \"tr\", // Turkish\n \"uk\", // Ukrainian\n \"zh-CN\", // Chinese (PRC)\n \"zh-TW\", // Chinese\n] as const;\n\nexport type SupportedLanguages = (typeof supportedLanguages)[number];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,kBAAkB,GAAG,CAChC,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,OAAO,CACC"}
|
package/dist/PasswordField.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import _InputBase from "@mui/material/InputBase";
|
|
2
2
|
import _InputAdornment from "@mui/material/InputAdornment";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
5
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
6
|
+
*
|
|
7
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
8
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
*
|
|
12
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
3
14
|
import { forwardRef, memo, useCallback, useState } from "react";
|
|
4
15
|
import { EyeIcon, EyeOffIcon, IconButton } from "./index.js";
|
|
5
16
|
import { Field } from "./Field.js";
|
|
@@ -7,11 +18,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
18
|
const PasswordField = forwardRef((_ref, ref) => {
|
|
8
19
|
let {
|
|
9
20
|
autoCompleteType,
|
|
10
|
-
autoFocus,
|
|
11
21
|
errorMessage,
|
|
22
|
+
hasInitialFocus,
|
|
12
23
|
hint,
|
|
13
24
|
id: idOverride,
|
|
14
25
|
isDisabled = false,
|
|
26
|
+
isOptional = false,
|
|
15
27
|
isReadOnly,
|
|
16
28
|
label,
|
|
17
29
|
onChange,
|
|
@@ -32,7 +44,7 @@ const PasswordField = forwardRef((_ref, ref) => {
|
|
|
32
44
|
return _jsx(_InputBase, {
|
|
33
45
|
"aria-describedby": ariaDescribedBy,
|
|
34
46
|
autoComplete: autoCompleteType,
|
|
35
|
-
autoFocus:
|
|
47
|
+
autoFocus: hasInitialFocus,
|
|
36
48
|
endAdornment: _jsx(_InputAdornment, {
|
|
37
49
|
position: "end",
|
|
38
50
|
children: _jsx(IconButton, {
|
|
@@ -43,26 +55,31 @@ const PasswordField = forwardRef((_ref, ref) => {
|
|
|
43
55
|
})
|
|
44
56
|
}),
|
|
45
57
|
id: id,
|
|
58
|
+
name: id,
|
|
46
59
|
onChange: onChange,
|
|
47
60
|
onFocus: onFocus,
|
|
48
61
|
onBlur: onBlur,
|
|
49
62
|
placeholder: placeholder,
|
|
50
63
|
readOnly: isReadOnly,
|
|
51
64
|
ref: ref,
|
|
65
|
+
required: !isOptional,
|
|
52
66
|
type: inputType,
|
|
53
67
|
value: value
|
|
54
68
|
});
|
|
55
|
-
}, [autoCompleteType,
|
|
69
|
+
}, [autoCompleteType, hasInitialFocus, togglePasswordVisibility, inputType, onChange, onFocus, onBlur, placeholder, isOptional, isReadOnly, ref, value]);
|
|
56
70
|
return _jsx(Field, {
|
|
57
71
|
errorMessage: errorMessage,
|
|
72
|
+
fieldType: "single",
|
|
58
73
|
hasVisibleLabel: true,
|
|
59
74
|
hint: hint,
|
|
60
75
|
id: idOverride,
|
|
61
76
|
isDisabled: isDisabled,
|
|
77
|
+
isOptional: isOptional,
|
|
62
78
|
label: label,
|
|
63
79
|
renderFieldComponent: renderFieldComponent
|
|
64
80
|
});
|
|
65
81
|
});
|
|
66
82
|
const MemoizedPasswordField = memo(PasswordField);
|
|
83
|
+
MemoizedPasswordField.displayName = "PasswordField";
|
|
67
84
|
export { MemoizedPasswordField as PasswordField };
|
|
68
85
|
//# sourceMappingURL=PasswordField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useState","EyeIcon","EyeOffIcon","IconButton","Field","PasswordField","ref","autoCompleteType","
|
|
1
|
+
{"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useState","EyeIcon","EyeOffIcon","IconButton","Field","jsx","_jsx","PasswordField","_ref","ref","autoCompleteType","errorMessage","hasInitialFocus","hint","id","idOverride","isDisabled","isOptional","isReadOnly","label","onChange","onFocus","onBlur","placeholder","value","inputType","setInputType","togglePasswordVisibility","renderFieldComponent","_ref2","ariaDescribedBy","_InputBase","autoComplete","autoFocus","endAdornment","_InputAdornment","position","children","edge","onClick","name","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 } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n memo,\n useCallback,\n useState,\n} from \"react\";\n\nimport { EyeIcon, EyeOffIcon, IconButton } from \"./\";\nimport { Field } from \"./Field\";\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 * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessage?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * The helper text content.\n */\n hint?: string;\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 * If `true`, the `input` element is not required.\n */\n isOptional?: boolean;\n /**\n * It prevents the user from changing the value of the field\n */\n isReadOnly?: boolean;\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, required for a controlled component.\n */\n value?: string;\n};\n\nconst PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n (\n {\n autoCompleteType,\n errorMessage,\n hasInitialFocus,\n hint,\n id: idOverride,\n isDisabled = false,\n isOptional = false,\n isReadOnly,\n label,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n value,\n },\n ref\n ) => {\n const [inputType, setInputType] = useState(\"password\");\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((inputType) =>\n inputType === \"password\" ? \"text\" : \"password\"\n );\n }, []);\n\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n <InputAdornment position=\"end\">\n <IconButton\n aria-label=\"toggle password visibility\"\n edge=\"end\"\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <EyeIcon /> : <EyeOffIcon />}\n </IconButton>\n </InputAdornment>\n }\n id={id}\n name={id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n type={inputType}\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n togglePasswordVisibility,\n inputType,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n ref,\n value,\n ]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\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,QAAQ,QACH,OAAO;AAAC,SAENC,OAAO,EAAEC,UAAU,EAAEC,UAAU;AAAA,SAC/BC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AA+Dd,MAAMC,aAAa,GAAGV,UAAU,CAC9B,CAAAW,IAAA,EAiBEC,GAAG,KACA;EAAA,IAjBH;IACEC,gBAAgB;IAChBC,YAAY;IACZC,eAAe;IACfC,IAAI;IACJC,EAAE,EAAEC,UAAU;IACdC,UAAU,GAAG,KAAK;IAClBC,UAAU,GAAG,KAAK;IAClBC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACNC,WAAW;IACXC;EACF,CAAC,GAAAhB,IAAA;EAGD,MAAM,CAACiB,SAAS,EAAEC,YAAY,CAAC,GAAG1B,QAAQ,CAAC,UAAU,CAAC;EAEtD,MAAM2B,wBAAwB,GAAG5B,WAAW,CAAC,MAAM;IACjD2B,YAAY,CAAED,SAAS,IACrBA,SAAS,KAAK,UAAU,GAAG,MAAM,GAAG,UACtC,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,oBAAoB,GAAG7B,WAAW,CACtC8B,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAEhB;IAAG,CAAC,GAAAe,KAAA;IAAA,OACtBvB,IAAA,CAAAyB,UAAA;MACE,oBAAkBD,eAAgB;MAClCE,YAAY,EAAEtB,gBAAiB;MAE/BuB,SAAS,EAAErB,eAAgB;MAC3BsB,YAAY,EACV5B,IAAA,CAAA6B,eAAA;QAAgBC,QAAQ,EAAC,KAAK;QAAAC,QAAA,EAC5B/B,IAAA,CAACH,UAAU;UACT,cAAW,4BAA4B;UACvCmC,IAAI,EAAC,KAAK;UACVC,OAAO,EAAEZ,wBAAyB;UAAAU,QAAA,EAEjCZ,SAAS,KAAK,UAAU,GAAGnB,IAAA,CAACL,OAAO,IAAE,CAAC,GAAGK,IAAA,CAACJ,UAAU,IAAE;QAAC,CAC9C;MAAC,CACC,CACjB;MACDY,EAAE,EAAEA,EAAG;MACP0B,IAAI,EAAE1B,EAAG;MACTM,QAAQ,EAAEA,QAAS;MACnBC,OAAO,EAAEA,OAAQ;MACjBC,MAAM,EAAEA,MAAO;MACfC,WAAW,EAAEA,WAAY;MACzBkB,QAAQ,EAAEvB,UAAW;MACrBT,GAAG,EAAEA,GAAI;MACTiC,QAAQ,EAAE,CAACzB,UAAW;MACtB0B,IAAI,EAAElB,SAAU;MAChBD,KAAK,EAAEA;IAAM,CACd,CAAC;EAAA,CACH,EACD,CACEd,gBAAgB,EAChBE,eAAe,EACfe,wBAAwB,EACxBF,SAAS,EACTL,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,WAAW,EACXN,UAAU,EACVC,UAAU,EACVT,GAAG,EACHe,KAAK,CAET,CAAC;EAED,OACElB,IAAA,CAACF,KAAK;IACJO,YAAY,EAAEA,YAAa;IAC3BiC,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACfhC,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBE,KAAK,EAAEA,KAAM;IACbS,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMkB,qBAAqB,GAAGhD,IAAI,CAACS,aAAa,CAAC;AACjDuC,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAIvC,aAAa"}
|
package/dist/Radio.js
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import _Radio from "@mui/material/Radio";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
4
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
5
|
+
*
|
|
6
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
*
|
|
11
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
2
13
|
import { memo } from "react";
|
|
3
14
|
import { FormControlLabel } from "./index.js";
|
|
4
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
|
|
6
16
|
const Radio = _ref => {
|
|
7
17
|
let {
|
|
8
18
|
isChecked,
|
|
@@ -24,7 +34,6 @@ const Radio = _ref => {
|
|
|
24
34
|
value: value
|
|
25
35
|
});
|
|
26
36
|
};
|
|
27
|
-
|
|
28
37
|
const MemoizedRadio = memo(Radio);
|
|
29
38
|
export { MemoizedRadio as Radio };
|
|
30
39
|
//# sourceMappingURL=Radio.js.map
|
package/dist/Radio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","names":["memo","FormControlLabel","Radio","isChecked","isDefaultChecked","isDisabled","hasError","label","name","value","MemoizedRadio"],"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 { Radio as MuiRadio } from \"@mui/material\";\nimport { memo } from \"react\";\n\nimport { FormControlLabel } from \".\";\n\nexport type RadioProps = {\n isChecked?: boolean;\n isDefaultChecked?: boolean;\n isDisabled?: boolean;\n hasError?: boolean;\n label: string;\n name?: string;\n value: string;\n};\n\nconst Radio = ({\n isChecked,\n isDefaultChecked,\n isDisabled,\n hasError,\n label,\n name,\n value,\n}: RadioProps) => (\n <FormControlLabel\n checked={isChecked}\n className={hasError ? \"Mui-error\" : \"\"}\n control={<MuiRadio />}\n defaultChecked={isDefaultChecked}\n disabled={isDisabled}\n label={label}\n name={name}\n value={value}\n />\n);\n\nconst MemoizedRadio = memo(Radio);\n\nexport { MemoizedRadio as Radio };\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"Radio.js","names":["memo","FormControlLabel","jsx","_jsx","Radio","_ref","isChecked","isDefaultChecked","isDisabled","hasError","label","name","value","checked","className","control","_Radio","defaultChecked","disabled","MemoizedRadio"],"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 { Radio as MuiRadio } from \"@mui/material\";\nimport { memo } from \"react\";\n\nimport { FormControlLabel } from \".\";\n\nexport type RadioProps = {\n isChecked?: boolean;\n isDefaultChecked?: boolean;\n isDisabled?: boolean;\n hasError?: boolean;\n label: string;\n name?: string;\n value: string;\n};\n\nconst Radio = ({\n isChecked,\n isDefaultChecked,\n isDisabled,\n hasError,\n label,\n name,\n value,\n}: RadioProps) => (\n <FormControlLabel\n checked={isChecked}\n className={hasError ? \"Mui-error\" : \"\"}\n control={<MuiRadio />}\n defaultChecked={isDefaultChecked}\n disabled={isDisabled}\n label={label}\n name={name}\n value={value}\n />\n);\n\nconst MemoizedRadio = memo(Radio);\n\nexport { MemoizedRadio as Radio };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,QAAQ,OAAO;AAAC,SAEpBC,gBAAgB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAYzB,MAAMC,KAAK,GAAGC,IAAA;EAAA,IAAC;IACbC,SAAS;IACTC,gBAAgB;IAChBC,UAAU;IACVC,QAAQ;IACRC,KAAK;IACLC,IAAI;IACJC;EACU,CAAC,GAAAP,IAAA;EAAA,OACXF,IAAA,CAACF,gBAAgB;IACfY,OAAO,EAAEP,SAAU;IACnBQ,SAAS,EAAEL,QAAQ,GAAG,WAAW,GAAG,EAAG;IACvCM,OAAO,EAAEZ,IAAA,CAAAa,MAAA,IAAW,CAAE;IACtBC,cAAc,EAAEV,gBAAiB;IACjCW,QAAQ,EAAEV,UAAW;IACrBE,KAAK,EAAEA,KAAM;IACbC,IAAI,EAAEA,IAAK;IACXC,KAAK,EAAEA;EAAM,CACd,CAAC;AAAA,CACH;AAED,MAAMO,aAAa,GAAGnB,IAAI,CAACI,KAAK,CAAC;AAEjC,SAASe,aAAa,IAAIf,KAAK"}
|
package/dist/RadioGroup.js
CHANGED
|
@@ -1,48 +1,56 @@
|
|
|
1
1
|
import _RadioGroup from "@mui/material/RadioGroup";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
4
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
5
|
+
*
|
|
6
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
9
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
*
|
|
11
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
import { memo, useCallback } from "react";
|
|
14
|
+
import { Field } from "./Field.js";
|
|
4
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
7
16
|
const RadioGroup = _ref => {
|
|
8
17
|
let {
|
|
9
18
|
children,
|
|
10
19
|
defaultValue,
|
|
11
20
|
errorMessage,
|
|
12
21
|
hint,
|
|
22
|
+
id: idOverride,
|
|
13
23
|
isDisabled,
|
|
14
24
|
label,
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
onChange,
|
|
26
|
+
value
|
|
17
27
|
} = _ref;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
children: [_jsx(FormLabel, {
|
|
25
|
-
component: "legend",
|
|
26
|
-
children: label
|
|
27
|
-
}), hint && _jsx(FormHelperText, {
|
|
28
|
-
id: `${uniqueName}-hint`,
|
|
29
|
-
children: hint
|
|
30
|
-
}), _jsx(_RadioGroup, {
|
|
28
|
+
const renderFieldComponent = useCallback(_ref2 => {
|
|
29
|
+
let {
|
|
30
|
+
ariaDescribedBy,
|
|
31
|
+
id
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return _jsx(_RadioGroup, {
|
|
31
34
|
"aria-describedby": ariaDescribedBy,
|
|
32
35
|
defaultValue: defaultValue,
|
|
33
|
-
|
|
36
|
+
id: id,
|
|
37
|
+
name: id,
|
|
34
38
|
onChange: onChange,
|
|
39
|
+
value: value,
|
|
35
40
|
children: children
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
});
|
|
42
|
+
}, [children, defaultValue, onChange, value]);
|
|
43
|
+
return _jsx(Field, {
|
|
44
|
+
errorMessage: errorMessage,
|
|
45
|
+
fieldType: "group",
|
|
46
|
+
hasVisibleLabel: false,
|
|
47
|
+
hint: hint,
|
|
48
|
+
id: idOverride,
|
|
49
|
+
isDisabled: isDisabled,
|
|
50
|
+
label: label,
|
|
51
|
+
renderFieldComponent: renderFieldComponent
|
|
43
52
|
});
|
|
44
53
|
};
|
|
45
|
-
|
|
46
54
|
const MemoizedRadioGroup = memo(RadioGroup);
|
|
47
55
|
export { MemoizedRadioGroup as RadioGroup };
|
|
48
56
|
//# sourceMappingURL=RadioGroup.js.map
|
package/dist/RadioGroup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.js","names":["memo","
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","names":["memo","useCallback","Field","jsx","_jsx","RadioGroup","_ref","children","defaultValue","errorMessage","hint","id","idOverride","isDisabled","label","onChange","value","renderFieldComponent","_ref2","ariaDescribedBy","_RadioGroup","name","fieldType","hasVisibleLabel","MemoizedRadioGroup"],"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 { RadioGroup as MuiRadioGroup } from \"@mui/material\";\nimport { ChangeEventHandler, memo, ReactElement, useCallback } from \"react\";\n\nimport { Radio, RadioProps } from \"./Radio\";\nimport { Field } from \"./Field\";\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 error text for an invalid group\n */\n errorMessage?: string;\n /**\n * Optional hint text\n */\n hint?: string;\n /**\n * The id of the `input` element. This will also be the input's `name` field.\n */\n id?: string;\n /**\n * Disables the whole radio group\n */\n isDisabled?: boolean;\n /**\n * The text label for the radio group\n */\n label: string;\n /**\n * Listen for changes in the browser that change `value`.\n */\n onChange?: ChangeEventHandler<EventTarget>;\n /**\n * The `value` on the selected radio button.\n */\n value?: RadioProps[\"value\"];\n};\n\nconst RadioGroup = ({\n children,\n defaultValue,\n errorMessage,\n hint,\n id: idOverride,\n isDisabled,\n label,\n onChange,\n value,\n}: RadioGroupProps) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <MuiRadioGroup\n aria-describedby={ariaDescribedBy}\n defaultValue={defaultValue}\n id={id}\n name={id}\n onChange={onChange}\n value={value}\n >\n {children}\n </MuiRadioGroup>\n ),\n [children, defaultValue, onChange, value]\n );\n\n return (\n <Field\n errorMessage={errorMessage}\n fieldType=\"group\"\n hasVisibleLabel={false}\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAA6BA,IAAI,EAAgBC,WAAW,QAAQ,OAAO;AAAC,SAGnEC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAyCd,MAAMC,UAAU,GAAGC,IAAA,IAUI;EAAA,IAVH;IAClBC,QAAQ;IACRC,YAAY;IACZC,YAAY;IACZC,IAAI;IACJC,EAAE,EAAEC,UAAU;IACdC,UAAU;IACVC,KAAK;IACLC,QAAQ;IACRC;EACe,CAAC,GAAAV,IAAA;EAChB,MAAMW,oBAAoB,GAAGhB,WAAW,CACtCiB,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAER;IAAG,CAAC,GAAAO,KAAA;IAAA,OACtBd,IAAA,CAAAgB,WAAA;MACE,oBAAkBD,eAAgB;MAClCX,YAAY,EAAEA,YAAa;MAC3BG,EAAE,EAAEA,EAAG;MACPU,IAAI,EAAEV,EAAG;MACTI,QAAQ,EAAEA,QAAS;MACnBC,KAAK,EAAEA,KAAM;MAAAT,QAAA,EAEZA;IAAQ,CACI,CAAC;EAAA,CACjB,EACD,CAACA,QAAQ,EAAEC,YAAY,EAAEO,QAAQ,EAAEC,KAAK,CAC1C,CAAC;EAED,OACEZ,IAAA,CAACF,KAAK;IACJO,YAAY,EAAEA,YAAa;IAC3Ba,SAAS,EAAC,OAAO;IACjBC,eAAe,EAAE,KAAM;IACvBb,IAAI,EAAEA,IAAK;IACXC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbG,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMO,kBAAkB,GAAGxB,IAAI,CAACK,UAAU,CAAC;AAE3C,SAASmB,kBAAkB,IAAInB,UAAU"}
|
package/dist/ScreenReaderText.js
CHANGED
|
@@ -9,12 +9,13 @@
|
|
|
9
9
|
*
|
|
10
10
|
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
|
+
|
|
12
13
|
import { memo } from "react";
|
|
13
14
|
import { Box, visuallyHidden } from "./index.js";
|
|
14
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
const style = {
|
|
16
|
+
const style = {
|
|
17
|
+
...visuallyHidden
|
|
16
18
|
};
|
|
17
|
-
|
|
18
19
|
const ScreenReaderText = _ref => {
|
|
19
20
|
let {
|
|
20
21
|
children
|
|
@@ -24,7 +25,6 @@ const ScreenReaderText = _ref => {
|
|
|
24
25
|
children: children
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
|
-
|
|
28
28
|
const MemoizedScreenReaderText = memo(ScreenReaderText);
|
|
29
29
|
export { MemoizedScreenReaderText as ScreenReaderText };
|
|
30
30
|
//# sourceMappingURL=ScreenReaderText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenReaderText.js","names":["memo","Box","visuallyHidden","style","ScreenReaderText","children","MemoizedScreenReaderText"],"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, visuallyHidden } from \"./\";\n\nexport type ScreenReaderTextProps = {\n /**\n * The visually-hidden text.\n */\n children: ReactNode;\n};\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 }: ScreenReaderTextProps) => (\n <Box sx={style}>{children}</Box>\n);\n\nconst MemoizedScreenReaderText = memo(ScreenReaderText);\n\nexport { MemoizedScreenReaderText as ScreenReaderText };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"file":"ScreenReaderText.js","names":["memo","Box","visuallyHidden","jsx","_jsx","style","ScreenReaderText","_ref","children","sx","MemoizedScreenReaderText"],"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, visuallyHidden } from \"./\";\n\nexport type ScreenReaderTextProps = {\n /**\n * The visually-hidden text.\n */\n children: ReactNode;\n};\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 }: ScreenReaderTextProps) => (\n <Box sx={style}>{children}</Box>\n);\n\nconst MemoizedScreenReaderText = memo(ScreenReaderText);\n\nexport { MemoizedScreenReaderText as ScreenReaderText };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAC/BC,GAAG,EAAEC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAc5B,MAAMC,KAAK,GAAG;EAAE,GAAGH;AAAe,CAAC;AAEnC,MAAMI,gBAAgB,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAgC,CAAC,GAAAD,IAAA;EAAA,OAC3DH,IAAA,CAACH,GAAG;IAACQ,EAAE,EAAEJ,KAAM;IAAAG,QAAA,EAAEA;EAAQ,CAAM,CAAC;AAAA,CACjC;AAED,MAAME,wBAAwB,GAAGV,IAAI,CAACM,gBAAgB,CAAC;AAEvD,SAASI,wBAAwB,IAAIJ,gBAAgB"}
|
package/dist/SearchField.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import _InputBase from "@mui/material/InputBase";
|
|
2
2
|
import _InputAdornment from "@mui/material/InputAdornment";
|
|
3
|
+
/*!
|
|
4
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
5
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
6
|
+
*
|
|
7
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
8
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
*
|
|
12
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
3
14
|
import { forwardRef, memo, useCallback } from "react";
|
|
4
15
|
import { SearchIcon } from "./index.js";
|
|
5
16
|
import { Field } from "./Field.js";
|
|
@@ -7,7 +18,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
18
|
const SearchField = forwardRef((_ref, ref) => {
|
|
8
19
|
let {
|
|
9
20
|
autoCompleteType,
|
|
10
|
-
|
|
21
|
+
hasInitialFocus,
|
|
11
22
|
id: idOverride,
|
|
12
23
|
isDisabled = false,
|
|
13
24
|
label,
|
|
@@ -25,8 +36,9 @@ const SearchField = forwardRef((_ref, ref) => {
|
|
|
25
36
|
return _jsx(_InputBase, {
|
|
26
37
|
"aria-describedby": ariaDescribedBy,
|
|
27
38
|
autoComplete: autoCompleteType,
|
|
28
|
-
autoFocus:
|
|
39
|
+
autoFocus: hasInitialFocus,
|
|
29
40
|
id: id,
|
|
41
|
+
name: id,
|
|
30
42
|
onChange: onChange,
|
|
31
43
|
onFocus: onFocus,
|
|
32
44
|
onBlur: onBlur,
|
|
@@ -39,12 +51,13 @@ const SearchField = forwardRef((_ref, ref) => {
|
|
|
39
51
|
type: "search",
|
|
40
52
|
value: value
|
|
41
53
|
});
|
|
42
|
-
}, [autoCompleteType,
|
|
54
|
+
}, [autoCompleteType, hasInitialFocus, onChange, onFocus, onBlur, placeholder, ref, value]);
|
|
43
55
|
return _jsx(Field, {
|
|
56
|
+
fieldType: "single",
|
|
44
57
|
hasVisibleLabel: false,
|
|
45
58
|
id: idOverride,
|
|
46
59
|
isDisabled: isDisabled,
|
|
47
|
-
|
|
60
|
+
isOptional: true,
|
|
48
61
|
label: label,
|
|
49
62
|
renderFieldComponent: renderFieldComponent
|
|
50
63
|
});
|
package/dist/SearchField.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchField.js","names":["forwardRef","memo","useCallback","SearchIcon","Field","SearchField","ref","autoCompleteType","
|
|
1
|
+
{"version":3,"file":"SearchField.js","names":["forwardRef","memo","useCallback","SearchIcon","Field","jsx","_jsx","SearchField","_ref","ref","autoCompleteType","hasInitialFocus","id","idOverride","isDisabled","label","onChange","onFocus","onBlur","placeholder","value","renderFieldComponent","_ref2","ariaDescribedBy","_InputBase","autoComplete","autoFocus","name","startAdornment","_InputAdornment","position","children","type","fieldType","hasVisibleLabel","isOptional","MemoizedSearchField"],"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 } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n InputHTMLAttributes,\n memo,\n useCallback,\n} from \"react\";\n\nimport { SearchIcon } from \"./\";\nimport { Field } from \"./Field\";\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 * 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 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, required for a controlled component.\n */\n value?: string;\n};\n\nconst SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n (\n {\n autoCompleteType,\n hasInitialFocus,\n id: idOverride,\n isDisabled = false,\n label,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n value,\n },\n ref\n ) => {\n const renderFieldComponent = useCallback(\n ({ ariaDescribedBy, id }) => (\n <InputBase\n aria-describedby={ariaDescribedBy}\n autoComplete={autoCompleteType}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n id={id}\n name={id}\n onChange={onChange}\n onFocus={onFocus}\n onBlur={onBlur}\n placeholder={placeholder}\n ref={ref}\n startAdornment={\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n }\n type=\"search\"\n value={value}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n ref,\n value,\n ]\n );\n\n return (\n <Field\n fieldType=\"single\"\n hasVisibleLabel={false}\n id={idOverride}\n isDisabled={isDisabled}\n isOptional={true}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n }\n);\n\nconst MemoizedSearchField = memo(SearchField);\n\nexport { MemoizedSearchField as SearchField };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAGEA,UAAU,EAEVC,IAAI,EACJC,WAAW,QACN,OAAO;AAAC,SAENC,UAAU;AAAA,SACVC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AA+Cd,MAAMC,WAAW,GAAGP,UAAU,CAC5B,CAAAQ,IAAA,EAaEC,GAAG,KACA;EAAA,IAbH;IACEC,gBAAgB;IAChBC,eAAe;IACfC,EAAE,EAAEC,UAAU;IACdC,UAAU,GAAG,KAAK;IAClBC,KAAK;IACLC,QAAQ;IACRC,OAAO;IACPC,MAAM;IACNC,WAAW;IACXC;EACF,CAAC,GAAAZ,IAAA;EAGD,MAAMa,oBAAoB,GAAGnB,WAAW,CACtCoB,KAAA;IAAA,IAAC;MAAEC,eAAe;MAAEX;IAAG,CAAC,GAAAU,KAAA;IAAA,OACtBhB,IAAA,CAAAkB,UAAA;MACE,oBAAkBD,eAAgB;MAClCE,YAAY,EAAEf,gBAAiB;MAE/BgB,SAAS,EAAEf,eAAgB;MAC3BC,EAAE,EAAEA,EAAG;MACPe,IAAI,EAAEf,EAAG;MACTI,QAAQ,EAAEA,QAAS;MACnBC,OAAO,EAAEA,OAAQ;MACjBC,MAAM,EAAEA,MAAO;MACfC,WAAW,EAAEA,WAAY;MACzBV,GAAG,EAAEA,GAAI;MACTmB,cAAc,EACZtB,IAAA,CAAAuB,eAAA;QAAgBC,QAAQ,EAAC,OAAO;QAAAC,QAAA,EAC9BzB,IAAA,CAACH,UAAU,IAAE;MAAC,CACA,CACjB;MACD6B,IAAI,EAAC,QAAQ;MACbZ,KAAK,EAAEA;IAAM,CACd,CAAC;EAAA,CACH,EACD,CACEV,gBAAgB,EAChBC,eAAe,EACfK,QAAQ,EACRC,OAAO,EACPC,MAAM,EACNC,WAAW,EACXV,GAAG,EACHW,KAAK,CAET,CAAC;EAED,OACEd,IAAA,CAACF,KAAK;IACJ6B,SAAS,EAAC,QAAQ;IAClBC,eAAe,EAAE,KAAM;IACvBtB,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBqB,UAAU,EAAE,IAAK;IACjBpB,KAAK,EAAEA,KAAM;IACbM,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMe,mBAAmB,GAAGnC,IAAI,CAACM,WAAW,CAAC;AAE7C,SAAS6B,mBAAmB,IAAI7B,WAAW"}
|
package/dist/Select.js
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import _Select from "@mui/material/Select";
|
|
2
|
+
import _MenuItem from "@mui/material/MenuItem";
|
|
3
|
+
import _ListSubheader from "@mui/material/ListSubheader";
|
|
4
|
+
import _Box from "@mui/material/Box";
|
|
5
|
+
import _Chip from "@mui/material/Chip";
|
|
6
|
+
/*!
|
|
7
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
8
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
9
|
+
*
|
|
10
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
13
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
*
|
|
15
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { forwardRef, memo, useCallback, useState } from "react";
|
|
19
|
+
import { Checkbox } from "./Checkbox.js";
|
|
20
|
+
import { Field } from "./Field.js";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
const Select = forwardRef((_ref, ref) => {
|
|
24
|
+
let {
|
|
25
|
+
errorMessage,
|
|
26
|
+
hint,
|
|
27
|
+
id: idOverride,
|
|
28
|
+
isDisabled = false,
|
|
29
|
+
isMultiSelect = false,
|
|
30
|
+
isOptional = false,
|
|
31
|
+
label,
|
|
32
|
+
onBlur,
|
|
33
|
+
onChange: onChangeProp,
|
|
34
|
+
onFocus,
|
|
35
|
+
value,
|
|
36
|
+
options
|
|
37
|
+
} = _ref;
|
|
38
|
+
if (typeof value === "undefined") {
|
|
39
|
+
value = isMultiSelect ? [] : "";
|
|
40
|
+
}
|
|
41
|
+
const [selectedValue, setSelectedValue] = useState(value);
|
|
42
|
+
const onChange = useCallback((event, child) => {
|
|
43
|
+
const {
|
|
44
|
+
target: {
|
|
45
|
+
value
|
|
46
|
+
}
|
|
47
|
+
} = event;
|
|
48
|
+
if (isMultiSelect) {
|
|
49
|
+
setSelectedValue(typeof value === "string" ? value.split(",") : value);
|
|
50
|
+
} else {
|
|
51
|
+
setSelectedValue(value);
|
|
52
|
+
}
|
|
53
|
+
if (onChangeProp) {
|
|
54
|
+
onChangeProp(event, child);
|
|
55
|
+
}
|
|
56
|
+
}, [isMultiSelect, onChangeProp, setSelectedValue]);
|
|
57
|
+
const normalizedOptions = options.map(option => {
|
|
58
|
+
if (typeof option === "object") {
|
|
59
|
+
return {
|
|
60
|
+
text: option.text,
|
|
61
|
+
value: option.value || option.text,
|
|
62
|
+
type: option.type === "heading" ? "heading" : "option"
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
text: option,
|
|
67
|
+
value: option,
|
|
68
|
+
type: "option"
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
const renderValue = useCallback(selected => {
|
|
72
|
+
if (typeof selected === "string") {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
const renderedChips = selected.map(item => {
|
|
76
|
+
const selectedOption = normalizedOptions.find(option => option.value === item);
|
|
77
|
+
if (!selectedOption) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
return _jsx(_Chip, {
|
|
81
|
+
label: selectedOption.text
|
|
82
|
+
}, item);
|
|
83
|
+
}).filter(Boolean);
|
|
84
|
+
if (renderedChips.length === 0) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return _jsx(_Box, {
|
|
88
|
+
children: renderedChips
|
|
89
|
+
});
|
|
90
|
+
}, [normalizedOptions]);
|
|
91
|
+
const children = normalizedOptions.map(option => {
|
|
92
|
+
if (option.type === "heading") {
|
|
93
|
+
return _jsx(_ListSubheader, {
|
|
94
|
+
children: option.text
|
|
95
|
+
}, option.text);
|
|
96
|
+
}
|
|
97
|
+
return _jsxs(_MenuItem, {
|
|
98
|
+
value: option.value,
|
|
99
|
+
children: [isMultiSelect && _jsx(Checkbox, {
|
|
100
|
+
isChecked: selectedValue.includes(option.value)
|
|
101
|
+
}), option.text]
|
|
102
|
+
}, option.value);
|
|
103
|
+
});
|
|
104
|
+
const renderFieldComponent = useCallback(() => _jsx(_Select, {
|
|
105
|
+
id: idOverride,
|
|
106
|
+
name: idOverride,
|
|
107
|
+
multiple: isMultiSelect,
|
|
108
|
+
onBlur: onBlur,
|
|
109
|
+
onChange: onChange,
|
|
110
|
+
onFocus: onFocus,
|
|
111
|
+
ref: ref,
|
|
112
|
+
children: children,
|
|
113
|
+
renderValue: isMultiSelect ? renderValue : undefined,
|
|
114
|
+
value: selectedValue
|
|
115
|
+
}), [idOverride, isMultiSelect, onBlur, onChange, onFocus, ref, children, renderValue, selectedValue]);
|
|
116
|
+
return _jsx(Field, {
|
|
117
|
+
errorMessage: errorMessage,
|
|
118
|
+
fieldType: "single",
|
|
119
|
+
hasVisibleLabel: true,
|
|
120
|
+
hint: hint,
|
|
121
|
+
id: idOverride,
|
|
122
|
+
isDisabled: isDisabled,
|
|
123
|
+
isOptional: isOptional,
|
|
124
|
+
label: label,
|
|
125
|
+
renderFieldComponent: renderFieldComponent
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
const MemoizedSelect = memo(Select);
|
|
129
|
+
MemoizedSelect.displayName = "Select";
|
|
130
|
+
export { MemoizedSelect as Select };
|
|
131
|
+
//# sourceMappingURL=Select.js.map
|