@okta/odyssey-react-mui 1.52.0 → 1.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appswitcher/admin-app-default.svg +6 -0
- package/dist/appswitcher/admin-app-selected.svg +6 -0
- package/dist/appswitcher/aerial-default.svg +7 -0
- package/dist/appswitcher/aerial-selected.svg +7 -0
- package/dist/appswitcher/okta-dashboard-default.svg +7 -0
- package/dist/appswitcher/okta-dashboard-selected.svg +7 -0
- package/dist/appswitcher/privileged-access-default.svg +4 -0
- package/dist/appswitcher/privileged-access-selected.svg +4 -0
- package/dist/appswitcher/workflows-default.svg +5 -0
- package/dist/appswitcher/workflows-selected.svg +5 -0
- package/dist/assets/Accordion-CLdY3bef.js +1 -0
- package/dist/assets/Accordion.stories-X3jwsTUf.js +85 -0
- package/dist/assets/AccordionSummary-wkTP8_D6.js +1 -0
- package/dist/assets/AddCircle-zDqHIKbQ.js +1 -0
- package/dist/assets/AlertTitle-UQV7DT5q.js +1 -0
- package/dist/assets/AppSwitcher-Dgfa_AoU.js +21 -0
- package/dist/assets/AppSwitcher.stories-CwjWKK9x.js +100 -0
- package/dist/assets/AppTile.stories-BfdQQaCS.js +136 -0
- package/dist/assets/ArrowDropDown-BbLKA4fg.js +1 -0
- package/dist/assets/ArrowRight-C5USrGY5.js +1 -0
- package/dist/assets/Autocomplete-BajR4gNT.js +1 -0
- package/dist/assets/Autocomplete-BwSwXNq_.js +1 -0
- package/dist/assets/Autocomplete.stories-C7T-kCUQ.js +316 -0
- package/dist/assets/Badge-4k4qHpX4.js +11 -0
- package/dist/assets/Banner-CfvXqDEI.js +1 -0
- package/dist/assets/Banner.stories-NnVFdOhp.js +96 -0
- package/dist/assets/BaseButton-C9tiChQu.js +11 -0
- package/dist/assets/BaseMenuButton-BXkyi9Y-.js +1 -0
- package/dist/assets/Box--NDTewyO.js +1 -0
- package/dist/assets/Box-B3rdnavX.js +1 -0
- package/dist/assets/Box-CnVllI1S.js +1 -0
- package/dist/assets/Box-Dieb6jd6.js +11 -0
- package/dist/assets/Box.stories-0iw_Ut4E.js +38 -0
- package/dist/assets/Breadcrumb.stories-BOG-nvIn.js +19 -0
- package/dist/assets/BreadcrumbList.stories-BjYldubq.js +81 -0
- package/dist/assets/Breadcrumbs-DlF1RjAJ.js +6 -0
- package/dist/assets/Bug-BnGJL5iO.js +1 -0
- package/dist/assets/Button-0PI4ljbj.js +11 -0
- package/dist/assets/Button-BEdrRzeO.js +11 -0
- package/dist/assets/Button-CQAScxdp.js +31 -0
- package/dist/assets/Button-Dug4qNr3.js +1 -0
- package/dist/assets/Button.stories-CNPwpgVA.js +133 -0
- package/dist/assets/Button.stories-CaESBfZW.js +271 -0
- package/dist/assets/ButtonBase-Rz8p08Xo.js +74 -0
- package/dist/assets/Calendar-Do4wfihU.js +1 -0
- package/dist/assets/Call-CZmd0zlk.js +1 -0
- package/dist/assets/Callout-WJN7MCgu.js +1 -0
- package/dist/assets/Callout.stories-EyhGsZIg.js +322 -0
- package/dist/assets/Card-BejcE3ak.js +8 -0
- package/dist/assets/Card-CYHxgfcj.js +1 -0
- package/dist/assets/Card.stories-CB7itEof.js +56 -0
- package/dist/assets/CardActionArea-CjEHgWqq.js +1 -0
- package/dist/assets/CardActions-AjPk7ICQ.js +1 -0
- package/dist/assets/Checkbox-3Yu84dfy.js +1 -0
- package/dist/assets/Checkbox-mRntsWEy.js +1 -0
- package/dist/assets/Checkbox.stories-CnAqBzmf.js +113 -0
- package/dist/assets/CheckboxGroup-Bris2fCF.js +1 -0
- package/dist/assets/CheckboxGroup.stories-CIRolYTR.js +89 -0
- package/dist/assets/ChevronRight-QYu5EQHS.js +1 -0
- package/dist/assets/ChevronUp-D226bAv0.js +1 -0
- package/dist/assets/Chip-BgPaZbUf.js +1 -0
- package/dist/assets/CircularProgress-B7sj16Me.js +1 -0
- package/dist/assets/CircularProgress-D6L1y9kt.js +28 -0
- package/dist/assets/CircularProgress.stories-CvfXEtcf.js +44 -0
- package/dist/assets/Clock-CRMbzsTS.js +1 -0
- package/dist/assets/Close-CELHOmN_.js +1 -0
- package/dist/assets/Code Styling Guidelines-CstdJT8e.js +13 -0
- package/dist/assets/Collapse-DULszxZp.js +1 -0
- package/dist/assets/Color-ASIRERSW-D1UGGYVZ.js +1 -0
- package/dist/assets/CssBaseline-BxXlsiez.js +191 -0
- package/dist/assets/CssBaseline.stories-DVe508J0.js +364 -0
- package/dist/assets/Custom Theming-ccLDrBQS.js +135 -0
- package/dist/assets/Custom Theming.stories-CWCReKRB.js +95 -0
- package/dist/assets/DataFilters-4og6bOFS.js +1 -0
- package/dist/assets/DataFilters-BkX84ZQL.js +55 -0
- package/dist/assets/DataFilters.stories-DewPnjr_.js +31 -0
- package/dist/assets/DataTable-019cW0Jq.js +495 -0
- package/dist/assets/DataTable-B5iX_c6m.js +21 -0
- package/dist/assets/DataTable-DV-P1c62.js +41 -0
- package/dist/assets/DataTable.stories-Bn546tQH.js +21 -0
- package/dist/assets/DataTable.stories-CZ38vjC1.js +438 -0
- package/dist/assets/DataView-BS0E464o.js +91 -0
- package/dist/assets/DataView-C1SHLIDp.js +332 -0
- package/dist/assets/DataView.stories-CzFmgLtp.js +439 -0
- package/dist/assets/DataView.stories-E0Zxfc-o.js +646 -0
- package/dist/assets/DatePicker-DE3q9EuO.js +11 -0
- package/dist/assets/DatePicker-vZfA4IWy.js +1 -0
- package/dist/assets/DatePicker.stories-DWhZFsWV.js +133 -0
- package/dist/assets/DateTimePicker-ByepBMwy.js +1 -0
- package/dist/assets/DateTimePicker.stories-Cas4UCrt.js +158 -0
- package/dist/assets/DebugMenu-3nsw5Xt7.js +1 -0
- package/dist/assets/Design Tokens-OxRvZCcK.js +4 -0
- package/dist/assets/Dialog-DiU8nQnH.js +1 -0
- package/dist/assets/Dialog.stories-Cl9r8_yI.js +207 -0
- package/dist/assets/DialogContent-C6DlqjnA.js +1 -0
- package/dist/assets/DialogTitle-B_QxN4PO.js +1 -0
- package/dist/assets/Divider-C7lvc1xB.js +1 -0
- package/dist/assets/Divider.stories-BEuF_CK6.js +5 -0
- package/dist/assets/DocsRenderer-GHJI37HO-DFEQwt06.js +2 -0
- package/dist/assets/Documentation-nAJnZGCK.js +1 -0
- package/dist/assets/Download-CA8gZ8xE.js +1 -0
- package/dist/assets/Drawer-CYAKZaWu.js +33 -0
- package/dist/assets/Drawer.stories-we3mu0fd.js +95 -0
- package/dist/assets/EmptyState-B1EvR4rn.js +11 -0
- package/dist/assets/EmptyState.stories-BoZoxyTs.js +11 -0
- package/dist/assets/ExampleButton.stories-C3scpIjS.js +11 -0
- package/dist/assets/Extending Translations-3H_cpfNQ.js +147 -0
- package/dist/assets/ExternalLink-3_gWbh_U.js +1 -0
- package/dist/assets/Fade-ZBabHGDm.js +1 -0
- package/dist/assets/Field-CqIOaZfg.js +11 -0
- package/dist/assets/FieldHint-Cs73lQge.js +1 -0
- package/dist/assets/Fieldset-emRDW8u7.js +11 -0
- package/dist/assets/Fieldset.stories-B_r0XFjE.js +15 -0
- package/dist/assets/FileUploader.stories-82Cob1aQ.js +58 -0
- package/dist/assets/Filter-XcwxIcdg.js +1 -0
- package/dist/assets/Folder-CVKRyg4P.js +1 -0
- package/dist/assets/Form Field Accessibility-CZo064GW.js +17 -0
- package/dist/assets/Form-jEIBfmsN.js +11 -0
- package/dist/assets/Form.stories-Bge8Frr0.js +69 -0
- package/dist/assets/FormControlLabel-BG9mNqQc.js +1 -0
- package/dist/assets/FormGroup-D8ZDwdpx.js +1 -0
- package/dist/assets/FormHelperText-CVc1kPQJ.js +1 -0
- package/dist/assets/FormLabel-CWWbs_c2.js +1 -0
- package/dist/assets/FullScreenOverlay-GJH3R5s4.js +11 -0
- package/dist/assets/Generating Icons-DzaDzJO9.js +15 -0
- package/dist/assets/Globe-C0SMdL8H.js +1 -0
- package/dist/assets/Grid-DnpTJXeB.js +1 -0
- package/dist/assets/Group-BJr9nAnt.js +1 -0
- package/dist/assets/GroupPicker.stories-Oc5zKcw1.js +33 -0
- package/dist/assets/Grow-DvH-Xu1P.js +1 -0
- package/dist/assets/Hide-C2jA-JOQ.js +1 -0
- package/dist/assets/Hint-BXue9c6p.js +11 -0
- package/dist/assets/HintLink.stories-FqiBpDGQ.js +44 -0
- package/dist/assets/Home-D8RWt2JU.js +1 -0
- package/dist/assets/Icon.stories-CB1sFVG5.js +16 -0
- package/dist/assets/IconButton-BPR_sq0F.js +1 -0
- package/dist/assets/IconWithTooltip.stories-qhJ3BM2A.js +19 -0
- package/dist/assets/IgaComponentsOdysseyStorybookThemeDecorator-DdMym0aA.js +269 -0
- package/dist/assets/InformationCircle-DRZkRWne.js +1 -0
- package/dist/assets/InputAdornment-Clfg5IS6.js +1 -0
- package/dist/assets/InputBase-BYnzr12H.js +2 -0
- package/dist/assets/Installing odyssey-react-mui-C75NTz-Q.js +216 -0
- package/dist/assets/Introduction-DqVi6Ihy.js +46 -0
- package/dist/assets/Layout-XY1MknZE.js +11 -0
- package/dist/assets/Layout.stories-CnOmeQ-W.js +285 -0
- package/dist/assets/Legacy Migrations-D05TylMb.js +85 -0
- package/dist/assets/LinearProgress-Z53mwHnp.js +54 -0
- package/dist/assets/Link-BKNciOfr.js +1 -0
- package/dist/assets/Link-Cg_KakDo.js +1 -0
- package/dist/assets/Link-Djl4opNm.js +11 -0
- package/dist/assets/Link-thynTosX.js +1 -0
- package/dist/assets/Link.stories-Clh1Bkzm.js +38 -0
- package/dist/assets/List-CZ2bN2bA.js +1 -0
- package/dist/assets/List-D0N4Xybp.js +1 -0
- package/dist/assets/ListItem-BNz1zv6N.js +1 -0
- package/dist/assets/ListSubheader-Dwx7m0BA.js +1 -0
- package/dist/assets/ListSubheader.stories-nA_TcAiG.js +5 -0
- package/dist/assets/Menu-DB2s3Jn0.js +1 -0
- package/dist/assets/MenuButton-BffESdH9.js +11 -0
- package/dist/assets/MenuButton-BrxZ5EA2.js +31 -0
- package/dist/assets/MenuButton.stories-CtQrmY2o.js +246 -0
- package/dist/assets/MenuButton.stories-l4pnLJBo.js +75 -0
- package/dist/assets/MenuContext-UsOwIWpO.js +11 -0
- package/dist/assets/MenuItem-Cmq8TfUJ.js +1 -0
- package/dist/assets/MenuItem-CpMFWgaz.js +1 -0
- package/dist/assets/MenuItem-nncwAWHS.js +1 -0
- package/dist/assets/MenuItem.stories-76iDefqo.js +22 -0
- package/dist/assets/MenuItem.stories-CQ-735qG.js +38 -0
- package/dist/assets/MenuList-D3GSt85L.js +1 -0
- package/dist/assets/Modal-C5P7v6Gt.js +1 -0
- package/dist/assets/More-BAN0OFVF.js +1 -0
- package/dist/assets/MuiPropsContext-D6i6qZME.js +11 -0
- package/dist/assets/MuiPropsContext-Df02xyKB.js +11 -0
- package/dist/assets/NativeSelect.stories-D2Ob7KE5.js +114 -0
- package/dist/assets/Notification-CqbysXIb.js +1 -0
- package/dist/assets/OdysseyProvider-PxeTd-wx.js +197 -0
- package/dist/assets/OdysseyProvider-rboSNY26.js +76 -0
- package/dist/assets/OdysseyStorybookThemeDecorator-CHlNoX17.js +1 -0
- package/dist/assets/OdysseyThemeProvider-BA0_xP7N.js +174 -0
- package/dist/assets/PageHeader-DHtVYyb-.js +6 -0
- package/dist/assets/PageHeader.stories-CCvS30-w.js +17 -0
- package/dist/assets/PageHeader.stories-DzO4wv8w.js +364 -0
- package/dist/assets/PageHeader.stories-xG6qoBox.js +364 -0
- package/dist/assets/PageTemplate-BUVvgcIj.js +21 -0
- package/dist/assets/PageTemplate-Dfm2PU1P.js +8 -0
- package/dist/assets/PageTemplate.stories-M6ewVPJx.js +205 -0
- package/dist/assets/PageTemplate.stories-XizDmXOT.js +205 -0
- package/dist/assets/PageTemplate.stories-mpYXgZT4.js +306 -0
- package/dist/assets/PaginatedTable.stories-BGRIoKo4.js +65 -0
- package/dist/assets/Paper-vUVrw-QB.js +1 -0
- package/dist/assets/PasswordField.stories-T70RtAAe.js +121 -0
- package/dist/assets/Picker.stories-DHQ88s15.js +44 -0
- package/dist/assets/PickerWithOptionAdornment.stories-DC1J_qH3.js +93 -0
- package/dist/assets/PlaceholderLogo-SOqcoUNb.js +11 -0
- package/dist/assets/Popper-CISS1LuJ.js +1 -0
- package/dist/assets/Portal-DeJFqeW-.js +1 -0
- package/dist/assets/ProgressBar.stories-Cyam9OIf.js +258 -0
- package/dist/assets/Radio-BlxlCYZY.js +1 -0
- package/dist/assets/Radio-C5-GzJtb.js +1 -0
- package/dist/assets/Radio.stories-BrGqWocJ.js +63 -0
- package/dist/assets/RadioGroup-BcwUBGJo.js +1 -0
- package/dist/assets/RadioGroup-D8i98nDO.js +10 -0
- package/dist/assets/RadioGroup-sL620ofZ.js +1 -0
- package/dist/assets/RadioGroup.stories-CBlRX0KY.js +138 -0
- package/dist/assets/Refresh-ZZ_nNcXg.js +1 -0
- package/dist/assets/ResourceAccessPolicyComponentsStorybookThemeDecorator-C-AyLafs.js +212 -0
- package/dist/assets/Right-to-Left (RTL)-DMJ1RF_H.js +61 -0
- package/dist/assets/ScopedCssBaseline-BOa6kM98.js +1 -0
- package/dist/assets/ScreenReaderText-BfpueyoK.js +15 -0
- package/dist/assets/ScreenReaderText-toqV93JE.js +1 -0
- package/dist/assets/ScreenReaderText.stories-C1dE1n7A.js +8 -0
- package/dist/assets/Search-0744_rm_.js +1 -0
- package/dist/assets/SearchDropdown.stories-lpj_p0pn.js +53 -0
- package/dist/assets/SearchField-DmDpB-Sd.js +1 -0
- package/dist/assets/SearchField.stories-LT1ewC26.js +37 -0
- package/dist/assets/Select-CQoJvuLM.js +15 -0
- package/dist/assets/Select-DE0mojaE.js +1 -0
- package/dist/assets/Select.stories-B8cWbr6v.js +233 -0
- package/dist/assets/Server-1eTAy_EZ.js +1 -0
- package/dist/assets/Settings-CnuBvsmb.js +1 -0
- package/dist/assets/Setup-CG2Lh3Ff.js +6 -0
- package/dist/assets/Shadow DOM-D2Xm68lR.js +63 -0
- package/dist/assets/Show-C6ORd-wr.js +1 -0
- package/dist/assets/SideNav-WgViafRP.js +131 -0
- package/dist/assets/SideNav-tldrZCp2.js +85 -0
- package/dist/assets/SideNav.stories-Crrw-ySP.js +207 -0
- package/dist/assets/Skeleton-DxFSebyW.js +51 -0
- package/dist/assets/Snackbar-C2LtiN82.js +1 -0
- package/dist/assets/Stack-Duw-TXBf.js +1 -0
- package/dist/assets/Stack-jxMWaEAU.js +1 -0
- package/dist/assets/Stack.stories-B9W1XlQs.js +1 -0
- package/dist/assets/StaticTable.stories-D0R7o_xf.js +34 -0
- package/dist/assets/Status-DyDCzqET.js +1 -0
- package/dist/assets/Status.stories-CT9I5C3E.js +66 -0
- package/dist/assets/Stepper.stories-BGyCeC7L.js +486 -0
- package/dist/assets/Surface-s9E2mDWU.js +1 -0
- package/dist/assets/Switch.stories-CiNsUF_b.js +72 -0
- package/dist/assets/SwitchBase-C_6ALR3v.js +1 -0
- package/dist/assets/Sync-Bo0k4rYZ.js +1 -0
- package/dist/assets/Tabs-BPWnyCAU.js +1 -0
- package/dist/assets/Tabs-BnDKqj9p.js +23 -0
- package/dist/assets/Tabs.stories-xaGU0YrM.js +100 -0
- package/dist/assets/Tag-CYK8pNzu.js +11 -0
- package/dist/assets/Tag.stories-CFd40qf5.js +96 -0
- package/dist/assets/TagList-CunLkaIS.js +1 -0
- package/dist/assets/TextField-DF5R_omM.js +1 -0
- package/dist/assets/TextField.stories-julPXfI1.js +177 -0
- package/dist/assets/Toast.stories-BuX-cdk6.js +164 -0
- package/dist/assets/ToastManager.stories-C6VVt3In.js +195 -0
- package/dist/assets/Tooltip-B-PXZNTK.js +11 -0
- package/dist/assets/Tooltip-yxN-KFjL.js +1 -0
- package/dist/assets/Tooltip.stories-BXjrRGGM.js +68 -0
- package/dist/assets/TopNav-CCO_Sukh.js +11 -0
- package/dist/assets/TopNav.stories-C3X2SUf9.js +13 -0
- package/dist/assets/TransitionGroupContext-yBqGXZYI.js +1 -0
- package/dist/assets/Typography-CP569bC2.js +1 -0
- package/dist/assets/Typography-CjpHjc10.js +1 -0
- package/dist/assets/Typography-Dy2bDiU6.js +9 -0
- package/dist/assets/Typography-Jr4Brrb5.js +1 -0
- package/dist/assets/Typography.stories-CBkQTJR8.js +73 -0
- package/dist/assets/Typography.stories-DjnTqZOD.js +139 -0
- package/dist/assets/Typography.stories-dzvvlIBm.js +73 -0
- package/dist/assets/UiShell.stories-Cz9ZqBh6.js +569 -0
- package/dist/assets/UiShellProvider-oDzwqt6Y.js +31 -0
- package/dist/assets/Upload-nb-hV6Ym.js +1 -0
- package/dist/assets/User-BEFwQRGi.js +1 -0
- package/dist/assets/UserProfile-BM4I2P2Q.js +11 -0
- package/dist/assets/UserProfile.stories-BOMOuxsL.js +14 -0
- package/dist/assets/UserProfileMenuButton.stories-PNsdwClg.js +30 -0
- package/dist/assets/Video-DHeibuka.js +1 -0
- package/dist/assets/WarningFilled-DOHs-JmZ.js +1 -0
- package/dist/assets/WithTooltip-IO6J4KBT-DQaUt46F.js +9 -0
- package/dist/assets/WorkflowsComponentsStorybookThemeDecorator-DrWk22II.js +1 -0
- package/dist/assets/WpComponentsStorybookThemeDecorator-Db3wSJC0.js +1 -0
- package/dist/assets/ariaDisabledStyles-BnD13Dho.js +11 -0
- package/dist/assets/axe-9-4xvXvL.js +30 -0
- package/dist/assets/axeRun-w5CBCc9V.js +11 -0
- package/dist/assets/blocks-D521Uej3.js +162 -0
- package/dist/assets/colorManipulator-BYcVMQmD.js +1 -0
- package/{vitest-browser-setup.ts → dist/assets/constants-CGUp4oSR.js} +1 -4
- package/dist/assets/createChainedFunction-BO_9K8Jh.js +1 -0
- package/dist/assets/createStyled-BKWdp2xc.js +1 -0
- package/dist/assets/createSvgIcon-CaWcxZng.js +1 -0
- package/{vitest-node-setup.ts → dist/assets/createUniqueId-BHjR7HQF.js} +2 -4
- package/dist/assets/debounce-Be36O1Ab.js +1 -0
- package/dist/assets/dialogActionsClasses-J0iu7jYO.js +1 -0
- package/dist/assets/fieldComponentPropsMetaData-C9gCwuus.js +11 -0
- package/dist/assets/formatter-QJ4M4OGQ-BVt8pa2h.js +1 -0
- package/dist/assets/getScrollbarSize-Bqq2hMjQ.js +1 -0
- package/dist/assets/i18next-7SyOfhCu.js +1 -0
- package/dist/assets/iconUtils-DmnxHGuV.js +11 -0
- package/dist/assets/iframe-CQjT1fxh.js +1672 -0
- package/dist/assets/index-5Qx3hCfP.js +1 -0
- package/dist/assets/index-C77ZwfYm.js +39 -0
- package/dist/assets/index-D5BUEpVX.js +1 -0
- package/dist/assets/index-Vzl5wUDu.js +1 -0
- package/dist/assets/index.esm-Bohtd3OQ.js +85 -0
- package/dist/assets/index.esm-Dvk_qjX0.js +1 -0
- package/dist/assets/index.modern-DX91rx7y.js +14 -0
- package/dist/assets/inputUtils-BBH9ADKa.js +11 -0
- package/dist/assets/isHostComponent-DVu5iVWx.js +1 -0
- package/dist/assets/matchers-DMFSMG2O-CAdg16Fl.js +14 -0
- package/dist/assets/ownerDocument-DW-IO8s5.js +1 -0
- package/dist/assets/ownerWindow-HkKU3E4x.js +1 -0
- package/dist/assets/personData-Bi-Gg5yH.js +1 -0
- package/dist/assets/personData-CV-uVWcJ.js +21 -0
- package/dist/assets/pickerComponentPropsMetaData-aBuTm1AZ.js +75 -0
- package/dist/assets/preload-helper-Dp1pzeXC.js +1 -0
- package/{vitest-jsdom-setup.ts → dist/assets/pxToRem-BrMhKUxS.js} +1 -3
- package/dist/assets/react-18-DkaAwiRb.js +1 -0
- package/dist/assets/renderUiShell.stories-R-ckgOdr.js +902 -0
- package/dist/assets/resolveComponentProps-DGxe9oED.js +1 -0
- package/dist/assets/syntaxhighlighter-IQDEPFLK-CL1ROTuv.js +6 -0
- package/dist/assets/tableRowClasses-Bk1uFtwh.js +9 -0
- package/dist/assets/tableSortLabelClasses-i_d6KGQQ.js +1 -0
- package/{vitest.config.project.ts → dist/assets/uiShellSharedConstants-CvCey4L_.js} +1 -6
- package/dist/assets/useAutocomplete-DG_kuhWb.js +11 -0
- package/dist/assets/useControlled-BUhC7uWK.js +1 -0
- package/dist/assets/useIsFocusVisible-D1xCTBdT.js +1 -0
- package/dist/assets/useMobilePicker-DJQJ3D8W.js +6 -0
- package/dist/assets/useMountLifecycleEffect-BNByHT_g.js +11 -0
- package/dist/assets/useOdysseyDateFields-BVmmVg1G.js +61 -0
- package/dist/assets/useScrollIndication-BGw7dgC5.js +41 -0
- package/dist/assets/useSlot-BMAKysxJ.js +1 -0
- package/dist/assets/useStoryArgOrLocalState-CRQAGSTX.js +11 -0
- package/dist/assets/useThemeProps-BCUqwy59.js +1 -0
- package/dist/assets/useThemeProps-Bc2iWdri.js +1 -0
- package/dist/assets/useUniqueId-DG6rB8dI.js +11 -0
- package/dist/assets/utilities.esm-D9akhJLQ.js +5 -0
- package/dist/assets/utils-D-QCjykO.js +1 -0
- package/dist/assets/visuallyHidden-Dan1xhjv.js +1 -0
- package/dist/cjs/Field.cjs +2 -4
- package/dist/cjs/Field.cjs.map +1 -1
- package/dist/cjs/FullScreenOverlay.cjs +3 -1
- package/dist/cjs/FullScreenOverlay.cjs.map +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/labs/DataView/DataView.cjs +17 -4
- package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/Picker.cjs +2 -0
- package/dist/cjs/labs/OdysseyPickers/Picker.cjs.map +1 -1
- package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
- package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
- package/dist/esm/Field.js +4 -6
- package/dist/esm/Field.js.map +1 -1
- package/dist/esm/FullScreenOverlay.js +4 -2
- package/dist/esm/FullScreenOverlay.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/labs/DataView/DataView.js +17 -4
- package/dist/esm/labs/DataView/DataView.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/Picker.js +2 -0
- package/dist/esm/labs/OdysseyPickers/Picker.js.map +1 -1
- package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
- package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
- package/dist/favicon-wrapper.svg +46 -0
- package/dist/favicon.svg +1 -0
- package/dist/iframe.html +768 -0
- package/dist/index.html +173 -0
- package/dist/index.json +1 -0
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +1 -0
- package/dist/sb-addons/a11y-3/manager-bundle.js +5 -0
- package/dist/sb-addons/docs-1/manager-bundle.js +3 -0
- package/dist/sb-addons/links-2/manager-bundle.js +3 -0
- package/dist/sb-addons/rtl-4/manager-bundle.js +3 -0
- package/dist/sb-addons/storybook-6/manager-bundle.js +786 -0
- package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +628 -0
- package/dist/sb-addons/tag-badges-5/manager-bundle.js +35 -0
- package/dist/sb-common-assets/favicon-wrapper.svg +46 -0
- package/dist/sb-common-assets/favicon.svg +1 -0
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-runtime.js +75605 -0
- package/dist/sb-manager/globals.js +24 -0
- package/dist/sb-manager/manager-stores.js +23 -0
- package/dist/sb-manager/runtime.js +19717 -0
- package/dist/tsconfig.production.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Field.d.ts.map +1 -1
- package/dist/types/FullScreenOverlay.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/labs/DataView/DataView.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/Picker.d.ts +4 -5
- package/dist/types/labs/OdysseyPickers/Picker.d.ts.map +1 -1
- package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts +7 -5
- package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -1
- package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
- package/dist/vite-inject-mocker-entry.js +18 -0
- package/package.json +9 -7
- package/CHANGELOG.md +0 -43
- package/dist/index.es.js +0 -3173
- package/dist/index.es.js.map +0 -1
- package/dist/index.iife.js +0 -9
- package/dist/index.iife.js.map +0 -1
- package/dist/index.umd.cjs +0 -9
- package/dist/index.umd.cjs.map +0 -1
- package/dist/types/getTranslationServices.browser.test.d.ts +0 -1
- package/dist/types/getTranslationServices.browser.test.js +0 -88
- package/dist/types/getTranslationServices.browser.test.js.map +0 -1
- package/dist/types/getTranslationServices.d.ts +0 -91
- package/dist/types/getTranslationServices.js +0 -77
- package/dist/types/getTranslationServices.js.map +0 -1
- package/dist/types/getTypedObjectEntries.d.ts +0 -1
- package/dist/types/getTypedObjectEntries.js +0 -2
- package/dist/types/getTypedObjectEntries.js.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/types/translationServices.types.d.ts +0 -2
- package/dist/types/translationServices.types.js +0 -34
- package/dist/types/translationServices.types.js.map +0 -1
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/ok.yaml +0 -1
- package/src/getTranslationServices.browser.test.tsx +0 -173
- package/src/getTranslationServices.tsx +0 -286
- package/src/getTypedObjectEntries.ts +0 -3
- package/src/index.ts +0 -2
- package/src/translationServices.types.ts +0 -36
- package/src/tsconfig.json +0 -7
- package/tsconfig.json +0 -41
- package/vite.config.project.ts +0 -61
- package/vite.config.ts +0 -21
- package/vite.config.ts.bak +0 -33
- package/vitest.config.ts +0 -27
- package/vitest.config.ts.bak +0 -27
|
@@ -1,173 +0,0 @@
|
|
|
1
|
-
import { render, screen, waitFor } from "@testing-library/react";
|
|
2
|
-
|
|
3
|
-
import type { UseTranslation } from "./getTranslationServices.js";
|
|
4
|
-
|
|
5
|
-
import { getTranslationServices } from "./getTranslationServices.js";
|
|
6
|
-
|
|
7
|
-
describe(getTranslationServices.name, () => {
|
|
8
|
-
const en = {
|
|
9
|
-
greeting: "Hello World {{friends}}",
|
|
10
|
-
farewell: "Goodbye",
|
|
11
|
-
} as const;
|
|
12
|
-
const fr = { greeting: "Bonjour le monde {{friends}}" } as const;
|
|
13
|
-
const testResources = {
|
|
14
|
-
en,
|
|
15
|
-
fr,
|
|
16
|
-
} as const;
|
|
17
|
-
|
|
18
|
-
let OdysseyTranslationProvider: ReturnType<
|
|
19
|
-
typeof getTranslationServices
|
|
20
|
-
>["TranslationProvider"];
|
|
21
|
-
let useTranslation: UseTranslation<"test-app", (typeof testResources)["en"]>;
|
|
22
|
-
|
|
23
|
-
// create a fresh instance of the translation services before each test
|
|
24
|
-
beforeEach(() => {
|
|
25
|
-
const services = getTranslationServices({
|
|
26
|
-
namespace: "test-app",
|
|
27
|
-
defaultLanguageCode: "en",
|
|
28
|
-
resources: testResources,
|
|
29
|
-
});
|
|
30
|
-
OdysseyTranslationProvider = services.TranslationProvider;
|
|
31
|
-
useTranslation = services.useTranslation;
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const TestComponent = () => {
|
|
35
|
-
const [t, i18n] = useTranslation();
|
|
36
|
-
return (
|
|
37
|
-
<div>
|
|
38
|
-
<h1>{t("greeting", { friends: "FRIENDS" })}</h1>
|
|
39
|
-
<p>Current language: {i18n.language}</p>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
test("renders `children` and uses the default translations", () => {
|
|
45
|
-
render(
|
|
46
|
-
<OdysseyTranslationProvider>
|
|
47
|
-
<TestComponent />
|
|
48
|
-
</OdysseyTranslationProvider>,
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
// check if the English text is rendered by default
|
|
52
|
-
expect(
|
|
53
|
-
screen.getByRole("heading", { name: "Hello World FRIENDS" }),
|
|
54
|
-
).toBeInTheDocument();
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
test("switches languages when the `languageCode` prop changes", async () => {
|
|
58
|
-
const { rerender } = render(
|
|
59
|
-
<OdysseyTranslationProvider languageCode="en">
|
|
60
|
-
<TestComponent />
|
|
61
|
-
</OdysseyTranslationProvider>,
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
expect(
|
|
65
|
-
screen.getByRole("heading", { name: "Hello World FRIENDS" }),
|
|
66
|
-
).toBeInTheDocument();
|
|
67
|
-
|
|
68
|
-
// rerender the component with a new language prop
|
|
69
|
-
rerender(
|
|
70
|
-
<OdysseyTranslationProvider languageCode="fr">
|
|
71
|
-
<TestComponent />
|
|
72
|
-
</OdysseyTranslationProvider>,
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
// wait for the content to update and check for the French text
|
|
76
|
-
await waitFor(() => {
|
|
77
|
-
expect(
|
|
78
|
-
screen.getByRole("heading", { name: "Bonjour le monde FRIENDS" }),
|
|
79
|
-
).toBeInTheDocument();
|
|
80
|
-
expect(screen.getByText("Current language: fr")).toBeInTheDocument();
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test("applies translation overrides to one of the known languages", () => {
|
|
85
|
-
render(
|
|
86
|
-
<OdysseyTranslationProvider
|
|
87
|
-
translationOverrides={{ en: { greeting: "Hello Overridden!" } }}
|
|
88
|
-
>
|
|
89
|
-
<TestComponent />
|
|
90
|
-
</OdysseyTranslationProvider>,
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
expect(
|
|
94
|
-
screen.getByRole("heading", { name: "Hello Overridden!" }),
|
|
95
|
-
).toBeInTheDocument();
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
describe("when components are nested", () => {
|
|
99
|
-
const contributionsPackageResources = {
|
|
100
|
-
en: {
|
|
101
|
-
greeting: "I am the nested greeting",
|
|
102
|
-
farewell: "I am the nested goodbye",
|
|
103
|
-
withPlaceholders:
|
|
104
|
-
"I am only available in the nested translations - {{placeholder1}}, {{placeholder2}}",
|
|
105
|
-
},
|
|
106
|
-
} as const;
|
|
107
|
-
|
|
108
|
-
const {
|
|
109
|
-
TranslationProvider: ContributionsPackageOdysseyTranslationProvider,
|
|
110
|
-
useTranslation: useContributionsPackageTranslation,
|
|
111
|
-
Trans: ContributionsPackageTrans,
|
|
112
|
-
} = getTranslationServices({
|
|
113
|
-
namespace: "nested-app",
|
|
114
|
-
defaultLanguageCode: "en",
|
|
115
|
-
resources: contributionsPackageResources,
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
const ContributionsPackageComponent = () => {
|
|
119
|
-
const { t } = useContributionsPackageTranslation();
|
|
120
|
-
return (
|
|
121
|
-
<section>
|
|
122
|
-
<h2>{t("greeting")}</h2>
|
|
123
|
-
<h2>
|
|
124
|
-
<ContributionsPackageTrans
|
|
125
|
-
i18nKey="withPlaceholders"
|
|
126
|
-
values={{
|
|
127
|
-
placeholder1: "placeholder text one",
|
|
128
|
-
placeholder2: "placeholder text two",
|
|
129
|
-
}}
|
|
130
|
-
/>
|
|
131
|
-
</h2>
|
|
132
|
-
</section>
|
|
133
|
-
);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const ComponentWithNestedContributions = () => {
|
|
137
|
-
const { t } = useTranslation();
|
|
138
|
-
return (
|
|
139
|
-
<div>
|
|
140
|
-
<h1>{t("greeting", { friends: "PARENT" })}</h1>
|
|
141
|
-
<ContributionsPackageComponent />
|
|
142
|
-
</div>
|
|
143
|
-
);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
test("the appropriate translation bundle is used for each component", async () => {
|
|
147
|
-
render(
|
|
148
|
-
<OdysseyTranslationProvider>
|
|
149
|
-
<ContributionsPackageOdysseyTranslationProvider>
|
|
150
|
-
<ComponentWithNestedContributions />
|
|
151
|
-
</ContributionsPackageOdysseyTranslationProvider>
|
|
152
|
-
</OdysseyTranslationProvider>,
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
await waitFor(() => {
|
|
156
|
-
// we are correctly using top level odyssey translation provider text
|
|
157
|
-
expect(
|
|
158
|
-
screen.getByRole("heading", { name: "Hello World PARENT" }),
|
|
159
|
-
).toBeInTheDocument();
|
|
160
|
-
|
|
161
|
-
// we are correctly using the nested odyssey translation provider text
|
|
162
|
-
expect(
|
|
163
|
-
screen.getByRole("heading", { name: "I am the nested greeting" }),
|
|
164
|
-
).toBeInTheDocument();
|
|
165
|
-
expect(
|
|
166
|
-
screen.getByRole("heading", {
|
|
167
|
-
name: "I am only available in the nested translations - placeholder text one, placeholder text two",
|
|
168
|
-
}),
|
|
169
|
-
).toBeInTheDocument();
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
});
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import type { UseTranslationOptions as UseI18NextTranslationOptions } from "react-i18next";
|
|
2
|
-
|
|
3
|
-
import i18n, { createInstance, TOptions } from "i18next";
|
|
4
|
-
import { memo, ReactElement, ReactNode, useEffect } from "react";
|
|
5
|
-
import {
|
|
6
|
-
I18nextProvider,
|
|
7
|
-
initReactI18next,
|
|
8
|
-
Trans as TransI18nNext,
|
|
9
|
-
TransProps as TransI18nNextProps,
|
|
10
|
-
useTranslation as useI18nNextTranslation,
|
|
11
|
-
} from "react-i18next";
|
|
12
|
-
|
|
13
|
-
import type { DefaultSupportedLanguages } from "./translationServices.types.js";
|
|
14
|
-
|
|
15
|
-
import { getTypedObjectEntries } from "./getTypedObjectEntries.js";
|
|
16
|
-
|
|
17
|
-
/** A record of translation keys and their corresponding translated strings. */
|
|
18
|
-
export type I18nTranslationBundle = Record<string, string>;
|
|
19
|
-
|
|
20
|
-
/** A record of language codes and their corresponding translation bundles. */
|
|
21
|
-
export type ResourcesRecord = Record<string, I18nTranslationBundle>;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Props for the `getTranslationServices` function.
|
|
25
|
-
* It infers the supported language codes and bundle types from the `resources` object.
|
|
26
|
-
*/
|
|
27
|
-
export type GetTranslationServicesProps<
|
|
28
|
-
TNamespace extends string,
|
|
29
|
-
TResources extends ResourcesRecord,
|
|
30
|
-
TDefaultLanguageCode extends Extract<keyof TResources, string>,
|
|
31
|
-
> = {
|
|
32
|
-
/**
|
|
33
|
-
* Default language code to fall back to.
|
|
34
|
-
* MUST be one of the keys in the `resources` object.
|
|
35
|
-
*/
|
|
36
|
-
defaultLanguageCode: TDefaultLanguageCode;
|
|
37
|
-
/** The namespace for the translation resources. */
|
|
38
|
-
namespace: TNamespace;
|
|
39
|
-
/** The resources object, from which all language codes and bundle types are inferred. */
|
|
40
|
-
resources: TResources;
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
export type TranslationOverrides<
|
|
44
|
-
SupportedLanguageCodes extends string = DefaultSupportedLanguages,
|
|
45
|
-
> = Record<SupportedLanguageCodes, Partial<I18nTranslationBundle>>;
|
|
46
|
-
|
|
47
|
-
export type TranslationProviderProps<
|
|
48
|
-
SupportedLanguageCodes extends string = DefaultSupportedLanguages,
|
|
49
|
-
> = {
|
|
50
|
-
children: ReactNode;
|
|
51
|
-
languageCode?: SupportedLanguageCodes;
|
|
52
|
-
translationOverrides?: TranslationOverrides<SupportedLanguageCodes>;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
type ExtractPlaceholders<TString extends string> =
|
|
56
|
-
TString extends `${string}{{${infer PlaceholderId}}}${infer Rest}`
|
|
57
|
-
? PlaceholderId | ExtractPlaceholders<Rest>
|
|
58
|
-
: never;
|
|
59
|
-
|
|
60
|
-
export type PlaceholderValues =
|
|
61
|
-
| string
|
|
62
|
-
| number
|
|
63
|
-
| TemplateStringsArray
|
|
64
|
-
| (string | TemplateStringsArray)[];
|
|
65
|
-
|
|
66
|
-
export type PlaceholderRecord<
|
|
67
|
-
TResourceBundle extends I18nTranslationBundle,
|
|
68
|
-
TKey extends keyof TResourceBundle & string,
|
|
69
|
-
> = Record<ExtractPlaceholders<TResourceBundle[TKey]>, PlaceholderValues>;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Custom function signature that enforces strong typing
|
|
73
|
-
* against the keys of a specific resource bundle.
|
|
74
|
-
*/
|
|
75
|
-
export type TypedTFunction<TResourceBundle extends I18nTranslationBundle> = <
|
|
76
|
-
TKey extends keyof TResourceBundle & string,
|
|
77
|
-
>(
|
|
78
|
-
...args: [ExtractPlaceholders<TResourceBundle[TKey]>] extends [never]
|
|
79
|
-
? // if no placeholders, options are optional
|
|
80
|
-
[key: TKey | TKey[], options?: TOptions]
|
|
81
|
-
: // if placeholders exist, placeholder values are required
|
|
82
|
-
[
|
|
83
|
-
key: TKey | TKey[],
|
|
84
|
-
options: TOptions<PlaceholderRecord<TResourceBundle, TKey>>,
|
|
85
|
-
]
|
|
86
|
-
) => string;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Return type of our strongly-typed `useTranslation` hook.
|
|
90
|
-
*
|
|
91
|
-
* Matches the original `useTranslation` return type, but with
|
|
92
|
-
* our `TypedTFunction` rather than the generic `TFunction`.
|
|
93
|
-
*/
|
|
94
|
-
export type TypedUseTranslationResponse<
|
|
95
|
-
TResourceBundle extends I18nTranslationBundle,
|
|
96
|
-
> = [t: TypedTFunction<TResourceBundle>, i18n: typeof i18n, ready: boolean] & {
|
|
97
|
-
i18n: typeof i18n;
|
|
98
|
-
ready: boolean;
|
|
99
|
-
t: TypedTFunction<TResourceBundle>;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export interface IGenericTranslationProvider {
|
|
103
|
-
<SupportedLanguageCodes extends string = DefaultSupportedLanguages>(
|
|
104
|
-
props: TranslationProviderProps<SupportedLanguageCodes>,
|
|
105
|
-
): ReactNode;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export type UseTranslationOptions<TNamespace extends string> = Omit<
|
|
109
|
-
UseI18NextTranslationOptions<TNamespace>,
|
|
110
|
-
"i18n"
|
|
111
|
-
>;
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* A strongly-typed version of the `useTranslation` hook from `react-i18next`,
|
|
115
|
-
* bound to a specific namespace and resource bundle type.
|
|
116
|
-
*/
|
|
117
|
-
export type UseTranslation<
|
|
118
|
-
TNamespace extends string,
|
|
119
|
-
TResourceBundle extends I18nTranslationBundle,
|
|
120
|
-
> = (
|
|
121
|
-
options?: UseTranslationOptions<TNamespace>,
|
|
122
|
-
) => TypedUseTranslationResponse<TResourceBundle>;
|
|
123
|
-
|
|
124
|
-
export type TypedTrans<
|
|
125
|
-
TNamespace extends string,
|
|
126
|
-
TResourceBundle extends I18nTranslationBundle,
|
|
127
|
-
> = <TKey extends Extract<keyof TResourceBundle, string>>(
|
|
128
|
-
props: Omit<
|
|
129
|
-
TransI18nNextProps<TKey & string, TNamespace>,
|
|
130
|
-
"i18n" | "values" | "i18nKey"
|
|
131
|
-
> & {
|
|
132
|
-
// explicitly type `i18nKey` to be the specific key
|
|
133
|
-
i18nKey: TKey | TKey[];
|
|
134
|
-
} & ([ExtractPlaceholders<TResourceBundle[TKey]>] extends [never] // add conditional `values` prop
|
|
135
|
-
? // if no placeholders, `values` is forbidden
|
|
136
|
-
{ values?: never }
|
|
137
|
-
: // if placeholders exist, `values` is required and strictly typed
|
|
138
|
-
{
|
|
139
|
-
values: PlaceholderRecord<TResourceBundle, TKey>;
|
|
140
|
-
}),
|
|
141
|
-
) => ReactElement;
|
|
142
|
-
|
|
143
|
-
export type TranslationServices<
|
|
144
|
-
TNamespace extends string,
|
|
145
|
-
TResources extends ResourcesRecord,
|
|
146
|
-
TDefaultLanguageCode extends Extract<keyof TResources, string>,
|
|
147
|
-
> = {
|
|
148
|
-
/** The i18next instance created for this package. */
|
|
149
|
-
i18n: typeof i18n;
|
|
150
|
-
Trans: TypedTrans<TNamespace, TResources[TDefaultLanguageCode]>;
|
|
151
|
-
/**
|
|
152
|
-
* A ready-to-use Translation Provider, which is a generic component.
|
|
153
|
-
*
|
|
154
|
-
* The consumer can specify the supported languages when using it.
|
|
155
|
-
* @example <TranslationProvider<"en" | "ja">>
|
|
156
|
-
*/
|
|
157
|
-
TranslationProvider: IGenericTranslationProvider;
|
|
158
|
-
/** A pre-typed `useTranslation` hook bound to the given namespace. */
|
|
159
|
-
useTranslation: UseTranslation<TNamespace, TResources[TDefaultLanguageCode]>;
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Initializes an `i18next` instance and provides strongly-typed
|
|
164
|
-
* translation utilities: `useTranslation`, `Trans`, and `TranslationProvider`.
|
|
165
|
-
*/
|
|
166
|
-
export function getTranslationServices<
|
|
167
|
-
TNamespace extends string,
|
|
168
|
-
TResources extends ResourcesRecord,
|
|
169
|
-
TDefaultLanguageCode extends Extract<keyof TResources, string>,
|
|
170
|
-
>({
|
|
171
|
-
defaultLanguageCode,
|
|
172
|
-
namespace,
|
|
173
|
-
resources,
|
|
174
|
-
}: GetTranslationServicesProps<
|
|
175
|
-
TNamespace,
|
|
176
|
-
TResources,
|
|
177
|
-
TDefaultLanguageCode
|
|
178
|
-
>): TranslationServices<TNamespace, TResources, TDefaultLanguageCode> {
|
|
179
|
-
const i18nInstance = createInstance();
|
|
180
|
-
|
|
181
|
-
i18nInstance
|
|
182
|
-
.use(initReactI18next)
|
|
183
|
-
.init({
|
|
184
|
-
defaultNS: namespace,
|
|
185
|
-
ns: [namespace],
|
|
186
|
-
fallbackLng: defaultLanguageCode,
|
|
187
|
-
load: "currentOnly",
|
|
188
|
-
keySeparator: false,
|
|
189
|
-
interpolation: {
|
|
190
|
-
escapeValue: false,
|
|
191
|
-
skipOnVariables: false,
|
|
192
|
-
},
|
|
193
|
-
react: {
|
|
194
|
-
bindI18nStore: "added",
|
|
195
|
-
useSuspense: false,
|
|
196
|
-
},
|
|
197
|
-
})
|
|
198
|
-
.catch((error) => {
|
|
199
|
-
console.error(
|
|
200
|
-
`[odyssey-contribution-tooling] Error initializing i18nInstance for namespace: ${namespace}`,
|
|
201
|
-
);
|
|
202
|
-
console.error(error);
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
Object.entries(resources).forEach(([languageCode, bundle]) => {
|
|
206
|
-
i18nInstance.addResourceBundle(languageCode, namespace, bundle);
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
const TranslationProvider = <
|
|
210
|
-
ProviderSupportedLanguageCodes extends string = DefaultSupportedLanguages,
|
|
211
|
-
>({
|
|
212
|
-
children,
|
|
213
|
-
languageCode,
|
|
214
|
-
translationOverrides,
|
|
215
|
-
}: TranslationProviderProps<ProviderSupportedLanguageCodes>) => {
|
|
216
|
-
useEffect(() => {
|
|
217
|
-
const updatedLanguageCode = languageCode || window.navigator.language;
|
|
218
|
-
i18nInstance.changeLanguage(updatedLanguageCode).catch((error) => {
|
|
219
|
-
console.error(
|
|
220
|
-
`[odyssey-contribution-tooling] Error changing language code in i18nInstance to: ${updatedLanguageCode}`,
|
|
221
|
-
);
|
|
222
|
-
console.error(error);
|
|
223
|
-
});
|
|
224
|
-
}, [languageCode]);
|
|
225
|
-
|
|
226
|
-
useEffect(() => {
|
|
227
|
-
if (translationOverrides) {
|
|
228
|
-
getTypedObjectEntries(translationOverrides).forEach(
|
|
229
|
-
([languageCode, overrideBundle]) => {
|
|
230
|
-
i18nInstance.addResourceBundle(
|
|
231
|
-
languageCode,
|
|
232
|
-
namespace,
|
|
233
|
-
overrideBundle,
|
|
234
|
-
true,
|
|
235
|
-
true,
|
|
236
|
-
);
|
|
237
|
-
},
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
}, [translationOverrides]);
|
|
241
|
-
|
|
242
|
-
return <I18nextProvider i18n={i18nInstance}>{children}</I18nextProvider>;
|
|
243
|
-
};
|
|
244
|
-
|
|
245
|
-
const MemoizedTranslationProvider = memo(TranslationProvider);
|
|
246
|
-
MemoizedTranslationProvider.displayName = "TranslationProvider";
|
|
247
|
-
|
|
248
|
-
const Trans: TypedTrans<TNamespace, TResources[TDefaultLanguageCode]> = (
|
|
249
|
-
props,
|
|
250
|
-
) => {
|
|
251
|
-
return (
|
|
252
|
-
<TransI18nNext
|
|
253
|
-
{...(props satisfies TransI18nNextProps<string, TNamespace>)}
|
|
254
|
-
i18n={i18nInstance}
|
|
255
|
-
/>
|
|
256
|
-
);
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
const useTranslation: UseTranslation<
|
|
260
|
-
TNamespace,
|
|
261
|
-
TResources[TDefaultLanguageCode]
|
|
262
|
-
> = (options?: UseTranslationOptions<TNamespace>) => {
|
|
263
|
-
const [t, i18n, ready] = useI18nNextTranslation(namespace, {
|
|
264
|
-
...options,
|
|
265
|
-
i18n: i18nInstance,
|
|
266
|
-
});
|
|
267
|
-
const typedT = t as TypedTFunction<TResources[TDefaultLanguageCode]>;
|
|
268
|
-
|
|
269
|
-
const result = [typedT, i18n, ready] as TypedUseTranslationResponse<
|
|
270
|
-
TResources[TDefaultLanguageCode]
|
|
271
|
-
>;
|
|
272
|
-
|
|
273
|
-
result.t = typedT;
|
|
274
|
-
result.i18n = i18n;
|
|
275
|
-
result.ready = ready;
|
|
276
|
-
|
|
277
|
-
return result;
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
return {
|
|
281
|
-
i18n: i18nInstance,
|
|
282
|
-
TranslationProvider: MemoizedTranslationProvider,
|
|
283
|
-
Trans,
|
|
284
|
-
useTranslation,
|
|
285
|
-
};
|
|
286
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export const defaultSupportedLanguages = [
|
|
2
|
-
"cs", // Czech
|
|
3
|
-
"da", // Danish
|
|
4
|
-
"de", // German
|
|
5
|
-
"el", // Greek
|
|
6
|
-
"en", // English
|
|
7
|
-
"es", // Spanish
|
|
8
|
-
"eu", // Euskara
|
|
9
|
-
"fi", // Finnish
|
|
10
|
-
"fr", // French
|
|
11
|
-
"ht", // Haitian Creole
|
|
12
|
-
"hu", // Hungarian
|
|
13
|
-
"id", // Indonesian
|
|
14
|
-
"it", // Italian
|
|
15
|
-
"ja", // Japanese
|
|
16
|
-
"ko", // Korean
|
|
17
|
-
"ms", // Malaysian
|
|
18
|
-
"nb", // Norwegian
|
|
19
|
-
"nl_NL", // Dutch
|
|
20
|
-
"ok_PL", // (Test Language) Pseudo-loc
|
|
21
|
-
"ok_SK", // (Test Language) Show Keys
|
|
22
|
-
"pl", // Polish
|
|
23
|
-
"pt_BR", // Portuguese (Brazil)
|
|
24
|
-
"ro", // Romanian
|
|
25
|
-
"ru", // Russian
|
|
26
|
-
"sv", // Swedish
|
|
27
|
-
"th", // Thai
|
|
28
|
-
"tr", // Turkish
|
|
29
|
-
"uk", // Ukrainian
|
|
30
|
-
"vi", // Vietnamese
|
|
31
|
-
"zh_CN", // Chinese (PRC)
|
|
32
|
-
"zh_TW", // Chinese
|
|
33
|
-
] as const;
|
|
34
|
-
|
|
35
|
-
export type DefaultSupportedLanguages =
|
|
36
|
-
(typeof defaultSupportedLanguages)[number];
|
package/src/tsconfig.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"allowJs": false,
|
|
5
|
-
"composite": true,
|
|
6
|
-
"emitDeclarationOnly": false,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"incremental": true,
|
|
10
|
-
"isolatedModules": true,
|
|
11
|
-
"jsx": "react-jsx",
|
|
12
|
-
"jsxImportSource": "@emotion/react",
|
|
13
|
-
"lib": ["DOM", "ESNext", "ES2021"],
|
|
14
|
-
"module": "NodeNext",
|
|
15
|
-
"moduleResolution": "NodeNext",
|
|
16
|
-
"noEmit": false,
|
|
17
|
-
"noEmitOnError": true,
|
|
18
|
-
"noFallthroughCasesInSwitch": true,
|
|
19
|
-
"noImplicitOverride": true,
|
|
20
|
-
"noImplicitReturns": true,
|
|
21
|
-
"noUnusedLocals": true,
|
|
22
|
-
"noUnusedParameters": true,
|
|
23
|
-
"outDir": "dist/types",
|
|
24
|
-
"resolveJsonModule": true,
|
|
25
|
-
"rootDir": "src",
|
|
26
|
-
"skipLibCheck": true,
|
|
27
|
-
"sourceMap": true,
|
|
28
|
-
"strict": true,
|
|
29
|
-
"target": "es2020",
|
|
30
|
-
"types": ["@vitest/browser/matchers", "vitest/globals"]
|
|
31
|
-
},
|
|
32
|
-
"include": [
|
|
33
|
-
"src/**/*.ts",
|
|
34
|
-
"src/**/*.tsx",
|
|
35
|
-
"../vite.config.ts",
|
|
36
|
-
"../vite.config.project.ts",
|
|
37
|
-
"../vitest.config.ts",
|
|
38
|
-
"../vitest.config.project.ts"
|
|
39
|
-
],
|
|
40
|
-
"exclude": ["**/dist/**/*"]
|
|
41
|
-
}
|
package/vite.config.project.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2025-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 { defineConfig } from "vite";
|
|
14
|
-
|
|
15
|
-
import packageJson from "./package.json" with { type: "json" };
|
|
16
|
-
|
|
17
|
-
const umdName = packageJson.name
|
|
18
|
-
.replace(/^(@(.+)\/)?(.+)$/, "$2-$3")
|
|
19
|
-
.split("-")
|
|
20
|
-
.map((namePart) =>
|
|
21
|
-
namePart.slice(0, 1).toUpperCase().concat(namePart.slice(1)),
|
|
22
|
-
)
|
|
23
|
-
.join("");
|
|
24
|
-
|
|
25
|
-
// Vite customizations can go in this file. These will override those provided by the stack.
|
|
26
|
-
export default defineConfig(({ command }) => ({
|
|
27
|
-
define:
|
|
28
|
-
command === "build"
|
|
29
|
-
? {
|
|
30
|
-
"process.env.NODE_ENV": '"production"',
|
|
31
|
-
}
|
|
32
|
-
: {},
|
|
33
|
-
|
|
34
|
-
build: {
|
|
35
|
-
emptyOutDir: false,
|
|
36
|
-
lib: {
|
|
37
|
-
entry: `${__dirname}/src/index.ts`,
|
|
38
|
-
fileName: (format) =>
|
|
39
|
-
`index.${format}.${format === "umd" ? "cjs" : "js"}`,
|
|
40
|
-
formats: ["es", "iife", "umd"],
|
|
41
|
-
name: umdName,
|
|
42
|
-
},
|
|
43
|
-
sourcemap: true,
|
|
44
|
-
rollupOptions: {
|
|
45
|
-
external: [
|
|
46
|
-
"react",
|
|
47
|
-
"react-dom",
|
|
48
|
-
"react/jsx-runtime",
|
|
49
|
-
"react/jsx-dev-runtime",
|
|
50
|
-
],
|
|
51
|
-
output: {
|
|
52
|
-
globals: {
|
|
53
|
-
react: "React",
|
|
54
|
-
"react-dom": "ReactDOM",
|
|
55
|
-
"react/jsx-runtime": "ReactJSXRuntime",
|
|
56
|
-
"react/jsx-dev-runtime": "ReactJSXDevRuntime",
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
}));
|
package/vite.config.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// DO NOT EDIT THIS FILE!
|
|
2
|
-
// This is the vite.config.ts file provided by the core-gen4 stack. Do not edit this; instead, place any custom configuration settings
|
|
3
|
-
// in the `vite.config.project.ts` file. If this file is modified, you are on your own and results of using the stack's vite config
|
|
4
|
-
// cannot be supported.
|
|
5
|
-
|
|
6
|
-
import stackConfig from "@okta/ui-stacks-component-libraries-odyssey-contributions/dist/configs/vite.config.js";
|
|
7
|
-
import { defineConfig, mergeConfig, type UserConfigFnPromise } from "vite";
|
|
8
|
-
|
|
9
|
-
import projectConfig from "./vite.config.project.js";
|
|
10
|
-
|
|
11
|
-
// Merge, in this order:
|
|
12
|
-
// - the stack's vite.config.js
|
|
13
|
-
// - the project's vite.config.project.js
|
|
14
|
-
export default defineConfig(async (env) =>
|
|
15
|
-
mergeConfig(
|
|
16
|
-
stackConfig,
|
|
17
|
-
typeof projectConfig === "function"
|
|
18
|
-
? await (projectConfig as UserConfigFnPromise)(env)
|
|
19
|
-
: projectConfig,
|
|
20
|
-
),
|
|
21
|
-
);
|
package/vite.config.ts.bak
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2025-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
|
-
// DO NOT EDIT THIS FILE!
|
|
14
|
-
// This is the vite.config.ts file provided by the core-gen4 stack. Do not edit this; instead, place any custom configuration settings
|
|
15
|
-
// in the `vite.config.project.ts` file. If this file is modified, you are on your own and results of using the stack's vite config
|
|
16
|
-
// cannot be supported.
|
|
17
|
-
|
|
18
|
-
import stackConfig from "@okta/ui-stacks-component-libraries-odyssey-contributions/dist/configs/vite.config.js";
|
|
19
|
-
import { defineConfig, mergeConfig, type UserConfigFnPromise } from "vite";
|
|
20
|
-
|
|
21
|
-
import projectConfig from "./vite.config.project.js";
|
|
22
|
-
|
|
23
|
-
// Merge, in this order:
|
|
24
|
-
// - the stack's vite.config.js
|
|
25
|
-
// - the project's vite.config.project.js
|
|
26
|
-
export default defineConfig(async (env) =>
|
|
27
|
-
mergeConfig(
|
|
28
|
-
stackConfig,
|
|
29
|
-
typeof projectConfig === "function"
|
|
30
|
-
? await (projectConfig as UserConfigFnPromise)(env)
|
|
31
|
-
: projectConfig,
|
|
32
|
-
),
|
|
33
|
-
);
|