@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
package/src/PasswordField.tsx
CHANGED
|
@@ -24,10 +24,6 @@ import { EyeIcon, EyeOffIcon, IconButton } from "./";
|
|
|
24
24
|
import { Field } from "./Field";
|
|
25
25
|
|
|
26
26
|
export type PasswordFieldProps = {
|
|
27
|
-
/**
|
|
28
|
-
* If `true`, the component will receive focus automatically.
|
|
29
|
-
*/
|
|
30
|
-
autoFocus?: boolean;
|
|
31
27
|
/**
|
|
32
28
|
* This prop helps users to fill forms faster, especially on mobile devices.
|
|
33
29
|
* The name can be confusing, as it's more like an autofill.
|
|
@@ -38,6 +34,10 @@ export type PasswordFieldProps = {
|
|
|
38
34
|
* If `error` is not undefined, the `input` will indicate an error.
|
|
39
35
|
*/
|
|
40
36
|
errorMessage?: string;
|
|
37
|
+
/**
|
|
38
|
+
* If `true`, the component will receive focus automatically.
|
|
39
|
+
*/
|
|
40
|
+
hasInitialFocus?: boolean;
|
|
41
41
|
/**
|
|
42
42
|
* The helper text content.
|
|
43
43
|
*/
|
|
@@ -51,13 +51,13 @@ export type PasswordFieldProps = {
|
|
|
51
51
|
*/
|
|
52
52
|
isDisabled?: boolean;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* If `true`, the `input` element is not required.
|
|
55
55
|
*/
|
|
56
|
-
|
|
56
|
+
isOptional?: boolean;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* It prevents the user from changing the value of the field
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
isReadOnly?: boolean;
|
|
61
61
|
/**
|
|
62
62
|
* The label for the `input` element.
|
|
63
63
|
*/
|
|
@@ -88,11 +88,12 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
88
88
|
(
|
|
89
89
|
{
|
|
90
90
|
autoCompleteType,
|
|
91
|
-
autoFocus,
|
|
92
91
|
errorMessage,
|
|
92
|
+
hasInitialFocus,
|
|
93
93
|
hint,
|
|
94
94
|
id: idOverride,
|
|
95
95
|
isDisabled = false,
|
|
96
|
+
isOptional = false,
|
|
96
97
|
isReadOnly,
|
|
97
98
|
label,
|
|
98
99
|
onChange,
|
|
@@ -117,7 +118,7 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
117
118
|
aria-describedby={ariaDescribedBy}
|
|
118
119
|
autoComplete={autoCompleteType}
|
|
119
120
|
/* eslint-disable-next-line jsx-a11y/no-autofocus */
|
|
120
|
-
autoFocus={
|
|
121
|
+
autoFocus={hasInitialFocus}
|
|
121
122
|
endAdornment={
|
|
122
123
|
<InputAdornment position="end">
|
|
123
124
|
<IconButton
|
|
@@ -130,25 +131,28 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
130
131
|
</InputAdornment>
|
|
131
132
|
}
|
|
132
133
|
id={id}
|
|
134
|
+
name={id}
|
|
133
135
|
onChange={onChange}
|
|
134
136
|
onFocus={onFocus}
|
|
135
137
|
onBlur={onBlur}
|
|
136
138
|
placeholder={placeholder}
|
|
137
139
|
readOnly={isReadOnly}
|
|
138
140
|
ref={ref}
|
|
141
|
+
required={!isOptional}
|
|
139
142
|
type={inputType}
|
|
140
143
|
value={value}
|
|
141
144
|
/>
|
|
142
145
|
),
|
|
143
146
|
[
|
|
144
147
|
autoCompleteType,
|
|
145
|
-
|
|
148
|
+
hasInitialFocus,
|
|
146
149
|
togglePasswordVisibility,
|
|
147
150
|
inputType,
|
|
148
151
|
onChange,
|
|
149
152
|
onFocus,
|
|
150
153
|
onBlur,
|
|
151
154
|
placeholder,
|
|
155
|
+
isOptional,
|
|
152
156
|
isReadOnly,
|
|
153
157
|
ref,
|
|
154
158
|
value,
|
|
@@ -158,10 +162,12 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
158
162
|
return (
|
|
159
163
|
<Field
|
|
160
164
|
errorMessage={errorMessage}
|
|
165
|
+
fieldType="single"
|
|
161
166
|
hasVisibleLabel
|
|
162
167
|
hint={hint}
|
|
163
168
|
id={idOverride}
|
|
164
169
|
isDisabled={isDisabled}
|
|
170
|
+
isOptional={isOptional}
|
|
165
171
|
label={label}
|
|
166
172
|
renderFieldComponent={renderFieldComponent}
|
|
167
173
|
/>
|
|
@@ -170,5 +176,6 @@ const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(
|
|
|
170
176
|
);
|
|
171
177
|
|
|
172
178
|
const MemoizedPasswordField = memo(PasswordField);
|
|
179
|
+
MemoizedPasswordField.displayName = "PasswordField";
|
|
173
180
|
|
|
174
181
|
export { MemoizedPasswordField as PasswordField };
|
package/src/RadioGroup.tsx
CHANGED
|
@@ -11,19 +11,12 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { RadioGroup as MuiRadioGroup } from "@mui/material";
|
|
14
|
-
import { ChangeEventHandler, memo, ReactElement,
|
|
14
|
+
import { ChangeEventHandler, memo, ReactElement, useCallback } from "react";
|
|
15
15
|
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
FormLabel,
|
|
19
|
-
FormHelperText,
|
|
20
|
-
Radio,
|
|
21
|
-
ScreenReaderText,
|
|
22
|
-
useUniqueId,
|
|
23
|
-
RadioProps,
|
|
24
|
-
} from ".";
|
|
16
|
+
import { Radio, RadioProps } from "./Radio";
|
|
17
|
+
import { Field } from "./Field";
|
|
25
18
|
|
|
26
|
-
export
|
|
19
|
+
export type RadioGroupProps = {
|
|
27
20
|
/**
|
|
28
21
|
* The <Radio> components within the group. Must include two or more.
|
|
29
22
|
*/
|
|
@@ -40,6 +33,10 @@ export interface RadioGroupProps {
|
|
|
40
33
|
* Optional hint text
|
|
41
34
|
*/
|
|
42
35
|
hint?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The id of the `input` element. This will also be the input's `name` field.
|
|
38
|
+
*/
|
|
39
|
+
id?: string;
|
|
43
40
|
/**
|
|
44
41
|
* Disables the whole radio group
|
|
45
42
|
*/
|
|
@@ -48,10 +45,6 @@ export interface RadioGroupProps {
|
|
|
48
45
|
* The text label for the radio group
|
|
49
46
|
*/
|
|
50
47
|
label: string;
|
|
51
|
-
/**
|
|
52
|
-
* The name of the radio group, which only needs to be changed if there are multiple radio groups on the same screen
|
|
53
|
-
*/
|
|
54
|
-
name?: string;
|
|
55
48
|
/**
|
|
56
49
|
* Listen for changes in the browser that change `value`.
|
|
57
50
|
*/
|
|
@@ -60,54 +53,46 @@ export interface RadioGroupProps {
|
|
|
60
53
|
* The `value` on the selected radio button.
|
|
61
54
|
*/
|
|
62
55
|
value?: RadioProps["value"];
|
|
63
|
-
}
|
|
56
|
+
};
|
|
64
57
|
|
|
65
58
|
const RadioGroup = ({
|
|
66
59
|
children,
|
|
67
60
|
defaultValue,
|
|
68
61
|
errorMessage,
|
|
69
62
|
hint,
|
|
63
|
+
id: idOverride,
|
|
70
64
|
isDisabled,
|
|
71
65
|
label,
|
|
72
|
-
name,
|
|
73
66
|
onChange,
|
|
67
|
+
value,
|
|
74
68
|
}: RadioGroupProps) => {
|
|
75
|
-
const
|
|
76
|
-
() =>
|
|
77
|
-
errorMessage || hint
|
|
78
|
-
? [hint && `${name}-hint`, errorMessage && `${name}-error`]
|
|
79
|
-
.filter(Boolean)
|
|
80
|
-
.join(" ")
|
|
81
|
-
: undefined,
|
|
82
|
-
[errorMessage, hint, name]
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
const uniqueName = useUniqueId(name);
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<FormControl
|
|
89
|
-
component="fieldset"
|
|
90
|
-
disabled={isDisabled}
|
|
91
|
-
error={Boolean(errorMessage)}
|
|
92
|
-
>
|
|
93
|
-
<FormLabel component="legend">{label}</FormLabel>
|
|
94
|
-
{hint && (
|
|
95
|
-
<FormHelperText id={`${uniqueName}-hint`}>{hint}</FormHelperText>
|
|
96
|
-
)}
|
|
69
|
+
const renderFieldComponent = useCallback(
|
|
70
|
+
({ ariaDescribedBy, id }) => (
|
|
97
71
|
<MuiRadioGroup
|
|
98
72
|
aria-describedby={ariaDescribedBy}
|
|
99
73
|
defaultValue={defaultValue}
|
|
100
|
-
|
|
74
|
+
id={id}
|
|
75
|
+
name={id}
|
|
101
76
|
onChange={onChange}
|
|
77
|
+
value={value}
|
|
102
78
|
>
|
|
103
79
|
{children}
|
|
104
80
|
</MuiRadioGroup>
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
81
|
+
),
|
|
82
|
+
[children, defaultValue, onChange, value]
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<Field
|
|
87
|
+
errorMessage={errorMessage}
|
|
88
|
+
fieldType="group"
|
|
89
|
+
hasVisibleLabel={false}
|
|
90
|
+
hint={hint}
|
|
91
|
+
id={idOverride}
|
|
92
|
+
isDisabled={isDisabled}
|
|
93
|
+
label={label}
|
|
94
|
+
renderFieldComponent={renderFieldComponent}
|
|
95
|
+
/>
|
|
111
96
|
);
|
|
112
97
|
};
|
|
113
98
|
|
package/src/SearchField.tsx
CHANGED
|
@@ -24,16 +24,16 @@ import { SearchIcon } from "./";
|
|
|
24
24
|
import { Field } from "./Field";
|
|
25
25
|
|
|
26
26
|
export type SearchFieldProps = {
|
|
27
|
-
/**
|
|
28
|
-
* If `true`, the component will receive focus automatically.
|
|
29
|
-
*/
|
|
30
|
-
autoFocus?: boolean;
|
|
31
27
|
/**
|
|
32
28
|
* This prop helps users to fill forms faster, especially on mobile devices.
|
|
33
29
|
* The name can be confusing, as it's more like an autofill.
|
|
34
30
|
* You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).
|
|
35
31
|
*/
|
|
36
32
|
autoCompleteType?: InputHTMLAttributes<HTMLInputElement>["autoComplete"];
|
|
33
|
+
/**
|
|
34
|
+
* If `true`, the component will receive focus automatically.
|
|
35
|
+
*/
|
|
36
|
+
hasInitialFocus?: boolean;
|
|
37
37
|
/**
|
|
38
38
|
* The id of the `input` element.
|
|
39
39
|
*/
|
|
@@ -72,7 +72,7 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
72
72
|
(
|
|
73
73
|
{
|
|
74
74
|
autoCompleteType,
|
|
75
|
-
|
|
75
|
+
hasInitialFocus,
|
|
76
76
|
id: idOverride,
|
|
77
77
|
isDisabled = false,
|
|
78
78
|
label,
|
|
@@ -90,8 +90,9 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
90
90
|
aria-describedby={ariaDescribedBy}
|
|
91
91
|
autoComplete={autoCompleteType}
|
|
92
92
|
/* eslint-disable-next-line jsx-a11y/no-autofocus */
|
|
93
|
-
autoFocus={
|
|
93
|
+
autoFocus={hasInitialFocus}
|
|
94
94
|
id={id}
|
|
95
|
+
name={id}
|
|
95
96
|
onChange={onChange}
|
|
96
97
|
onFocus={onFocus}
|
|
97
98
|
onBlur={onBlur}
|
|
@@ -108,7 +109,7 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
108
109
|
),
|
|
109
110
|
[
|
|
110
111
|
autoCompleteType,
|
|
111
|
-
|
|
112
|
+
hasInitialFocus,
|
|
112
113
|
onChange,
|
|
113
114
|
onFocus,
|
|
114
115
|
onBlur,
|
|
@@ -120,10 +121,11 @@ const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(
|
|
|
120
121
|
|
|
121
122
|
return (
|
|
122
123
|
<Field
|
|
124
|
+
fieldType="single"
|
|
123
125
|
hasVisibleLabel={false}
|
|
124
126
|
id={idOverride}
|
|
125
127
|
isDisabled={isDisabled}
|
|
126
|
-
|
|
128
|
+
isOptional={true}
|
|
127
129
|
label={label}
|
|
128
130
|
renderFieldComponent={renderFieldComponent}
|
|
129
131
|
/>
|
package/src/Select.tsx
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { ReactNode, forwardRef, memo, useCallback, useState } from "react";
|
|
14
|
+
import {
|
|
15
|
+
Box,
|
|
16
|
+
Chip,
|
|
17
|
+
ListSubheader,
|
|
18
|
+
MenuItem,
|
|
19
|
+
Select as MuiSelect,
|
|
20
|
+
SelectChangeEvent,
|
|
21
|
+
} from "@mui/material";
|
|
22
|
+
import { SelectProps as MuiSelectProps } from "@mui/material";
|
|
23
|
+
import { Checkbox } from "./Checkbox";
|
|
24
|
+
import { Field } from "./Field";
|
|
25
|
+
|
|
26
|
+
export type SelectOption = {
|
|
27
|
+
text: string;
|
|
28
|
+
value?: string;
|
|
29
|
+
type?: "heading" | "option";
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type SelectProps = {
|
|
33
|
+
errorMessage?: string;
|
|
34
|
+
hint?: string;
|
|
35
|
+
id?: string;
|
|
36
|
+
isDisabled?: boolean;
|
|
37
|
+
isMultiSelect?: boolean;
|
|
38
|
+
isOptional?: boolean;
|
|
39
|
+
label: string;
|
|
40
|
+
onBlur?: MuiSelectProps["onBlur"];
|
|
41
|
+
onChange?: MuiSelectProps["onChange"];
|
|
42
|
+
onFocus?: MuiSelectProps["onFocus"];
|
|
43
|
+
options: (string | SelectOption)[];
|
|
44
|
+
value?: string | string[];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Options in Odyssey <Select> are passed as an array, which can contain any combination
|
|
49
|
+
* of the following:
|
|
50
|
+
* - string — A simple string. The string will be both the text and the value of the resulting option.
|
|
51
|
+
* <option value="string">string</option>
|
|
52
|
+
*
|
|
53
|
+
* - { text: string } — Same as above, but the string is contained within an object.
|
|
54
|
+
* <option value="text">text</option>
|
|
55
|
+
*
|
|
56
|
+
* - { text: string, value: string } — The option text will be text, and the option value will be value.
|
|
57
|
+
* <option value="value">text</option>
|
|
58
|
+
*
|
|
59
|
+
* - { text: string, type: "heading" } — Used to display a group heading with the text
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
const Select = forwardRef<HTMLSelectElement, SelectProps>(
|
|
63
|
+
(
|
|
64
|
+
{
|
|
65
|
+
errorMessage,
|
|
66
|
+
hint,
|
|
67
|
+
id: idOverride,
|
|
68
|
+
isDisabled = false,
|
|
69
|
+
isMultiSelect = false,
|
|
70
|
+
isOptional = false,
|
|
71
|
+
label,
|
|
72
|
+
onBlur,
|
|
73
|
+
onChange: onChangeProp,
|
|
74
|
+
onFocus,
|
|
75
|
+
value,
|
|
76
|
+
options,
|
|
77
|
+
},
|
|
78
|
+
ref
|
|
79
|
+
) => {
|
|
80
|
+
// If there's no value set, we set it to a blank string (if it's a single-select)
|
|
81
|
+
// or an empty array (if it's a multi-select)
|
|
82
|
+
if (typeof value === "undefined") {
|
|
83
|
+
value = isMultiSelect ? [] : "";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const [selectedValue, setSelectedValue] = useState<string | string[]>(
|
|
87
|
+
value
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const onChange = useCallback(
|
|
91
|
+
(event: SelectChangeEvent<string | string[]>, child: ReactNode) => {
|
|
92
|
+
const {
|
|
93
|
+
target: { value },
|
|
94
|
+
} = event;
|
|
95
|
+
|
|
96
|
+
// Set the field value, with some additional logic to handle array values
|
|
97
|
+
// for multi-selects
|
|
98
|
+
if (isMultiSelect) {
|
|
99
|
+
setSelectedValue(
|
|
100
|
+
typeof value === "string" ? value.split(",") : value
|
|
101
|
+
);
|
|
102
|
+
} else {
|
|
103
|
+
setSelectedValue(value);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Trigger the onChange event, if one has been passed
|
|
107
|
+
if (onChangeProp) {
|
|
108
|
+
onChangeProp(event, child);
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
[isMultiSelect, onChangeProp, setSelectedValue]
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
// Normalize the options array to accommodate the various
|
|
115
|
+
// data types that might be passed
|
|
116
|
+
const normalizedOptions = options.map((option) => {
|
|
117
|
+
if (typeof option === "object") {
|
|
118
|
+
return {
|
|
119
|
+
text: option.text,
|
|
120
|
+
value: option.value || option.text,
|
|
121
|
+
type: option.type === "heading" ? "heading" : "option",
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return { text: option, value: option, type: "option" };
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const renderValue = useCallback(
|
|
129
|
+
(selected: string | string[]) => {
|
|
130
|
+
// If the selected value isn't an array, then we don't need to display
|
|
131
|
+
// chips and should fall back to the default render behavior
|
|
132
|
+
if (typeof selected === "string") {
|
|
133
|
+
return undefined;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Convert the selected options array into <Chip>s
|
|
137
|
+
const renderedChips = selected
|
|
138
|
+
.map((item: string) => {
|
|
139
|
+
const selectedOption = normalizedOptions.find(
|
|
140
|
+
(option) => option.value === item
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
if (!selectedOption) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return <Chip key={item} label={selectedOption.text} />;
|
|
148
|
+
})
|
|
149
|
+
.filter(Boolean);
|
|
150
|
+
|
|
151
|
+
if (renderedChips.length === 0) {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// We need the <Box> to surround the <Chip>s for
|
|
156
|
+
// proper styling
|
|
157
|
+
return <Box>{renderedChips}</Box>;
|
|
158
|
+
},
|
|
159
|
+
[normalizedOptions]
|
|
160
|
+
);
|
|
161
|
+
|
|
162
|
+
// Convert the options into the ReactNode children
|
|
163
|
+
// that will populate the <Select>
|
|
164
|
+
const children = normalizedOptions.map((option) => {
|
|
165
|
+
if (option.type === "heading") {
|
|
166
|
+
return <ListSubheader key={option.text}>{option.text}</ListSubheader>;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
<MenuItem key={option.value} value={option.value}>
|
|
171
|
+
{isMultiSelect && (
|
|
172
|
+
<Checkbox isChecked={selectedValue.includes(option.value)} />
|
|
173
|
+
)}
|
|
174
|
+
{option.text}
|
|
175
|
+
</MenuItem>
|
|
176
|
+
);
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const renderFieldComponent = useCallback(
|
|
180
|
+
() => (
|
|
181
|
+
<MuiSelect
|
|
182
|
+
id={idOverride}
|
|
183
|
+
name={idOverride}
|
|
184
|
+
multiple={isMultiSelect}
|
|
185
|
+
onBlur={onBlur}
|
|
186
|
+
onChange={onChange}
|
|
187
|
+
onFocus={onFocus}
|
|
188
|
+
ref={ref}
|
|
189
|
+
children={children}
|
|
190
|
+
renderValue={isMultiSelect ? renderValue : undefined}
|
|
191
|
+
value={selectedValue}
|
|
192
|
+
/>
|
|
193
|
+
),
|
|
194
|
+
[
|
|
195
|
+
idOverride,
|
|
196
|
+
isMultiSelect,
|
|
197
|
+
onBlur,
|
|
198
|
+
onChange,
|
|
199
|
+
onFocus,
|
|
200
|
+
ref,
|
|
201
|
+
children,
|
|
202
|
+
renderValue,
|
|
203
|
+
selectedValue,
|
|
204
|
+
]
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
return (
|
|
208
|
+
<Field
|
|
209
|
+
errorMessage={errorMessage}
|
|
210
|
+
fieldType="single"
|
|
211
|
+
hasVisibleLabel
|
|
212
|
+
hint={hint}
|
|
213
|
+
id={idOverride}
|
|
214
|
+
isDisabled={isDisabled}
|
|
215
|
+
isOptional={isOptional}
|
|
216
|
+
label={label}
|
|
217
|
+
renderFieldComponent={renderFieldComponent}
|
|
218
|
+
/>
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
|
|
223
|
+
const MemoizedSelect = memo(Select);
|
|
224
|
+
MemoizedSelect.displayName = "Select";
|
|
225
|
+
|
|
226
|
+
export { MemoizedSelect as Select };
|
package/src/Status.tsx
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { Chip } from "./";
|
|
14
14
|
|
|
15
|
-
export
|
|
15
|
+
export type StatusProps = {
|
|
16
16
|
/**
|
|
17
17
|
* Determine the color and icon of the alert
|
|
18
18
|
*/
|
|
@@ -22,7 +22,7 @@ export interface StatusProps {
|
|
|
22
22
|
* The text content of the status
|
|
23
23
|
*/
|
|
24
24
|
label: string;
|
|
25
|
-
}
|
|
25
|
+
};
|
|
26
26
|
|
|
27
27
|
export const Status = ({ severity, label }: StatusProps) => (
|
|
28
28
|
<Chip label={label} color={severity} variant="status" />
|
package/src/Tabs.tsx
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
|
|
3
|
+
* The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
|
|
4
|
+
*
|
|
5
|
+
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7
|
+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
8
|
+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
9
|
+
*
|
|
10
|
+
* See the License for the specific language governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import React, { ReactElement, ReactNode, useCallback, useState } from "react";
|
|
14
|
+
import { Tab as MuiTab } from "@mui/material";
|
|
15
|
+
import {
|
|
16
|
+
TabList as MuiTabList,
|
|
17
|
+
TabPanel as MuiTabPanel,
|
|
18
|
+
TabContext as MuiTabContext,
|
|
19
|
+
} from "@mui/lab";
|
|
20
|
+
|
|
21
|
+
export type TabItemProps = {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
startIcon?: ReactElement;
|
|
24
|
+
label: string;
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
value?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type TabsProps = {
|
|
30
|
+
tabs: TabItemProps[];
|
|
31
|
+
initialValue?: string;
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const Tabs = ({ ariaLabel, tabs, initialValue = "0" }: TabsProps) => {
|
|
36
|
+
const [tabState, setTabState] = useState(initialValue);
|
|
37
|
+
|
|
38
|
+
const onChange = useCallback(
|
|
39
|
+
(_event: React.SyntheticEvent, newState: string) => {
|
|
40
|
+
setTabState(newState);
|
|
41
|
+
},
|
|
42
|
+
[]
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<MuiTabContext value={tabState}>
|
|
47
|
+
<MuiTabList onChange={onChange} aria-label={ariaLabel}>
|
|
48
|
+
{tabs.map((tab, index) => (
|
|
49
|
+
<MuiTab
|
|
50
|
+
disabled={tab.isDisabled}
|
|
51
|
+
icon={tab.startIcon}
|
|
52
|
+
label={tab.label}
|
|
53
|
+
value={tab.value ? tab.value : index.toString()}
|
|
54
|
+
key={tab.value ? tab.value : index.toString()}
|
|
55
|
+
/>
|
|
56
|
+
))}
|
|
57
|
+
</MuiTabList>
|
|
58
|
+
{tabs.map((tab, index) => (
|
|
59
|
+
<MuiTabPanel
|
|
60
|
+
value={tab.value ? tab.value : index.toString()}
|
|
61
|
+
key={tab.value ? tab.value : index.toString()}
|
|
62
|
+
>
|
|
63
|
+
{tab.children}
|
|
64
|
+
</MuiTabPanel>
|
|
65
|
+
))}
|
|
66
|
+
</MuiTabContext>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { Tabs };
|