@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/Link.tsx
CHANGED
|
@@ -12,17 +12,25 @@
|
|
|
12
12
|
|
|
13
13
|
import { forwardRef, ReactElement } from "react";
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
|
|
15
|
+
import {
|
|
16
|
+
Link as MuiLink,
|
|
17
|
+
LinkProps as MuiLinkProps,
|
|
18
|
+
SvgIcon,
|
|
19
|
+
} from "@mui/material";
|
|
17
20
|
|
|
18
|
-
export
|
|
21
|
+
export type LinkProps = {
|
|
22
|
+
children: React.ReactNode;
|
|
23
|
+
href: string;
|
|
19
24
|
icon?: ReactElement;
|
|
20
|
-
|
|
25
|
+
rel?: string;
|
|
26
|
+
target?: "_self" | "_blank" | "_parent" | "_top" | string;
|
|
27
|
+
variant?: MuiLinkProps["variant"];
|
|
28
|
+
};
|
|
21
29
|
|
|
22
30
|
export const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {
|
|
23
|
-
const { icon, children, target } = props;
|
|
31
|
+
const { icon, children, target, variant, href, rel } = props;
|
|
24
32
|
return (
|
|
25
|
-
<MuiLink {
|
|
33
|
+
<MuiLink ref={ref} variant={variant} target={target} href={href} rel={rel}>
|
|
26
34
|
{icon && <span className="Link-icon">{icon}</span>}
|
|
27
35
|
{children}
|
|
28
36
|
{target === "_blank" && (
|
package/src/MenuButton.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./";
|
|
23
23
|
import { memo, MouseEvent, ReactElement, useMemo, useState } from "react";
|
|
24
24
|
|
|
25
|
-
export
|
|
25
|
+
export type MenuButtonProps = {
|
|
26
26
|
/**
|
|
27
27
|
* The <MenuItem> components within the Menu.
|
|
28
28
|
*/
|
|
@@ -41,13 +41,18 @@ export interface MenuButtonProps {
|
|
|
41
41
|
* The variant of the triggering Button
|
|
42
42
|
*/
|
|
43
43
|
buttonVariant?: ButtonProps["variant"];
|
|
44
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The id of the `input` element.
|
|
46
|
+
*/
|
|
47
|
+
id?: string;
|
|
48
|
+
};
|
|
45
49
|
|
|
46
50
|
const MenuButton = ({
|
|
47
51
|
buttonLabel = "",
|
|
48
52
|
children,
|
|
49
53
|
buttonEndIcon = <ChevronDownIcon />,
|
|
50
54
|
buttonVariant = "secondary",
|
|
55
|
+
id: idOverride,
|
|
51
56
|
}: MenuButtonProps) => {
|
|
52
57
|
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
|
|
53
58
|
|
|
@@ -61,7 +66,7 @@ const MenuButton = ({
|
|
|
61
66
|
setAnchorEl(null);
|
|
62
67
|
};
|
|
63
68
|
|
|
64
|
-
const uniqueId = useUniqueId();
|
|
69
|
+
const uniqueId = useUniqueId(idOverride);
|
|
65
70
|
|
|
66
71
|
const menuListProps = useMemo(
|
|
67
72
|
() => ({ "aria-labelledby": `${uniqueId}-button` }),
|
package/src/MenuItem.tsx
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
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 { forwardRef, memo, ReactNode, useMemo } from "react";
|
|
14
|
+
|
|
15
|
+
import { MuiPropsContext, MuiPropsContextType } from "./MuiPropsContext";
|
|
16
|
+
|
|
17
|
+
export type MuiPropsChildProps = {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const MuiPropsChild = forwardRef<HTMLElement, MuiPropsChildProps>(
|
|
22
|
+
({ children, ...muiProps }, ref) => {
|
|
23
|
+
const providerValue = useMemo<MuiPropsContextType>(
|
|
24
|
+
() => ({
|
|
25
|
+
...muiProps,
|
|
26
|
+
ref,
|
|
27
|
+
}),
|
|
28
|
+
[muiProps, ref]
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<MuiPropsContext.Provider value={providerValue}>
|
|
33
|
+
{children}
|
|
34
|
+
</MuiPropsContext.Provider>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const MemoizedMuiPropsChild = memo(MuiPropsChild);
|
|
40
|
+
|
|
41
|
+
export { MemoizedMuiPropsChild as MuiPropsChild };
|
|
@@ -0,0 +1,17 @@
|
|
|
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 { createContext } from "react";
|
|
14
|
+
|
|
15
|
+
export type MuiPropsContextType = Record<string, unknown>;
|
|
16
|
+
|
|
17
|
+
export const MuiPropsContext = createContext<MuiPropsContextType>({});
|
|
@@ -0,0 +1,107 @@
|
|
|
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 { ReactElement, forwardRef, memo, useCallback } from "react";
|
|
14
|
+
import { Select as MuiSelect } from "@mui/material";
|
|
15
|
+
import { SelectProps as MuiSelectProps } from "@mui/material";
|
|
16
|
+
import { Field } from "./Field";
|
|
17
|
+
|
|
18
|
+
export type NativeSelectOption = {
|
|
19
|
+
text: string;
|
|
20
|
+
value?: string;
|
|
21
|
+
type?: "heading" | "option";
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type NativeSelectProps = {
|
|
25
|
+
children?: ReactElement<"option"> | ReactElement<"optgroup">;
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
errorMessage?: string;
|
|
28
|
+
hint?: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
isDisabled?: boolean;
|
|
31
|
+
isMultiSelect?: boolean;
|
|
32
|
+
isOptional?: boolean;
|
|
33
|
+
label: string;
|
|
34
|
+
onBlur?: MuiSelectProps["onBlur"];
|
|
35
|
+
onChange?: MuiSelectProps["onChange"];
|
|
36
|
+
onFocus?: MuiSelectProps["onFocus"];
|
|
37
|
+
value?: string | string[];
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const NativeSelect = forwardRef<HTMLSelectElement, NativeSelectProps>(
|
|
41
|
+
(
|
|
42
|
+
{
|
|
43
|
+
defaultValue,
|
|
44
|
+
errorMessage,
|
|
45
|
+
hint,
|
|
46
|
+
id: idOverride,
|
|
47
|
+
isDisabled = false,
|
|
48
|
+
isMultiSelect = false,
|
|
49
|
+
isOptional = false,
|
|
50
|
+
label,
|
|
51
|
+
onBlur,
|
|
52
|
+
onChange,
|
|
53
|
+
onFocus,
|
|
54
|
+
value,
|
|
55
|
+
children,
|
|
56
|
+
},
|
|
57
|
+
ref
|
|
58
|
+
) => {
|
|
59
|
+
const renderFieldComponent = useCallback(
|
|
60
|
+
() => (
|
|
61
|
+
<MuiSelect
|
|
62
|
+
defaultValue={defaultValue}
|
|
63
|
+
id={idOverride}
|
|
64
|
+
name={idOverride}
|
|
65
|
+
multiple={isMultiSelect}
|
|
66
|
+
native={true}
|
|
67
|
+
onBlur={onBlur}
|
|
68
|
+
onChange={onChange}
|
|
69
|
+
onFocus={onFocus}
|
|
70
|
+
ref={ref}
|
|
71
|
+
value={value}
|
|
72
|
+
children={children}
|
|
73
|
+
/>
|
|
74
|
+
),
|
|
75
|
+
[
|
|
76
|
+
defaultValue,
|
|
77
|
+
idOverride,
|
|
78
|
+
isMultiSelect,
|
|
79
|
+
onBlur,
|
|
80
|
+
onChange,
|
|
81
|
+
onFocus,
|
|
82
|
+
ref,
|
|
83
|
+
children,
|
|
84
|
+
value,
|
|
85
|
+
]
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<Field
|
|
90
|
+
errorMessage={errorMessage}
|
|
91
|
+
fieldType="single"
|
|
92
|
+
hasVisibleLabel
|
|
93
|
+
hint={hint}
|
|
94
|
+
id={idOverride}
|
|
95
|
+
isDisabled={isDisabled}
|
|
96
|
+
isOptional={isOptional}
|
|
97
|
+
label={label}
|
|
98
|
+
renderFieldComponent={renderFieldComponent}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const MemoizedNativeSelect = memo(NativeSelect);
|
|
105
|
+
MemoizedNativeSelect.displayName = "NativeSelect";
|
|
106
|
+
|
|
107
|
+
export { MemoizedNativeSelect as NativeSelect };
|
|
@@ -0,0 +1,101 @@
|
|
|
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 i18n from "i18next";
|
|
14
|
+
import { initReactI18next } from "react-i18next";
|
|
15
|
+
|
|
16
|
+
import { translation as cs } from "./properties/ts/odyssey-react-mui_cs";
|
|
17
|
+
import { translation as da } from "./properties/ts/odyssey-react-mui_da";
|
|
18
|
+
import { translation as de } from "./properties/ts/odyssey-react-mui_de";
|
|
19
|
+
import { translation as el } from "./properties/ts/odyssey-react-mui_el";
|
|
20
|
+
import { translation as en } from "./properties/ts/odyssey-react-mui";
|
|
21
|
+
import { translation as es } from "./properties/ts/odyssey-react-mui_es";
|
|
22
|
+
import { translation as fi } from "./properties/ts/odyssey-react-mui_fi";
|
|
23
|
+
import { translation as fr } from "./properties/ts/odyssey-react-mui_fr";
|
|
24
|
+
import { translation as hu } from "./properties/ts/odyssey-react-mui_hu";
|
|
25
|
+
import { translation as id } from "./properties/ts/odyssey-react-mui_id";
|
|
26
|
+
import { translation as it } from "./properties/ts/odyssey-react-mui_it";
|
|
27
|
+
import { translation as ja } from "./properties/ts/odyssey-react-mui_ja";
|
|
28
|
+
import { translation as ko } from "./properties/ts/odyssey-react-mui_ko";
|
|
29
|
+
import { translation as ms } from "./properties/ts/odyssey-react-mui_ms";
|
|
30
|
+
import { translation as nb } from "./properties/ts/odyssey-react-mui_nb";
|
|
31
|
+
import { translation as nlNL } from "./properties/ts/odyssey-react-mui_nl-NL";
|
|
32
|
+
import { translation as pl } from "./properties/ts/odyssey-react-mui_pl";
|
|
33
|
+
import { translation as ptBR } from "./properties/ts/odyssey-react-mui_pt-BR";
|
|
34
|
+
import { translation as ro } from "./properties/ts/odyssey-react-mui_ro";
|
|
35
|
+
import { translation as ru } from "./properties/ts/odyssey-react-mui_ru";
|
|
36
|
+
import { translation as sv } from "./properties/ts/odyssey-react-mui_sv";
|
|
37
|
+
import { translation as th } from "./properties/ts/odyssey-react-mui_th";
|
|
38
|
+
import { translation as tr } from "./properties/ts/odyssey-react-mui_tr";
|
|
39
|
+
import { translation as uk } from "./properties/ts/odyssey-react-mui_uk";
|
|
40
|
+
import { translation as zhCN } from "./properties/ts/odyssey-react-mui_zh-CN";
|
|
41
|
+
import { translation as znTW } from "./properties/ts/odyssey-react-mui_zh-TW";
|
|
42
|
+
|
|
43
|
+
import {
|
|
44
|
+
SupportedLanguages,
|
|
45
|
+
supportedLanguages,
|
|
46
|
+
} from "./OdysseyTranslationProvider.types";
|
|
47
|
+
|
|
48
|
+
export const defaultLNG: SupportedLanguages = "en";
|
|
49
|
+
export const defaultNS = "translations";
|
|
50
|
+
export const resources = {
|
|
51
|
+
cs,
|
|
52
|
+
da,
|
|
53
|
+
de,
|
|
54
|
+
el,
|
|
55
|
+
en,
|
|
56
|
+
es,
|
|
57
|
+
fi,
|
|
58
|
+
fr,
|
|
59
|
+
hu,
|
|
60
|
+
id,
|
|
61
|
+
it,
|
|
62
|
+
ja,
|
|
63
|
+
ko,
|
|
64
|
+
ms,
|
|
65
|
+
nb,
|
|
66
|
+
"nl-NL": nlNL,
|
|
67
|
+
pl,
|
|
68
|
+
"pt-BR": ptBR,
|
|
69
|
+
ro,
|
|
70
|
+
ru,
|
|
71
|
+
sv,
|
|
72
|
+
th,
|
|
73
|
+
tr,
|
|
74
|
+
uk,
|
|
75
|
+
"zh-CN": zhCN,
|
|
76
|
+
"zh-TW": znTW,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
i18n.use(initReactI18next).init({
|
|
80
|
+
defaultNS,
|
|
81
|
+
ns: [defaultNS],
|
|
82
|
+
fallbackLng: defaultLNG,
|
|
83
|
+
supportedLngs: supportedLanguages,
|
|
84
|
+
load: "currentOnly",
|
|
85
|
+
keySeparator: false,
|
|
86
|
+
interpolation: {
|
|
87
|
+
escapeValue: false, // react already safe from xss
|
|
88
|
+
skipOnVariables: false, // to handle translations that use nesting
|
|
89
|
+
},
|
|
90
|
+
react: {
|
|
91
|
+
useSuspense: false,
|
|
92
|
+
bindI18nStore: "added",
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
Object.entries(resources).forEach(([locale, property]) => {
|
|
97
|
+
i18n.addResourceBundle(locale, defaultNS, property);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// eslint-disable-next-line import/no-default-export
|
|
101
|
+
export default i18n;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { memo, ReactElement } from "react";
|
|
14
|
+
|
|
15
|
+
import { ThemeOptions } from ".";
|
|
16
|
+
import { DesignTokensOverride } from "../src/theme/index";
|
|
17
|
+
import { OdysseyCacheProvider } from "./OdysseyCacheProvider";
|
|
18
|
+
import { OdysseyThemeProvider } from "./OdysseyThemeProvider";
|
|
19
|
+
import {
|
|
20
|
+
OdysseyTranslationProvider,
|
|
21
|
+
TranslationOverrides,
|
|
22
|
+
} from "./OdysseyTranslationProvider";
|
|
23
|
+
import { SupportedLanguages } from "./OdysseyTranslationProvider.types";
|
|
24
|
+
|
|
25
|
+
type OdysseyProviderProps = {
|
|
26
|
+
children: ReactElement;
|
|
27
|
+
nonce?: string;
|
|
28
|
+
themeOverride?: ThemeOptions;
|
|
29
|
+
designTokensOverride?: DesignTokensOverride;
|
|
30
|
+
languageCode?: SupportedLanguages;
|
|
31
|
+
translationOverrides?: TranslationOverrides;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const OdysseyProvider = ({
|
|
35
|
+
children,
|
|
36
|
+
nonce,
|
|
37
|
+
themeOverride,
|
|
38
|
+
designTokensOverride,
|
|
39
|
+
languageCode,
|
|
40
|
+
translationOverrides,
|
|
41
|
+
}: OdysseyProviderProps) => (
|
|
42
|
+
<OdysseyCacheProvider nonce={nonce}>
|
|
43
|
+
<OdysseyThemeProvider
|
|
44
|
+
themeOverride={themeOverride}
|
|
45
|
+
designTokensOverride={designTokensOverride}
|
|
46
|
+
>
|
|
47
|
+
<OdysseyTranslationProvider
|
|
48
|
+
languageCode={languageCode}
|
|
49
|
+
translationOverrides={translationOverrides}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</OdysseyTranslationProvider>
|
|
53
|
+
</OdysseyThemeProvider>
|
|
54
|
+
</OdysseyCacheProvider>
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const MemoizedThemeProvider = memo(OdysseyProvider);
|
|
58
|
+
|
|
59
|
+
export { MemoizedThemeProvider as OdysseyProvider };
|
|
@@ -13,19 +13,25 @@
|
|
|
13
13
|
import { ThemeProvider as MuiThemeProvider } from "@mui/material/styles";
|
|
14
14
|
import { memo, ReactElement, useMemo } from "react";
|
|
15
15
|
|
|
16
|
-
import { createTheme, deepmerge, ThemeOptions } from ".";
|
|
17
|
-
import {
|
|
16
|
+
import { createTheme, deepmerge, ThemeOptions, DesignTokensOverride } from ".";
|
|
17
|
+
import { createOdysseyMuiTheme } from "./theme";
|
|
18
|
+
import * as Tokens from "@okta/odyssey-design-tokens";
|
|
18
19
|
|
|
19
20
|
const OdysseyThemeProvider = ({
|
|
20
21
|
children,
|
|
21
22
|
themeOverride,
|
|
23
|
+
designTokensOverride,
|
|
22
24
|
}: {
|
|
23
25
|
children: ReactElement;
|
|
24
26
|
themeOverride?: ThemeOptions;
|
|
27
|
+
designTokensOverride?: DesignTokensOverride;
|
|
25
28
|
}) => {
|
|
29
|
+
const odysseyTokens = { ...Tokens, ...designTokensOverride };
|
|
30
|
+
const odysseyTheme = createOdysseyMuiTheme(odysseyTokens);
|
|
31
|
+
|
|
26
32
|
const customOdysseyTheme = useMemo(
|
|
27
33
|
() => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)),
|
|
28
|
-
[themeOverride]
|
|
34
|
+
[odysseyTheme, themeOverride]
|
|
29
35
|
);
|
|
30
36
|
|
|
31
37
|
return (
|
|
@@ -0,0 +1,63 @@
|
|
|
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 { render, screen } from "@testing-library/react";
|
|
14
|
+
import { OdysseyTranslationProvider } from "./OdysseyTranslationProvider";
|
|
15
|
+
import i18n from "./OdysseyI18n";
|
|
16
|
+
import { TextField } from "./TextField";
|
|
17
|
+
|
|
18
|
+
describe("OdysseyTranslationProvider", () => {
|
|
19
|
+
it("defaults to 'en' translation bundle", () => {
|
|
20
|
+
render(
|
|
21
|
+
<OdysseyTranslationProvider>
|
|
22
|
+
<span>{i18n.t("fieldlabel.optional.text")}</span>
|
|
23
|
+
</OdysseyTranslationProvider>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
expect(screen.getByText("Optional"));
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("can modify a translation bundle with translantionOverrides", () => {
|
|
30
|
+
const translationOverrides = {
|
|
31
|
+
en: {
|
|
32
|
+
"fieldlabel.optional.text": "Non Required",
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
render(
|
|
37
|
+
<OdysseyTranslationProvider translationOverrides={translationOverrides}>
|
|
38
|
+
<TextField label={""} isOptional />
|
|
39
|
+
</OdysseyTranslationProvider>
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
expect(screen.getByText("Non Required"));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("can change the displayed language with languageCode", () => {
|
|
46
|
+
const translationOverrides = {
|
|
47
|
+
fr: {
|
|
48
|
+
"fieldlabel.optional.text": "Optionnel",
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
render(
|
|
53
|
+
<OdysseyTranslationProvider
|
|
54
|
+
languageCode="fr"
|
|
55
|
+
translationOverrides={translationOverrides}
|
|
56
|
+
>
|
|
57
|
+
<TextField label={""} isOptional />
|
|
58
|
+
</OdysseyTranslationProvider>
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
expect(screen.getByText("Optionnel"));
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { ReactElement, useEffect } from "react";
|
|
14
|
+
|
|
15
|
+
import { SupportedLanguages } from "./OdysseyTranslationProvider.types";
|
|
16
|
+
|
|
17
|
+
import i18n, { defaultNS, resources } from "./OdysseyI18n";
|
|
18
|
+
import { I18nextProvider } from "react-i18next";
|
|
19
|
+
|
|
20
|
+
export type TranslationOverrides = {
|
|
21
|
+
[key in SupportedLanguages]?: Partial<(typeof resources)["en"]>;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type OdysseyTranslationProviderProps = {
|
|
25
|
+
children: ReactElement;
|
|
26
|
+
languageCode?: SupportedLanguages;
|
|
27
|
+
translationOverrides?: TranslationOverrides;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const mergeBundleOverrides = (
|
|
31
|
+
languageCode: SupportedLanguages,
|
|
32
|
+
translationOverrides: TranslationOverrides
|
|
33
|
+
) => {
|
|
34
|
+
const bundle = resources[languageCode];
|
|
35
|
+
const overrides = translationOverrides[languageCode];
|
|
36
|
+
return {
|
|
37
|
+
...bundle,
|
|
38
|
+
...overrides,
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const OdysseyTranslationProvider = ({
|
|
43
|
+
children,
|
|
44
|
+
languageCode,
|
|
45
|
+
translationOverrides,
|
|
46
|
+
}: OdysseyTranslationProviderProps) => {
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
// Defaults to the browser's language if available otherwise `en` will be used
|
|
49
|
+
i18n.changeLanguage(languageCode || window.navigator.language);
|
|
50
|
+
}, [languageCode]);
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (translationOverrides) {
|
|
54
|
+
Object.keys(translationOverrides).forEach((language) => {
|
|
55
|
+
const bundle = mergeBundleOverrides(
|
|
56
|
+
language as SupportedLanguages,
|
|
57
|
+
translationOverrides
|
|
58
|
+
);
|
|
59
|
+
i18n.addResourceBundle(language, defaultNS, bundle);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}, [translationOverrides]);
|
|
63
|
+
|
|
64
|
+
return <I18nextProvider i18n={i18n}>{children}</I18nextProvider>;
|
|
65
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
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 = [
|
|
14
|
+
"cs", // Czech
|
|
15
|
+
"da", // Danish
|
|
16
|
+
"de", // German
|
|
17
|
+
"el", // Greek
|
|
18
|
+
"en", // English
|
|
19
|
+
"es", // Spanish
|
|
20
|
+
"fi", // Finnish
|
|
21
|
+
"fr", // French
|
|
22
|
+
"hu", // Hungarian
|
|
23
|
+
"id", // Indonesian
|
|
24
|
+
"it", // Italian
|
|
25
|
+
"ja", // Japanese
|
|
26
|
+
"ko", // Korean
|
|
27
|
+
"ms", // Malaysian
|
|
28
|
+
"nb", // Norwegian
|
|
29
|
+
"nl-NL", // Dutch
|
|
30
|
+
"pl", // Polish
|
|
31
|
+
"pt-BR", // Portuguese (Brazil)
|
|
32
|
+
"ro", // Romanian
|
|
33
|
+
"ru", // Russian
|
|
34
|
+
"sv", // Swedish
|
|
35
|
+
"th", // Thai
|
|
36
|
+
"tr", // Turkish
|
|
37
|
+
"uk", // Ukrainian
|
|
38
|
+
"zh-CN", // Chinese (PRC)
|
|
39
|
+
"zh-TW", // Chinese
|
|
40
|
+
] as const;
|
|
41
|
+
|
|
42
|
+
export type SupportedLanguages = (typeof supportedLanguages)[number];
|