@okta/odyssey-react-mui 1.44.0 → 1.47.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 (752) hide show
  1. package/dist/cjs/Autocomplete.cjs +3 -33
  2. package/dist/cjs/Autocomplete.cjs.map +1 -1
  3. package/dist/cjs/Banner.cjs +2 -2
  4. package/dist/cjs/Banner.cjs.map +1 -1
  5. package/dist/cjs/Breadcrumbs.cjs +2 -2
  6. package/dist/cjs/Breadcrumbs.cjs.map +1 -1
  7. package/dist/cjs/Buttons/BaseButton.cjs.map +1 -1
  8. package/dist/cjs/Callout.cjs +3 -27
  9. package/dist/cjs/Callout.cjs.map +1 -1
  10. package/dist/cjs/Card.cjs +280 -63
  11. package/dist/cjs/Card.cjs.map +1 -1
  12. package/dist/cjs/Checkbox.cjs +14 -12
  13. package/dist/cjs/Checkbox.cjs.map +1 -1
  14. package/dist/cjs/DataTable/DataTable.cjs +2 -2
  15. package/dist/cjs/DataTable/DataTable.cjs.map +1 -1
  16. package/dist/cjs/DataTable/DataTableRowActions.cjs +6 -6
  17. package/dist/cjs/DataTable/DataTableRowActions.cjs.map +1 -1
  18. package/dist/cjs/DataTable/DataTableSettings.cjs +2 -2
  19. package/dist/cjs/DataTable/DataTableSettings.cjs.map +1 -1
  20. package/dist/cjs/DataTable/useRowReordering.cjs +2 -2
  21. package/dist/cjs/DataTable/useRowReordering.cjs.map +1 -1
  22. package/dist/cjs/DatePickers/DateField.cjs +2 -2
  23. package/dist/cjs/DatePickers/DateField.cjs.map +1 -1
  24. package/dist/cjs/DatePickers/DateFieldActionBar.cjs +2 -2
  25. package/dist/cjs/DatePickers/DateFieldActionBar.cjs.map +1 -1
  26. package/dist/cjs/DatePickers/DatePicker.cjs +2 -2
  27. package/dist/cjs/DatePickers/DatePicker.cjs.map +1 -1
  28. package/dist/cjs/DatePickers/useDateFieldsTranslations.cjs +2 -2
  29. package/dist/cjs/DatePickers/useDateFieldsTranslations.cjs.map +1 -1
  30. package/dist/cjs/DatePickers/useOdysseyDateFields.cjs +2 -2
  31. package/dist/cjs/DatePickers/useOdysseyDateFields.cjs.map +1 -1
  32. package/dist/cjs/Dialog.cjs +34 -31
  33. package/dist/cjs/Dialog.cjs.map +1 -1
  34. package/dist/cjs/Drawer.cjs +8 -4
  35. package/dist/cjs/Drawer.cjs.map +1 -1
  36. package/dist/cjs/Field.cjs +2 -2
  37. package/dist/cjs/Field.cjs.map +1 -1
  38. package/dist/cjs/FieldError.cjs +2 -2
  39. package/dist/cjs/FieldError.cjs.map +1 -1
  40. package/dist/cjs/FieldLabel.cjs +2 -2
  41. package/dist/cjs/FieldLabel.cjs.map +1 -1
  42. package/dist/cjs/FileUploader/FileUploadPreview.cjs +2 -2
  43. package/dist/cjs/FileUploader/FileUploadPreview.cjs.map +1 -1
  44. package/dist/cjs/FileUploader/FileUploader.cjs +2 -2
  45. package/dist/cjs/FileUploader/FileUploader.cjs.map +1 -1
  46. package/dist/cjs/FullScreenOverlay.cjs +40 -0
  47. package/dist/cjs/FullScreenOverlay.cjs.map +1 -0
  48. package/dist/cjs/FullScreenOverlayContext.cjs +72 -0
  49. package/dist/cjs/FullScreenOverlayContext.cjs.map +1 -0
  50. package/dist/cjs/OdysseyCacheProvider.cjs +12 -17
  51. package/dist/cjs/OdysseyCacheProvider.cjs.map +1 -1
  52. package/dist/cjs/OdysseyProvider.cjs +18 -10
  53. package/dist/cjs/OdysseyProvider.cjs.map +1 -1
  54. package/dist/cjs/OdysseyThemeProvider.cjs +27 -16
  55. package/dist/cjs/OdysseyThemeProvider.cjs.map +1 -1
  56. package/dist/cjs/OdysseyThemeProviderPropsContext.cjs +44 -0
  57. package/dist/cjs/OdysseyThemeProviderPropsContext.cjs.map +1 -0
  58. package/dist/cjs/Pagination/Pagination.cjs +2 -3
  59. package/dist/cjs/Pagination/Pagination.cjs.map +1 -1
  60. package/dist/cjs/Pagination/usePagination.cjs +2 -2
  61. package/dist/cjs/Pagination/usePagination.cjs.map +1 -1
  62. package/dist/cjs/PasswordField.cjs +2 -2
  63. package/dist/cjs/PasswordField.cjs.map +1 -1
  64. package/dist/cjs/Radio.cjs +22 -20
  65. package/dist/cjs/Radio.cjs.map +1 -1
  66. package/dist/cjs/SearchField.cjs +2 -2
  67. package/dist/cjs/SearchField.cjs.map +1 -1
  68. package/dist/cjs/Select.cjs +1 -37
  69. package/dist/cjs/Select.cjs.map +1 -1
  70. package/dist/cjs/Surface.cjs +3 -3
  71. package/dist/cjs/Surface.cjs.map +1 -1
  72. package/dist/cjs/Switch.cjs +2 -2
  73. package/dist/cjs/Switch.cjs.map +1 -1
  74. package/dist/cjs/Tabs.cjs +1 -21
  75. package/dist/cjs/Tabs.cjs.map +1 -1
  76. package/dist/cjs/Tag.cjs +2 -2
  77. package/dist/cjs/Tag.cjs.map +1 -1
  78. package/dist/cjs/TextField.cjs +1 -26
  79. package/dist/cjs/TextField.cjs.map +1 -1
  80. package/dist/cjs/Toast.cjs +2 -2
  81. package/dist/cjs/Toast.cjs.map +1 -1
  82. package/dist/cjs/__internal.cjs +149 -0
  83. package/dist/cjs/__internal.cjs.map +1 -0
  84. package/dist/cjs/i18n.generated/i18n.cjs +35 -0
  85. package/dist/cjs/i18n.generated/i18n.cjs.map +1 -0
  86. package/dist/cjs/i18n.generated/i18n.resources.cjs +81 -0
  87. package/dist/cjs/i18n.generated/i18n.resources.cjs.map +1 -0
  88. package/dist/{esm/shadow-dom/index.js → cjs/i18n.generated/i18n.types.cjs} +9 -4
  89. package/dist/cjs/i18n.generated/i18n.types.cjs.map +1 -0
  90. package/dist/cjs/index.cjs +49 -30
  91. package/dist/cjs/index.cjs.map +1 -1
  92. package/dist/cjs/labs/DataFilters.cjs +4 -4
  93. package/dist/cjs/labs/DataFilters.cjs.map +1 -1
  94. package/dist/cjs/labs/DataTable.cjs +2 -2
  95. package/dist/cjs/labs/DataTable.cjs.map +1 -1
  96. package/dist/cjs/labs/DataView/BulkActionsMenu.cjs +2 -2
  97. package/dist/cjs/labs/DataView/BulkActionsMenu.cjs.map +1 -1
  98. package/dist/cjs/labs/DataView/CardLayoutContent.cjs +60 -44
  99. package/dist/cjs/labs/DataView/CardLayoutContent.cjs.map +1 -1
  100. package/dist/cjs/labs/DataView/DataCard.cjs +52 -181
  101. package/dist/cjs/labs/DataView/DataCard.cjs.map +1 -1
  102. package/dist/cjs/labs/DataView/DataView.cjs +2 -2
  103. package/dist/cjs/labs/DataView/DataView.cjs.map +1 -1
  104. package/dist/cjs/labs/DataView/LayoutSwitcher.cjs +2 -2
  105. package/dist/cjs/labs/DataView/LayoutSwitcher.cjs.map +1 -1
  106. package/dist/cjs/labs/DataView/RowActions.cjs +2 -2
  107. package/dist/cjs/labs/DataView/RowActions.cjs.map +1 -1
  108. package/dist/cjs/labs/DataView/TableLayoutContent.cjs +2 -2
  109. package/dist/cjs/labs/DataView/TableLayoutContent.cjs.map +1 -1
  110. package/dist/cjs/labs/DataView/TableSettings.cjs +2 -2
  111. package/dist/cjs/labs/DataView/TableSettings.cjs.map +1 -1
  112. package/dist/cjs/labs/DataView/componentTypes.cjs.map +1 -1
  113. package/dist/cjs/labs/DataView/fetchData.cjs +2 -2
  114. package/dist/cjs/labs/DataView/fetchData.cjs.map +1 -1
  115. package/dist/cjs/labs/DatePickers/DateTimeField.cjs +2 -2
  116. package/dist/cjs/labs/DatePickers/DateTimeField.cjs.map +1 -1
  117. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs +2 -2
  118. package/dist/cjs/labs/DatePickers/DateTimePicker.cjs.map +1 -1
  119. package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs +3 -3
  120. package/dist/cjs/labs/DatePickers/dateTimePickerTheme.cjs.map +1 -1
  121. package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs +2 -2
  122. package/dist/cjs/labs/OdysseyPickers/ComposablePicker.cjs.map +1 -1
  123. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs +4 -0
  124. package/dist/cjs/labs/OdysseyPickers/PickerWithOptionAdornment.cjs.map +1 -1
  125. package/dist/cjs/labs/OdysseyPickers/index.cjs.map +1 -1
  126. package/dist/cjs/labs/PageTemplate/Layout.cjs +2 -2
  127. package/dist/cjs/labs/PageTemplate/Layout.cjs.map +1 -1
  128. package/dist/cjs/labs/PageTemplate/PageTemplate.cjs.map +1 -1
  129. package/dist/cjs/labs/PaginatedTable.cjs +4 -4
  130. package/dist/cjs/labs/PaginatedTable.cjs.map +1 -1
  131. package/dist/cjs/labs/StaticTable.cjs +2 -2
  132. package/dist/cjs/labs/StaticTable.cjs.map +1 -1
  133. package/dist/cjs/properties/ts/odyssey-react-mui.cjs.map +1 -1
  134. package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs +7 -1
  135. package/dist/cjs/properties/ts/odyssey-react-mui_cs.cjs.map +1 -1
  136. package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs +7 -1
  137. package/dist/cjs/properties/ts/odyssey-react-mui_da.cjs.map +1 -1
  138. package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs +8 -2
  139. package/dist/cjs/properties/ts/odyssey-react-mui_de.cjs.map +1 -1
  140. package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs +7 -1
  141. package/dist/cjs/properties/ts/odyssey-react-mui_el.cjs.map +1 -1
  142. package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs +7 -1
  143. package/dist/cjs/properties/ts/odyssey-react-mui_es.cjs.map +1 -1
  144. package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs +7 -1
  145. package/dist/cjs/properties/ts/odyssey-react-mui_eu.cjs.map +1 -1
  146. package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs +7 -1
  147. package/dist/cjs/properties/ts/odyssey-react-mui_fi.cjs.map +1 -1
  148. package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs +7 -1
  149. package/dist/cjs/properties/ts/odyssey-react-mui_fr.cjs.map +1 -1
  150. package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs +7 -1
  151. package/dist/cjs/properties/ts/odyssey-react-mui_ht.cjs.map +1 -1
  152. package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs +7 -1
  153. package/dist/cjs/properties/ts/odyssey-react-mui_hu.cjs.map +1 -1
  154. package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs +7 -1
  155. package/dist/cjs/properties/ts/odyssey-react-mui_id.cjs.map +1 -1
  156. package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs +7 -1
  157. package/dist/cjs/properties/ts/odyssey-react-mui_it.cjs.map +1 -1
  158. package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs +7 -1
  159. package/dist/cjs/properties/ts/odyssey-react-mui_ja.cjs.map +1 -1
  160. package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs +7 -1
  161. package/dist/cjs/properties/ts/odyssey-react-mui_ko.cjs.map +1 -1
  162. package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs +7 -1
  163. package/dist/cjs/properties/ts/odyssey-react-mui_ms.cjs.map +1 -1
  164. package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs +7 -1
  165. package/dist/cjs/properties/ts/odyssey-react-mui_nb.cjs.map +1 -1
  166. package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs +7 -1
  167. package/dist/cjs/properties/ts/odyssey-react-mui_nl_NL.cjs.map +1 -1
  168. package/dist/cjs/properties/ts/odyssey-react-mui_ok_PL.cjs.map +1 -1
  169. package/dist/cjs/properties/ts/odyssey-react-mui_ok_SK.cjs.map +1 -1
  170. package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs +7 -1
  171. package/dist/cjs/properties/ts/odyssey-react-mui_pl.cjs.map +1 -1
  172. package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs +7 -1
  173. package/dist/cjs/properties/ts/odyssey-react-mui_pt_BR.cjs.map +1 -1
  174. package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs +7 -1
  175. package/dist/cjs/properties/ts/odyssey-react-mui_ro.cjs.map +1 -1
  176. package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs +7 -1
  177. package/dist/cjs/properties/ts/odyssey-react-mui_ru.cjs.map +1 -1
  178. package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs +7 -1
  179. package/dist/cjs/properties/ts/odyssey-react-mui_sv.cjs.map +1 -1
  180. package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs +7 -1
  181. package/dist/cjs/properties/ts/odyssey-react-mui_th.cjs.map +1 -1
  182. package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs +7 -1
  183. package/dist/cjs/properties/ts/odyssey-react-mui_tr.cjs.map +1 -1
  184. package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs +7 -1
  185. package/dist/cjs/properties/ts/odyssey-react-mui_uk.cjs.map +1 -1
  186. package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs +7 -1
  187. package/dist/cjs/properties/ts/odyssey-react-mui_vi.cjs.map +1 -1
  188. package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs +7 -1
  189. package/dist/cjs/properties/ts/odyssey-react-mui_zh_CN.cjs.map +1 -1
  190. package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs +7 -1
  191. package/dist/cjs/properties/ts/odyssey-react-mui_zh_TW.cjs.map +1 -1
  192. package/dist/cjs/test-selectors/AutocompleteTestSelector.cjs +49 -0
  193. package/dist/cjs/test-selectors/AutocompleteTestSelector.cjs.map +1 -0
  194. package/dist/cjs/test-selectors/CalloutTestSelector.cjs +43 -0
  195. package/dist/cjs/test-selectors/CalloutTestSelector.cjs.map +1 -0
  196. package/dist/cjs/test-selectors/SelectTestSelector.cjs +55 -0
  197. package/dist/cjs/test-selectors/SelectTestSelector.cjs.map +1 -0
  198. package/dist/cjs/{OdysseyTranslationProvider.types.cjs → test-selectors/TabsTestSelector.cjs} +23 -4
  199. package/dist/cjs/test-selectors/TabsTestSelector.cjs.map +1 -0
  200. package/dist/cjs/test-selectors/TextFieldTestSelector.cjs +44 -0
  201. package/dist/cjs/test-selectors/TextFieldTestSelector.cjs.map +1 -0
  202. package/dist/cjs/test-selectors/index.cjs +11 -0
  203. package/dist/cjs/test-selectors/index.cjs.map +1 -1
  204. package/dist/cjs/test-selectors/queryOdysseySelector.cjs +10 -10
  205. package/dist/cjs/test-selectors/queryOdysseySelector.cjs.map +1 -1
  206. package/dist/cjs/theme/components.cjs +5 -9
  207. package/dist/cjs/theme/components.cjs.map +1 -1
  208. package/dist/cjs/tools/addSpecificity.cjs.map +1 -0
  209. package/dist/cjs/tools/bufferLatest.cjs.map +1 -0
  210. package/dist/cjs/tools/createMessageBus.cjs.map +1 -0
  211. package/dist/cjs/tools/createStore.cjs.map +1 -0
  212. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs +2 -12
  213. package/dist/cjs/ui-shell/NarrowUiShellContent.cjs.map +1 -1
  214. package/dist/cjs/ui-shell/SideNav/NavAccordion.cjs +20 -15
  215. package/dist/cjs/ui-shell/SideNav/NavAccordion.cjs.map +1 -1
  216. package/dist/cjs/ui-shell/SideNav/SideNav.cjs +137 -136
  217. package/dist/cjs/ui-shell/SideNav/SideNav.cjs.map +1 -1
  218. package/dist/cjs/ui-shell/SideNav/SideNavFooterContent.cjs +2 -2
  219. package/dist/cjs/ui-shell/SideNav/SideNavFooterContent.cjs.map +1 -1
  220. package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs +7 -4
  221. package/dist/cjs/ui-shell/SideNav/SideNavItemContent.cjs.map +1 -1
  222. package/dist/cjs/ui-shell/SideNav/SideNavItemContentContext.cjs.map +1 -1
  223. package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs +3 -4
  224. package/dist/cjs/ui-shell/SideNav/SideNavItemLinkContent.cjs.map +1 -1
  225. package/dist/cjs/ui-shell/SideNav/SideNavSortableList.cjs +47 -0
  226. package/dist/cjs/ui-shell/SideNav/SideNavSortableList.cjs.map +1 -0
  227. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs +2 -2
  228. package/dist/cjs/ui-shell/SideNav/SideNavToggleButton.cjs.map +1 -1
  229. package/dist/cjs/ui-shell/SideNav/SortableList/SortableItem.cjs +2 -2
  230. package/dist/cjs/ui-shell/SideNav/SortableList/SortableItem.cjs.map +1 -1
  231. package/dist/cjs/ui-shell/SideNav/SortableList/SortableList.cjs +2 -2
  232. package/dist/cjs/ui-shell/SideNav/SortableList/SortableList.cjs.map +1 -1
  233. package/dist/cjs/ui-shell/SideNav/types.cjs.map +1 -1
  234. package/dist/cjs/ui-shell/UiShell.cjs +4 -4
  235. package/dist/cjs/ui-shell/UiShell.cjs.map +1 -1
  236. package/dist/cjs/ui-shell/UiShellProvider.cjs +1 -1
  237. package/dist/cjs/ui-shell/UiShellProvider.cjs.map +1 -1
  238. package/dist/cjs/ui-shell/WideUiShellContent.cjs +2 -1
  239. package/dist/cjs/ui-shell/WideUiShellContent.cjs.map +1 -1
  240. package/dist/cjs/ui-shell/renderUiShell.cjs +2 -2
  241. package/dist/cjs/ui-shell/renderUiShell.cjs.map +1 -1
  242. package/dist/cjs/ui-shell/uiShellContentTypes.cjs +2 -1
  243. package/dist/cjs/ui-shell/uiShellContentTypes.cjs.map +1 -1
  244. package/dist/cjs/{shadow-dom/shadow-dom.cjs → web-component/createShadowDomElements.cjs} +8 -3
  245. package/dist/cjs/web-component/createShadowDomElements.cjs.map +1 -0
  246. package/dist/cjs/web-component/index.cjs +33 -0
  247. package/dist/cjs/web-component/index.cjs.map +1 -1
  248. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs +1 -1
  249. package/dist/cjs/web-component/odysseyWebComponentVersion.generated.cjs.map +1 -1
  250. package/dist/cjs/web-component/removeGlobalStylesFromShadowDom.cjs +35 -0
  251. package/dist/cjs/web-component/removeGlobalStylesFromShadowDom.cjs.map +1 -0
  252. package/dist/cjs/web-component/renderReactInWebComponent.cjs +5 -9
  253. package/dist/cjs/web-component/renderReactInWebComponent.cjs.map +1 -1
  254. package/dist/esm/Autocomplete.js +1 -31
  255. package/dist/esm/Autocomplete.js.map +1 -1
  256. package/dist/esm/Banner.js +1 -1
  257. package/dist/esm/Banner.js.map +1 -1
  258. package/dist/esm/Breadcrumbs.js +1 -1
  259. package/dist/esm/Breadcrumbs.js.map +1 -1
  260. package/dist/esm/Buttons/BaseButton.js.map +1 -1
  261. package/dist/esm/Callout.js +1 -25
  262. package/dist/esm/Callout.js.map +1 -1
  263. package/dist/esm/Card.js +281 -63
  264. package/dist/esm/Card.js.map +1 -1
  265. package/dist/esm/Checkbox.js +13 -11
  266. package/dist/esm/Checkbox.js.map +1 -1
  267. package/dist/esm/DataTable/DataTable.js +1 -1
  268. package/dist/esm/DataTable/DataTable.js.map +1 -1
  269. package/dist/esm/DataTable/DataTableRowActions.js +1 -1
  270. package/dist/esm/DataTable/DataTableRowActions.js.map +1 -1
  271. package/dist/esm/DataTable/DataTableSettings.js +1 -1
  272. package/dist/esm/DataTable/DataTableSettings.js.map +1 -1
  273. package/dist/esm/DataTable/useRowReordering.js +1 -1
  274. package/dist/esm/DataTable/useRowReordering.js.map +1 -1
  275. package/dist/esm/DatePickers/DateField.js +1 -1
  276. package/dist/esm/DatePickers/DateField.js.map +1 -1
  277. package/dist/esm/DatePickers/DateFieldActionBar.js +1 -1
  278. package/dist/esm/DatePickers/DateFieldActionBar.js.map +1 -1
  279. package/dist/esm/DatePickers/DatePicker.js +1 -1
  280. package/dist/esm/DatePickers/DatePicker.js.map +1 -1
  281. package/dist/esm/DatePickers/useDateFieldsTranslations.js +1 -1
  282. package/dist/esm/DatePickers/useDateFieldsTranslations.js.map +1 -1
  283. package/dist/esm/DatePickers/useOdysseyDateFields.js +1 -1
  284. package/dist/esm/DatePickers/useOdysseyDateFields.js.map +1 -1
  285. package/dist/esm/Dialog.js +33 -30
  286. package/dist/esm/Dialog.js.map +1 -1
  287. package/dist/esm/Drawer.js +7 -3
  288. package/dist/esm/Drawer.js.map +1 -1
  289. package/dist/esm/Field.js +1 -1
  290. package/dist/esm/Field.js.map +1 -1
  291. package/dist/esm/FieldError.js +1 -1
  292. package/dist/esm/FieldError.js.map +1 -1
  293. package/dist/esm/FieldLabel.js +1 -1
  294. package/dist/esm/FieldLabel.js.map +1 -1
  295. package/dist/esm/FileUploader/FileUploadPreview.js +1 -1
  296. package/dist/esm/FileUploader/FileUploadPreview.js.map +1 -1
  297. package/dist/esm/FileUploader/FileUploader.js +1 -1
  298. package/dist/esm/FileUploader/FileUploader.js.map +1 -1
  299. package/dist/esm/FullScreenOverlay.js +35 -0
  300. package/dist/esm/FullScreenOverlay.js.map +1 -0
  301. package/dist/esm/FullScreenOverlayContext.js +66 -0
  302. package/dist/esm/FullScreenOverlayContext.js.map +1 -0
  303. package/dist/esm/OdysseyCacheProvider.js +12 -17
  304. package/dist/esm/OdysseyCacheProvider.js.map +1 -1
  305. package/dist/esm/OdysseyProvider.js +18 -10
  306. package/dist/esm/OdysseyProvider.js.map +1 -1
  307. package/dist/esm/OdysseyThemeProvider.js +27 -16
  308. package/dist/esm/OdysseyThemeProvider.js.map +1 -1
  309. package/dist/esm/OdysseyThemeProviderPropsContext.js +38 -0
  310. package/dist/esm/OdysseyThemeProviderPropsContext.js.map +1 -0
  311. package/dist/esm/Pagination/Pagination.js +1 -2
  312. package/dist/esm/Pagination/Pagination.js.map +1 -1
  313. package/dist/esm/Pagination/usePagination.js +1 -1
  314. package/dist/esm/Pagination/usePagination.js.map +1 -1
  315. package/dist/esm/PasswordField.js +1 -1
  316. package/dist/esm/PasswordField.js.map +1 -1
  317. package/dist/esm/Radio.js +22 -20
  318. package/dist/esm/Radio.js.map +1 -1
  319. package/dist/esm/SearchField.js +1 -1
  320. package/dist/esm/SearchField.js.map +1 -1
  321. package/dist/esm/Select.js +0 -36
  322. package/dist/esm/Select.js.map +1 -1
  323. package/dist/esm/Surface.js +3 -3
  324. package/dist/esm/Surface.js.map +1 -1
  325. package/dist/esm/Switch.js +1 -1
  326. package/dist/esm/Switch.js.map +1 -1
  327. package/dist/esm/Tabs.js +0 -20
  328. package/dist/esm/Tabs.js.map +1 -1
  329. package/dist/esm/Tag.js +1 -1
  330. package/dist/esm/Tag.js.map +1 -1
  331. package/dist/esm/TextField.js +0 -25
  332. package/dist/esm/TextField.js.map +1 -1
  333. package/dist/esm/Toast.js +1 -1
  334. package/dist/esm/Toast.js.map +1 -1
  335. package/dist/esm/__internal.js +24 -0
  336. package/dist/esm/__internal.js.map +1 -0
  337. package/dist/esm/i18n.generated/i18n.js +25 -0
  338. package/dist/esm/i18n.generated/i18n.js.map +1 -0
  339. package/dist/esm/i18n.generated/i18n.resources.js +75 -0
  340. package/dist/esm/i18n.generated/i18n.resources.js.map +1 -0
  341. package/dist/{types/shadow-dom/index.d.ts → esm/i18n.generated/i18n.types.js} +3 -3
  342. package/dist/esm/i18n.generated/i18n.types.js.map +1 -0
  343. package/dist/esm/index.js +4 -3
  344. package/dist/esm/index.js.map +1 -1
  345. package/dist/esm/labs/DataFilters.js +1 -1
  346. package/dist/esm/labs/DataFilters.js.map +1 -1
  347. package/dist/esm/labs/DataTable.js +1 -1
  348. package/dist/esm/labs/DataTable.js.map +1 -1
  349. package/dist/esm/labs/DataView/BulkActionsMenu.js +1 -1
  350. package/dist/esm/labs/DataView/BulkActionsMenu.js.map +1 -1
  351. package/dist/esm/labs/DataView/CardLayoutContent.js +61 -45
  352. package/dist/esm/labs/DataView/CardLayoutContent.js.map +1 -1
  353. package/dist/esm/labs/DataView/DataCard.js +51 -180
  354. package/dist/esm/labs/DataView/DataCard.js.map +1 -1
  355. package/dist/esm/labs/DataView/DataView.js +1 -1
  356. package/dist/esm/labs/DataView/DataView.js.map +1 -1
  357. package/dist/esm/labs/DataView/LayoutSwitcher.js +1 -1
  358. package/dist/esm/labs/DataView/LayoutSwitcher.js.map +1 -1
  359. package/dist/esm/labs/DataView/RowActions.js +1 -1
  360. package/dist/esm/labs/DataView/RowActions.js.map +1 -1
  361. package/dist/esm/labs/DataView/TableLayoutContent.js +1 -1
  362. package/dist/esm/labs/DataView/TableLayoutContent.js.map +1 -1
  363. package/dist/esm/labs/DataView/TableSettings.js +1 -1
  364. package/dist/esm/labs/DataView/TableSettings.js.map +1 -1
  365. package/dist/esm/labs/DataView/componentTypes.js.map +1 -1
  366. package/dist/esm/labs/DataView/fetchData.js +2 -2
  367. package/dist/esm/labs/DataView/fetchData.js.map +1 -1
  368. package/dist/esm/labs/DatePickers/DateTimeField.js +1 -1
  369. package/dist/esm/labs/DatePickers/DateTimeField.js.map +1 -1
  370. package/dist/esm/labs/DatePickers/DateTimePicker.js +1 -1
  371. package/dist/esm/labs/DatePickers/DateTimePicker.js.map +1 -1
  372. package/dist/esm/labs/DatePickers/dateTimePickerTheme.js +3 -3
  373. package/dist/esm/labs/DatePickers/dateTimePickerTheme.js.map +1 -1
  374. package/dist/esm/labs/OdysseyPickers/ComposablePicker.js +1 -1
  375. package/dist/esm/labs/OdysseyPickers/ComposablePicker.js.map +1 -1
  376. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js +4 -0
  377. package/dist/esm/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -1
  378. package/dist/esm/labs/OdysseyPickers/index.js.map +1 -1
  379. package/dist/esm/labs/PageTemplate/Layout.js +2 -2
  380. package/dist/esm/labs/PageTemplate/Layout.js.map +1 -1
  381. package/dist/esm/labs/PageTemplate/PageTemplate.js.map +1 -1
  382. package/dist/esm/labs/PaginatedTable.js +1 -1
  383. package/dist/esm/labs/PaginatedTable.js.map +1 -1
  384. package/dist/esm/labs/StaticTable.js +1 -1
  385. package/dist/esm/labs/StaticTable.js.map +1 -1
  386. package/dist/esm/properties/ts/odyssey-react-mui.js.map +1 -1
  387. package/dist/esm/properties/ts/odyssey-react-mui_cs.js +7 -1
  388. package/dist/esm/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  389. package/dist/esm/properties/ts/odyssey-react-mui_da.js +7 -1
  390. package/dist/esm/properties/ts/odyssey-react-mui_da.js.map +1 -1
  391. package/dist/esm/properties/ts/odyssey-react-mui_de.js +8 -2
  392. package/dist/esm/properties/ts/odyssey-react-mui_de.js.map +1 -1
  393. package/dist/esm/properties/ts/odyssey-react-mui_el.js +7 -1
  394. package/dist/esm/properties/ts/odyssey-react-mui_el.js.map +1 -1
  395. package/dist/esm/properties/ts/odyssey-react-mui_es.js +7 -1
  396. package/dist/esm/properties/ts/odyssey-react-mui_es.js.map +1 -1
  397. package/dist/esm/properties/ts/odyssey-react-mui_eu.js +7 -1
  398. package/dist/esm/properties/ts/odyssey-react-mui_eu.js.map +1 -1
  399. package/dist/esm/properties/ts/odyssey-react-mui_fi.js +7 -1
  400. package/dist/esm/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  401. package/dist/esm/properties/ts/odyssey-react-mui_fr.js +7 -1
  402. package/dist/esm/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  403. package/dist/esm/properties/ts/odyssey-react-mui_ht.js +7 -1
  404. package/dist/esm/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  405. package/dist/esm/properties/ts/odyssey-react-mui_hu.js +7 -1
  406. package/dist/esm/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  407. package/dist/esm/properties/ts/odyssey-react-mui_id.js +7 -1
  408. package/dist/esm/properties/ts/odyssey-react-mui_id.js.map +1 -1
  409. package/dist/esm/properties/ts/odyssey-react-mui_it.js +7 -1
  410. package/dist/esm/properties/ts/odyssey-react-mui_it.js.map +1 -1
  411. package/dist/esm/properties/ts/odyssey-react-mui_ja.js +7 -1
  412. package/dist/esm/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  413. package/dist/esm/properties/ts/odyssey-react-mui_ko.js +7 -1
  414. package/dist/esm/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  415. package/dist/esm/properties/ts/odyssey-react-mui_ms.js +7 -1
  416. package/dist/esm/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  417. package/dist/esm/properties/ts/odyssey-react-mui_nb.js +7 -1
  418. package/dist/esm/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  419. package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js +7 -1
  420. package/dist/esm/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  421. package/dist/esm/properties/ts/odyssey-react-mui_ok_PL.js.map +1 -1
  422. package/dist/esm/properties/ts/odyssey-react-mui_ok_SK.js.map +1 -1
  423. package/dist/esm/properties/ts/odyssey-react-mui_pl.js +7 -1
  424. package/dist/esm/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  425. package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js +7 -1
  426. package/dist/esm/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  427. package/dist/esm/properties/ts/odyssey-react-mui_ro.js +7 -1
  428. package/dist/esm/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  429. package/dist/esm/properties/ts/odyssey-react-mui_ru.js +7 -1
  430. package/dist/esm/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  431. package/dist/esm/properties/ts/odyssey-react-mui_sv.js +7 -1
  432. package/dist/esm/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  433. package/dist/esm/properties/ts/odyssey-react-mui_th.js +7 -1
  434. package/dist/esm/properties/ts/odyssey-react-mui_th.js.map +1 -1
  435. package/dist/esm/properties/ts/odyssey-react-mui_tr.js +7 -1
  436. package/dist/esm/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  437. package/dist/esm/properties/ts/odyssey-react-mui_uk.js +7 -1
  438. package/dist/esm/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  439. package/dist/esm/properties/ts/odyssey-react-mui_vi.js +7 -1
  440. package/dist/esm/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  441. package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js +7 -1
  442. package/dist/esm/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  443. package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js +7 -1
  444. package/dist/esm/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  445. package/dist/esm/test-selectors/AutocompleteTestSelector.js +43 -0
  446. package/dist/esm/test-selectors/AutocompleteTestSelector.js.map +1 -0
  447. package/dist/esm/test-selectors/CalloutTestSelector.js +37 -0
  448. package/dist/esm/test-selectors/CalloutTestSelector.js.map +1 -0
  449. package/dist/esm/test-selectors/SelectTestSelector.js +49 -0
  450. package/dist/esm/test-selectors/SelectTestSelector.js.map +1 -0
  451. package/dist/esm/test-selectors/TabsTestSelector.js +33 -0
  452. package/dist/esm/test-selectors/TabsTestSelector.js.map +1 -0
  453. package/dist/esm/test-selectors/TextFieldTestSelector.js +38 -0
  454. package/dist/esm/test-selectors/TextFieldTestSelector.js.map +1 -0
  455. package/dist/esm/test-selectors/index.js +1 -0
  456. package/dist/esm/test-selectors/index.js.map +1 -1
  457. package/dist/esm/test-selectors/queryOdysseySelector.js +5 -5
  458. package/dist/esm/test-selectors/queryOdysseySelector.js.map +1 -1
  459. package/dist/esm/theme/components.js +5 -9
  460. package/dist/esm/theme/components.js.map +1 -1
  461. package/dist/esm/tools/addSpecificity.js.map +1 -0
  462. package/dist/esm/tools/bufferLatest.js.map +1 -0
  463. package/dist/esm/tools/createMessageBus.js.map +1 -0
  464. package/dist/esm/tools/createStore.js.map +1 -0
  465. package/dist/esm/ui-shell/NarrowUiShellContent.js +3 -13
  466. package/dist/esm/ui-shell/NarrowUiShellContent.js.map +1 -1
  467. package/dist/esm/ui-shell/SideNav/NavAccordion.js +20 -15
  468. package/dist/esm/ui-shell/SideNav/NavAccordion.js.map +1 -1
  469. package/dist/esm/ui-shell/SideNav/SideNav.js +136 -135
  470. package/dist/esm/ui-shell/SideNav/SideNav.js.map +1 -1
  471. package/dist/esm/ui-shell/SideNav/SideNavFooterContent.js +1 -1
  472. package/dist/esm/ui-shell/SideNav/SideNavFooterContent.js.map +1 -1
  473. package/dist/esm/ui-shell/SideNav/SideNavItemContent.js +7 -4
  474. package/dist/esm/ui-shell/SideNav/SideNavItemContent.js.map +1 -1
  475. package/dist/esm/ui-shell/SideNav/SideNavItemContentContext.js.map +1 -1
  476. package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js +3 -4
  477. package/dist/esm/ui-shell/SideNav/SideNavItemLinkContent.js.map +1 -1
  478. package/dist/esm/ui-shell/SideNav/SideNavSortableList.js +42 -0
  479. package/dist/esm/ui-shell/SideNav/SideNavSortableList.js.map +1 -0
  480. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js +1 -1
  481. package/dist/esm/ui-shell/SideNav/SideNavToggleButton.js.map +1 -1
  482. package/dist/esm/ui-shell/SideNav/SortableList/SortableItem.js +1 -1
  483. package/dist/esm/ui-shell/SideNav/SortableList/SortableItem.js.map +1 -1
  484. package/dist/esm/ui-shell/SideNav/SortableList/SortableList.js +1 -1
  485. package/dist/esm/ui-shell/SideNav/SortableList/SortableList.js.map +1 -1
  486. package/dist/esm/ui-shell/SideNav/types.js.map +1 -1
  487. package/dist/esm/ui-shell/UiShell.js +4 -4
  488. package/dist/esm/ui-shell/UiShell.js.map +1 -1
  489. package/dist/esm/ui-shell/UiShellProvider.js +1 -1
  490. package/dist/esm/ui-shell/UiShellProvider.js.map +1 -1
  491. package/dist/esm/ui-shell/WideUiShellContent.js +2 -1
  492. package/dist/esm/ui-shell/WideUiShellContent.js.map +1 -1
  493. package/dist/esm/ui-shell/renderUiShell.js +2 -2
  494. package/dist/esm/ui-shell/renderUiShell.js.map +1 -1
  495. package/dist/esm/ui-shell/uiShellContentTypes.js +1 -0
  496. package/dist/esm/ui-shell/uiShellContentTypes.js.map +1 -1
  497. package/dist/esm/{shadow-dom/shadow-dom.js → web-component/createShadowDomElements.js} +8 -3
  498. package/dist/esm/web-component/createShadowDomElements.js.map +1 -0
  499. package/dist/esm/web-component/index.js +3 -0
  500. package/dist/esm/web-component/index.js.map +1 -1
  501. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js +1 -1
  502. package/dist/esm/web-component/odysseyWebComponentVersion.generated.js.map +1 -1
  503. package/dist/esm/web-component/removeGlobalStylesFromShadowDom.js +28 -0
  504. package/dist/esm/web-component/removeGlobalStylesFromShadowDom.js.map +1 -0
  505. package/dist/esm/web-component/renderReactInWebComponent.js +5 -9
  506. package/dist/esm/web-component/renderReactInWebComponent.js.map +1 -1
  507. package/dist/tsconfig.production.tsbuildinfo +1 -1
  508. package/dist/types/Autocomplete.d.ts +0 -30
  509. package/dist/types/Autocomplete.d.ts.map +1 -1
  510. package/dist/types/Banner.d.ts.map +1 -1
  511. package/dist/types/Breadcrumbs.d.ts.map +1 -1
  512. package/dist/types/Buttons/BaseButton.d.ts +2 -2
  513. package/dist/types/Buttons/BaseButton.d.ts.map +1 -1
  514. package/dist/types/Callout.d.ts +0 -24
  515. package/dist/types/Callout.d.ts.map +1 -1
  516. package/dist/types/Card.d.ts +17 -6
  517. package/dist/types/Card.d.ts.map +1 -1
  518. package/dist/types/Checkbox.d.ts.map +1 -1
  519. package/dist/types/DataTable/DataTable.d.ts.map +1 -1
  520. package/dist/types/DataTable/DataTableRowActions.d.ts.map +1 -1
  521. package/dist/types/DatePickers/DatePicker.d.ts.map +1 -1
  522. package/dist/types/DatePickers/useDateFieldsTranslations.d.ts.map +1 -1
  523. package/dist/types/DatePickers/useOdysseyDateFields.d.ts.map +1 -1
  524. package/dist/types/Dialog.d.ts.map +1 -1
  525. package/dist/types/Drawer.d.ts.map +1 -1
  526. package/dist/types/Field.d.ts.map +1 -1
  527. package/dist/types/FieldError.d.ts.map +1 -1
  528. package/dist/types/FieldLabel.d.ts.map +1 -1
  529. package/dist/types/FileUploader/FileUploader.d.ts.map +1 -1
  530. package/dist/types/FullScreenOverlay.d.ts +19 -0
  531. package/dist/types/FullScreenOverlay.d.ts.map +1 -0
  532. package/dist/types/FullScreenOverlayContext.d.ts +31 -0
  533. package/dist/types/FullScreenOverlayContext.d.ts.map +1 -0
  534. package/dist/types/NativeSelect.d.ts +1 -1
  535. package/dist/types/OdysseyCacheProvider.d.ts +10 -3
  536. package/dist/types/OdysseyCacheProvider.d.ts.map +1 -1
  537. package/dist/types/OdysseyProvider.d.ts +8 -8
  538. package/dist/types/OdysseyProvider.d.ts.map +1 -1
  539. package/dist/types/OdysseyThemeProvider.d.ts +7 -16
  540. package/dist/types/OdysseyThemeProvider.d.ts.map +1 -1
  541. package/dist/types/OdysseyThemeProviderPropsContext.d.ts +27 -0
  542. package/dist/types/OdysseyThemeProviderPropsContext.d.ts.map +1 -0
  543. package/dist/types/Pagination/Pagination.d.ts +0 -1
  544. package/dist/types/Pagination/Pagination.d.ts.map +1 -1
  545. package/dist/types/Pagination/usePagination.d.ts.map +1 -1
  546. package/dist/types/PasswordField.d.ts.map +1 -1
  547. package/dist/types/Radio.d.ts.map +1 -1
  548. package/dist/types/SearchField.d.ts.map +1 -1
  549. package/dist/types/Select.d.ts +0 -36
  550. package/dist/types/Select.d.ts.map +1 -1
  551. package/dist/types/Surface.d.ts.map +1 -1
  552. package/dist/types/Switch.d.ts.map +1 -1
  553. package/dist/types/Tabs.d.ts +0 -20
  554. package/dist/types/Tabs.d.ts.map +1 -1
  555. package/dist/types/Tag.d.ts.map +1 -1
  556. package/dist/types/TextField.d.ts +0 -25
  557. package/dist/types/TextField.d.ts.map +1 -1
  558. package/dist/types/Toast.d.ts.map +1 -1
  559. package/dist/types/__internal.d.ts +30 -0
  560. package/dist/types/__internal.d.ts.map +1 -0
  561. package/dist/types/i18n.generated/i18n.d.ts +285 -0
  562. package/dist/types/i18n.generated/i18n.d.ts.map +1 -0
  563. package/dist/types/i18n.generated/i18n.resources.d.ts +4199 -0
  564. package/dist/types/{i18n.d.ts.map → i18n.generated/i18n.resources.d.ts.map} +1 -1
  565. package/dist/types/i18n.generated/i18n.types.d.ts +30 -0
  566. package/dist/types/i18n.generated/i18n.types.d.ts.map +1 -0
  567. package/dist/types/index.d.ts +4 -3
  568. package/dist/types/index.d.ts.map +1 -1
  569. package/dist/types/labs/DataTable.d.ts.map +1 -1
  570. package/dist/types/labs/DataView/CardLayoutContent.d.ts.map +1 -1
  571. package/dist/types/labs/DataView/DataCard.d.ts +14 -30
  572. package/dist/types/labs/DataView/DataCard.d.ts.map +1 -1
  573. package/dist/types/labs/DataView/RowActions.d.ts.map +1 -1
  574. package/dist/types/labs/DataView/componentTypes.d.ts +1 -1
  575. package/dist/types/labs/DataView/componentTypes.d.ts.map +1 -1
  576. package/dist/types/labs/DataView/fetchData.d.ts.map +1 -1
  577. package/dist/types/labs/DatePickers/DateTimePicker.d.ts.map +1 -1
  578. package/dist/types/labs/OdysseyPickers/ComposablePicker.d.ts.map +1 -1
  579. package/dist/types/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -1
  580. package/dist/types/labs/OdysseyPickers/index.d.ts +1 -2
  581. package/dist/types/labs/OdysseyPickers/index.d.ts.map +1 -1
  582. package/dist/types/labs/PageTemplate/PageTemplate.d.ts.map +1 -1
  583. package/dist/types/labs/PaginatedTable.d.ts.map +1 -1
  584. package/dist/types/labs/StaticTable.d.ts.map +1 -1
  585. package/dist/types/properties/ts/odyssey-react-mui.d.ts +133 -133
  586. package/dist/types/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  587. package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts +133 -127
  588. package/dist/types/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  589. package/dist/types/properties/ts/odyssey-react-mui_da.d.ts +133 -127
  590. package/dist/types/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  591. package/dist/types/properties/ts/odyssey-react-mui_de.d.ts +133 -127
  592. package/dist/types/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  593. package/dist/types/properties/ts/odyssey-react-mui_el.d.ts +133 -127
  594. package/dist/types/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  595. package/dist/types/properties/ts/odyssey-react-mui_es.d.ts +133 -127
  596. package/dist/types/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  597. package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts +133 -127
  598. package/dist/types/properties/ts/odyssey-react-mui_eu.d.ts.map +1 -1
  599. package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts +133 -127
  600. package/dist/types/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  601. package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts +133 -127
  602. package/dist/types/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  603. package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts +133 -127
  604. package/dist/types/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  605. package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts +133 -127
  606. package/dist/types/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  607. package/dist/types/properties/ts/odyssey-react-mui_id.d.ts +133 -127
  608. package/dist/types/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  609. package/dist/types/properties/ts/odyssey-react-mui_it.d.ts +133 -127
  610. package/dist/types/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  611. package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts +133 -127
  612. package/dist/types/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  613. package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts +133 -127
  614. package/dist/types/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  615. package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts +133 -127
  616. package/dist/types/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  617. package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts +133 -127
  618. package/dist/types/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  619. package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts +133 -127
  620. package/dist/types/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  621. package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts +133 -133
  622. package/dist/types/properties/ts/odyssey-react-mui_ok_PL.d.ts.map +1 -1
  623. package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts +133 -133
  624. package/dist/types/properties/ts/odyssey-react-mui_ok_SK.d.ts.map +1 -1
  625. package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts +133 -127
  626. package/dist/types/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  627. package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts +133 -127
  628. package/dist/types/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  629. package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts +133 -127
  630. package/dist/types/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  631. package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts +133 -127
  632. package/dist/types/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  633. package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts +133 -127
  634. package/dist/types/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  635. package/dist/types/properties/ts/odyssey-react-mui_th.d.ts +133 -127
  636. package/dist/types/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  637. package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts +133 -127
  638. package/dist/types/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  639. package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts +133 -127
  640. package/dist/types/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  641. package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts +133 -127
  642. package/dist/types/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  643. package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts +133 -127
  644. package/dist/types/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  645. package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts +133 -127
  646. package/dist/types/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  647. package/dist/types/test-selectors/AutocompleteTestSelector.d.ts +42 -0
  648. package/dist/types/test-selectors/AutocompleteTestSelector.d.ts.map +1 -0
  649. package/dist/types/test-selectors/CalloutTestSelector.d.ts +36 -0
  650. package/dist/types/test-selectors/CalloutTestSelector.d.ts.map +1 -0
  651. package/dist/types/test-selectors/SelectTestSelector.d.ts +48 -0
  652. package/dist/types/test-selectors/SelectTestSelector.d.ts.map +1 -0
  653. package/dist/types/test-selectors/TabsTestSelector.d.ts +32 -0
  654. package/dist/types/test-selectors/TabsTestSelector.d.ts.map +1 -0
  655. package/dist/types/test-selectors/TextFieldTestSelector.d.ts +37 -0
  656. package/dist/types/test-selectors/TextFieldTestSelector.d.ts.map +1 -0
  657. package/dist/types/test-selectors/index.d.ts +1 -0
  658. package/dist/types/test-selectors/index.d.ts.map +1 -1
  659. package/dist/types/test-selectors/queryOdysseySelector.d.ts.map +1 -1
  660. package/dist/types/theme/components.d.ts.map +1 -1
  661. package/dist/types/tools/addSpecificity.d.ts.map +1 -0
  662. package/dist/types/tools/bufferLatest.d.ts.map +1 -0
  663. package/dist/types/tools/createMessageBus.d.ts.map +1 -0
  664. package/dist/types/tools/createStore.d.ts.map +1 -0
  665. package/dist/types/ui-shell/NarrowUiShellContent.d.ts.map +1 -1
  666. package/dist/types/ui-shell/SideNav/NavAccordion.d.ts.map +1 -1
  667. package/dist/types/ui-shell/SideNav/SideNav.d.ts +1 -1
  668. package/dist/types/ui-shell/SideNav/SideNav.d.ts.map +1 -1
  669. package/dist/types/ui-shell/SideNav/SideNavFooterContent.d.ts.map +1 -1
  670. package/dist/types/ui-shell/SideNav/SideNavItemContent.d.ts +2 -1
  671. package/dist/types/ui-shell/SideNav/SideNavItemContent.d.ts.map +1 -1
  672. package/dist/types/ui-shell/SideNav/SideNavItemContentContext.d.ts +1 -0
  673. package/dist/types/ui-shell/SideNav/SideNavItemContentContext.d.ts.map +1 -1
  674. package/dist/types/ui-shell/SideNav/SideNavItemLinkContent.d.ts.map +1 -1
  675. package/dist/types/ui-shell/SideNav/SideNavSortableList.d.ts +41 -0
  676. package/dist/types/ui-shell/SideNav/SideNavSortableList.d.ts.map +1 -0
  677. package/dist/types/ui-shell/SideNav/types.d.ts +13 -2
  678. package/dist/types/ui-shell/SideNav/types.d.ts.map +1 -1
  679. package/dist/types/ui-shell/UiShell.d.ts +1 -1
  680. package/dist/types/ui-shell/UiShell.d.ts.map +1 -1
  681. package/dist/types/ui-shell/UiShellProvider.d.ts +1 -1
  682. package/dist/types/ui-shell/UiShellProvider.d.ts.map +1 -1
  683. package/dist/types/ui-shell/WideUiShellContent.d.ts.map +1 -1
  684. package/dist/types/ui-shell/renderUiShell.d.ts +2 -2
  685. package/dist/types/ui-shell/renderUiShell.d.ts.map +1 -1
  686. package/dist/types/ui-shell/uiShellContentTypes.d.ts +4 -1
  687. package/dist/types/ui-shell/uiShellContentTypes.d.ts.map +1 -1
  688. package/dist/types/{shadow-dom/shadow-dom.d.ts → web-component/createShadowDomElements.d.ts} +6 -4
  689. package/dist/types/web-component/createShadowDomElements.d.ts.map +1 -0
  690. package/dist/types/web-component/index.d.ts +3 -0
  691. package/dist/types/web-component/index.d.ts.map +1 -1
  692. package/dist/types/web-component/odysseyWebComponentVersion.generated.d.ts +1 -1
  693. package/dist/types/web-component/removeGlobalStylesFromShadowDom.d.ts +18 -0
  694. package/dist/types/web-component/removeGlobalStylesFromShadowDom.d.ts.map +1 -0
  695. package/dist/types/web-component/renderReactInWebComponent.d.ts +1 -1
  696. package/dist/types/web-component/renderReactInWebComponent.d.ts.map +1 -1
  697. package/package.json +26 -17
  698. package/dist/cjs/@types/i18next.d.cjs +0 -4
  699. package/dist/cjs/@types/i18next.d.cjs.map +0 -1
  700. package/dist/cjs/@types/properties.d.cjs +0 -2
  701. package/dist/cjs/@types/properties.d.cjs.map +0 -1
  702. package/dist/cjs/OdysseyTranslationProvider.cjs +0 -55
  703. package/dist/cjs/OdysseyTranslationProvider.cjs.map +0 -1
  704. package/dist/cjs/OdysseyTranslationProvider.types.cjs.map +0 -1
  705. package/dist/cjs/addSpecificity.cjs.map +0 -1
  706. package/dist/cjs/i18n.cjs +0 -113
  707. package/dist/cjs/i18n.cjs.map +0 -1
  708. package/dist/cjs/shadow-dom/index.cjs +0 -17
  709. package/dist/cjs/shadow-dom/index.cjs.map +0 -1
  710. package/dist/cjs/shadow-dom/shadow-dom.cjs.map +0 -1
  711. package/dist/cjs/ui-shell/bufferLatest.cjs.map +0 -1
  712. package/dist/cjs/ui-shell/createMessageBus.cjs.map +0 -1
  713. package/dist/cjs/ui-shell/createStore.cjs.map +0 -1
  714. package/dist/esm/@types/i18next.d.js +0 -14
  715. package/dist/esm/@types/i18next.d.js.map +0 -1
  716. package/dist/esm/@types/properties.d.js +0 -2
  717. package/dist/esm/@types/properties.d.js.map +0 -1
  718. package/dist/esm/OdysseyTranslationProvider.js +0 -48
  719. package/dist/esm/OdysseyTranslationProvider.js.map +0 -1
  720. package/dist/esm/OdysseyTranslationProvider.types.js +0 -14
  721. package/dist/esm/OdysseyTranslationProvider.types.js.map +0 -1
  722. package/dist/esm/addSpecificity.js.map +0 -1
  723. package/dist/esm/i18n.js +0 -100
  724. package/dist/esm/i18n.js.map +0 -1
  725. package/dist/esm/shadow-dom/index.js.map +0 -1
  726. package/dist/esm/shadow-dom/shadow-dom.js.map +0 -1
  727. package/dist/esm/ui-shell/bufferLatest.js.map +0 -1
  728. package/dist/esm/ui-shell/createMessageBus.js.map +0 -1
  729. package/dist/esm/ui-shell/createStore.js.map +0 -1
  730. package/dist/types/OdysseyTranslationProvider.d.ts +0 -24
  731. package/dist/types/OdysseyTranslationProvider.d.ts.map +0 -1
  732. package/dist/types/OdysseyTranslationProvider.types.d.ts +0 -14
  733. package/dist/types/OdysseyTranslationProvider.types.d.ts.map +0 -1
  734. package/dist/types/addSpecificity.d.ts.map +0 -1
  735. package/dist/types/i18n.d.ts +0 -3910
  736. package/dist/types/shadow-dom/index.d.ts.map +0 -1
  737. package/dist/types/shadow-dom/shadow-dom.d.ts.map +0 -1
  738. package/dist/types/ui-shell/bufferLatest.d.ts.map +0 -1
  739. package/dist/types/ui-shell/createMessageBus.d.ts.map +0 -1
  740. package/dist/types/ui-shell/createStore.d.ts.map +0 -1
  741. /package/dist/cjs/{addSpecificity.cjs → tools/addSpecificity.cjs} +0 -0
  742. /package/dist/cjs/{ui-shell → tools}/bufferLatest.cjs +0 -0
  743. /package/dist/cjs/{ui-shell → tools}/createMessageBus.cjs +0 -0
  744. /package/dist/cjs/{ui-shell → tools}/createStore.cjs +0 -0
  745. /package/dist/esm/{addSpecificity.js → tools/addSpecificity.js} +0 -0
  746. /package/dist/esm/{ui-shell → tools}/bufferLatest.js +0 -0
  747. /package/dist/esm/{ui-shell → tools}/createMessageBus.js +0 -0
  748. /package/dist/esm/{ui-shell → tools}/createStore.js +0 -0
  749. /package/dist/types/{addSpecificity.d.ts → tools/addSpecificity.d.ts} +0 -0
  750. /package/dist/types/{ui-shell → tools}/bufferLatest.d.ts +0 -0
  751. /package/dist/types/{ui-shell → tools}/createMessageBus.d.ts +0 -0
  752. /package/dist/types/{ui-shell → tools}/createStore.d.ts +0 -0
