@okta/odyssey-react-mui 1.48.0 → 1.49.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.
Files changed (360) hide show
  1. package/dist/assets/{Accordion-MTHvu5cR.js → Accordion-BNJn0pfW.js} +1 -1
  2. package/dist/assets/{Accordion.stories-DniSJ38i.js → Accordion.stories-DZIjfE-o.js} +1 -1
  3. package/dist/assets/{AccordionSummary-Byc6MkHu.js → AccordionSummary-BjqT0nEb.js} +1 -1
  4. package/dist/assets/{AlertTitle-BDkgiA29.js → AlertTitle-q6ff_Zkl.js} +1 -1
  5. package/dist/assets/{AppSwitcher-mUx_f1r6.js → AppSwitcher-cyyPttJv.js} +1 -1
  6. package/dist/assets/{AppSwitcher.stories-CENgxWSC.js → AppSwitcher.stories--8DVDaS1.js} +1 -1
  7. package/dist/assets/AppTile _labs_.stories-D9W_XD90.js +136 -0
  8. package/dist/assets/ArrowDropDown-DdemyKZU.js +1 -0
  9. package/dist/assets/{ArrowRight-BquvVn3D.js → ArrowRight-ChWYjNny.js} +1 -1
  10. package/dist/assets/{Autocomplete-Bh3XRXMy.js → Autocomplete-Cpi_kUVA.js} +1 -1
  11. package/dist/assets/{Autocomplete-CknstIK_.js → Autocomplete-CxtGbb8j.js} +1 -1
  12. package/dist/assets/{Autocomplete.stories-DNDWoB5E.js → Autocomplete.stories-CQuaZrwN.js} +3 -3
  13. package/dist/assets/{Badge-DFZYqSZN.js → Badge-BO7bTIEa.js} +1 -1
  14. package/dist/assets/{Banner-25ZggH76.js → Banner-K7AM0SJj.js} +1 -1
  15. package/dist/assets/{Banner.stories-Dz37neYC.js → Banner.stories-BRQINNIu.js} +3 -3
  16. package/dist/assets/{BaseButton-Cd1oZPsh.js → BaseButton-DYZHKnV3.js} +1 -1
  17. package/dist/assets/BaseMenuButton-BIietjUB.js +1 -0
  18. package/dist/assets/{Box-B-R2QRDU.js → Box-1mvP3NLW.js} +1 -1
  19. package/dist/assets/Box-BcMTQ_R2.js +1 -0
  20. package/dist/assets/Box-DXoV5_ch.js +11 -0
  21. package/dist/assets/{Box.stories-BCtoarqr.js → Box.stories-C8EeKXhb.js} +1 -1
  22. package/dist/assets/Breadcrumbs-Bp-jt6t5.js +6 -0
  23. package/dist/assets/{Breadcrumbs.stories-BTEZLo9U.js → Breadcrumbs.stories-B_3snTWA.js} +1 -1
  24. package/dist/assets/{Bug-Z3X3t5xp.js → Bug-CQIUmZ-N.js} +1 -1
  25. package/dist/assets/{Button-DPUOjyZy.js → Button-BEA5U6Tg.js} +1 -1
  26. package/dist/assets/{Button-BvUGu5Sm.js → Button-BzIwUmSM.js} +1 -1
  27. package/dist/assets/{Button.stories-CLRsJ0J2.js → Button.stories-S7v-663i.js} +2 -2
  28. package/dist/assets/{ButtonBase-CrcIXP69.js → ButtonBase-BNqa2TMD.js} +2 -2
  29. package/dist/assets/{Calendar-DnwsjheN.js → Calendar-_GPHtaRa.js} +1 -1
  30. package/dist/assets/{Callout-qkeUDNKn.js → Callout-FZxPpigF.js} +1 -1
  31. package/dist/assets/Callout.stories-CODSBn6K.js +105 -0
  32. package/dist/assets/{Card-DL97TZJd.js → Card-C0RGIer3.js} +1 -1
  33. package/dist/assets/Card-CBiqCoFv.js +8 -0
  34. package/dist/assets/{Card.stories-ROWJyBI0.js → Card.stories-Cp5cSsvN.js} +1 -1
  35. package/dist/assets/{CardActionArea-BaL2GhSM.js → CardActionArea-DWrXZntI.js} +1 -1
  36. package/dist/assets/{CardActions-C1bW_Jqo.js → CardActions-BQdq7Bn0.js} +1 -1
  37. package/dist/assets/{Checkbox-eGdyySzm.js → Checkbox-DPv3Q9UW.js} +1 -1
  38. package/dist/assets/{Checkbox-OauVZWc5.js → Checkbox-vZwuXtzm.js} +1 -1
  39. package/dist/assets/{Checkbox.stories-DwmuFw2j.js → Checkbox.stories-9dZS0JMC.js} +1 -1
  40. package/dist/assets/{CheckboxGroup-BQ5GiUey.js → CheckboxGroup-Be66QML5.js} +1 -1
  41. package/dist/assets/CheckboxGroup.stories-Cx6CsE7C.js +92 -0
  42. package/dist/assets/{ChevronRight-BLkvXBUf.js → ChevronRight-C12ToI7Y.js} +1 -1
  43. package/dist/assets/{ChevronUp-Br-QC-XK.js → ChevronUp-CfT7Bz8X.js} +1 -1
  44. package/dist/assets/{Chip-B9WkuA4b.js → Chip-CXnMieIl.js} +1 -1
  45. package/dist/assets/{CircularProgress-DxY3QwHW.js → CircularProgress-DPxwxglU.js} +1 -1
  46. package/dist/assets/{CircularProgress-AX8KCiV6.js → CircularProgress-HbIdZLBB.js} +4 -4
  47. package/dist/assets/{CircularProgress.stories-a_Rse-5m.js → CircularProgress.stories-BCClfpJw.js} +1 -1
  48. package/dist/assets/{Clock-8HOQy_d4.js → Clock-17ua7UAW.js} +1 -1
  49. package/dist/assets/{Close-BjXKhBr_.js → Close-OXBt1nIe.js} +1 -1
  50. package/dist/assets/{Code Styling Guidelines-BkGO8zp-.js → Code Styling Guidelines-CVbofGQK.js } +1 -1
  51. package/dist/assets/{Collapse-DtQCvyEw.js → Collapse-DfdoVIdP.js} +1 -1
  52. package/dist/assets/{Color-YHDXOIA2-CcoN0wsl.js → Color-YHDXOIA2-DT4T6TnK.js} +1 -1
  53. package/dist/assets/{CssBaseline-CI1_OCUX.js → CssBaseline-DpDXOHEK.js} +1 -1
  54. package/dist/assets/{CssBaseline.stories-BSLs5ScZ.js → CssBaseline.stories-DeSEyTd-.js} +1 -1
  55. package/dist/assets/{Custom Theming-WlDJkwzT.js → Custom Theming-CmbOHtP1.js } +2 -2
  56. package/dist/assets/Custom Theming.stories-CxVTbjdx.js +95 -0
  57. package/dist/assets/{DataFilters _labs_-BIYE5QJU.js → DataFilters _labs_-DvUVhC-g.js } +2 -2
  58. package/dist/assets/{DataFilters _labs_.stories-BdV81MCI.js → DataFilters _labs_.stories-Ca9tvzkv.js } +1 -1
  59. package/dist/assets/{DataFilters-KxLw7hL5.js → DataFilters-BnT_U3-o.js} +1 -1
  60. package/dist/assets/DataTable _labs_-DL8Jc4Hl.js +41 -0
  61. package/dist/assets/{DataTable _labs_.stories-CTl54dDN.js → DataTable _labs_.stories-C9Tljg4U.js } +1 -1
  62. package/dist/assets/{DataTable-bZz790ci.js → DataTable-S0xhd1LQ.js} +2 -2
  63. package/dist/assets/{DataTable-BJQ8WkUd.js → DataTable-XayRBHyP.js} +2 -2
  64. package/dist/assets/{DataTable.stories-9eBclyx2.js → DataTable.stories-tcZyd507.js} +1 -1
  65. package/dist/assets/{DataView _labs_-AutzTAhE.js → DataView _labs_-oQPoSKgb.js } +2 -2
  66. package/dist/assets/{DataView _labs_.stories-CO0XGhOV.js → DataView _labs_.stories-C_xQt04_.js } +1 -1
  67. package/dist/assets/{DataView-CHGdxu-Z.js → DataView-C5rMFmwA.js} +6 -6
  68. package/dist/assets/{DataView.stories-6cnSmpm3.js → DataView.stories-oJRHGPAN.js} +3 -3
  69. package/dist/assets/{DatePicker-BGoHW8Is.js → DatePicker-BwDkz3WT.js} +1 -1
  70. package/dist/assets/{DatePicker-C6TIvuN7.js → DatePicker-CaivHe9y.js} +2 -2
  71. package/dist/assets/DatePicker.stories-DbwO66Pf.js +133 -0
  72. package/dist/assets/{DateTimePicker-DKGE8593.js → DateTimePicker-B7a9bgL6.js} +1 -1
  73. package/dist/assets/{DateTimePicker.stories-TBpe3AjQ.js → DateTimePicker.stories-DL2oaP7L.js} +6 -6
  74. package/dist/assets/Design Tokens-CLnoritM.js +4 -0
  75. package/dist/assets/Dialog-CR4TUjlJ.js +1 -0
  76. package/dist/assets/{Dialog.stories-BQZpS-f5.js → Dialog.stories-2q37jV4r.js} +1 -1
  77. package/dist/assets/{DialogContent-B-pM1DP1.js → DialogContent-Cwn-I-C_.js} +1 -1
  78. package/dist/assets/{DialogTitle-DA2nrmUc.js → DialogTitle-C-K7jEio.js} +1 -1
  79. package/dist/assets/{Divider-CAwVs6Y1.js → Divider-Ln3VaO81.js} +1 -1
  80. package/dist/assets/{DocsRenderer-CFRXHY34-kO-n-5EB.js → DocsRenderer-CFRXHY34-CCeAz_jE.js} +1 -1
  81. package/dist/assets/{Documentation-CBbHUjXC.js → Documentation-DF3oo39e.js} +1 -1
  82. package/dist/assets/{Download-VHpUH0as.js → Download-Zlhupksh.js} +1 -1
  83. package/dist/assets/{Drawer-C9M8pytV.js → Drawer-CXQ3piJR.js} +2 -2
  84. package/dist/assets/Drawer.stories-Dlkg74m1.js +95 -0
  85. package/dist/assets/{EmptyState-FpIKkMpd.js → EmptyState-CpBEzmap.js} +1 -1
  86. package/dist/assets/EmptyState.stories-Dl57LvdY.js +11 -0
  87. package/dist/assets/{ExampleButton.stories-CbAFs20l.js → ExampleButton.stories-Bbj5W6A-.js} +1 -1
  88. package/dist/assets/{Extending Translations-mp_vyXoH.js → Extending Translations-D38KR8Kn.js } +1 -1
  89. package/dist/assets/{ExternalLink-lox07hAR.js → ExternalLink-D0l1c5Cz.js} +1 -1
  90. package/dist/assets/{Fade-CHnXmzFb.js → Fade-dUgBN8rJ.js} +1 -1
  91. package/dist/assets/{Field-BxkyNVQW.js → Field-DH3L8v09.js} +2 -2
  92. package/dist/assets/{FieldHint-D5VttvwL.js → FieldHint-B3Jif_Up.js} +1 -1
  93. package/dist/assets/{Fieldset-Dp9uCwiB.js → Fieldset-D7_59eeI.js} +1 -1
  94. package/dist/assets/Fieldset.stories-B-NXKKP-.js +15 -0
  95. package/dist/assets/{FileUploader.stories-CxYwF2DZ.js → FileUploader.stories-C9ua336t.js} +6 -6
  96. package/dist/assets/{Filter-BiREetkX.js → Filter-DsDJ7si-.js} +1 -1
  97. package/dist/assets/{Folder-8esChg_E.js → Folder-e-po0U54.js} +1 -1
  98. package/dist/assets/{Form Field Accessibility-BCFouYXt.js → Form Field Accessibility-D5GmQTjo.js } +1 -1
  99. package/dist/assets/{Form-CJrxMkwr.js → Form-iTx8DKdm.js} +1 -1
  100. package/dist/assets/Form.stories-CKX8F-HV.js +69 -0
  101. package/dist/assets/{FormControlLabel-CoGABX1G.js → FormControlLabel-0BBemR80.js} +1 -1
  102. package/dist/assets/{FormGroup-D2d8E3Cw.js → FormGroup-HFkGZ983.js} +1 -1
  103. package/dist/assets/{FormHelperText-Ca69g4Je.js → FormHelperText-CsNAE1E3.js} +1 -1
  104. package/dist/assets/{FormLabel-EOlXQpGp.js → FormLabel-CiGre9wK.js} +1 -1
  105. package/dist/assets/{FullScreenOverlay-Bujsxbxh.js → FullScreenOverlay-BTMDlJhE.js} +1 -1
  106. package/dist/assets/{Generating Icons-pN6RBs4J.js → Generating Icons-B_lqn7WI.js } +1 -1
  107. package/dist/assets/{Globe-BHk1B5d7.js → Globe-B83Xmd05.js} +1 -1
  108. package/dist/assets/{Grid-B7XSvQ_X.js → Grid-EpV3TL4a.js} +1 -1
  109. package/dist/assets/{Group-DWmiPyzE.js → Group-mTVRC79V.js} +1 -1
  110. package/dist/assets/GroupPicker _labs_.stories-rRod3ZIj.js +33 -0
  111. package/dist/assets/{Grow-6R6cTzr4.js → Grow-C8kUeGCY.js} +1 -1
  112. package/dist/assets/{Hide-Bvhl5PVN.js → Hide-TKfOHglI.js} +1 -1
  113. package/dist/assets/{Hint-DTEjQAxl.js → Hint-DoJneNg9.js} +1 -1
  114. package/dist/assets/{Home-CUQc6tB8.js → Home-la7Lmt_L.js} +1 -1
  115. package/dist/assets/Icon _icons_.stories-BmisOf4s.js +16 -0
  116. package/dist/assets/{IconButton-Wwvz84xG.js → IconButton-5qShmnSr.js} +1 -1
  117. package/dist/assets/{IconWithTooltip _icons_.stories-BiiIBhOv.js → IconWithTooltip _icons_.stories-C86MVO5n.js } +1 -1
  118. package/dist/assets/{InformationCircle-DYQV39lt.js → InformationCircle-a2jMUKfL.js} +1 -1
  119. package/dist/assets/{InputAdornment-Dj-8HF_1.js → InputAdornment-CdR3XT6f.js} +1 -1
  120. package/dist/assets/{InputBase-6reb9B7r.js → InputBase-DeB4_faH.js} +2 -2
  121. package/dist/assets/{Installing odyssey-react-mui-DuIfuEaw.js → Installing odyssey-react-mui-BlZZYALn.js } +1 -1
  122. package/dist/assets/{Introduction-BTH-MnwV.js → Introduction-D6814AO1.js} +6 -6
  123. package/dist/assets/{Layout-BndkhA1_.js → Layout-DGOs1275.js} +1 -1
  124. package/dist/assets/{Layout.stories-BwMtW-cW.js → Layout.stories-DE3l510g.js} +2 -2
  125. package/dist/assets/{Legacy Migrations-BfDwGUg3.js → Legacy Migrations-B9gOEz-l.js } +1 -1
  126. package/dist/assets/{Link-BQo2zH0c.js → Link-BDoLypER.js} +1 -1
  127. package/dist/assets/{Link-DcsndbPK.js → Link-DNIf0luC.js} +1 -1
  128. package/dist/assets/Link-dX7EI1Ct.js +11 -0
  129. package/dist/assets/{Link.stories-DiVQZsn1.js → Link.stories-DnkjU-5y.js} +1 -1
  130. package/dist/assets/{List-_p0jkXPM.js → List-CmjR1pNu.js} +1 -1
  131. package/dist/assets/{List-CNCQEpRl.js → List-UlX1tusJ.js} +1 -1
  132. package/dist/assets/{ListItem-BLYwuKOG.js → ListItem-C0ExFtXb.js} +1 -1
  133. package/dist/assets/{ListSubheader-DO359rMr.js → ListSubheader-CQJAAOsd.js} +1 -1
  134. package/dist/assets/{Menu-CU_mHT7L.js → Menu-K9lpVvDG.js} +1 -1
  135. package/dist/assets/{MenuButton-DvVmjwMC.js → MenuButton-B3T7c15t.js} +1 -1
  136. package/dist/assets/MenuButton-hdFGv_9Z.js +9 -0
  137. package/dist/assets/{MenuButton.stories-rLpv4nq1.js → MenuButton.stories-BRHUGqba.js} +1 -1
  138. package/dist/assets/{MenuItem-DoUaLmgU.js → MenuItem-CmSG6PNu.js} +1 -1
  139. package/dist/assets/{MenuItem-oi_JaUho.js → MenuItem-vhp8G-Nb.js} +1 -1
  140. package/dist/assets/{MenuItem.stories-Ba6BR5kj.js → MenuItem.stories-dOOOz3KO.js} +1 -1
  141. package/dist/assets/{MenuList-0OHGr5AC.js → MenuList-BMOesnfs.js} +1 -1
  142. package/dist/assets/{Modal-B12sS2Yh.js → Modal-CSDyCVCf.js} +1 -1
  143. package/dist/assets/{More-BgQrTkKM.js → More-DLQ2RjWn.js} +1 -1
  144. package/dist/assets/NativeSelect.stories-DHgms1GM.js +173 -0
  145. package/dist/assets/{OdysseyProvider-BPLFYiwr.js → OdysseyProvider-qIn9QVYS.js} +2 -2
  146. package/dist/assets/{OdysseyStorybookThemeDecorator-CGH8visK.js → OdysseyStorybookThemeDecorator-BuDiOG2V.js} +1 -1
  147. package/dist/assets/{OdysseyThemeProvider-BykOaJq8.js → OdysseyThemeProvider-Bh0Bu-2o.js} +1 -1
  148. package/dist/assets/{PageHeader.stories-DHDJTskZ.js → PageHeader.stories-MDEEjM1g.js} +2 -2
  149. package/dist/assets/{PageHeader.stories-Cg0XA0p_.js → PageHeader.stories-eACdVWYK.js} +3 -3
  150. package/dist/assets/PageTemplate _labs_-BuvgCua7.js +8 -0
  151. package/dist/assets/{PageTemplate _labs_.stories-DdUcW43S.js → PageTemplate _labs_.stories-C8RdfTqi.js } +1 -1
  152. package/dist/assets/{PageTemplate-mjLVQesI.js → PageTemplate-D-EQlTUx.js} +1 -1
  153. package/dist/assets/{PageTemplate.stories-BD8Hafdu.js → PageTemplate.stories-BzgC-WCT.js} +3 -3
  154. package/dist/assets/{PaginatedTable _labs_.stories-Lt6yWTDo.js → PaginatedTable _labs_.stories-CvpuSFlt.js } +3 -3
  155. package/dist/assets/{Pagination-BTycGMV-.js → Pagination-CB1wBW8Q.js} +2 -2
  156. package/dist/assets/Pagination.stories-RoH8O-RA.js +17 -0
  157. package/dist/assets/{Paper-DwBg74qy.js → Paper-D-_O-EjU.js} +1 -1
  158. package/dist/assets/PasswordField.stories-BUOy4gYe.js +129 -0
  159. package/dist/assets/Picker _labs_.stories-BIZmrH82.js +18 -0
  160. package/dist/assets/{PickerWithOptionAdornment _labs_.stories-BxW5XACd.js → PickerWithOptionAdornment _labs_.stories-CQYX6Af7.js } +3 -3
  161. package/dist/assets/Popper-BARIxJrI.js +1 -0
  162. package/dist/assets/{Portal-CsPQSHsR.js → Portal-C6D59xAE.js} +1 -1
  163. package/dist/assets/ProgressBar.stories-Dyp9UXSp.js +311 -0
  164. package/dist/assets/{Radio-7iHx2pBU.js → Radio-B4gVvwps.js} +1 -1
  165. package/dist/assets/{Radio-AD-L5UNl.js → Radio-BdNnpooK.js} +1 -1
  166. package/dist/assets/{Radio.stories-eZmvoamt.js → Radio.stories-BtiaRnXY.js} +1 -1
  167. package/dist/assets/{RadioGroup-Mx_cTqVX.js → RadioGroup-BYJZ378_.js} +1 -1
  168. package/dist/assets/RadioGroup-CtUWSbQc.js +1 -0
  169. package/dist/assets/RadioGroup-D1k5iqEQ.js +10 -0
  170. package/dist/assets/{RadioGroup.stories-CackbN0d.js → RadioGroup.stories-kfMrpCQ4.js} +1 -1
  171. package/dist/assets/{Refresh-CgZVXlSy.js → Refresh-DexPEklu.js} +1 -1
  172. package/dist/assets/{ResourceAccessPolicyComponentsStorybookThemeDecorator-Xen2vDro.js → ResourceAccessPolicyComponentsStorybookThemeDecorator-Bo_QNpfC.js} +1 -1
  173. package/dist/assets/{Right-to-Left (RTL)-CALRs8aM.js → Right-to-Left (RTL)-BHFSR1q8.js } +1 -1
  174. package/dist/assets/{ScreenReaderText-DbrZU7M5.js → ScreenReaderText-CebALBsG.js} +1 -1
  175. package/dist/assets/{ScreenReaderText-D9dVDvYs.js → ScreenReaderText-DkVEZTIb.js} +2 -2
  176. package/dist/assets/ScreenReaderText.stories-BuS5WxvE.js +8 -0
  177. package/dist/assets/{Search-BSlcf4bB.js → Search-C5TVrLyE.js} +1 -1
  178. package/dist/assets/{SearchDropdown _labs_.stories-CQype98o.js → SearchDropdown _labs_.stories-Bq7Qapoa.js } +3 -3
  179. package/dist/assets/{SearchField-glDE5e-X.js → SearchField-BdnOrhVM.js} +1 -1
  180. package/dist/assets/SearchField.stories-IB3f7QOK.js +37 -0
  181. package/dist/assets/{Select-VvpDulqk.js → Select-DZTigpTO.js} +1 -1
  182. package/dist/assets/{Select-BWJ6-p1Z.js → Select-KZvejALm.js} +2 -2
  183. package/dist/assets/{Select.stories-BXXrgt5o.js → Select.stories-5trfU4Ma.js} +2 -2
  184. package/dist/assets/{Server-DS5iERo2.js → Server-Ch5aeRtt.js} +1 -1
  185. package/dist/assets/{Settings-SRsJGOHl.js → Settings-2rTKyez8.js} +1 -1
  186. package/dist/assets/{Setup-Ri7IU42o.js → Setup-BDM9nDVO.js} +1 -1
  187. package/dist/assets/{Shadow DOM-DK_1Epv_.js → Shadow DOM-DHECKIzr.js } +1 -1
  188. package/dist/assets/{Show-DXIrBgNq.js → Show-BnmQFsN6.js} +1 -1
  189. package/dist/assets/{SideNav-QMiST_j6.js → SideNav-5pMdKSEl.js} +1 -1
  190. package/dist/assets/{SideNav-CUpwLG1e.js → SideNav-bhdOFKbL.js} +2 -2
  191. package/dist/assets/{SideNav.stories-l5XPKDfB.js → SideNav.stories-ciX1pArE.js} +1 -1
  192. package/dist/assets/{Skeleton-DAUyPclv.js → Skeleton-BPjIT6NG.js} +5 -5
  193. package/dist/assets/{Snackbar-DWLMI8Az.js → Snackbar-BM0ZOC4Y.js} +1 -1
  194. package/dist/assets/{Stack-t9yXrJ7r.js → Stack-B7OGvu7C.js} +1 -1
  195. package/dist/assets/{Stack.stories-zmhDXY_k.js → Stack.stories-CYylNLHT.js} +1 -1
  196. package/dist/assets/{StaticTable _labs_.stories-DJCAtW2q.js → StaticTable _labs_.stories-ChL0Cwn4.js } +3 -3
  197. package/dist/assets/{Status-CdgTiE4c.js → Status-BlOUycBm.js} +1 -1
  198. package/dist/assets/{Status.stories-D5tSpO2F.js → Status.stories-Dv4b1Z5X.js} +1 -1
  199. package/dist/assets/{Surface-BCTO1YR-.js → Surface-DTngmQRF.js} +1 -1
  200. package/dist/assets/{Switch.stories-r3bYAZpt.js → Switch.stories-hjVvL7UR.js} +5 -5
  201. package/dist/assets/{SwitchBase-CWdXZnig.js → SwitchBase-CefEM0OA.js} +1 -1
  202. package/dist/assets/{Sync-CCP_JZB8.js → Sync-BbqTDeWk.js} +1 -1
  203. package/dist/assets/{Tabs-Dxt5P3aJ.js → Tabs-CQz87GHd.js} +1 -1
  204. package/dist/assets/{Tabs-DCV9oDtT.js → Tabs-gXh7YFSu.js} +2 -2
  205. package/dist/assets/{Tabs.stories-CmjPJB02.js → Tabs.stories-CRJgQA20.js} +4 -4
  206. package/dist/assets/{Tag-C_iW2sj3.js → Tag-DwH0t814.js} +1 -1
  207. package/dist/assets/{Tag.stories-uilRDgPB.js → Tag.stories-CoLnXBke.js} +1 -1
  208. package/dist/assets/{TagList-cWni94xt.js → TagList-BZGEhGXn.js} +1 -1
  209. package/dist/assets/{TextField-BIepBlYn.js → TextField-BhK0y2Zt.js} +1 -1
  210. package/dist/assets/{TextField.stories-DkCMFN0S.js → TextField.stories-DYOK0z5b.js} +2 -2
  211. package/dist/assets/Toast.stories-BipAY3GN.js +134 -0
  212. package/dist/assets/{ToastManager.stories-DToM8bFE.js → ToastManager.stories-BWZvSWGT.js} +1 -1
  213. package/dist/assets/{Tooltip-D_pBGtcj.js → Tooltip-Cq2rQGbD.js} +1 -1
  214. package/dist/assets/{Tooltip-DQDBPKMu.js → Tooltip-CsVWtVfL.js} +1 -1
  215. package/dist/assets/{Tooltip.stories-CgIybZDx.js → Tooltip.stories-B6wyATg5.js} +1 -1
  216. package/dist/assets/{TopNav-Dwo-KfAw.js → TopNav-DEIYDz6v.js} +1 -1
  217. package/dist/assets/TopNav.stories-DJNZEi08.js +13 -0
  218. package/dist/assets/{Typography-DBt3ajUl.js → Typography-CkeEfKaM.js} +1 -1
  219. package/dist/assets/{Typography-CSpPZFTF.js → Typography-ClQ35Rr-.js} +1 -1
  220. package/dist/assets/{Typography-B7ktrxCD.js → Typography-Cz6D417Y.js} +1 -1
  221. package/dist/assets/{Typography-CQfngSjD.js → Typography-r6MlG5YM.js} +1 -1
  222. package/dist/assets/{Typography.stories-CitS-iTX.js → Typography.stories-93RlEwpU.js} +1 -1
  223. package/dist/assets/{Typography.stories-dzT0O_H3.js → Typography.stories-DRUYEGzH.js} +1 -1
  224. package/dist/assets/{UiShell.stories-BV5mK0Oz.js → UiShell.stories-HV8yGvd3.js} +3 -3
  225. package/dist/assets/{UiShellProvider-Bm9plvoZ.js → UiShellProvider-BEcD16AU.js} +1 -1
  226. package/dist/assets/{Upload-DH1T10x5.js → Upload-CfzP_Muq.js} +1 -1
  227. package/dist/assets/{User-CvYTA860.js → User-CyxEAfVT.js} +1 -1
  228. package/dist/assets/{UserProfile-DrnAMPM1.js → UserProfile-B6GSEZPs.js} +1 -1
  229. package/dist/assets/UserProfile.stories-Cx9GmLsV.js +14 -0
  230. package/dist/assets/{UserProfileMenuButton.stories-Dhe9t4Oh.js → UserProfileMenuButton.stories-BjxJHNWm.js} +3 -3
  231. package/dist/assets/{Video-D8qbHdF4.js → Video-DWT3WylB.js} +1 -1
  232. package/dist/assets/{WorkflowsComponentsStorybookThemeDecorator-DJR9iMBt.js → WorkflowsComponentsStorybookThemeDecorator-CxOFxh0W.js} +1 -1
  233. package/dist/assets/{colorManipulator-C6C6_xuT.js → colorManipulator-DKifQsuo.js} +1 -1
  234. package/dist/assets/createBox-Dxawkfow.js +1 -0
  235. package/dist/assets/{createStyled-B0CJenTX.js → createStyled-D6bTcpHC.js} +1 -1
  236. package/dist/assets/{createSvgIcon-Bv_3NNsK.js → createSvgIcon-ClUWwDzL.js} +1 -1
  237. package/dist/assets/{dialogActionsClasses-d6kliu8x.js → dialogActionsClasses-ZEPlxVw-.js} +1 -1
  238. package/dist/assets/emotion-react-jsx-runtime.browser.esm-DL0BDwaj.js +1 -0
  239. package/dist/assets/{entry-preview-Bi6MTClg.js → entry-preview-BxxndF3a.js} +1 -1
  240. package/dist/assets/{getReactElementRef-Bs64nbeG.js → getReactElementRef-DsIevm5t.js} +1 -1
  241. package/dist/assets/{iconUtils-C1HBA-0w.js → iconUtils-BII10A1q.js} +1 -1
  242. package/dist/assets/{iframe-C7GWUW76.js → iframe-Cf-Lpz6Y.js} +2 -2
  243. package/dist/assets/{index-DkrUiDVY.js → index-DB8HwIVZ.js} +1 -1
  244. package/dist/assets/{index-DfE121Jj.js → index-DLgQDw3r.js} +3 -3
  245. package/dist/assets/{index-DoKqiSdS.js → index-Ml2UeFXJ.js} +1 -1
  246. package/dist/assets/index-_dyfSX8u.js +1 -0
  247. package/dist/assets/{index.esm-BliC9-aw.js → index.esm-CBOWgn41.js} +1 -1
  248. package/dist/assets/{index.esm-XFhSJO0s.js → index.esm-DTxqsiYY.js} +1 -1
  249. package/dist/assets/{inheritsLoose-DTTkq0Su.js → inheritsLoose-CJ6Ie9dp.js} +1 -1
  250. package/dist/assets/{personData-BOnk54P3.js → personData-BYPP3apv.js} +1 -1
  251. package/dist/assets/{personData-L8dJyb3X.js → personData-CRkmqebZ.js} +1 -1
  252. package/dist/assets/{pickerComponentPropsMetadata-CozVRRyR.js → pickerComponentPropsMetadata-D10GkMIO.js} +2 -2
  253. package/dist/assets/{popper-aiaZgC6t.js → popper-BVOCD5jc.js} +1 -1
  254. package/dist/assets/{preview-DXRUsonv.js → preview-D06dtFvI.js} +2 -2
  255. package/dist/assets/{preview-NdtsJkHc.js → preview-Dk8DzNBz.js} +1 -1
  256. package/dist/assets/{renderUiShell.stories-Pp6_Iqzc.js → renderUiShell.stories-CAw-IOS4.js} +4 -4
  257. package/dist/assets/{resolveComponentProps-TTQVZ4OZ.js → resolveComponentProps-DXQ8X87i.js} +1 -1
  258. package/dist/assets/{tableSortLabelClasses-C7INAE6Y.js → tableSortLabelClasses-CkKrbp1R.js} +1 -1
  259. package/dist/assets/{useAutocomplete-CD_GwhMI.js → useAutocomplete-BRetTkpF.js} +1 -1
  260. package/dist/assets/{useMobilePicker-CRiGjvfW.js → useMobilePicker-DZhX9dEQ.js} +1 -1
  261. package/dist/assets/{useOdysseyDateFields-D1TYF4ew.js → useOdysseyDateFields-DPSkeXJj.js} +1 -1
  262. package/dist/assets/{useScrollIndication-Dq_i6CX-.js → useScrollIndication-mYI-g6xa.js} +3 -3
  263. package/dist/assets/{useSlot-VN2O4BOA.js → useSlot-CvpE2t6D.js} +1 -1
  264. package/dist/assets/useThemeProps-BPvYx-mf.js +1 -0
  265. package/dist/assets/useThemeProps-DwvbKxez.js +1 -0
  266. package/dist/assets/utils-kUZVaD1e.js +1 -0
  267. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
  268. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
  269. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
  270. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
  271. package/dist/iframe.html +1 -1
  272. package/dist/index.json +1 -1
  273. package/dist/project.json +1 -1
  274. package/dist/sb-addons/storybook-13/manager-bundle.js +1 -1
  275. package/dist/tsconfig.production.tsbuildinfo +1 -1
  276. package/dist/tsconfig.tsbuildinfo +1 -1
  277. package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
  278. package/package.json +8 -8
  279. package/CHANGELOG.md +0 -25
  280. package/dist/assets/AppTile _labs_.stories-B5BjKm0o.js +0 -136
  281. package/dist/assets/ArrowDropDown-Dnrg-0Q8.js +0 -1
  282. package/dist/assets/BaseMenuButton-DCwowxQ6.js +0 -1
  283. package/dist/assets/Box-B6KmU4_J.js +0 -1
  284. package/dist/assets/Box-B92Cdrku.js +0 -11
  285. package/dist/assets/Breadcrumbs-BGJJeoxM.js +0 -6
  286. package/dist/assets/Callout.stories-DVWATUoj.js +0 -105
  287. package/dist/assets/Card-DqLPNu4w.js +0 -8
  288. package/dist/assets/CheckboxGroup.stories-BbHNliqq.js +0 -92
  289. package/dist/assets/Custom Theming.stories-Kx3noLIn.js +0 -95
  290. package/dist/assets/DataTable _labs_-D_W9CY5T.js +0 -41
  291. package/dist/assets/DatePicker.stories-DldeVOlB.js +0 -133
  292. package/dist/assets/Design Tokens-BnlBB5OL.js +0 -4
  293. package/dist/assets/Dialog-BkOLgyLu.js +0 -1
  294. package/dist/assets/Drawer.stories-DpNTQVxG.js +0 -95
  295. package/dist/assets/EmptyState.stories-CkUF2dIR.js +0 -11
  296. package/dist/assets/Fieldset.stories-Wa9hG8Z0.js +0 -15
  297. package/dist/assets/Form.stories-Bc84FwlQ.js +0 -69
  298. package/dist/assets/GroupPicker _labs_.stories-D0PDtKKA.js +0 -33
  299. package/dist/assets/Icon _icons_.stories-S2muaIBP.js +0 -16
  300. package/dist/assets/Link-C5sM1_ZF.js +0 -11
  301. package/dist/assets/MenuButton-CGRa_Y2p.js +0 -9
  302. package/dist/assets/NativeSelect.stories-CYtg4GGs.js +0 -173
  303. package/dist/assets/PageTemplate _labs_-Bi3xwFV2.js +0 -8
  304. package/dist/assets/Pagination.stories-rN3x32X9.js +0 -17
  305. package/dist/assets/PasswordField.stories-BdnDY-tl.js +0 -129
  306. package/dist/assets/Picker _labs_.stories-D3FvB-m5.js +0 -18
  307. package/dist/assets/Popper-CSwIGEpk.js +0 -1
  308. package/dist/assets/RadioGroup-C_zn6OtS.js +0 -1
  309. package/dist/assets/RadioGroup-yPcOJn0w.js +0 -10
  310. package/dist/assets/ScreenReaderText.stories-CuVJmeWD.js +0 -8
  311. package/dist/assets/SearchField.stories-B_myC5_S.js +0 -37
  312. package/dist/assets/Toast.stories-BgAm1BNQ.js +0 -134
  313. package/dist/assets/TopNav.stories-z9mNMFB3.js +0 -13
  314. package/dist/assets/UserProfile.stories-C4EJFTV8.js +0 -14
  315. package/dist/assets/emotion-react-jsx-runtime.browser.esm-Cn-06VTs.js +0 -1
  316. package/dist/assets/index-6QUE-j0v.js +0 -1
  317. package/dist/assets/useThemeProps-BgDANuN6.js +0 -1
  318. package/dist/assets/useThemeProps-DJ3F4KkW.js +0 -1
  319. package/dist/assets/utils-BdcLUgCD.js +0 -1
  320. package/dist/index.cjs +0 -231
  321. package/dist/index.es.js +0 -3173
  322. package/dist/index.es.js.map +0 -1
  323. package/dist/index.iife.js +0 -9
  324. package/dist/index.iife.js.map +0 -1
  325. package/dist/index.mjs +0 -229
  326. package/dist/index.scss +0 -549
  327. package/dist/index.umd.cjs +0 -9
  328. package/dist/index.umd.cjs.map +0 -1
  329. package/dist/types/getTranslationServices.browser.test.d.ts +0 -1
  330. package/dist/types/getTranslationServices.browser.test.js +0 -88
  331. package/dist/types/getTranslationServices.browser.test.js.map +0 -1
  332. package/dist/types/getTranslationServices.d.ts +0 -91
  333. package/dist/types/getTranslationServices.js +0 -77
  334. package/dist/types/getTranslationServices.js.map +0 -1
  335. package/dist/types/getTypedObjectEntries.d.ts +0 -1
  336. package/dist/types/getTypedObjectEntries.js +0 -2
  337. package/dist/types/getTypedObjectEntries.js.map +0 -1
  338. package/dist/types/index.js +0 -3
  339. package/dist/types/index.js.map +0 -1
  340. package/dist/types/translationServices.types.d.ts +0 -2
  341. package/dist/types/translationServices.types.js +0 -34
  342. package/dist/types/translationServices.types.js.map +0 -1
  343. package/dist/types/tsconfig.tsbuildinfo +0 -1
  344. package/ok.yaml +0 -1
  345. package/src/getTranslationServices.browser.test.tsx +0 -173
  346. package/src/getTranslationServices.tsx +0 -286
  347. package/src/getTypedObjectEntries.ts +0 -3
  348. package/src/index.ts +0 -2
  349. package/src/translationServices.types.ts +0 -36
  350. package/src/tsconfig.json +0 -7
  351. package/tsconfig.json +0 -41
  352. package/vite.config.project.ts +0 -61
  353. package/vite.config.ts +0 -21
  354. package/vite.config.ts.bak +0 -33
  355. package/vitest-browser-setup.ts +0 -14
  356. package/vitest-jsdom-setup.ts +0 -13
  357. package/vitest-node-setup.ts +0 -13
  358. package/vitest.config.project.ts +0 -16
  359. package/vitest.config.ts +0 -27
  360. 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
- }
@@ -1,3 +0,0 @@
1
- export const getTypedObjectEntries = <ObjectType extends object>(
2
- obj: ObjectType,
3
- ) => Object.entries(obj) as [keyof ObjectType, ObjectType[keyof ObjectType]][];
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./getTranslationServices.js";
2
- export * from "./translationServices.types.js";
@@ -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
@@ -1,7 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true
4
- },
5
- "include": ["**/*"],
6
- "extends": "../tsconfig.json"
7
- }
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
- }
@@ -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
- );
@@ -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
- );
@@ -1,14 +0,0 @@
1
- /*!
2
- * Copyright (c) 2024-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 "@testing-library/jest-dom/vitest";
14
- import "jest-axe/extend-expect";