@@ -19,27 +19,22 @@ const OdysseyCacheProvider = ({
19
19
  children,
20
20
  emotionRoot,
21
21
  emotionRootElement,
22
- hasShadowDom: hasShadowDomProp,
23
22
  nonce,
24
- shadowDomElement,
25
23
  stylisPlugins
26
24
  }) => {
27
25
  const uniqueAlphabeticalId = useUniqueAlphabeticalId();
28
- const hasShadowDom = hasShadowDomProp || shadowDomElement;
29
- const emotionCache = useMemo(() => {
30
- return createCache({
31
- ...((emotionRootElement || emotionRoot) && {
32
- container: emotionRootElement || emotionRoot
33
- }),
34
- key: uniqueAlphabeticalId,
35
- nonce: nonce ?? globalThis.cspNonce,
36
- prepend: true,
37
- speedy: hasShadowDom ? false : true,
38
- ...(stylisPlugins && {
39
- stylisPlugins
40
- })
41
- });
42
- }, [emotionRoot, emotionRootElement, hasShadowDom, nonce, stylisPlugins, uniqueAlphabeticalId]);
26
+ const emotionCache = useMemo(() => createCache({
27
+ ...((emotionRootElement || emotionRoot) && {
28
+ container: emotionRootElement || emotionRoot
29
+ }),
30
+ key: uniqueAlphabeticalId,
31
+ nonce: nonce ?? globalThis.cspNonce,
32
+ prepend: true,
33
+ speedy: true,
34
+ ...(stylisPlugins && {
35
+ stylisPlugins
36
+ })
37
+ }), [emotionRoot, emotionRootElement, nonce, stylisPlugins, uniqueAlphabeticalId]);
43
38
  return _jsx(CacheProvider, {
44
39
  value: emotionCache,
45
40
  children: children
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","CacheProvider","memo","useMemo","useUniqueAlphabeticalId","jsx","_jsx","OdysseyCacheProvider","children","emotionRoot","emotionRootElement","hasShadowDom","hasShadowDomProp","nonce","shadowDomElement","stylisPlugins","uniqueAlphabeticalId","emotionCache","container","key","globalThis","cspNonce","prepend","speedy","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../../src/OdysseyCacheProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\ndeclare global {\n var cspNonce: string; // Adding types to `globalThis` requires we use `var`.\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { CacheProvider } from \"@emotion/react\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId.js\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n /**\n * Emotion caches styles into the style element.\n * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.\n * @deprecated Use `EmotionRootElement` instead. This was incorrectly configured as an `HTMLStyleElement`, but then we're rendering `<style>` inside `<style>`. We need this to be a `<div>` instead.\n */\n emotionRoot?: HTMLStyleElement;\n /**\n * Emotion adds `<style>` elements into this DOM node. Normally, Emotion puts these in `document.head`.\n * This is useful if you want to render into a Shadow DOM or iframe.\n */\n emotionRootElement?: HTMLElement;\n hasShadowDom?: boolean;\n nonce?: string;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n * @deprecated Will be removed in a future Odyssey version. Use `hasShadowDomElement` instead.\n */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n emotionRoot,\n emotionRootElement,\n hasShadowDom: hasShadowDomProp,\n nonce,\n shadowDomElement,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const hasShadowDom = hasShadowDomProp || shadowDomElement;\n\n const emotionCache = useMemo(() => {\n return createCache({\n ...((emotionRootElement || emotionRoot) && {\n container: emotionRootElement || emotionRoot,\n }),\n key: uniqueAlphabeticalId,\n nonce: nonce ?? globalThis.cspNonce,\n prepend: true,\n speedy: hasShadowDom ? false : true, // <-- Needs to be set to false when shadow-dom is used! https://github.com/emotion-js/emotion/issues/2053#issuecomment-713429122\n ...(stylisPlugins && { stylisPlugins }),\n });\n }, [\n emotionRoot,\n emotionRootElement,\n hasShadowDom,\n nonce,\n stylisPlugins,\n uniqueAlphabeticalId,\n ]);\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAOA,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Cache","CacheProvider","memo","useMemo","useUniqueAlphabeticalId","jsx","_jsx","OdysseyCacheProvider","children","emotionRoot","emotionRootElement","nonce","stylisPlugins","uniqueAlphabeticalId","emotionCache","container","key","globalThis","cspNonce","prepend","speedy","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../../src/OdysseyCacheProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\ndeclare global {\n var cspNonce: string; // Adding types to `globalThis` requires we use `var`.\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { CacheProvider } from \"@emotion/react\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId.js\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n /**\n * @deprecated Use `EmotionRootElement` instead. This was incorrectly configured as an `HTMLStyleElement`, but then we're rendering `<style>` inside `<style>`. We need this to be a `<div>` instead.\n *\n * Emotion caches styles into the style element.\n * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.\n */\n emotionRoot?: HTMLStyleElement;\n /**\n * Emotion adds `<style>` elements into this DOM node. Normally, Emotion puts these in `document.head`.\n * This is useful if you want to render into a Shadow DOM or iframe.\n */\n emotionRootElement?: HTMLElement;\n /**\n * @deprecated No longer necessary.\n *\n * Required to know if a Shadow DOM is in use. This tells Emotion to change its cache configuration.\n */\n hasShadowDom?: boolean;\n nonce?: string;\n /**\n * @deprecated No longer necessary.\n *\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n emotionRoot,\n emotionRootElement,\n nonce,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const emotionCache = useMemo(\n () =>\n createCache({\n ...((emotionRootElement || emotionRoot) && {\n container: emotionRootElement || emotionRoot,\n }),\n key: uniqueAlphabeticalId,\n nonce: nonce ?? globalThis.cspNonce,\n prepend: true,\n speedy: true,\n ...(stylisPlugins && { stylisPlugins }),\n }),\n [\n emotionRoot,\n emotionRootElement,\n nonce,\n stylisPlugins,\n uniqueAlphabeticalId,\n ],\n );\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAOA,WAAW,MAAwB,gBAAgB;AAC1D,SAASC,aAAa,QAAQ,gBAAgB;AAC9C,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAEhD,SAASC,uBAAuB,QAAQ,8BAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiCvE,MAAMC,oBAAoB,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,WAAW;EACXC,kBAAkB;EAClBC,KAAK;EACLC;AACyB,CAAC,KAAK;EAC/B,MAAMC,oBAAoB,GAAGT,uBAAuB,CAAC,CAAC;EAEtD,MAAMU,YAAY,GAAGX,OAAO,CAC1B,MACEH,WAAW,CAAC;IACV,IAAI,CAACU,kBAAkB,IAAID,WAAW,KAAK;MACzCM,SAAS,EAAEL,kBAAkB,IAAID;IACnC,CAAC,CAAC;IACFO,GAAG,EAAEH,oBAAoB;IACzBF,KAAK,EAAEA,KAAK,IAAIM,UAAU,CAACC,QAAQ;IACnCC,OAAO,EAAE,IAAI;IACbC,MAAM,EAAE,IAAI;IACZ,IAAIR,aAAa,IAAI;MAAEA;IAAc,CAAC;EACxC,CAAC,CAAC,EACJ,CACEH,WAAW,EACXC,kBAAkB,EAClBC,KAAK,EACLC,aAAa,EACbC,oBAAoB,CAExB,CAAC;EAED,OAAOP,IAAA,CAACL,aAAa;IAACoB,KAAK,EAAEP,YAAa;IAAAN,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AACvE,CAAC;AAED,MAAMc,4BAA4B,GAAGpB,IAAI,CAACK,oBAAoB,CAAC;AAC/De,4BAA4B,CAACC,WAAW,GAAG,sBAAsB;AAEjE,SAASD,4BAA4B,IAAIf,oBAAoB","ignoreList":[]}
@@ -11,10 +11,12 @@ import _ScopedCssBaseline from "@mui/material/ScopedCssBaseline";
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
13
  import { memo } from "react";
14
+ import { CssBaseline } from "./CssBaseline.js";
15
+ import { FullScreenOverlayProvider } from "./FullScreenOverlayContext.js";
16
+ import { TranslationProvider as OdysseyTranslationProvider } from "./i18n.generated/i18n.js";
14
17
  import { OdysseyCacheProvider } from "./OdysseyCacheProvider.js";
15
18
  import { OdysseyThemeProvider } from "./OdysseyThemeProvider.js";
16
- import { OdysseyTranslationProvider } from "./OdysseyTranslationProvider.js";
17
- import { jsx as _jsx } from "react/jsx-runtime";
19
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
18
20
  const scopedCssBaselineStyles = {
19
21
  height: "inherit"
20
22
  };
@@ -24,9 +26,12 @@ const OdysseyProvider = ({
24
26
  designTokensOverride,
25
27
  emotionRoot,
26
28
  emotionRootElement,
29
+ hasCssBaseline: hasGlobalCss,
27
30
  hasScopedCssBaseline = true,
31
+ hasWrapperElement,
28
32
  languageCode,
29
33
  nonce,
34
+ overlayParentElement,
30
35
  shadowDomElement,
31
36
  shadowRootElement,
32
37
  stylisPlugins,
@@ -34,26 +39,29 @@ const OdysseyProvider = ({
34
39
  translationOverrides
35
40
  }) => _jsx(OdysseyCacheProvider, {
36
41
  emotionRootElement: emotionRootElement || emotionRoot,
37
- hasShadowDom: Boolean(shadowRootElement || shadowDomElement),
38
42
  nonce: nonce,
39
43
  stylisPlugins: stylisPlugins,
40
44
  children: _jsx(OdysseyThemeProvider, {
41
45
  contrastMode: contrastMode,
42
46
  designTokensOverride: designTokensOverride,
43
- shadowDomElement: shadowDomElement,
44
- shadowRootElement: shadowRootElement,
47
+ hasWrapperElement: hasWrapperElement,
48
+ shadowRootElement: shadowRootElement ?? shadowDomElement,
45
49
  themeOverride: themeOverride,
46
50
  children: _jsx(OdysseyTranslationProvider, {
47
51
  languageCode: languageCode,
48
52
  translationOverrides: translationOverrides,
49
- children: hasScopedCssBaseline ? _jsx(_ScopedCssBaseline, {
50
- sx: scopedCssBaselineStyles,
51
- children: children
52
- }) : children
53
+ children: _jsxs(FullScreenOverlayProvider, {
54
+ hasShadowDom: Boolean(shadowRootElement || shadowDomElement),
55
+ overlayParentElement: overlayParentElement,
56
+ children: [hasGlobalCss && _jsx(CssBaseline, {}), hasScopedCssBaseline ? _jsx(_ScopedCssBaseline, {
57
+ sx: scopedCssBaselineStyles,
58
+ children: children
59
+ }) : children]
60
+ })
53
61
  })
54
62
  })
55
63
  });
56
- OdysseyProvider.displayName = "OdysseyProvider";
57
64
  const MemoizedOdysseyProvider = memo(OdysseyProvider);
65
+ MemoizedOdysseyProvider.displayName = "OdysseyProvider";
58
66
  export { MemoizedOdysseyProvider as OdysseyProvider };
59
67
  //# sourceMappingURL=OdysseyProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","scopedCssBaselineStyles","height","OdysseyProvider","children","contrastMode","designTokensOverride","emotionRoot","emotionRootElement","hasScopedCssBaseline","languageCode","nonce","shadowDomElement","shadowRootElement","stylisPlugins","themeOverride","translationOverrides","hasShadowDom","Boolean","_ScopedCssBaseline","sx","displayName","MemoizedOdysseyProvider"],"sources":["../../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ScopedCssBaseline } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\n\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider.js\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider.js\";\nimport {\n OdysseyTranslationProvider,\n OdysseyTranslationProviderProps,\n} from \"./OdysseyTranslationProvider.js\";\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types.js\";\n\nconst scopedCssBaselineStyles = {\n height: \"inherit\",\n};\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n /**\n * Whether to emit the ScopedCssBaseline. Defaults to true.\n */\n hasScopedCssBaseline?: boolean;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n contrastMode,\n designTokensOverride,\n emotionRoot,\n emotionRootElement,\n hasScopedCssBaseline = true,\n languageCode,\n nonce,\n shadowDomElement,\n shadowRootElement,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n emotionRootElement={emotionRootElement || emotionRoot}\n hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}\n nonce={nonce}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n contrastMode={contrastMode}\n designTokensOverride={designTokensOverride}\n shadowDomElement={shadowDomElement}\n shadowRootElement={shadowRootElement}\n themeOverride={themeOverride}\n >\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {hasScopedCssBaseline ? (\n <ScopedCssBaseline sx={scopedCssBaselineStyles}>\n {children}\n </ScopedCssBaseline>\n ) : (\n children\n )}\n </OdysseyTranslationProvider>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\nOdysseyProvider.displayName = \"OdysseyProvider\";\n\nconst MemoizedOdysseyProvider = memo(OdysseyProvider) as typeof OdysseyProvider;\n\nexport { MemoizedOdysseyProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,QAAmB,OAAO;AAEvC,SACEC,oBAAoB,QAEf,2BAA2B;AAClC,SACEC,oBAAoB,QAEf,2BAA2B;AAClC,SACEC,0BAA0B,QAErB,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGzC,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE;AACV,CAAC;AAcD,MAAMC,eAAe,GAAGA,CAAoC;EAC1DC,QAAQ;EACRC,YAAY;EACZC,oBAAoB;EACpBC,WAAW;EACXC,kBAAkB;EAClBC,oBAAoB,GAAG,IAAI;EAC3BC,YAAY;EACZC,KAAK;EACLC,gBAAgB;EAChBC,iBAAiB;EACjBC,aAAa;EACbC,aAAa;EACbC;AACwC,CAAC,KACzChB,IAAA,CAACJ,oBAAoB;EACnBY,kBAAkB,EAAEA,kBAAkB,IAAID,WAAY;EACtDU,YAAY,EAAEC,OAAO,CAACL,iBAAiB,IAAID,gBAAgB,CAAE;EAC7DD,KAAK,EAAEA,KAAM;EACbG,aAAa,EAAEA,aAAc;EAAAV,QAAA,EAE7BJ,IAAA,CAACH,oBAAoB;IACnBQ,YAAY,EAAEA,YAAa;IAC3BC,oBAAoB,EAAEA,oBAAqB;IAC3CM,gBAAgB,EAAEA,gBAAiB;IACnCC,iBAAiB,EAAEA,iBAAkB;IACrCE,aAAa,EAAEA,aAAc;IAAAX,QAAA,EAE7BJ,IAAA,CAACF,0BAA0B;MACzBY,YAAY,EAAEA,YAAa;MAC3BM,oBAAoB,EAAEA,oBAAqB;MAAAZ,QAAA,EAE1CK,oBAAoB,GACnBT,IAAA,CAAAmB,kBAAA;QAAmBC,EAAE,EAAEnB,uBAAwB;QAAAG,QAAA,EAC5CA;MAAQ,CACQ,CAAC,GAEpBA;IACD,CACyB;EAAC,CACT;AAAC,CACH,CACvB;AACDD,eAAe,CAACkB,WAAW,GAAG,iBAAiB;AAE/C,MAAMC,uBAAuB,GAAG3B,IAAI,CAACQ,eAAe,CAA2B;AAE/E,SAASmB,uBAAuB,IAAInB,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"OdysseyProvider.js","names":["memo","CssBaseline","FullScreenOverlayProvider","TranslationProvider","OdysseyTranslationProvider","OdysseyCacheProvider","OdysseyThemeProvider","jsx","_jsx","jsxs","_jsxs","scopedCssBaselineStyles","height","OdysseyProvider","children","contrastMode","designTokensOverride","emotionRoot","emotionRootElement","hasCssBaseline","hasGlobalCss","hasScopedCssBaseline","hasWrapperElement","languageCode","nonce","overlayParentElement","shadowDomElement","shadowRootElement","stylisPlugins","themeOverride","translationOverrides","hasShadowDom","Boolean","_ScopedCssBaseline","sx","MemoizedOdysseyProvider","displayName"],"sources":["../../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ScopedCssBaseline } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\n\nimport { CssBaseline } from \"./CssBaseline.js\";\nimport {\n FullScreenOverlayProvider,\n FullScreenOverlayProviderProps,\n} from \"./FullScreenOverlayContext.js\";\nimport {\n type DefaultSupportedLanguages,\n TranslationProvider as OdysseyTranslationProvider,\n type TranslationProviderProps as OdysseyTranslationProviderProps,\n} from \"./i18n.generated/i18n.js\";\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider.js\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider.js\";\n\nconst scopedCssBaselineStyles = {\n height: \"inherit\",\n};\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = Omit<OdysseyCacheProviderProps, \"hasShadowDom\"> &\n FullScreenOverlayProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n /**\n * Whether to emit the ScopedCssBaseline. Defaults to true.\n */\n hasCssBaseline?: boolean;\n /**\n * Adds the `ScopedCssBaseline` wrapper. This also adds a `div`, so it might not be what you want.\n */\n hasScopedCssBaseline?: boolean;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n contrastMode,\n designTokensOverride,\n emotionRoot,\n emotionRootElement,\n hasCssBaseline: hasGlobalCss,\n hasScopedCssBaseline = true,\n hasWrapperElement,\n languageCode,\n nonce,\n overlayParentElement,\n shadowDomElement,\n shadowRootElement,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n emotionRootElement={emotionRootElement || emotionRoot}\n nonce={nonce}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n contrastMode={contrastMode}\n designTokensOverride={designTokensOverride}\n hasWrapperElement={hasWrapperElement}\n shadowRootElement={shadowRootElement ?? shadowDomElement}\n themeOverride={themeOverride}\n >\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n <FullScreenOverlayProvider\n hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}\n overlayParentElement={overlayParentElement}\n >\n {hasGlobalCss && <CssBaseline />}\n\n {hasScopedCssBaseline ? (\n <ScopedCssBaseline sx={scopedCssBaselineStyles}>\n {children}\n </ScopedCssBaseline>\n ) : (\n children\n )}\n </FullScreenOverlayProvider>\n </OdysseyTranslationProvider>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\n\nconst MemoizedOdysseyProvider = memo(OdysseyProvider);\nMemoizedOdysseyProvider.displayName = \"OdysseyProvider\";\n\nexport { MemoizedOdysseyProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,QAAmB,OAAO;AAEvC,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SACEC,yBAAyB,QAEpB,+BAA+B;AACtC,SAEEC,mBAAmB,IAAIC,0BAA0B,QAE5C,0BAA0B;AACjC,SACEC,oBAAoB,QAEf,2BAA2B;AAClC,SACEC,oBAAoB,QAEf,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE;AACV,CAAC;AAmBD,MAAMC,eAAe,GAAGA,CAAoC;EAC1DC,QAAQ;EACRC,YAAY;EACZC,oBAAoB;EACpBC,WAAW;EACXC,kBAAkB;EAClBC,cAAc,EAAEC,YAAY;EAC5BC,oBAAoB,GAAG,IAAI;EAC3BC,iBAAiB;EACjBC,YAAY;EACZC,KAAK;EACLC,oBAAoB;EACpBC,gBAAgB;EAChBC,iBAAiB;EACjBC,aAAa;EACbC,aAAa;EACbC;AACwC,CAAC,KACzCtB,IAAA,CAACH,oBAAoB;EACnBa,kBAAkB,EAAEA,kBAAkB,IAAID,WAAY;EACtDO,KAAK,EAAEA,KAAM;EACbI,aAAa,EAAEA,aAAc;EAAAd,QAAA,EAE7BN,IAAA,CAACF,oBAAoB;IACnBS,YAAY,EAAEA,YAAa;IAC3BC,oBAAoB,EAAEA,oBAAqB;IAC3CM,iBAAiB,EAAEA,iBAAkB;IACrCK,iBAAiB,EAAEA,iBAAiB,IAAID,gBAAiB;IACzDG,aAAa,EAAEA,aAAc;IAAAf,QAAA,EAE7BN,IAAA,CAACJ,0BAA0B;MACzBmB,YAAY,EAAEA,YAAa;MAC3BO,oBAAoB,EAAEA,oBAAqB;MAAAhB,QAAA,EAE3CJ,KAAA,CAACR,yBAAyB;QACxB6B,YAAY,EAAEC,OAAO,CAACL,iBAAiB,IAAID,gBAAgB,CAAE;QAC7DD,oBAAoB,EAAEA,oBAAqB;QAAAX,QAAA,GAE1CM,YAAY,IAAIZ,IAAA,CAACP,WAAW,IAAE,CAAC,EAE/BoB,oBAAoB,GACnBb,IAAA,CAAAyB,kBAAA;UAAmBC,EAAE,EAAEvB,uBAAwB;UAAAG,QAAA,EAC5CA;QAAQ,CACQ,CAAC,GAEpBA,QACD;MAAA,CACwB;IAAC,CACF;EAAC,CACT;AAAC,CACH,CACvB;AAED,MAAMqB,uBAAuB,GAAGnC,IAAI,CAACa,eAAe,CAAC;AACrDsB,uBAAuB,CAACC,WAAW,GAAG,iBAAiB;AAEvD,SAASD,uBAAuB,IAAItB,eAAe","ignoreList":[]}
@@ -16,6 +16,7 @@ import { deepmerge } from "@mui/utils";
16
16
  import * as Tokens from "@okta/odyssey-design-tokens";
17
17
  import { memo, useMemo } from "react";
18
18
  import { OdysseyDesignTokensContext } from "./OdysseyDesignTokensContext.js";
19
+ import { OdysseyThemeProviderPropsProvider, useOdysseyThemeProviderPropsContext } from "./OdysseyThemeProviderPropsContext.js";
19
20
  import { createOdysseyMuiTheme } from "./theme/index.js";
20
21
  import { ContrastModeContext, useContrastMode } from "./useContrastMode.js";
21
22
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -24,47 +25,57 @@ const StyledContrastContainerStyles = styled("div")({
24
25
  });
25
26
  const OdysseyThemeProvider = ({
26
27
  children,
27
- contrastMode: explicitContrastMode,
28
- designTokensOverride,
28
+ contrastMode: contrastModeProp,
29
+ designTokensOverride: designTokensOverrideProp,
30
+ hasWrapperElement = true,
29
31
  shadowDomElement,
30
- shadowRootElement,
31
- themeOverride
32
+ shadowRootElement: shadowRootElementProp,
33
+ themeOverride: themeOverrideProp
32
34
  }) => {
35
+ const odysseyThemeProviderPropsContext = useOdysseyThemeProviderPropsContext();
36
+ const designTokensOverride = designTokensOverrideProp ?? odysseyThemeProviderPropsContext.designTokensOverride;
37
+ const shadowRootElement = shadowRootElementProp ?? shadowDomElement ?? odysseyThemeProviderPropsContext.shadowRootElement;
38
+ const themeOverride = themeOverrideProp ?? odysseyThemeProviderPropsContext.themeOverride;
33
39
  const {
34
40
  contrastMode,
35
41
  contrastContainerRef
36
42
  } = useContrastMode({
37
- contrastMode: explicitContrastMode
43
+ contrastMode: contrastModeProp
38
44
  });
39
45
  const odysseyTokens = useMemo(() => ({
40
46
  ...Tokens,
41
47
  ...designTokensOverride
42
48
  }), [designTokensOverride]);
43
- const effectiveShadowRootElement = shadowRootElement || shadowDomElement;
44
49
  const odysseyTheme = useMemo(() => createOdysseyMuiTheme({
45
50
  contrastMode,
46
51
  odysseyTokens,
47
- shadowRootElement: effectiveShadowRootElement
48
- }), [contrastMode, odysseyTokens, effectiveShadowRootElement]);
52
+ shadowRootElement
53
+ }), [contrastMode, odysseyTokens, shadowRootElement]);
49
54
  const customOdysseyTheme = useMemo(() => createTheme(deepmerge(odysseyTheme, themeOverride || {})), [odysseyTheme, themeOverride]);
50
55
  const contrastModeProviderValue = useMemo(() => ({
51
56
  contrastMode
52
57
  }), [contrastMode]);
53
- return _jsx(StyledContrastContainerStyles, {
54
- ref: contrastContainerRef,
55
- children: _jsx(ContrastModeContext.Provider, {
56
- value: contrastModeProviderValue,
57
- children: _jsx(MuiThemeProvider, {
58
- theme: customOdysseyTheme,
58
+ const providerComponents = useMemo(() => _jsx(ContrastModeContext.Provider, {
59
+ value: contrastModeProviderValue,
60
+ children: _jsx(MuiThemeProvider, {
61
+ theme: customOdysseyTheme,
62
+ children: _jsx(OdysseyThemeProviderPropsProvider, {
63
+ designTokensOverride: designTokensOverride,
64
+ shadowRootElement: shadowRootElement,
65
+ themeOverride: themeOverride,
59
66
  children: _jsx(OdysseyDesignTokensContext.Provider, {
60
67
  value: odysseyTokens,
61
68
  children: children
62
69
  })
63
70
  })
64
71
  })
65
- });
72
+ }), [children, contrastModeProviderValue, customOdysseyTheme, designTokensOverride, odysseyTokens, shadowRootElement, themeOverride]);
73
+ return hasWrapperElement ? _jsx(StyledContrastContainerStyles, {
74
+ ref: contrastContainerRef,
75
+ children: providerComponents
76
+ }) : providerComponents;
66
77
  };
67
- OdysseyThemeProvider.displayName = "OdysseyThemeProvider";
68
78
  const MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);
79
+ MemoizedOdysseyThemeProvider.displayName = "OdysseyThemeProvider";
69
80
  export { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };
70
81
  //# sourceMappingURL=OdysseyThemeProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyThemeProvider.js","names":["styled","createTheme","ThemeProvider","MuiThemeProvider","deepmerge","Tokens","memo","useMemo","OdysseyDesignTokensContext","createOdysseyMuiTheme","ContrastModeContext","useContrastMode","jsx","_jsx","StyledContrastContainerStyles","height","OdysseyThemeProvider","children","contrastMode","explicitContrastMode","designTokensOverride","shadowDomElement","shadowRootElement","themeOverride","contrastContainerRef","odysseyTokens","effectiveShadowRootElement","odysseyTheme","customOdysseyTheme","contrastModeProviderValue","ref","Provider","value","theme","displayName","MemoizedOdysseyThemeProvider"],"sources":["../../src/OdysseyThemeProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { ThemeOptions } from \"@mui/material\";\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport { deepmerge } from \"@mui/utils\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { OdysseyDesignTokensContext } from \"./OdysseyDesignTokensContext.js\";\nimport { createOdysseyMuiTheme, DesignTokensOverride } from \"./theme/index.js\";\nimport {\n ContrastMode,\n ContrastModeContext,\n useContrastMode,\n} from \"./useContrastMode.js\";\n\nconst StyledContrastContainerStyles = styled(\"div\")({\n height: \"inherit\",\n});\n\nexport type OdysseyThemeProviderProps = {\n children: ReactNode;\n contrastMode?: ContrastMode;\n designTokensOverride?: DesignTokensOverride;\n /** @deprecated Use shadowRootElement instead */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n shadowRootElement?: HTMLDivElement | HTMLElement;\n themeOverride?: ThemeOptions;\n};\n\n/**\n * This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.\n *\n * Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.\n */\nconst OdysseyThemeProvider = ({\n children,\n contrastMode: explicitContrastMode,\n designTokensOverride,\n shadowDomElement,\n shadowRootElement,\n themeOverride,\n}: OdysseyThemeProviderProps) => {\n const { contrastMode, contrastContainerRef } = useContrastMode({\n contrastMode: explicitContrastMode,\n });\n\n const odysseyTokens = useMemo(\n () => ({ ...Tokens, ...designTokensOverride }),\n [designTokensOverride],\n );\n\n const effectiveShadowRootElement = shadowRootElement || shadowDomElement;\n\n const odysseyTheme = useMemo(\n () =>\n createOdysseyMuiTheme({\n contrastMode,\n odysseyTokens,\n shadowRootElement: effectiveShadowRootElement,\n }),\n [contrastMode, odysseyTokens, effectiveShadowRootElement],\n );\n\n const customOdysseyTheme = useMemo(\n () => createTheme(deepmerge(odysseyTheme, themeOverride || {})),\n [odysseyTheme, themeOverride],\n );\n\n const contrastModeProviderValue = useMemo(\n () => ({\n contrastMode,\n }),\n [contrastMode],\n );\n\n return (\n <StyledContrastContainerStyles ref={contrastContainerRef}>\n <ContrastModeContext.Provider value={contrastModeProviderValue}>\n <MuiThemeProvider theme={customOdysseyTheme}>\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </MuiThemeProvider>\n </ContrastModeContext.Provider>\n </StyledContrastContainerStyles>\n );\n};\nOdysseyThemeProvider.displayName = \"OdysseyThemeProvider\";\n\nconst MemoizedOdysseyThemeProvider = memo(\n OdysseyThemeProvider,\n) as typeof OdysseyThemeProvider;\n\nexport { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SACEC,WAAW,EACXC,aAAa,IAAIC,gBAAgB,QAC5B,sBAAsB;AAC7B,SAASC,SAAS,QAAQ,YAAY;AACtC,OAAO,KAAKC,MAAM,MAAM,6BAA6B;AACrD,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAEhD,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,qBAAqB,QAA8B,kB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QAAA,EAC7DJ,IAAA,CAACV,gBAAgB;QAAC8B,KAAK,EAAEL,kBAAmB;QAAAX,QAAA,EAC1CJ,IAAA,CAACL,0BAA0B,CAACuB,QAAQ;UAACC,KAAK,EAAEP,aAAc;UAAAR,QAAA,EACvDA;QAAQ,CAC0B;MAAC,CACtB;IAAC,CACS;EAAC,CACF,CAAC;AAEpC,CAAC;AACDD,oBAAoB,CAACkB,WAAW,GAAG,sBAAsB;AAEzD,MAAMC,4BAA4B,GAAG7B,IAAI,CACvCU,oBACF,CAAgC;AAEhC,SAASmB,4BAA4B,IAAInB,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"OdysseyThemeProvider.js","names":["styled","createTheme","ThemeProvider","MuiThemeProvider","deepmerge","Tokens","memo","useMemo","OdysseyDesignTokensContext","OdysseyThemeProviderPropsProvider","useOdysseyThemeProviderPropsContext","createOdysseyMuiTheme","ContrastModeContext","useContrastMode","jsx","_jsx","StyledContrastContainerStyles","height","OdysseyThemeProvider","children","contrastMode","contrastModeProp","designTokensOverride","designTokensOverrideProp","hasWrapperElement","shadowDomElement","shadowRootElement","shadowRootElementProp","themeOverride","themeOverrideProp","odysseyThemeProviderPropsContext","contrastContainerRef","odysseyTokens","odysseyTheme","customOdysseyTheme","contrastModeProviderValue","providerComponents","Provider","value","theme","ref","MemoizedOdysseyThemeProvider","displayName"],"sources":["../../src/OdysseyThemeProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport { deepmerge } from \"@mui/utils\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { OdysseyDesignTokensContext } from \"./OdysseyDesignTokensContext.js\";\nimport {\n type OdysseyThemeProviderContextProps,\n OdysseyThemeProviderPropsProvider,\n useOdysseyThemeProviderPropsContext,\n} from \"./OdysseyThemeProviderPropsContext.js\";\nimport { createOdysseyMuiTheme } from \"./theme/index.js\";\nimport {\n ContrastMode,\n ContrastModeContext,\n useContrastMode,\n} from \"./useContrastMode.js\";\n\nconst StyledContrastContainerStyles = styled(\"div\")({\n height: \"inherit\",\n});\n\nexport type OdysseyThemeProviderProps = OdysseyThemeProviderContextProps & {\n children: ReactNode;\n contrastMode?: ContrastMode;\n /**\n * Odyssey adds a wrapper `div` for contrast changes and height calculations. This is not necessary if you're not changing the background color or rendering into full-height element.\n */\n hasWrapperElement?: boolean;\n /** @deprecated Use shadowRootElement instead */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n};\n\n/**\n * This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.\n *\n * Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.\n */\nconst OdysseyThemeProvider = ({\n children,\n contrastMode: contrastModeProp,\n designTokensOverride: designTokensOverrideProp,\n hasWrapperElement = true,\n shadowDomElement,\n shadowRootElement: shadowRootElementProp,\n themeOverride: themeOverrideProp,\n}: OdysseyThemeProviderProps) => {\n const odysseyThemeProviderPropsContext =\n useOdysseyThemeProviderPropsContext();\n\n const designTokensOverride =\n designTokensOverrideProp ??\n odysseyThemeProviderPropsContext.designTokensOverride;\n\n const shadowRootElement =\n shadowRootElementProp ??\n shadowDomElement ??\n odysseyThemeProviderPropsContext.shadowRootElement; // Adding `odysseyThemeProviderPropsContext.shadowRootElement` fixes popovers not being styled in `Surface`.\n\n const themeOverride =\n themeOverrideProp ?? odysseyThemeProviderPropsContext.themeOverride;\n\n const { contrastMode, contrastContainerRef } = useContrastMode({\n contrastMode: contrastModeProp,\n });\n\n const odysseyTokens = useMemo(\n () => ({ ...Tokens, ...designTokensOverride }),\n [designTokensOverride],\n );\n\n const odysseyTheme = useMemo(\n () =>\n createOdysseyMuiTheme({\n contrastMode,\n odysseyTokens,\n shadowRootElement,\n }),\n [contrastMode, odysseyTokens, shadowRootElement],\n );\n\n const customOdysseyTheme = useMemo(\n () => createTheme(deepmerge(odysseyTheme, themeOverride || {})),\n [odysseyTheme, themeOverride],\n );\n\n const contrastModeProviderValue = useMemo(\n () => ({\n contrastMode,\n }),\n [contrastMode],\n );\n\n const providerComponents = useMemo(\n () => (\n <ContrastModeContext.Provider value={contrastModeProviderValue}>\n <MuiThemeProvider theme={customOdysseyTheme}>\n <OdysseyThemeProviderPropsProvider\n designTokensOverride={designTokensOverride}\n shadowRootElement={shadowRootElement}\n themeOverride={themeOverride}\n >\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </OdysseyThemeProviderPropsProvider>\n </MuiThemeProvider>\n </ContrastModeContext.Provider>\n ),\n [\n children,\n contrastModeProviderValue,\n customOdysseyTheme,\n designTokensOverride,\n odysseyTokens,\n shadowRootElement,\n themeOverride,\n ],\n );\n\n return hasWrapperElement ? (\n <StyledContrastContainerStyles ref={contrastContainerRef}>\n {providerComponents}\n </StyledContrastContainerStyles>\n ) : (\n providerComponents\n );\n};\n\nconst MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);\nMemoizedOdysseyThemeProvider.displayName = \"OdysseyThemeProvider\";\n\nexport { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SACEC,WAAW,EACXC,aAAa,IAAIC,gBAAgB,QAC5B,sBAAsB;AAC7B,SAASC,SAAS,QAAQ,Y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,0 +1,38 @@
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 { createContext, memo, useContext, useMemo } from "react";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ export const OdysseyThemeProviderPropsContext = createContext({});
16
+ export const useOdysseyThemeProviderPropsContext = () => useContext(OdysseyThemeProviderPropsContext);
17
+ const OdysseyThemeProviderPropsProvider = ({
18
+ children,
19
+ designTokensOverride,
20
+ shadowRootElement,
21
+ themeOverride
22
+ }) => {
23
+ const odysseyThemeProviderPropsContext = useOdysseyThemeProviderPropsContext();
24
+ const providerValue = useMemo(() => ({
25
+ ...odysseyThemeProviderPropsContext,
26
+ designTokensOverride,
27
+ shadowRootElement,
28
+ themeOverride
29
+ }), [designTokensOverride, odysseyThemeProviderPropsContext, shadowRootElement, themeOverride]);
30
+ return _jsx(OdysseyThemeProviderPropsContext.Provider, {
31
+ value: providerValue,
32
+ children: children
33
+ });
34
+ };
35
+ const MemoizedOdysseyThemeProviderPropsProvider = memo(OdysseyThemeProviderPropsProvider);
36
+ MemoizedOdysseyThemeProviderPropsProvider.displayName = "OdysseyThemeProviderPropsProvider";
37
+ export { MemoizedOdysseyThemeProviderPropsProvider as OdysseyThemeProviderPropsProvider };
38
+ //# sourceMappingURL=OdysseyThemeProviderPropsContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OdysseyThemeProviderPropsContext.js","names":["createContext","memo","useContext","useMemo","jsx","_jsx","OdysseyThemeProviderPropsContext","useOdysseyThemeProviderPropsContext","OdysseyThemeProviderPropsProvider","children","designTokensOverride","shadowRootElement","themeOverride","odysseyThemeProviderPropsContext","providerValue","Provider","value","MemoizedOdysseyThemeProviderPropsProvider","displayName"],"sources":["../../src/OdysseyThemeProviderPropsContext.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2025-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { ThemeOptions } from \"@mui/material\";\nimport {\n createContext,\n memo,\n type ReactNode,\n useContext,\n useMemo,\n} from \"react\";\n\nimport { DesignTokensOverride } from \"./theme/index.js\";\n\nexport type OdysseyThemeProviderContextProps = {\n designTokensOverride?: DesignTokensOverride;\n shadowRootElement?: HTMLDivElement | HTMLElement;\n themeOverride?: ThemeOptions;\n};\n\nexport const OdysseyThemeProviderPropsContext =\n createContext<OdysseyThemeProviderContextProps>({});\n\nexport const useOdysseyThemeProviderPropsContext = () =>\n useContext(OdysseyThemeProviderPropsContext);\n\nexport type OdysseyThemeProviderPropsProviderProps =\n OdysseyThemeProviderContextProps & {\n children: ReactNode;\n };\n\nconst OdysseyThemeProviderPropsProvider = ({\n children,\n designTokensOverride,\n shadowRootElement,\n themeOverride,\n}: OdysseyThemeProviderPropsProviderProps) => {\n const odysseyThemeProviderPropsContext =\n useOdysseyThemeProviderPropsContext();\n\n const providerValue = useMemo(\n () => ({\n ...odysseyThemeProviderPropsContext,\n designTokensOverride,\n shadowRootElement,\n themeOverride,\n }),\n [\n designTokensOverride,\n odysseyThemeProviderPropsContext,\n shadowRootElement,\n themeOverride,\n ],\n );\n\n return (\n <OdysseyThemeProviderPropsContext.Provider value={providerValue}>\n {children}\n </OdysseyThemeProviderPropsContext.Provider>\n );\n};\n\nconst MemoizedOdysseyThemeProviderPropsProvider = memo(\n OdysseyThemeProviderPropsProvider,\n);\nMemoizedOdysseyThemeProviderPropsProvider.displayName =\n \"OdysseyThemeProviderPropsProvider\";\n\nexport { MemoizedOdysseyThemeProviderPropsProvider as OdysseyThemeProviderPropsProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SACEA,aAAa,EACbC,IAAI,EAEJC,UAAU,EACVC,OAAO,QACF,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAUf,OAAO,MAAMC,gCAAgC,GAC3CN,aAAa,CAAmC,CAAC,CAAC,CAAC;AAErD,OAAO,MAAMO,mCAAmC,GAAGA,CAAA,KACjDL,UAAU,CAACI,gCAAgC,CAAC;AAO9C,MAAME,iCAAiC,GAAGA,CAAC;EACzCC,QAAQ;EACRC,oBAAoB;EACpBC,iBAAiB;EACjBC;AACsC,CAAC,KAAK;EAC5C,MAAMC,gCAAgC,GACpCN,mCAAmC,CAAC,CAAC;EAEvC,MAAMO,aAAa,GAAGX,OAAO,CAC3B,OAAO;IACL,GAAGU,gCAAgC;IACnCH,oBAAoB;IACpBC,iBAAiB;IACjBC;EACF,CAAC,CAAC,EACF,CACEF,oBAAoB,EACpBG,gCAAgC,EAChCF,iBAAiB,EACjBC,aAAa,CAEjB,CAAC;EAED,OACEP,IAAA,CAACC,gCAAgC,CAACS,QAAQ;IAACC,KAAK,EAAEF,aAAc;IAAAL,QAAA,EAC7DA;EAAQ,CACgC,CAAC;AAEhD,CAAC;AAED,MAAMQ,yCAAyC,GAAGhB,IAAI,CACpDO,iCACF,CAAC;AACDS,yCAAyC,CAACC,WAAW,GACnD,mCAAmC;AAErC,SAASD,yCAAyC,IAAIT,iCAAiC","ignoreList":[]}
@@ -13,14 +13,13 @@ import _InputBase from "@mui/material/InputBase";
13
13
 
14
14
  import styled from "@emotion/styled";
15
15
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
16
- import { useTranslation } from "react-i18next";
17
16
  import { Box } from "../Box.js";
18
17
  import { Button } from "../Buttons/index.js";
18
+ import { useTranslation } from "../i18n.generated/i18n.js";
19
19
  import { ArrowLeftIcon, ArrowRightIcon } from "../icons.generated/index.js";
20
20
  import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
21
21
  import { Paragraph } from "../Typography.js";
22
22
  import { usePagination } from "./usePagination.js";
23
- import "../i18n.js";
24
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
24
  const PaginationContainer = styled("nav")({
26
25
  display: "flex",
@@ -1 +1 @@
1
- {"version":3,"file":"Pagination.js","names":["styled","memo","useCallback","useEffect","useMemo","useRef","useState","useTranslation","Box","Button","ArrowLeftIcon","ArrowRightIcon","useOdysseyDesignTokens","Paragraph","usePagination","jsx","_jsx","jsxs","_jsxs","PaginationContainer","display","justifyContent","PaginationSegment","shouldForwardProp","prop","odysseyDesignTokens","alignItems","gap","Spacing4","Spacing2","PaginationInput","_InputBase","borderColor","HueNeutral200","borderRadius","BorderRadiusTight","height","Spacing6","width","HueNeutral400","PalettePrimaryMain","PaginationButtonContainer","marginInlineStart","Pagination","currentPageLabel","currentPageLabelProp","currentRowsCount","hasPageInput","hasRowCountInput","hasRowCountLabel","isDisabled","isMoreDisabled","lastRow","loadMoreLabel","loadMoreLabelProp","maxPageIndex","maxPageSize","nextLabel","nextLabelProp","onPaginationChange","onPaginationChangeProp","pageIndex","pageSize","previousLabel","previousLabelProp","rowsPerPageLabel","rowsPerPageLabelProp","totalRows","variant","t","page","setPage","rowsPerPage","setRowsPerPage","initialRowsPerPage","totalRowsLabel","handlePaginationChange","updatedPage","updatedRowsPerPage","Math","ceil","handlePageSubmit","event","key","Number","currentTarget","value","handleRowsPerPageSubmit","setPageFromEvent","min","target","max","setRowsPerPageFromEvent","handleLoadMore","current","handleNextButton","handlePreviousButton","loadMoreIsDisabled","nextButtonDisabled","previousButtonDisabled","rowsPerPageInputProps","currentPageInputProps","children","color","component","disabled","inputProps","onBlur","onChange","onKeyDown","type","ariaLabel","onClick","size","startIcon","endIcon","label","MemoizedPagination","displayName"],"sources":["../../../src/Pagination/Pagination.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { InputBase } from \"@mui/material\";\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Box } from \"../Box.js\";\nimport { Button } from \"../Buttons/index.js\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"../icons.generated/index.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { Paragraph } from \"../Typography.js\";\nimport { paginationTypeValues } from \"./constants.js\";\nimport { usePagination } from \"./usePagination.js\";\nimport \"../i18n.js\";\n\nconst PaginationContainer = styled(\"nav\")({\n display: \"flex\",\n justifyContent: \"space-between\",\n});\n\nconst PaginationSegment = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing4,\n \"& > div\": {\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing2,\n },\n}));\n\nconst PaginationInput = styled(InputBase, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n borderColor: odysseyDesignTokens.HueNeutral200,\n borderRadius: odysseyDesignTokens.BorderRadiusTight,\n height: odysseyDesignTokens.Spacing6,\n width: \"4.5714285714rem\", // This is a hardcoded value, keep as string\n \"&:hover\": {\n borderColor: odysseyDesignTokens.HueNeutral400,\n },\n \"&.Mui-focused:hover\": {\n borderColor: odysseyDesignTokens.PalettePrimaryMain,\n },\n}));\n\nconst PaginationButtonContainer = styled(\"div\")({\n \"& > *\": {\n marginInlineStart: `0 !important`,\n },\n});\n\nexport type PaginationProps = {\n /**\n * The labeled rendered for the current page index\n */\n currentPageLabel?: string;\n /**\n * The number of items currently visible on the page\n */\n currentRowsCount?: number;\n /**\n * If true, the page input will be visible and the user can directly manipulate which page\n * is visible.\n */\n hasPageInput?: boolean;\n /**\n * If true, the row count input will be visible and the user can directly manipulate how many rows\n * are visible.\n */\n hasRowCountInput?: boolean;\n /**\n * If true, the \"X - X of total X\" label will be visible\n */\n hasRowCountLabel?: boolean;\n /**\n * If true, the pagination controls will be disabled\n */\n isDisabled?: boolean;\n /**\n * If true, the next or Show More button will be disabled\n */\n isMoreDisabled?: boolean;\n /**\n * The current page last row index\n */\n lastRow?: number;\n /**\n * If the pagination is of \"loadMore\" variant, then this is the the load more label\n */\n loadMoreLabel?: string;\n /**\n * The max page\n */\n maxPageIndex?: number;\n /**\n * The max rows per page\n */\n maxPageSize?: number;\n /**\n * The label for the next control\n */\n nextLabel?: string;\n /**\n * Page index and page size setter\n */\n onPaginationChange: ({\n pageIndex,\n pageSize,\n }: {\n pageIndex: number;\n pageSize: number;\n }) => void;\n /**\n * The current page index\n */\n pageIndex: number;\n /**\n * The current page size\n */\n pageSize: number;\n /**\n * The label for the previous control\n */\n previousLabel?: string;\n /**\n * The label that shows how many results are rendered per page\n */\n rowsPerPageLabel?: string;\n /**\n * Total rows count\n */\n totalRows?: number;\n /**\n * The type of pagination controls shown. Defaults to next/prev buttons, but can be\n * set to a simple \"Load more\" button by setting to \"loadMore\".\n */\n variant?: (typeof paginationTypeValues)[number];\n};\n\nconst Pagination = ({\n currentPageLabel: currentPageLabelProp,\n currentRowsCount,\n hasPageInput = true,\n hasRowCountInput = true,\n hasRowCountLabel = true,\n isDisabled,\n isMoreDisabled,\n lastRow,\n loadMoreLabel: loadMoreLabelProp,\n maxPageIndex,\n maxPageSize,\n nextLabel: nextLabelProp,\n onPaginationChange: onPaginationChangeProp,\n pageIndex,\n pageSize,\n previousLabel: previousLabelProp,\n rowsPerPageLabel: rowsPerPageLabelProp,\n totalRows,\n variant,\n}: PaginationProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const [page, setPage] = useState<number>(pageIndex);\n const [rowsPerPage, setRowsPerPage] = useState<number>(pageSize);\n const initialRowsPerPage = useRef<number>(pageSize);\n\n const currentPageLabel = currentPageLabelProp ?? t(\"pagination.page\");\n const loadMoreLabel = loadMoreLabelProp ?? t(\"pagination.loadmore\");\n const nextLabel = nextLabelProp ?? t(\"pagination.next\");\n const previousLabel = previousLabelProp ?? t(\"pagination.previous\");\n const rowsPerPageLabel = rowsPerPageLabelProp ?? t(\"pagination.rowsperpage\");\n\n useEffect(() => {\n setPage(pageIndex);\n setRowsPerPage(pageSize);\n }, [pageIndex, pageSize]);\n\n const onPaginationChange = useCallback(\n ({ pageIndex, pageSize }: { pageIndex: number; pageSize: number }) => {\n onPaginationChangeProp({ pageIndex, pageSize });\n },\n [onPaginationChangeProp],\n );\n\n const { totalRowsLabel } = usePagination({\n pageIndex,\n pageSize,\n currentRowsCount: currentRowsCount || 0,\n totalRows,\n });\n\n const handlePaginationChange = useCallback(() => {\n let updatedPage = page;\n let updatedRowsPerPage = rowsPerPage;\n\n if (totalRows) {\n const maxPageIndex = Math.ceil(totalRows / updatedRowsPerPage);\n\n // Ensure rowsPerPage does not exceed totalRows\n if (updatedRowsPerPage > totalRows) {\n updatedRowsPerPage = totalRows;\n }\n\n // Ensure page is within valid range\n if (updatedPage > maxPageIndex) {\n updatedPage = maxPageIndex;\n } else if (updatedPage < 1) {\n updatedPage = 1;\n }\n }\n\n onPaginationChange({\n pageIndex: updatedPage,\n pageSize: updatedRowsPerPage,\n });\n }, [page, rowsPerPage, onPaginationChange, totalRows]);\n\n // The following handlers use React.KeyboardEvent (rather than just KeyboardEvent) because React.KeyboardEvent\n // is generic, while plain KeyboardEvent is not. We need this generic so we can specify the HTMLInputElement,\n // which allows us to use currentTarget.value\n const handlePageSubmit = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Enter\") {\n onPaginationChange({\n pageIndex: Number(event.currentTarget.value),\n pageSize: rowsPerPage,\n });\n }\n },\n [rowsPerPage, onPaginationChange],\n );\n\n const handleRowsPerPageSubmit = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Enter\") {\n onPaginationChange({\n pageIndex: page,\n pageSize: Number(event.currentTarget.value),\n });\n }\n },\n [page, onPaginationChange],\n );\n\n const setPageFromEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = maxPageIndex\n ? Math.min(Number(event.target.value), maxPageIndex)\n : Number(event.target.value);\n\n // Ensure the value can't be less than 1\n setPage(Math.max(1, value));\n },\n [setPage, maxPageIndex],\n );\n\n const setRowsPerPageFromEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = maxPageSize\n ? Math.min(Number(event.target.value), maxPageSize)\n : Number(event.target.value);\n\n // Ensure the value can't be less than 1\n setRowsPerPage(Math.max(1, value));\n },\n [setRowsPerPage, maxPageSize],\n );\n\n const handleLoadMore = useCallback(() => {\n onPaginationChange({\n pageIndex: 1,\n pageSize: rowsPerPage + initialRowsPerPage.current,\n });\n }, [rowsPerPage, onPaginationChange]);\n\n const handleNextButton = useCallback(() => {\n onPaginationChange({ pageIndex: page + 1, pageSize: rowsPerPage });\n }, [onPaginationChange, page, rowsPerPage]);\n\n const handlePreviousButton = useCallback(() => {\n onPaginationChange({ pageIndex: page - 1, pageSize: rowsPerPage });\n }, [onPaginationChange, page, rowsPerPage]);\n\n const loadMoreIsDisabled = useMemo(() => {\n return isMoreDisabled || (totalRows ? rowsPerPage >= totalRows : false);\n }, [isMoreDisabled, rowsPerPage, totalRows]);\n\n const nextButtonDisabled = useMemo(\n () =>\n isMoreDisabled ||\n (lastRow && (totalRows ? lastRow >= totalRows : false)) ||\n isDisabled,\n [isMoreDisabled, totalRows, lastRow, isDisabled],\n );\n\n const previousButtonDisabled = useMemo(\n () => pageIndex <= 1 || isDisabled,\n [pageIndex, isDisabled],\n );\n\n const rowsPerPageInputProps = useMemo(\n () => ({\n \"aria-label\": rowsPerPageLabel,\n max: maxPageSize || totalRows,\n }),\n [maxPageSize, rowsPerPageLabel, totalRows],\n );\n\n const currentPageInputProps = useMemo(\n () => ({\n \"aria-label\": currentPageLabel,\n max: maxPageIndex,\n }),\n [currentPageLabel, maxPageIndex],\n );\n\n return variant === \"paged\" ? (\n <PaginationContainer aria-label={t(\"pagination.label\")}>\n <PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>\n {hasRowCountInput && (\n <Box>\n <Paragraph color=\"textSecondary\" component=\"span\">\n {rowsPerPageLabel}\n </Paragraph>\n <PaginationInput\n disabled={isDisabled}\n inputProps={rowsPerPageInputProps}\n odysseyDesignTokens={odysseyDesignTokens}\n onBlur={handlePaginationChange}\n onChange={setRowsPerPageFromEvent}\n onKeyDown={handleRowsPerPageSubmit}\n type=\"number\"\n value={rowsPerPage}\n />\n </Box>\n )}\n {hasRowCountLabel && (\n <Paragraph color=\"textSecondary\" component=\"span\">\n {totalRowsLabel}\n </Paragraph>\n )}\n </PaginationSegment>\n\n <PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>\n {totalRows && hasPageInput && (\n <Box>\n <Paragraph color=\"textSecondary\" component=\"span\">\n {currentPageLabel}\n </Paragraph>\n <PaginationInput\n disabled={isDisabled}\n inputProps={currentPageInputProps}\n odysseyDesignTokens={odysseyDesignTokens}\n onBlur={handlePaginationChange}\n onChange={setPageFromEvent}\n onKeyDown={handlePageSubmit}\n type=\"number\"\n value={page}\n />\n </Box>\n )}\n <PaginationButtonContainer>\n <Button\n ariaLabel={previousLabel}\n isDisabled={previousButtonDisabled}\n onClick={handlePreviousButton}\n size=\"small\"\n startIcon={<ArrowLeftIcon />}\n variant=\"floating\"\n />\n <Button\n ariaLabel={nextLabel}\n endIcon={<ArrowRightIcon />}\n isDisabled={nextButtonDisabled}\n onClick={handleNextButton}\n size=\"small\"\n variant=\"floating\"\n />\n </PaginationButtonContainer>\n </PaginationSegment>\n </PaginationContainer>\n ) : (\n <Button\n isDisabled={loadMoreIsDisabled}\n label={loadMoreLabel}\n onClick={handleLoadMore}\n variant=\"secondary\"\n />\n );\n};\n\nconst MemoizedPagination = memo(Pagination);\nMemoizedPagination.displayName = \"Pagination\";\n\nexport { MemoizedPagination as Pagination };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SAASC,IAAI,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAC/E,SAASC,cAAc,QAAQ,eAAe;AAE9C,SAASC,GAAG,QAAQ,WAAW;AAC/B,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,aAAa,EAAEC,cAAc,QAAQ,6BAA6B;AAC3E,SAEEC,sBAAsB,QACjB,kCAAkC;AACzC,SAASC,SAAS,QAAQ,kBAAkB;AAE5C,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAO,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpB,MAAMC,mBAAmB,GAAGnB,MAAM,CAAC,KAAK,CAAC,CAAC;EACxCoB,OA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AM,EAAE/B,sBAAuB;UAC/BgC,QAAQ,EAAEpB,gBAAiB;UAC3BqB,SAAS,EAAE5B,gBAAiB;UAC5B6B,IAAI,EAAC,QAAQ;UACbxB,KAAK,EAAEhB;QAAK,CACb,CAAC;MAAA,CACC,CACN,EACDpD,KAAA,CAACuB,yBAAyB;QAAA6D,QAAA,GACxBtF,IAAA,CAACP,MAAM;UACLsG,SAAS,EAAEhD,aAAc;UACzBb,UAAU,EAAEiD,sBAAuB;UACnCa,OAAO,EAAEhB,oBAAqB;UAC9BiB,IAAI,EAAC,OAAO;UACZC,SAAS,EAAElG,IAAA,CAACN,aAAa,IAAE,CAAE;UAC7B0D,OAAO,EAAC;QAAU,CACnB,CAAC,EACFpD,IAAA,CAACP,MAAM;UACLsG,SAAS,EAAEtD,SAAU;UACrB0D,OAAO,EAAEnG,IAAA,CAACL,cAAc,IAAE,CAAE;UAC5BuC,UAAU,EAAEgD,kBAAmB;UAC/Bc,OAAO,EAAEjB,gBAAiB;UAC1BkB,IAAI,EAAC,OAAO;UACZ7C,OAAO,EAAC;QAAU,CACnB,CAAC;MAAA,CACuB,CAAC;IAAA,CACX,CAAC;EAAA,CACD,CAAC,GAEtBpD,IAAA,CAACP,MAAM;IACLyC,UAAU,EAAE+C,kBAAmB;IAC/BmB,KAAK,EAAE/D,aAAc;IACrB2D,OAAO,EAAEnB,cAAe;IACxBzB,OAAO,EAAC;EAAW,CACpB,CACF;AACH,CAAC;AAED,MAAMiD,kBAAkB,GAAGpH,IAAI,CAAC0C,UAAU,CAAC;AAC3C0E,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAI1E,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"Pagination.js","names":["styled","memo","useCallback","useEffect","useMemo","useRef","useState","Box","Button","useTranslation","ArrowLeftIcon","ArrowRightIcon","useOdysseyDesignTokens","Paragraph","usePagination","jsx","_jsx","jsxs","_jsxs","PaginationContainer","display","justifyContent","PaginationSegment","shouldForwardProp","prop","odysseyDesignTokens","alignItems","gap","Spacing4","Spacing2","PaginationInput","_InputBase","borderColor","HueNeutral200","borderRadius","BorderRadiusTight","height","Spacing6","width","HueNeutral400","PalettePrimaryMain","PaginationButtonContainer","marginInlineStart","Pagination","currentPageLabel","currentPageLabelProp","currentRowsCount","hasPageInput","hasRowCountInput","hasRowCountLabel","isDisabled","isMoreDisabled","lastRow","loadMoreLabel","loadMoreLabelProp","maxPageIndex","maxPageSize","nextLabel","nextLabelProp","onPaginationChange","onPaginationChangeProp","pageIndex","pageSize","previousLabel","previousLabelProp","rowsPerPageLabel","rowsPerPageLabelProp","totalRows","variant","t","page","setPage","rowsPerPage","setRowsPerPage","initialRowsPerPage","totalRowsLabel","handlePaginationChange","updatedPage","updatedRowsPerPage","Math","ceil","handlePageSubmit","event","key","Number","currentTarget","value","handleRowsPerPageSubmit","setPageFromEvent","min","target","max","setRowsPerPageFromEvent","handleLoadMore","current","handleNextButton","handlePreviousButton","loadMoreIsDisabled","nextButtonDisabled","previousButtonDisabled","rowsPerPageInputProps","currentPageInputProps","children","color","component","disabled","inputProps","onBlur","onChange","onKeyDown","type","ariaLabel","onClick","size","startIcon","endIcon","label","MemoizedPagination","displayName"],"sources":["../../../src/Pagination/Pagination.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { InputBase } from \"@mui/material\";\nimport { memo, useCallback, useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { Box } from \"../Box.js\";\nimport { Button } from \"../Buttons/index.js\";\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport { ArrowLeftIcon, ArrowRightIcon } from \"../icons.generated/index.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { Paragraph } from \"../Typography.js\";\nimport { paginationTypeValues } from \"./constants.js\";\nimport { usePagination } from \"./usePagination.js\";\n\nconst PaginationContainer = styled(\"nav\")({\n display: \"flex\",\n justifyContent: \"space-between\",\n});\n\nconst PaginationSegment = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing4,\n \"& > div\": {\n display: \"flex\",\n alignItems: \"center\",\n gap: odysseyDesignTokens.Spacing2,\n },\n}));\n\nconst PaginationInput = styled(InputBase, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n borderColor: odysseyDesignTokens.HueNeutral200,\n borderRadius: odysseyDesignTokens.BorderRadiusTight,\n height: odysseyDesignTokens.Spacing6,\n width: \"4.5714285714rem\", // This is a hardcoded value, keep as string\n \"&:hover\": {\n borderColor: odysseyDesignTokens.HueNeutral400,\n },\n \"&.Mui-focused:hover\": {\n borderColor: odysseyDesignTokens.PalettePrimaryMain,\n },\n}));\n\nconst PaginationButtonContainer = styled(\"div\")({\n \"& > *\": {\n marginInlineStart: `0 !important`,\n },\n});\n\nexport type PaginationProps = {\n /**\n * The labeled rendered for the current page index\n */\n currentPageLabel?: string;\n /**\n * The number of items currently visible on the page\n */\n currentRowsCount?: number;\n /**\n * If true, the page input will be visible and the user can directly manipulate which page\n * is visible.\n */\n hasPageInput?: boolean;\n /**\n * If true, the row count input will be visible and the user can directly manipulate how many rows\n * are visible.\n */\n hasRowCountInput?: boolean;\n /**\n * If true, the \"X - X of total X\" label will be visible\n */\n hasRowCountLabel?: boolean;\n /**\n * If true, the pagination controls will be disabled\n */\n isDisabled?: boolean;\n /**\n * If true, the next or Show More button will be disabled\n */\n isMoreDisabled?: boolean;\n /**\n * The current page last row index\n */\n lastRow?: number;\n /**\n * If the pagination is of \"loadMore\" variant, then this is the the load more label\n */\n loadMoreLabel?: string;\n /**\n * The max page\n */\n maxPageIndex?: number;\n /**\n * The max rows per page\n */\n maxPageSize?: number;\n /**\n * The label for the next control\n */\n nextLabel?: string;\n /**\n * Page index and page size setter\n */\n onPaginationChange: ({\n pageIndex,\n pageSize,\n }: {\n pageIndex: number;\n pageSize: number;\n }) => void;\n /**\n * The current page index\n */\n pageIndex: number;\n /**\n * The current page size\n */\n pageSize: number;\n /**\n * The label for the previous control\n */\n previousLabel?: string;\n /**\n * The label that shows how many results are rendered per page\n */\n rowsPerPageLabel?: string;\n /**\n * Total rows count\n */\n totalRows?: number;\n /**\n * The type of pagination controls shown. Defaults to next/prev buttons, but can be\n * set to a simple \"Load more\" button by setting to \"loadMore\".\n */\n variant?: (typeof paginationTypeValues)[number];\n};\n\nconst Pagination = ({\n currentPageLabel: currentPageLabelProp,\n currentRowsCount,\n hasPageInput = true,\n hasRowCountInput = true,\n hasRowCountLabel = true,\n isDisabled,\n isMoreDisabled,\n lastRow,\n loadMoreLabel: loadMoreLabelProp,\n maxPageIndex,\n maxPageSize,\n nextLabel: nextLabelProp,\n onPaginationChange: onPaginationChangeProp,\n pageIndex,\n pageSize,\n previousLabel: previousLabelProp,\n rowsPerPageLabel: rowsPerPageLabelProp,\n totalRows,\n variant,\n}: PaginationProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const [page, setPage] = useState<number>(pageIndex);\n const [rowsPerPage, setRowsPerPage] = useState<number>(pageSize);\n const initialRowsPerPage = useRef<number>(pageSize);\n\n const currentPageLabel = currentPageLabelProp ?? t(\"pagination.page\");\n const loadMoreLabel = loadMoreLabelProp ?? t(\"pagination.loadmore\");\n const nextLabel = nextLabelProp ?? t(\"pagination.next\");\n const previousLabel = previousLabelProp ?? t(\"pagination.previous\");\n const rowsPerPageLabel = rowsPerPageLabelProp ?? t(\"pagination.rowsperpage\");\n\n useEffect(() => {\n setPage(pageIndex);\n setRowsPerPage(pageSize);\n }, [pageIndex, pageSize]);\n\n const onPaginationChange = useCallback(\n ({ pageIndex, pageSize }: { pageIndex: number; pageSize: number }) => {\n onPaginationChangeProp({ pageIndex, pageSize });\n },\n [onPaginationChangeProp],\n );\n\n const { totalRowsLabel } = usePagination({\n pageIndex,\n pageSize,\n currentRowsCount: currentRowsCount || 0,\n totalRows,\n });\n\n const handlePaginationChange = useCallback(() => {\n let updatedPage = page;\n let updatedRowsPerPage = rowsPerPage;\n\n if (totalRows) {\n const maxPageIndex = Math.ceil(totalRows / updatedRowsPerPage);\n\n // Ensure rowsPerPage does not exceed totalRows\n if (updatedRowsPerPage > totalRows) {\n updatedRowsPerPage = totalRows;\n }\n\n // Ensure page is within valid range\n if (updatedPage > maxPageIndex) {\n updatedPage = maxPageIndex;\n } else if (updatedPage < 1) {\n updatedPage = 1;\n }\n }\n\n onPaginationChange({\n pageIndex: updatedPage,\n pageSize: updatedRowsPerPage,\n });\n }, [page, rowsPerPage, onPaginationChange, totalRows]);\n\n // The following handlers use React.KeyboardEvent (rather than just KeyboardEvent) because React.KeyboardEvent\n // is generic, while plain KeyboardEvent is not. We need this generic so we can specify the HTMLInputElement,\n // which allows us to use currentTarget.value\n const handlePageSubmit = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Enter\") {\n onPaginationChange({\n pageIndex: Number(event.currentTarget.value),\n pageSize: rowsPerPage,\n });\n }\n },\n [rowsPerPage, onPaginationChange],\n );\n\n const handleRowsPerPageSubmit = useCallback(\n (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n if (event.key === \"Enter\") {\n onPaginationChange({\n pageIndex: page,\n pageSize: Number(event.currentTarget.value),\n });\n }\n },\n [page, onPaginationChange],\n );\n\n const setPageFromEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = maxPageIndex\n ? Math.min(Number(event.target.value), maxPageIndex)\n : Number(event.target.value);\n\n // Ensure the value can't be less than 1\n setPage(Math.max(1, value));\n },\n [setPage, maxPageIndex],\n );\n\n const setRowsPerPageFromEvent = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = maxPageSize\n ? Math.min(Number(event.target.value), maxPageSize)\n : Number(event.target.value);\n\n // Ensure the value can't be less than 1\n setRowsPerPage(Math.max(1, value));\n },\n [setRowsPerPage, maxPageSize],\n );\n\n const handleLoadMore = useCallback(() => {\n onPaginationChange({\n pageIndex: 1,\n pageSize: rowsPerPage + initialRowsPerPage.current,\n });\n }, [rowsPerPage, onPaginationChange]);\n\n const handleNextButton = useCallback(() => {\n onPaginationChange({ pageIndex: page + 1, pageSize: rowsPerPage });\n }, [onPaginationChange, page, rowsPerPage]);\n\n const handlePreviousButton = useCallback(() => {\n onPaginationChange({ pageIndex: page - 1, pageSize: rowsPerPage });\n }, [onPaginationChange, page, rowsPerPage]);\n\n const loadMoreIsDisabled = useMemo(() => {\n return isMoreDisabled || (totalRows ? rowsPerPage >= totalRows : false);\n }, [isMoreDisabled, rowsPerPage, totalRows]);\n\n const nextButtonDisabled = useMemo(\n () =>\n isMoreDisabled ||\n (lastRow && (totalRows ? lastRow >= totalRows : false)) ||\n isDisabled,\n [isMoreDisabled, totalRows, lastRow, isDisabled],\n );\n\n const previousButtonDisabled = useMemo(\n () => pageIndex <= 1 || isDisabled,\n [pageIndex, isDisabled],\n );\n\n const rowsPerPageInputProps = useMemo(\n () => ({\n \"aria-label\": rowsPerPageLabel,\n max: maxPageSize || totalRows,\n }),\n [maxPageSize, rowsPerPageLabel, totalRows],\n );\n\n const currentPageInputProps = useMemo(\n () => ({\n \"aria-label\": currentPageLabel,\n max: maxPageIndex,\n }),\n [currentPageLabel, maxPageIndex],\n );\n\n return variant === \"paged\" ? (\n <PaginationContainer aria-label={t(\"pagination.label\")}>\n <PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>\n {hasRowCountInput && (\n <Box>\n <Paragraph color=\"textSecondary\" component=\"span\">\n {rowsPerPageLabel}\n </Paragraph>\n <PaginationInput\n disabled={isDisabled}\n inputProps={rowsPerPageInputProps}\n odysseyDesignTokens={odysseyDesignTokens}\n onBlur={handlePaginationChange}\n onChange={setRowsPerPageFromEvent}\n onKeyDown={handleRowsPerPageSubmit}\n type=\"number\"\n value={rowsPerPage}\n />\n </Box>\n )}\n {hasRowCountLabel && (\n <Paragraph color=\"textSecondary\" component=\"span\">\n {totalRowsLabel}\n </Paragraph>\n )}\n </PaginationSegment>\n\n <PaginationSegment odysseyDesignTokens={odysseyDesignTokens}>\n {totalRows && hasPageInput && (\n <Box>\n <Paragraph color=\"textSecondary\" component=\"span\">\n {currentPageLabel}\n </Paragraph>\n <PaginationInput\n disabled={isDisabled}\n inputProps={currentPageInputProps}\n odysseyDesignTokens={odysseyDesignTokens}\n onBlur={handlePaginationChange}\n onChange={setPageFromEvent}\n onKeyDown={handlePageSubmit}\n type=\"number\"\n value={page}\n />\n </Box>\n )}\n <PaginationButtonContainer>\n <Button\n ariaLabel={previousLabel}\n isDisabled={previousButtonDisabled}\n onClick={handlePreviousButton}\n size=\"small\"\n startIcon={<ArrowLeftIcon />}\n variant=\"floating\"\n />\n <Button\n ariaLabel={nextLabel}\n endIcon={<ArrowRightIcon />}\n isDisabled={nextButtonDisabled}\n onClick={handleNextButton}\n size=\"small\"\n variant=\"floating\"\n />\n </PaginationButtonContainer>\n </PaginationSegment>\n </PaginationContainer>\n ) : (\n <Button\n isDisabled={loadMoreIsDisabled}\n label={loadMoreLabel}\n onClick={handleLoadMore}\n variant=\"secondary\"\n />\n );\n};\n\nconst MemoizedPagination = memo(Pagination);\nMemoizedPagination.displayName = \"Pagination\";\n\nexport { MemoizedPagination as Pagination };\n"],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C,OAAO,EAAC;QAAU,CACnB,CAAC;MAAA,CACuB,CAAC;IAAA,CACX,CAAC;EAAA,CACD,CAAC,GAEtBpD,IAAA,CAACR,MAAM;IACL0C,UAAU,EAAE+C,kBAAmB;IAC/BmB,KAAK,EAAE/D,aAAc;IACrB2D,OAAO,EAAEnB,cAAe;IACxBzB,OAAO,EAAC;EAAW,CACpB,CACF;AACH,CAAC;AAED,MAAMiD,kBAAkB,GAAGpH,IAAI,CAAC0C,UAAU,CAAC;AAC3C0E,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAI1E,UAAU","ignoreList":[]}
@@ -11,7 +11,7 @@
11
11
  */
12
12
 
13
13
  import { useMemo } from "react";
14
- import { useTranslation } from "react-i18next";
14
+ import { useTranslation } from "../i18n.generated/i18n.js";
15
15
  export const usePagination = ({
16
16
  currentRowsCount,
17
17
  pageIndex,
@@ -1 +1 @@
1
- {"version":3,"file":"usePagination.js","names":["useMemo","useTranslation","usePagination","currentRowsCount","pageIndex","pageSize","totalRows","t","firstRow","lastRow","totalRowsLabel"],"sources":["../../../src/Pagination/usePagination.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\ntype UsePaginationType = {\n currentRowsCount: number;\n pageIndex: number;\n pageSize: number;\n totalRows?: number;\n};\n\nexport const usePagination = ({\n currentRowsCount,\n pageIndex,\n pageSize,\n totalRows,\n}: UsePaginationType) => {\n const { t } = useTranslation();\n\n return useMemo(() => {\n const firstRow = pageSize * (pageIndex - 1) + 1;\n const lastRow = firstRow + (currentRowsCount - 1);\n\n const totalRowsLabel =\n currentRowsCount === 0\n ? t(\"pagination.totalrows\", { totalRows: 0 })\n : totalRows\n ? t(\"pagination.rowswithtotal\", { firstRow, lastRow, totalRows })\n : t(\"pagination.rowswithouttotal\", { firstRow, lastRow });\n\n return {\n firstRow,\n lastRow,\n totalRowsLabel,\n };\n }, [currentRowsCount, pageIndex, pageSize, totalRows, t]);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,OAAO;AAC/B,SAASC,cAAc,QAAQ,eAAe;AAS9C,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,gBAAgB;EAChBC,SAAS;EACTC,QAAQ;EACRC;AACiB,CAAC,KAAK;EACvB,MAAM;IAAEC;EAAE,CAAC,GAAGN,cAAc,CAAC,CAAC;EAE9B,OAAOD,OAAO,CAAC,MAAM;IACnB,MAAMQ,QAAQ,GAAGH,QAAQ,IAAID,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC;IAC/C,MAAMK,OAAO,GAAGD,QAAQ,IAAIL,gBAAgB,GAAG,CAAC,CAAC;IAEjD,MAAMO,cAAc,GAClBP,gBAAgB,KAAK,CAAC,GAClBI,CAAC,CAAC,sBAAsB,EAAE;MAAED,SAAS,EAAE;IAAE,CAAC,CAAC,GAC3CA,SAAS,GACPC,CAAC,CAAC,0BAA0B,EAAE;MAAEC,QAAQ;MAAEC,OAAO;MAAEH;IAAU,CAAC,CAAC,GAC/DC,CAAC,CAAC,6BAA6B,EAAE;MAAEC,QAAQ;MAAEC;IAAQ,CAAC,CAAC;IAE/D,OAAO;MACLD,QAAQ;MACRC,OAAO;MACPC;IACF,CAAC;EACH,CAAC,EAAE,CAACP,gBAAgB,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,CAAC,CAAC,CAAC;AAC3D,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"usePagination.js","names":["useMemo","useTranslation","usePagination","currentRowsCount","pageIndex","pageSize","totalRows","t","firstRow","lastRow","totalRowsLabel"],"sources":["../../../src/Pagination/usePagination.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useMemo } from \"react\";\n\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\n\ntype UsePaginationType = {\n currentRowsCount: number;\n pageIndex: number;\n pageSize: number;\n totalRows?: number;\n};\n\nexport const usePagination = ({\n currentRowsCount,\n pageIndex,\n pageSize,\n totalRows,\n}: UsePaginationType) => {\n const { t } = useTranslation();\n\n return useMemo(() => {\n const firstRow = pageSize * (pageIndex - 1) + 1;\n const lastRow = firstRow + (currentRowsCount - 1);\n\n const totalRowsLabel =\n currentRowsCount === 0\n ? t(\"pagination.totalrows\", { totalRows: 0 })\n : totalRows\n ? t(\"pagination.rowswithtotal\", { firstRow, lastRow, totalRows })\n : t(\"pagination.rowswithouttotal\", { firstRow, lastRow });\n\n return {\n firstRow,\n lastRow,\n totalRowsLabel,\n };\n }, [currentRowsCount, pageIndex, pageSize, totalRows, t]);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,OAAO,QAAQ,OAAO;AAE/B,SAASC,cAAc,QAAQ,2BAA2B;AAS1D,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAC5BC,gBAAgB;EAChBC,SAAS;EACTC,QAAQ;EACRC;AACiB,CAAC,KAAK;EACvB,MAAM;IAAEC;EAAE,CAAC,GAAGN,cAAc,CAAC,CAAC;EAE9B,OAAOD,OAAO,CAAC,MAAM;IACnB,MAAMQ,QAAQ,GAAGH,QAAQ,IAAID,SAAS,GAAG,CAAC,CAAC,GAAG,CAAC;IAC/C,MAAMK,OAAO,GAAGD,QAAQ,IAAIL,gBAAgB,GAAG,CAAC,CAAC;IAEjD,MAAMO,cAAc,GAClBP,gBAAgB,KAAK,CAAC,GAClBI,CAAC,CAAC,sBAAsB,EAAE;MAAED,SAAS,EAAE;IAAE,CAAC,CAAC,GAC3CA,SAAS,GACPC,CAAC,CAAC,0BAA0B,EAAE;MAAEC,QAAQ;MAAEC,OAAO;MAAEH;IAAU,CAAC,CAAC,GAC/DC,CAAC,CAAC,6BAA6B,EAAE;MAAEC,QAAQ;MAAEC;IAAQ,CAAC,CAAC;IAE/D,OAAO;MACLD,QAAQ;MACRC,OAAO;MACPC;IACF,CAAC;EACH,CAAC,EAAE,CAACP,gBAAgB,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,CAAC,CAAC,CAAC;AAC3D,CAAC","ignoreList":[]}
@@ -13,8 +13,8 @@ import _IconButton from "@mui/material/IconButton";
13
13
  * See the License for the specific language governing permissions and limitations under the License.
14
14
  */
15
15
  import { forwardRef, memo, useCallback, useImperativeHandle, useRef, useState } from "react";
16
- import { useTranslation } from "react-i18next";
17
16
  import { Field } from "./Field.js";
17
+ import { useTranslation } from "./i18n.generated/i18n.js";
18
18
  import { HideIcon, ShowIcon } from "./icons.generated/index.js";
19
19
  import { getControlState, useInputValues } from "./inputUtils.js";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","useState","useTranslation","Field","HideIcon","ShowIcon","getControlState","useInputValues","jsx","_jsx","PasswordField","ariaDescribedBy","autoCompleteType","defaultValue","errorMessage","errorMessageList","hasInitialFocus","hint","id","idOverride","inputRef","isDisabled","isFullWidth","isOptional","hasShowPassword","isReadOnly","label","name","nameOverride","onChange","onChangeProp","onFocus","onBlur","placeholder","testId","translate","value","ref","t","inputType","setInputType","togglePasswordVisibility","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","endAdornment","_InputAdornment","position","children","_IconButton","onClick","inputProps","role","readOnly","required","type","fieldType","hasVisibleLabel","MemoizedPasswordField","displayName"],"sources":["../../src/PasswordField.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { IconButton, InputAdornment, InputBase } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n memo,\n useCallback,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Field } from \"./Field.js\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport { HideIcon, ShowIcon } from \"./icons.generated/index.js\";\nimport { FocusHandle, getControlState, useInputValues } from \"./inputUtils.js\";\n\nexport type PasswordFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: \"current-password\" | \"new-password\";\n /**\n * initial value for input. Use when component in uncontrolled.\n */\n defaultValue?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * If `true`, the show/hide icon is not shown to the user\n */\n hasShowPassword?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * The value of the `input` element. Use when component is controlled.\n */\n value?: string;\n} & FieldComponentProps &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasInitialFocus,\n hint,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isOptional = false,\n hasShowPassword = true,\n isReadOnly,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n placeholder,\n testId,\n translate,\n value,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [inputType, setInputType] = useState(\"password\");\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((inputType) =>\n inputType === \"password\" ? \"text\" : \"password\",\n );\n }, []);\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(inputRef, () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n }, []);\n\n const onChange = useCallback<\n ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={inputType === \"password\" ? autoCompleteType : \"off\"}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n hasShowPassword && (\n <InputAdornment position=\"end\">\n <IconButton\n aria-controls={id}\n aria-label={t(\"passwordfield.icon.label.show\")}\n aria-pressed={inputType === \"text\"}\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <ShowIcon /> : <HideIcon />}\n </IconButton>\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n // role: \"textbox\" Added because password inputs don't have an implicit role assigned. This causes problems with element selection.\n role: \"textbox\",\n }}\n inputRef={localInputRef}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n translate={translate}\n type={inputType}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n inputValues,\n t,\n togglePasswordVisibility,\n inputType,\n nameOverride,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n hasShowPassword,\n ref,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n },\n);\n\nconst MemoizedPasswordField = memo(PasswordField);\nMemoizedPasswordField.displayName = \"PasswordField\";\n\nexport { MemoizedPasswordField as PasswordField };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAGEA,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,cAAc,QAAQ,eAAe;AAI9C,SAASC,KAAK,QAAQ,YAAY;AAKlC,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,4BAA4B;AAC/D,SAAsBC,eAAe,EAAEC,cAAc,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAyD/E,MAAMC,aAAa,GAAGd,UAAU,CAC9B,CACE;EACEe,eAAe;EACfC,gBAAgB;EAChBC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,eAAe;EACfC,IAAI;EACJC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,UAAU,GAAG,KAAK;EAClBC,WAAW,GAAG,KAAK;EACnBC,UAAU,GAAG,KAAK;EAClBC,eAAe,GAAG,IAAI;EACtBC,UAAU;EACVC,KAAK;EACLC,IAAI,EAAEC,YAAY;EAClBC,QAAQ,EAAEC,YAAY;EACtBC,OAAO;EACPC,MAAM;EACNC,WAAW;EACXC,MAAM;EACNC,SAAS;EACTC;AACF,CAAC,EACDC,GAAG,KACA;EACH,MAAM;IAAEC;EAAE,CAAC,GAAGpC,cAAc,CAAC,CAAC;EAC9B,MAAM,CAACqC,SAAS,EAAEC,YAAY,CAAC,GAAGvC,QAAQ,CAAC,UAAU,CAAC;EAEtD,MAAMwC,wBAAwB,GAAG3C,WAAW,CAAC,MAAM;IACjD0C,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B,CAC5C,CAAC;AAEN,CACF,CAAC;AAED,MAAMmB,qBAAqB,GAAGzE,IAAI,CAACa,aAAa,CAAC;AACjD4D,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAI5D,aAAa","ignoreList":[]}
1
+ {"version":3,"file":"PasswordField.js","names":["forwardRef","memo","useCallback","useImperativeHandle","useRef","useState","Field","useTranslation","HideIcon","ShowIcon","getControlState","useInputValues","jsx","_jsx","PasswordField","ariaDescribedBy","autoCompleteType","defaultValue","errorMessage","errorMessageList","hasInitialFocus","hint","id","idOverride","inputRef","isDisabled","isFullWidth","isOptional","hasShowPassword","isReadOnly","label","name","nameOverride","onChange","onChangeProp","onFocus","onBlur","placeholder","testId","translate","value","ref","t","inputType","setInputType","togglePasswordVisibility","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","localInputRef","focus","event","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","autoComplete","autoFocus","endAdornment","_InputAdornment","position","children","_IconButton","onClick","inputProps","role","readOnly","required","type","fieldType","hasVisibleLabel","MemoizedPasswordField","displayName"],"sources":["../../src/PasswordField.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { IconButton, InputAdornment, InputBase } from \"@mui/material\";\nimport {\n ChangeEventHandler,\n FocusEventHandler,\n forwardRef,\n memo,\n useCallback,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Field } from \"./Field.js\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps.js\";\nimport { useTranslation } from \"./i18n.generated/i18n.js\";\nimport { HideIcon, ShowIcon } from \"./icons.generated/index.js\";\nimport { FocusHandle, getControlState, useInputValues } from \"./inputUtils.js\";\n\nexport type PasswordFieldProps = {\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoCompleteType?: \"current-password\" | \"new-password\";\n /**\n * initial value for input. Use when component in uncontrolled.\n */\n defaultValue?: string;\n /**\n * If `true`, the component will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * If `true`, the show/hide icon is not shown to the user\n */\n hasShowPassword?: boolean;\n /**\n * The ref forwarded to the TextField\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Callback fired when the `input` element loses focus.\n */\n onBlur?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * Callback fired when the value is changed.\n */\n onChange?: ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;\n /**\n * Callback fired when the `input` element get focus.\n */\n onFocus?: FocusEventHandler<HTMLInputElement | HTMLTextAreaElement>;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * The value of the `input` element. Use when component is controlled.\n */\n value?: string;\n} & FieldComponentProps &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n (\n {\n ariaDescribedBy,\n autoCompleteType,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasInitialFocus,\n hint,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isOptional = false,\n hasShowPassword = true,\n isReadOnly,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n onFocus,\n onBlur,\n placeholder,\n testId,\n translate,\n value,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const [inputType, setInputType] = useState(\"password\");\n\n const togglePasswordVisibility = useCallback(() => {\n setInputType((inputType) =>\n inputType === \"password\" ? \"text\" : \"password\",\n );\n }, []);\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(inputRef, () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n }, []);\n\n const onChange = useCallback<\n ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>\n >(\n (event) => {\n onChangeProp?.(event);\n },\n [onChangeProp],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <InputBase\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n autoComplete={inputType === \"password\" ? autoCompleteType : \"off\"}\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n endAdornment={\n hasShowPassword && (\n <InputAdornment position=\"end\">\n <IconButton\n aria-controls={id}\n aria-label={t(\"passwordfield.icon.label.show\")}\n aria-pressed={inputType === \"text\"}\n onClick={togglePasswordVisibility}\n >\n {inputType === \"password\" ? <ShowIcon /> : <HideIcon />}\n </IconButton>\n </InputAdornment>\n )\n }\n id={id}\n inputProps={{\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n // role: \"textbox\" Added because password inputs don't have an implicit role assigned. This causes problems with element selection.\n role: \"textbox\",\n }}\n inputRef={localInputRef}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n placeholder={placeholder}\n readOnly={isReadOnly}\n ref={ref}\n required={!isOptional}\n translate={translate}\n type={inputType}\n />\n ),\n [\n autoCompleteType,\n hasInitialFocus,\n inputValues,\n t,\n togglePasswordVisibility,\n inputType,\n nameOverride,\n onChange,\n onFocus,\n onBlur,\n placeholder,\n isOptional,\n isReadOnly,\n hasShowPassword,\n ref,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n },\n);\n\nconst MemoizedPasswordField = memo(PasswordField);\nMemoizedPasswordField.displayName = \"PasswordField\";\n\nexport { MemoizedPasswordField as PasswordField };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAGEA,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,mBAAmB,EACnBC,MAAM,EACNC,QAAQ,QACH,OAAO;AAId,SAASC,KAAK,QAAQ,YAAY;AAKlC,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,4BAA4B;AAC/D,SAAsBC,eAAe,EAAEC,cAAc,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAyD/E,MAAMC,aAAa,GAAGd,UAAU,CAC9B,CACE;EACEe,eAAe;EACfC,gBAAgB;EAChBC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,eAAe;EACfC,IAAI;EACJC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,UAAU,GAAG,KAAK;EAClBC,WAAW,GAAG,KAAK;EACnBC,UAAU,GAAG,KAAK;EAClBC,eAAe,GAAG,IAAI;EACtBC,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