@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
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","names":["cloneElement","memo","useCallback","useEffect","useRef","useState","useTranslation","Button","CloseIcon","useUniqueId","jsx","_jsx","jsxs","_jsxs","Dialog","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","callToActionFirstComponent","callToActionSecondComponent","callToActionLastComponent","children","isOpen","onClose","testId","title","translate","t","isContentScrollable","setIsContentScrollable","dialogContentRef","dialogTitleId","dialogLabelId","frameId","handleContentScroll","dialogContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","content","_DialogContentText","actionButtons","filter","Boolean","handleCloseButtonClick","event","_Dialog","open","_DialogTitle","id","ariaLabel","onClick","size","startIcon","variant","_DialogContent","tabIndex","dividers","ref","length","_DialogActions","map","actionButton","index","key","MemoizedDialog","displayName"],"sources":["../../src/Dialog.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 {\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n Dialog as MuiDialog,\n DialogProps as MuiDialogProps,\n} from \"@mui/material\";\nimport {\n cloneElement,\n memo,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Button, ButtonProps } from \"./Buttons/index.js\";\nimport { CloseIcon } from \"./icons.generated/index.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\ntype MuiOnCloseEvent = Parameters<Required<MuiDialogProps>[\"onClose\"]>[0];\ntype MuiOnCloseReason = Parameters<Required<MuiDialogProps>[\"onClose\"]>[1];\nexport type DialogOnCloseReason = MuiOnCloseReason | \"closeButtonClick\";\n\nexport type DialogProps = {\n /**\n * @deprecated `aria-label` for close button comes from translation file\n */\n ariaLabel?: string;\n\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `primaryCallToActionComponent` instead.\n */\n callToActionFirstComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `tertiaryCallToActionComponent` instead.\n */\n callToActionLastComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `secondaryCallToActionComponent` instead.\n */\n callToActionSecondComponent?: ReactElement<typeof Button>;\n /**\n * The content of the Dialog. May be a `string` or any other `ReactNode` or array of `ReactNode`s.\n */\n children: ReactNode;\n /**\n * When set to `true`, the Dialog will be visible.\n */\n isOpen: boolean;\n /**\n * Callback that controls what happens when the Dialog is dismissed.\n */\n onClose: (event: MuiOnCloseEvent, reason: DialogOnCloseReason) => void;\n /**\n * An optional Button object to be situated in the Dialog footer as the primary call to action.\n */\n primaryCallToActionComponent?: ReactElement<typeof Button>;\n\n /**\n * An optional Button object to be situated in the Dialog footer as the secondary call to action, alongside the `primaryCallToActionComponent`.\n */\n secondaryCallToActionComponent?: ReactElement<typeof Button>;\n\n /**\n * An optional Button object to be situated in the Dialog footer as the tertiary call to action, alongside the other `callToAction` components.\n */\n tertiaryCallToActionComponent?: ReactElement<typeof Button>;\n\n /**\n * The title of the Dialog.\n */\n title: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Dialog = ({\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n callToActionFirstComponent,\n callToActionSecondComponent,\n callToActionLastComponent,\n children,\n isOpen,\n onClose,\n testId,\n title,\n translate,\n}: DialogProps) => {\n const { t } = useTranslation();\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const dialogTitleId = useUniqueId();\n const dialogLabelId = useUniqueId();\n\n useEffect(() => {\n let frameId: number;\n\n const handleContentScroll = () => {\n const dialogContentElement = dialogContentRef.current;\n if (dialogContentElement) {\n cancelAnimationFrame(frameId);\n setIsContentScrollable(\n dialogContentElement.scrollHeight > dialogContentElement.clientHeight,\n );\n }\n frameId = requestAnimationFrame(handleContentScroll);\n };\n\n if (isOpen) {\n frameId = requestAnimationFrame(handleContentScroll);\n }\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [isOpen]);\n\n const content =\n typeof children === \"string\" ? (\n <DialogContentText>{children}</DialogContentText>\n ) : (\n children\n );\n\n // Prioritize new action button format (|| used as a fallback)\n const actionButtons = [\n tertiaryCallToActionComponent || callToActionLastComponent,\n secondaryCallToActionComponent || callToActionSecondComponent,\n primaryCallToActionComponent || callToActionFirstComponent,\n ].filter(Boolean);\n\n const handleCloseButtonClick = useCallback<\n NonNullable<ButtonProps[\"onClick\"]>\n >((event) => onClose(event, \"closeButtonClick\"), [onClose]);\n\n return (\n <MuiDialog\n aria-labelledby={dialogLabelId}\n data-se={testId}\n onClose={onClose}\n open={isOpen}\n >\n <DialogTitle\n id={dialogTitleId} // We need to explicitly unset `id` for MUI to automatically set it based on the `aria-labelledby` prop passed to `MuiDialog`\n translate={translate}\n >\n <span id={dialogLabelId}>{title}</span>\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={handleCloseButtonClick}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </DialogTitle>\n <DialogContent\n {...(isContentScrollable && {\n // Sets tabIndex on content element if scrollable so content is easier to navigate with the keyboard\n tabIndex: 0,\n })}\n dividers={isContentScrollable}\n ref={dialogContentRef}\n >\n {content}\n </DialogContent>\n\n {actionButtons.length > 0 && (\n <DialogActions>\n {actionButtons.map((actionButton, index) =>\n actionButton ? cloneElement(actionButton, { key: index }) : null,\n )}\n </DialogActions>\n )}\n </MuiDialog>\n );\n};\n\nconst MemoizedDialog = memo(Dialog);\nMemoizedDialog.displayName = \"Dialog\";\n\nexport { MemoizedDialog as Dialog };\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA,SACEA,YAAY,EACZC,IAAI,EAGJC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,cAAc,QAAQ,eAAe;AAI9C,SAASC,MAAM,QAAqB,oBAAoB;AACxD,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,WAAW,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAyD/C,MAAMC,MAAM,GAAGA,CAAC;EACdC,4BAA4B;EAC5BC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,0BAA0B;EAC1BC,2BAA2B;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WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIrD,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"Dialog.js","names":["cloneElement","memo","useCallback","useEffect","useRef","useState","Button","FullScreenOverlay","useTranslation","CloseIcon","useUniqueId","jsx","_jsx","jsxs","_jsxs","Dialog","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","callToActionFirstComponent","callToActionSecondComponent","callToActionLastComponent","children","isOpen","onClose","testId","title","translate","t","isContentScrollable","setIsContentScrollable","dialogContentRef","dialogTitleId","dialogLabelId","frameId","handleContentScroll","dialogContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","content","_DialogContentText","actionButtons","filter","Boolean","handleCloseButtonClick","event","_Dialog","open","_DialogTitle","id","ariaLabel","onClick","size","startIcon","variant","_DialogContent","tabIndex","dividers","ref","length","_DialogActions","map","actionButton","index","key","MemoizedDialog","displayName"],"sources":["../../src/Dialog.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 {\n Dialog as MuiDialog,\n DialogActions as MuiDialogActions,\n DialogContent as MuiDialogContent,\n DialogContentText as MuiDialogContentText,\n DialogProps as MuiDialogProps,\n DialogTitle as MuiDialogTitle,\n} from \"@mui/material\";\nimport {\n cloneElement,\n memo,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Button, ButtonProps } from \"./Buttons/index.js\";\nimport { FullScreenOverlay } from \"./FullScreenOverlay.js\";\nimport { useTranslation } from \"./i18n.generated/i18n.js\";\nimport { CloseIcon } from \"./icons.generated/index.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\ntype MuiOnCloseEvent = Parameters<Required<MuiDialogProps>[\"onClose\"]>[0];\ntype MuiOnCloseReason = Parameters<Required<MuiDialogProps>[\"onClose\"]>[1];\nexport type DialogOnCloseReason = MuiOnCloseReason | \"closeButtonClick\";\n\nexport type DialogProps = {\n /**\n * @deprecated `aria-label` for close button comes from translation file\n */\n ariaLabel?: string;\n\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `primaryCallToActionComponent` instead.\n */\n callToActionFirstComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `tertiaryCallToActionComponent` instead.\n */\n callToActionLastComponent?: ReactElement<typeof Button>;\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `secondaryCallToActionComponent` instead.\n */\n callToActionSecondComponent?: ReactElement<typeof Button>;\n /**\n * The content of the Dialog. May be a `string` or any other `ReactNode` or array of `ReactNode`s.\n */\n children: ReactNode;\n /**\n * When set to `true`, the Dialog will be visible.\n */\n isOpen: boolean;\n /**\n * Callback that controls what happens when the Dialog is dismissed.\n */\n onClose: (event: MuiOnCloseEvent, reason: DialogOnCloseReason) => void;\n /**\n * An optional Button object to be situated in the Dialog footer as the primary call to action.\n */\n primaryCallToActionComponent?: ReactElement<typeof Button>;\n\n /**\n * An optional Button object to be situated in the Dialog footer as the secondary call to action, alongside the `primaryCallToActionComponent`.\n */\n secondaryCallToActionComponent?: ReactElement<typeof Button>;\n\n /**\n * An optional Button object to be situated in the Dialog footer as the tertiary call to action, alongside the other `callToAction` components.\n */\n tertiaryCallToActionComponent?: ReactElement<typeof Button>;\n\n /**\n * The title of the Dialog.\n */\n title: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Dialog = ({\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n callToActionFirstComponent,\n callToActionSecondComponent,\n callToActionLastComponent,\n children,\n isOpen,\n onClose,\n testId,\n title,\n translate,\n}: DialogProps) => {\n const { t } = useTranslation();\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const dialogContentRef = useRef<HTMLDivElement>(null);\n const dialogTitleId = useUniqueId();\n const dialogLabelId = useUniqueId();\n\n useEffect(() => {\n let frameId: number;\n\n const handleContentScroll = () => {\n const dialogContentElement = dialogContentRef.current;\n if (dialogContentElement) {\n cancelAnimationFrame(frameId);\n setIsContentScrollable(\n dialogContentElement.scrollHeight > dialogContentElement.clientHeight,\n );\n }\n frameId = requestAnimationFrame(handleContentScroll);\n };\n\n if (isOpen) {\n frameId = requestAnimationFrame(handleContentScroll);\n }\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [isOpen]);\n\n const content =\n typeof children === \"string\" ? (\n <MuiDialogContentText>{children}</MuiDialogContentText>\n ) : (\n children\n );\n\n // Prioritize new action button format (|| used as a fallback)\n const actionButtons = [\n tertiaryCallToActionComponent || callToActionLastComponent,\n secondaryCallToActionComponent || callToActionSecondComponent,\n primaryCallToActionComponent || callToActionFirstComponent,\n ].filter(Boolean);\n\n const handleCloseButtonClick = useCallback<\n NonNullable<ButtonProps[\"onClick\"]>\n >((event) => onClose(event, \"closeButtonClick\"), [onClose]);\n\n return (\n <FullScreenOverlay>\n <MuiDialog\n aria-labelledby={dialogLabelId}\n data-se={testId}\n onClose={onClose}\n open={isOpen}\n >\n <MuiDialogTitle\n id={dialogTitleId} // We need to explicitly unset `id` for MUI to automatically set it based on the `aria-labelledby` prop passed to `MuiDialog`\n translate={translate}\n >\n <span id={dialogLabelId}>{title}</span>\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={handleCloseButtonClick}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </MuiDialogTitle>\n\n <MuiDialogContent\n {...(isContentScrollable && {\n // Sets tabIndex on content element if scrollable so content is easier to navigate with the keyboard\n tabIndex: 0,\n })}\n dividers={isContentScrollable}\n ref={dialogContentRef}\n >\n {content}\n </MuiDialogContent>\n\n {actionButtons.length > 0 && (\n <MuiDialogActions>\n {actionButtons.map((actionButton, index) =>\n actionButton ? cloneElement(actionButton, { key: index }) : null,\n )}\n </MuiDialogActions>\n )}\n </MuiDialog>\n </FullScreenOverlay>\n );\n};\n\nconst MemoizedDialog = memo(Dialog);\nMemoizedDialog.displayName = \"Dialog\";\n\nexport { MemoizedDialog as Dialog };\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA,SACEA,YAAY,EACZC,IAAI,EAGJC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,OAAO;AAId,SAASC,MAAM,QAAqB,oBAAoB;AACxD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,WAAW,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAyD/C,MAAMC,MAAM,GAAGA,CAAC;EACdC,4BAA4B;EAC5BC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,0BAA0B;EAC1BC,2BAA2B;EAC3BC,yBAAyB;EACzBC,QAAQ;EACRC,MAAM;EACNC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC;AACW,CAAC,KAAK;EACjB,MAAM;IAAEC;EAAE,CAAC,GAAGpB,cAAc,CAAC,CAAC;EAC9B,MAAM,CAACqB,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGzB,QAAQ,CAAC,KAAK,CAAC;EACrE,MAAM0B,gBAAgB,GAAG3B,MAAM,CAAiB,IAAI,CAAC;EACrD,MAAM4B,aAAa,GAAGtB,WAAW,CAAC,CAAC;EACnC,MAAMuB,aAAa,GAAGvB,WAAW,CAAC,CAAC;EAEnCP,SAAS,CAAC,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BV,IAAA;UAAMwC,EAAE,EAAEnB,aAAc;UAAAX,QAAA,EAAEI;QAAK,CAAO,CAAC,EACvCd,IAAA,CAACN,MAAM;UACL+C,SAAS,EAAEzB,CAAC,CAAC,YAAY,CAAE;UAC3B0B,OAAO,EAAEP,sBAAuB;UAChCQ,IAAI,EAAC,OAAO;UACZC,SAAS,EAAE5C,IAAA,CAACH,SAAS,IAAE,CAAE;UACzBgD,OAAO,EAAC;QAAU,CACnB,CAAC;MAAA,CACY,CAAC,EAEjB7C,IAAA,CAAA8C,cAAA;QAAA,IACO7B,mBAAmB,IAAI;UAE1B8B,QAAQ,EAAE;QACZ,CAAC;QACDC,QAAQ,EAAE/B,mBAAoB;QAC9BgC,GAAG,EAAE9B,gBAAiB;QAAAT,QAAA,EAErBoB;MAAO,CACQ,CAAC,EAElBE,aAAa,CAACkB,MAAM,GAAG,CAAC,IACvBlD,IAAA,CAAAmD,cAAA;QAAAzC,QAAA,EACGsB,aAAa,CAACoB,GAAG,CAAC,CAACC,YAAY,EAAEC,KAAK,KACrCD,YAAY,GAAGjE,YAAY,CAACiE,YAAY,EAAE;UAAEE,GAAG,EAAED;QAAM,CAAC,CAAC,GAAG,IAC9D;MAAC,CACe,CACnB;IAAA,CACQ;EAAC,CACK,CAAC;AAExB,CAAC;AAED,MAAME,cAAc,GAAGnE,IAAI,CAACc,MAAM,CAAC;AACnCqD,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIrD,MAAM","ignoreList":[]}
@@ -13,8 +13,9 @@ import _Drawer from "@mui/material/Drawer";
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 { Button } from "./Buttons/index.js";
17
+ import { FullScreenOverlay } from "./FullScreenOverlay.js";
18
+ import { useTranslation } from "./i18n.generated/i18n.js";
18
19
  import { CloseIcon } from "./icons.generated/index.js";
19
20
  import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
20
21
  import { Heading5 } from "./Typography.js";
@@ -124,7 +125,7 @@ const Drawer = ({
124
125
  }, [hasDividers, isContentScrollable]);
125
126
  const hasFooter = useMemo(() => primaryCallToActionComponent || secondaryCallToActionComponent || tertiaryCallToActionComponent, [primaryCallToActionComponent, secondaryCallToActionComponent, tertiaryCallToActionComponent]);
126
127
  const handleCloseButtonClick = useCallback(event => onClose(event, "closeButtonClick"), [onClose]);
127
- return _jsxs(_Drawer, {
128
+ const muiDrawerComponent = useMemo(() => _jsxs(_Drawer, {
128
129
  anchor: anchorDirection,
129
130
  "data-se": testId,
130
131
  onClose: onClose,
@@ -166,7 +167,10 @@ const Drawer = ({
166
167
  odysseyDesignTokens: odysseyDesignTokens,
167
168
  children: [tertiaryCallToActionComponent, secondaryCallToActionComponent, primaryCallToActionComponent]
168
169
  })]
169
- });
170
+ }), [anchorDirection, ariaLabel, children, dividersVisible, handleCloseButtonClick, hasFooter, isContentScrollable, isOpen, odysseyDesignTokens, onClose, primaryCallToActionComponent, secondaryCallToActionComponent, tertiaryCallToActionComponent, testId, title, translate, variant]);
171
+ return variant === "temporary" ? _jsx(FullScreenOverlay, {
172
+ children: muiDrawerComponent
173
+ }) : muiDrawerComponent;
170
174
  };
171
175
  const MemoizedDrawer = memo(Drawer);
172
176
  MemoizedDrawer.displayName = "Drawer";
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","names":["styled","memo","useCallback","useEffect","useMemo","useRef","useState","useTranslation","Button","CloseIcon","useOdysseyDesignTokens","Heading5","jsx","_jsx","jsxs","_jsxs","variantValues","DrawerHeader","shouldForwardProp","prop","odysseyDesignTokens","Spacing4","Spacing5","HueNeutral900","HueNeutralWhite","hasDividers","HueNeutral200","DrawerContentWrapper","DrawerContent","DrawerFooter","Drawer","ariaLabel","children","hasDividersProp","isOpen","onClose","primaryCallToActionComponent","secondaryCallToActionComponent","showDividers","tertiaryCallToActionComponent","testId","title","translate","variant","isContentScrollable","setIsContentScrollable","drawerContentRef","i18n","anchorDirection","dir","frameId","handleContentScroll","drawerContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","dividersVisible","hasFooter","handleCloseButtonClick","event","_Drawer","anchor","open","sx","transition","tabIndex","ref","onClick","size","startIcon","MemoizedDrawer","displayName"],"sources":["../../src/Drawer.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-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 Drawer as MuiDrawer,\n DrawerProps as MuiDrawerProps,\n} from \"@mui/material\";\nimport {\n memo,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Button, ButtonProps } from \"./Buttons/index.js\";\nimport { CloseIcon } from \"./icons.generated/index.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\nimport { Heading5 } from \"./Typography.js\";\n\ntype MuiOnCloseEvent = Parameters<Required<MuiDrawerProps>[\"onClose\"]>[0];\ntype MuiOnCloseReason = Parameters<Required<MuiDrawerProps>[\"onClose\"]>[1];\nexport type DrawerOnCloseReason = MuiOnCloseReason | \"closeButtonClick\";\n\nexport const variantValues = [\"temporary\", \"persistent\"] as const;\n\nexport type DrawerProps = {\n /**\n * The content of the Drawer. May be a `string` or any other `ReactNode` or array of `ReactNode`s.\n */\n children?: ReactNode;\n /**\n * When set to `true`, the Drawer will be visible.\n */\n isOpen?: boolean;\n /**\n * Callback that controls what happens when the Drawer is dismissed\n */\n onClose: (event: MuiOnCloseEvent, reason: DrawerOnCloseReason) => void;\n /**\n * An optional Button object to be situated in the Drawerfooter. Should almost always be of variant `primary`.\n */\n primaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Drawer footer, alongside the `callToActionPrimaryComponent`.\n */\n secondaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Drawer footer, alongside the other two `callToAction` components.\n */\n tertiaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * The title of the Drawer\n */\n title?: string;\n /**\n * Type of Drawer\n */\n variant?: (typeof variantValues)[number];\n} & Pick<HtmlProps, \"ariaLabel\" | \"testId\" | \"translate\"> &\n (\n | {\n /**\n * Shows divider lines separating header, content, and footer (if using action buttons).\n */\n hasDividers?: never;\n /**\n * @deprecated use `hasDividers` instead.\n *\n * Shows divider lines separating header, content, and footer (if using action buttons).\n */\n showDividers: boolean;\n }\n | {\n /**\n * Shows divider lines separating header, content, and footer (if using action buttons).\n */\n hasDividers: boolean;\n /**\n * @deprecated use `hasDividers` instead.\n *\n * Shows divider lines separating header, content, and footer (if using action buttons).\n */\n showDividers?: never;\n }\n );\n\ninterface DrawerStyleProps {\n hasDividers: boolean;\n odysseyDesignTokens: DesignTokens;\n}\nconst DrawerHeader = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasDividers\",\n})<DrawerStyleProps>`\n position: sticky;\n top: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0;\n padding: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing4}\n ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing5};\n color: ${({ odysseyDesignTokens }) => odysseyDesignTokens.HueNeutral900};\n background-color: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.HueNeutralWhite};\n border-bottom: ${({ hasDividers, odysseyDesignTokens }) =>\n hasDividers ? `1px solid ${odysseyDesignTokens.HueNeutral200}` : \"none\"};\n`;\n\nconst DrawerContentWrapper = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n overflow-y: auto;\n`;\n\nconst DrawerContent = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasDividers\",\n})<DrawerStyleProps>`\n padding: ${({ hasDividers, odysseyDesignTokens }) =>\n hasDividers\n ? `${odysseyDesignTokens.Spacing5}`\n : `0 ${odysseyDesignTokens.Spacing5}`};\n`;\n\nconst DrawerFooter = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasDividers\",\n})<DrawerStyleProps>`\n position: sticky;\n bottom: 0;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n align-content: center;\n padding: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing4};\n border-top: ${({ hasDividers, odysseyDesignTokens }) =>\n hasDividers ? `1px solid ${odysseyDesignTokens.HueNeutral200}` : \"none\"};\n background-color: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.HueNeutralWhite};\n`;\n\nconst Drawer = ({\n ariaLabel,\n children,\n hasDividers: hasDividersProp = false,\n isOpen,\n onClose,\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n showDividers = false,\n tertiaryCallToActionComponent,\n testId,\n title,\n translate,\n variant = \"temporary\",\n}: DrawerProps) => {\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const drawerContentRef = useRef<HTMLDivElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const hasDividers = hasDividersProp || showDividers;\n\n //If RTL is set in the theme, align the drawer on the left side of the screen, uses right by default.\n const { i18n } = useTranslation();\n const anchorDirection = i18n.dir() === \"rtl\" ? \"left\" : \"right\";\n\n useEffect(() => {\n let frameId: number;\n\n const handleContentScroll = () => {\n const drawerContentElement = drawerContentRef.current;\n if (drawerContentElement) {\n cancelAnimationFrame(frameId);\n setIsContentScrollable(\n drawerContentElement.scrollHeight > drawerContentElement.clientHeight,\n );\n }\n frameId = requestAnimationFrame(handleContentScroll);\n };\n\n if (isOpen) {\n frameId = requestAnimationFrame(handleContentScroll);\n }\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [isOpen]);\n\n const dividersVisible = useMemo(() => {\n return hasDividers || isContentScrollable;\n }, [hasDividers, isContentScrollable]);\n\n const hasFooter = useMemo(\n () =>\n primaryCallToActionComponent ||\n secondaryCallToActionComponent ||\n tertiaryCallToActionComponent,\n [\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n ],\n );\n\n const handleCloseButtonClick = useCallback<\n NonNullable<ButtonProps[\"onClick\"]>\n >((event) => onClose(event, \"closeButtonClick\"), [onClose]);\n\n return (\n <MuiDrawer\n anchor={anchorDirection}\n data-se={testId}\n onClose={onClose}\n open={isOpen}\n sx={{\n //Overrides default MUI inline style\n ...(variant === \"persistent\" && {\n \"& .MuiDrawer-paper\": {\n transition: \"none\",\n },\n }),\n }}\n variant={variant}\n >\n <DrawerContentWrapper\n {...(isContentScrollable && {\n //Sets tabIndex on content element if scrollable so content is easier to navigate with the keyboard\n tabIndex: 0,\n })}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={drawerContentRef}\n >\n <DrawerHeader\n hasDividers={dividersVisible}\n odysseyDesignTokens={odysseyDesignTokens}\n translate={translate}\n >\n <Heading5>{title}</Heading5>\n <Button\n ariaLabel={ariaLabel}\n onClick={handleCloseButtonClick}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </DrawerHeader>\n <DrawerContent\n hasDividers={dividersVisible}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {children}\n </DrawerContent>\n </DrawerContentWrapper>\n {hasFooter && (\n <DrawerFooter\n hasDividers={dividersVisible}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {tertiaryCallToActionComponent}\n {secondaryCallToActionComponent}\n {primaryCallToActionComponent}\n </DrawerFooter>\n )}\n </MuiDrawer>\n );\n};\n\nconst MemoizedDrawer = memo(Drawer);\nMemoizedDrawer.displayName = \"Drawer\";\n\nexport { MemoizedDrawer as Drawer };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAKpC,SACEC,IAAI,EAGJC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,cAAc,QAAQ,eAAe;AAI9C,SAASC,MAAM,QAAqB,oBAAoB;AACxD,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAEEC,sBAAsB,QACjB,iCAAiC;AACxC,SAASC,QAAQ,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAM3C,OAAO,MAAMC,aAAa,GAAG,CAAC,WAAW,EAAE,YAAY,CAAU;AAmEjE,MAAMC,YAAY,GAAGjB,MAAM,CAAC,KAAK,EAAE;EACjCkB,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAAIA,IAAI,KAAK;AAC/C,CAAC,CAAmB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,CAAC;EAAEC;AAAoB,CAAC,KAAKA,mBAAmB,CAACC,QAAQ;AACtE,MAAM,CAAC;EAAED;AAAoB,CAAC,KAAKA,mBAAmB,CAACE,QAAQ;AAC/D,WAAW,CAAC;EAAEF;AAAoB,CAAC,KAAKA,mBAAmB,CAACG,aAAa;AACzE,sBAAsB,CAAC;EAAEH;AAAoB,CAAC,KAC1CA,mBAAmB,CAACI,eAAe;AACvC,mBAAmB,CAAC;EAAEC,WAAW;EAAEL;AAAoB,CAAC,KACpDK,WAAW,GAAG,aAAaL,mBAAmB,CAACM,aAAa,EA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6B,EAC7BF,8BAA8B,EAC9BD,4BAA4B;IAAA,CACjB,CACf;EAAA,CACQ,CAAC;AAEhB,CAAC;AAED,MAAMoC,cAAc,GAAGvE,IAAI,CAAC6B,MAAM,CAAC;AACnC0C,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAI1C,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"Drawer.js","names":["styled","memo","useCallback","useEffect","useMemo","useRef","useState","Button","FullScreenOverlay","useTranslation","CloseIcon","useOdysseyDesignTokens","Heading5","jsx","_jsx","jsxs","_jsxs","variantValues","DrawerHeader","shouldForwardProp","prop","odysseyDesignTokens","Spacing4","Spacing5","HueNeutral900","HueNeutralWhite","hasDividers","HueNeutral200","DrawerContentWrapper","DrawerContent","DrawerFooter","Drawer","ariaLabel","children","hasDividersProp","isOpen","onClose","primaryCallToActionComponent","secondaryCallToActionComponent","showDividers","tertiaryCallToActionComponent","testId","title","translate","variant","isContentScrollable","setIsContentScrollable","drawerContentRef","i18n","anchorDirection","dir","frameId","handleContentScroll","drawerContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","dividersVisible","hasFooter","handleCloseButtonClick","event","muiDrawerComponent","_Drawer","anchor","open","sx","transition","tabIndex","ref","onClick","size","startIcon","MemoizedDrawer","displayName"],"sources":["../../src/Drawer.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-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 Drawer as MuiDrawer,\n DrawerProps as MuiDrawerProps,\n} from \"@mui/material\";\nimport {\n memo,\n ReactElement,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Button, ButtonProps } from \"./Buttons/index.js\";\nimport { FullScreenOverlay } from \"./FullScreenOverlay.js\";\nimport { useTranslation } from \"./i18n.generated/i18n.js\";\nimport { CloseIcon } from \"./icons.generated/index.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext.js\";\nimport { Heading5 } from \"./Typography.js\";\n\ntype MuiOnCloseEvent = Parameters<Required<MuiDrawerProps>[\"onClose\"]>[0];\ntype MuiOnCloseReason = Parameters<Required<MuiDrawerProps>[\"onClose\"]>[1];\nexport type DrawerOnCloseReason = MuiOnCloseReason | \"closeButtonClick\";\n\nexport const variantValues = [\"temporary\", \"persistent\"] as const;\n\nexport type DrawerProps = {\n /**\n * The content of the Drawer. May be a `string` or any other `ReactNode` or array of `ReactNode`s.\n */\n children?: ReactNode;\n /**\n * When set to `true`, the Drawer will be visible.\n */\n isOpen?: boolean;\n /**\n * Callback that controls what happens when the Drawer is dismissed\n */\n onClose: (event: MuiOnCloseEvent, reason: DrawerOnCloseReason) => void;\n /**\n * An optional Button object to be situated in the Drawerfooter. Should almost always be of variant `primary`.\n */\n primaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Drawer footer, alongside the `callToActionPrimaryComponent`.\n */\n secondaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Drawer footer, alongside the other two `callToAction` components.\n */\n tertiaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * The title of the Drawer\n */\n title?: string;\n /**\n * Type of Drawer\n */\n variant?: (typeof variantValues)[number];\n} & Pick<HtmlProps, \"ariaLabel\" | \"testId\" | \"translate\"> &\n (\n | {\n /**\n * Shows divider lines separating header, content, and footer (if using action buttons).\n */\n hasDividers?: never;\n /**\n * @deprecated use `hasDividers` instead.\n *\n * Shows divider lines separating header, content, and footer (if using action buttons).\n */\n showDividers: boolean;\n }\n | {\n /**\n * Shows divider lines separating header, content, and footer (if using action buttons).\n */\n hasDividers: boolean;\n /**\n * @deprecated use `hasDividers` instead.\n *\n * Shows divider lines separating header, content, and footer (if using action buttons).\n */\n showDividers?: never;\n }\n );\n\ntype DrawerStyleProps = {\n hasDividers: boolean;\n odysseyDesignTokens: DesignTokens;\n};\n\nconst DrawerHeader = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasDividers\",\n})<DrawerStyleProps>`\n position: sticky;\n top: 0;\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin: 0;\n padding: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing4}\n ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing5};\n color: ${({ odysseyDesignTokens }) => odysseyDesignTokens.HueNeutral900};\n background-color: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.HueNeutralWhite};\n border-bottom: ${({ hasDividers, odysseyDesignTokens }) =>\n hasDividers ? `1px solid ${odysseyDesignTokens.HueNeutral200}` : \"none\"};\n`;\n\nconst DrawerContentWrapper = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n overflow-y: auto;\n`;\n\nconst DrawerContent = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasDividers\",\n})<DrawerStyleProps>`\n padding: ${({ hasDividers, odysseyDesignTokens }) =>\n hasDividers\n ? `${odysseyDesignTokens.Spacing5}`\n : `0 ${odysseyDesignTokens.Spacing5}`};\n`;\n\nconst DrawerFooter = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasDividers\",\n})<DrawerStyleProps>`\n position: sticky;\n bottom: 0;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n align-content: center;\n padding: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing4};\n border-top: ${({ hasDividers, odysseyDesignTokens }) =>\n hasDividers ? `1px solid ${odysseyDesignTokens.HueNeutral200}` : \"none\"};\n background-color: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.HueNeutralWhite};\n`;\n\nconst Drawer = ({\n ariaLabel,\n children,\n hasDividers: hasDividersProp = false,\n isOpen,\n onClose,\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n showDividers = false,\n tertiaryCallToActionComponent,\n testId,\n title,\n translate,\n variant = \"temporary\",\n}: DrawerProps) => {\n const [isContentScrollable, setIsContentScrollable] = useState(false);\n const drawerContentRef = useRef<HTMLDivElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const hasDividers = hasDividersProp || showDividers;\n\n //If RTL is set in the theme, align the drawer on the left side of the screen, uses right by default.\n const { i18n } = useTranslation();\n const anchorDirection = i18n.dir() === \"rtl\" ? \"left\" : \"right\";\n\n useEffect(() => {\n let frameId: number;\n\n const handleContentScroll = () => {\n const drawerContentElement = drawerContentRef.current;\n if (drawerContentElement) {\n cancelAnimationFrame(frameId);\n setIsContentScrollable(\n drawerContentElement.scrollHeight > drawerContentElement.clientHeight,\n );\n }\n frameId = requestAnimationFrame(handleContentScroll);\n };\n\n if (isOpen) {\n frameId = requestAnimationFrame(handleContentScroll);\n }\n\n return () => {\n cancelAnimationFrame(frameId);\n };\n }, [isOpen]);\n\n const dividersVisible = useMemo(() => {\n return hasDividers || isContentScrollable;\n }, [hasDividers, isContentScrollable]);\n\n const hasFooter = useMemo(\n () =>\n primaryCallToActionComponent ||\n secondaryCallToActionComponent ||\n tertiaryCallToActionComponent,\n [\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n ],\n );\n\n const handleCloseButtonClick = useCallback<\n NonNullable<ButtonProps[\"onClick\"]>\n >((event) => onClose(event, \"closeButtonClick\"), [onClose]);\n\n const muiDrawerComponent = useMemo(\n () => (\n <MuiDrawer\n anchor={anchorDirection}\n data-se={testId}\n onClose={onClose}\n open={isOpen}\n sx={{\n //Overrides default MUI inline style\n ...(variant === \"persistent\" && {\n \"& .MuiDrawer-paper\": {\n transition: \"none\",\n },\n }),\n }}\n variant={variant}\n >\n <DrawerContentWrapper\n {...(isContentScrollable && {\n //Sets tabIndex on content element if scrollable so content is easier to navigate with the keyboard\n tabIndex: 0,\n })}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={drawerContentRef}\n >\n <DrawerHeader\n hasDividers={dividersVisible}\n odysseyDesignTokens={odysseyDesignTokens}\n translate={translate}\n >\n <Heading5>{title}</Heading5>\n\n <Button\n ariaLabel={ariaLabel}\n onClick={handleCloseButtonClick}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </DrawerHeader>\n <DrawerContent\n hasDividers={dividersVisible}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {children}\n </DrawerContent>\n </DrawerContentWrapper>\n {hasFooter && (\n <DrawerFooter\n hasDividers={dividersVisible}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {tertiaryCallToActionComponent}\n {secondaryCallToActionComponent}\n {primaryCallToActionComponent}\n </DrawerFooter>\n )}\n </MuiDrawer>\n ),\n [\n anchorDirection,\n ariaLabel,\n children,\n dividersVisible,\n handleCloseButtonClick,\n hasFooter,\n isContentScrollable,\n isOpen,\n odysseyDesignTokens,\n onClose,\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n testId,\n title,\n translate,\n variant,\n ],\n );\n\n return variant === \"temporary\" ? (\n <FullScreenOverlay>{muiDrawerComponent}</FullScreenOverlay>\n ) : (\n muiDrawerComponent\n );\n};\n\nconst MemoizedDrawer = memo(Drawer);\nMemoizedDrawer.displayName = \"Drawer\";\n\nexport { MemoizedDrawer as Drawer };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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V,MAAM,EACNd,mBAAmB,EACnBe,OAAO,EACPC,4BAA4B,EAC5BC,8BAA8B,EAC9BE,6BAA6B,EAC7BC,MAAM,EACNC,KAAK,EACLC,SAAS,EACTC,OAAO,CAEX,CAAC;EAED,OAAOA,OAAO,KAAK,WAAW,GAC5B9B,IAAA,CAACN,iBAAiB;IAAAyB,QAAA,EAAE8B;EAAkB,CAAoB,CAAC,GAE3DA,kBACD;AACH,CAAC;AAED,MAAMW,cAAc,GAAGzE,IAAI,CAAC8B,MAAM,CAAC;AACnC2C,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAI3C,MAAM","ignoreList":[]}
package/dist/esm/Field.js CHANGED
@@ -12,11 +12,11 @@ import _FormLabel from "@mui/material/FormLabel";
12
12
  * See the License for the specific language governing permissions and limitations under the License.
13
13
  */
14
14
  import { memo, useMemo } from "react";
15
- import { useTranslation } from "react-i18next";
16
15
  import { FieldError } from "./FieldError.js";
17
16
  import { FieldHint } from "./FieldHint.js";
18
17
  import { FieldLabel } from "./FieldLabel.js";
19
18
  import { useFieldset } from "./FieldsetContext.js";
19
+ import { useTranslation } from "./i18n.generated/i18n.js";
20
20
  import { Typography } from "./Typography.js";
21
21
  import { useUniqueId } from "./useUniqueId.js";
22
22
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","names":["memo","useMemo","useTranslation","FieldError","FieldHint","FieldLabel","useFieldset","Typography","useUniqueId","jsxs","_jsxs","jsx","_jsx","fieldTypeValues","Field","ariaDescribedBy","errorMessage","errorMessageList","fieldType","hasVisibleLabel","hint","HintLinkComponent","id","idOverride","isDisabled","isDisabledProp","isFullWidth","isRadioGroup","isOptional","isReadOnly","label","renderFieldComponent","t","hintId","undefined","errorMessageElementId","labelElementId","localAriaDescribedBy","join","trim","isFieldsetDisabled","_FormControl","component","disabled","error","Boolean","Array","isArray","length","fullWidth","role","children","_FormLabel","color","inputId","text","LinkComponent","message","messageList","MemoizedField","displayName"],"sources":["../../src/Field.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 {\n FormControl as MuiFormControl,\n FormLabel as MuiFormLabel,\n} from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps.js\";\nimport { FieldError } from \"./FieldError.js\";\nimport { FieldHint } from \"./FieldHint.js\";\nimport { FieldLabel } from \"./FieldLabel.js\";\nimport { useFieldset } from \"./FieldsetContext.js\";\nimport { HtmlProps } from \"./HtmlProps.js\";\nimport { Typography } from \"./Typography.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\nexport const fieldTypeValues = [\"single\", \"group\"] as const;\n\nexport type RenderFieldComponentProps = {\n ariaDescribedBy?: string;\n dataSe?: string;\n errorMessageElementId?: string;\n id: string;\n isReadOnly?: boolean;\n labelElementId: string;\n};\n\nexport type FieldProps = {\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessageList?: string[];\n /**\n * The field type determines how ARIA components are setup. It's important to use this to denote if you expect only one component (like a text field) or multiple (like a radio group).\n */\n fieldType: (typeof fieldTypeValues)[number];\n /**\n * If `true`, the Field label will be shown\n */\n hasVisibleLabel: boolean;\n /**\n * Important for determining if children inherit error state\n */\n isCheckboxGroup?: boolean;\n /**\n * Important for narrowing down the `fieldset` role to \"radiogroup\".\n */\n isRadioGroup?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Render-props function that sends back ARIA props to your field component.\n */\n renderFieldComponent: ({\n ariaDescribedBy,\n dataSe,\n errorMessageElementId,\n id,\n labelElementId,\n isReadOnly,\n }: RenderFieldComponentProps) => ReactElement;\n};\n\nconst Field = ({\n ariaDescribedBy,\n errorMessage,\n errorMessageList,\n fieldType,\n hasVisibleLabel,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled: isDisabledProp = false,\n isFullWidth = false,\n isRadioGroup = false,\n isOptional = false,\n isReadOnly = false,\n label,\n renderFieldComponent,\n}: FieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n > &\n Pick<HtmlProps, \"ariaDescribedBy\">) => {\n const { t } = useTranslation();\n\n const id = useUniqueId(idOverride);\n const hintId = hint ? `${id}-hint` : undefined;\n const errorMessageElementId =\n errorMessage || errorMessageList ? `${id}-error` : undefined;\n const labelElementId = `${id}-label`;\n\n const localAriaDescribedBy = useMemo(\n () =>\n [hintId, errorMessageElementId, ariaDescribedBy].join(\" \").trim() ||\n undefined,\n [ariaDescribedBy, errorMessageElementId, hintId],\n );\n\n const { isDisabled: isFieldsetDisabled } = useFieldset();\n\n const isDisabled = useMemo(\n () => isDisabledProp || isFieldsetDisabled,\n [isDisabledProp, isFieldsetDisabled],\n );\n\n return (\n <MuiFormControl\n component={fieldType === \"group\" ? \"fieldset\" : \"div\"}\n disabled={isDisabled}\n error={\n Boolean(errorMessage) ||\n (Array.isArray(errorMessageList) && errorMessageList.length > 0)\n }\n fullWidth={isFullWidth}\n role={isRadioGroup ? \"radiogroup\" : undefined}\n >\n {fieldType === \"group\" ? (\n <MuiFormLabel component=\"legend\" id={labelElementId}>\n {label}{\" \"}\n {isOptional && label && (\n <Typography color=\"textSecondary\" component=\"span\">\n ({t(\"fieldlabel.optional.text\")})\n </Typography>\n )}\n </MuiFormLabel>\n ) : (\n <FieldLabel\n hasVisibleLabel={hasVisibleLabel}\n id={labelElementId}\n inputId={id}\n isOptional={isOptional}\n text={label}\n />\n )}\n\n {hint && (\n <FieldHint id={hintId} LinkComponent={HintLinkComponent} text={hint} />\n )}\n\n {renderFieldComponent({\n ariaDescribedBy: localAriaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n isReadOnly,\n })}\n\n {(errorMessage || errorMessageList) && (\n <FieldError\n id={errorMessageElementId}\n message={errorMessage}\n messageList={errorMessageList}\n />\n )}\n </MuiFormControl>\n );\n};\n\nconst MemoizedField = memo(Field);\nMemoizedField.displayName = \"Field\";\n\nexport { MemoizedField as Field };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AACnD,SAASC,cAAc,QAAQ,eAAe;AAG9C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,sBAAsB;AAElD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,kBAAkB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAE/C,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAqD3D,MAAMC,KAAK,GAAGA,CAAC;EACbC,eAAe;EACfC,YAAY;EACZC,gBAAgB;EAChBC,SAAS;EACTC,eAAe;EACfC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,UAAU,EAAEC,cAAc,GAAG,KAAK;EAClCC,WAAW,GAAG,KAAK;EACnBC,YAAY,GAAG,KAAK;EACpBC,UAAU,GAAG,KAAK;EAClBC,UAAU,GAAG,KA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AEc,cAAe;MAAAe,QAAA,GACjDrB,KAAK,EAAE,GAAG,EACVF,UAAU,IAAIE,KAAK,IAClBpB,KAAA,CAACH,UAAU;QAAC8C,KAAK,EAAC,eAAe;QAACX,SAAS,EAAC,MAAM;QAAAS,QAAA,GAAC,GAChD,EAACnB,CAAC,CAAC,0BAA0B,CAAC,EAAC,GAClC;MAAA,CAAY,CACb;IAAA,CACW,CAAC,GAEfpB,IAAA,CAACP,UAAU;MACTc,eAAe,EAAEA,eAAgB;MACjCG,EAAE,EAAEc,cAAe;MACnBkB,OAAO,EAAEhC,EAAG;MACZM,UAAU,EAAEA,UAAW;MACvB2B,IAAI,EAAEzB;IAAM,CACb,CACF,EAEAV,IAAI,IACHR,IAAA,CAACR,SAAS;MAACkB,EAAE,EAAEW,MAAO;MAACuB,aAAa,EAAEnC,iBAAkB;MAACkC,IAAI,EAAEnC;IAAK,CAAE,CACvE,EAEAW,oBAAoB,CAAC;MACpBhB,eAAe,EAAEsB,oBAAoB;MACrCF,qBAAqB;MACrBb,EAAE;MACFc,cAAc;MACdP;IACF,CAAC,CAAC,EAED,CAACb,YAAY,IAAIC,gBAAgB,KAChCL,IAAA,CAACT,UAAU;MACTmB,EAAE,EAAEa,qBAAsB;MAC1BsB,OAAO,EAAEzC,YAAa;MACtB0C,WAAW,EAAEzC;IAAiB,CAC/B,CACF;EAAA,CACa,CAAC;AAErB,CAAC;AAED,MAAM0C,aAAa,GAAG3D,IAAI,CAACc,KAAK,CAAC;AACjC6C,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAI7C,KAAK","ignoreList":[]}
1
+ {"version":3,"file":"Field.js","names":["memo","useMemo","FieldError","FieldHint","FieldLabel","useFieldset","useTranslation","Typography","useUniqueId","jsxs","_jsxs","jsx","_jsx","fieldTypeValues","Field","ariaDescribedBy","errorMessage","errorMessageList","fieldType","hasVisibleLabel","hint","HintLinkComponent","id","idOverride","isDisabled","isDisabledProp","isFullWidth","isRadioGroup","isOptional","isReadOnly","label","renderFieldComponent","t","hintId","undefined","errorMessageElementId","labelElementId","localAriaDescribedBy","join","trim","isFieldsetDisabled","_FormControl","component","disabled","error","Boolean","Array","isArray","length","fullWidth","role","children","_FormLabel","color","inputId","text","LinkComponent","message","messageList","MemoizedField","displayName"],"sources":["../../src/Field.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 {\n FormControl as MuiFormControl,\n FormLabel as MuiFormLabel,\n} from \"@mui/material\";\nimport { memo, ReactElement, useMemo } from \"react\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps.js\";\nimport { FieldError } from \"./FieldError.js\";\nimport { FieldHint } from \"./FieldHint.js\";\nimport { FieldLabel } from \"./FieldLabel.js\";\nimport { useFieldset } from \"./FieldsetContext.js\";\nimport { HtmlProps } from \"./HtmlProps.js\";\nimport { useTranslation } from \"./i18n.generated/i18n.js\";\nimport { Typography } from \"./Typography.js\";\nimport { useUniqueId } from \"./useUniqueId.js\";\n\nexport const fieldTypeValues = [\"single\", \"group\"] as const;\n\nexport type RenderFieldComponentProps = {\n ariaDescribedBy?: string;\n dataSe?: string;\n errorMessageElementId?: string;\n id: string;\n isReadOnly?: boolean;\n labelElementId: string;\n};\n\nexport type FieldProps = {\n /**\n * If `error` is not undefined, the `input` will indicate an error.\n */\n errorMessageList?: string[];\n /**\n * The field type determines how ARIA components are setup. It's important to use this to denote if you expect only one component (like a text field) or multiple (like a radio group).\n */\n fieldType: (typeof fieldTypeValues)[number];\n /**\n * If `true`, the Field label will be shown\n */\n hasVisibleLabel: boolean;\n /**\n * Important for determining if children inherit error state\n */\n isCheckboxGroup?: boolean;\n /**\n * Important for narrowing down the `fieldset` role to \"radiogroup\".\n */\n isRadioGroup?: boolean;\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder?: string;\n /**\n * Render-props function that sends back ARIA props to your field component.\n */\n renderFieldComponent: ({\n ariaDescribedBy,\n dataSe,\n errorMessageElementId,\n id,\n labelElementId,\n isReadOnly,\n }: RenderFieldComponentProps) => ReactElement;\n};\n\nconst Field = ({\n ariaDescribedBy,\n errorMessage,\n errorMessageList,\n fieldType,\n hasVisibleLabel,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled: isDisabledProp = false,\n isFullWidth = false,\n isRadioGroup = false,\n isOptional = false,\n isReadOnly = false,\n label,\n renderFieldComponent,\n}: FieldProps &\n Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n > &\n Pick<HtmlProps, \"ariaDescribedBy\">) => {\n const { t } = useTranslation();\n\n const id = useUniqueId(idOverride);\n const hintId = hint ? `${id}-hint` : undefined;\n const errorMessageElementId =\n errorMessage || errorMessageList ? `${id}-error` : undefined;\n const labelElementId = `${id}-label`;\n\n const localAriaDescribedBy = useMemo(\n () =>\n [hintId, errorMessageElementId, ariaDescribedBy].join(\" \").trim() ||\n undefined,\n [ariaDescribedBy, errorMessageElementId, hintId],\n );\n\n const { isDisabled: isFieldsetDisabled } = useFieldset();\n\n const isDisabled = useMemo(\n () => isDisabledProp || isFieldsetDisabled,\n [isDisabledProp, isFieldsetDisabled],\n );\n\n return (\n <MuiFormControl\n component={fieldType === \"group\" ? \"fieldset\" : \"div\"}\n disabled={isDisabled}\n error={\n Boolean(errorMessage) ||\n (Array.isArray(errorMessageList) && errorMessageList.length > 0)\n }\n fullWidth={isFullWidth}\n role={isRadioGroup ? \"radiogroup\" : undefined}\n >\n {fieldType === \"group\" ? (\n <MuiFormLabel component=\"legend\" id={labelElementId}>\n {label}{\" \"}\n {isOptional && label && (\n <Typography color=\"textSecondary\" component=\"span\">\n ({t(\"fieldlabel.optional.text\")})\n </Typography>\n )}\n </MuiFormLabel>\n ) : (\n <FieldLabel\n hasVisibleLabel={hasVisibleLabel}\n id={labelElementId}\n inputId={id}\n isOptional={isOptional}\n text={label}\n />\n )}\n\n {hint && (\n <FieldHint id={hintId} LinkComponent={HintLinkComponent} text={hint} />\n )}\n\n {renderFieldComponent({\n ariaDescribedBy: localAriaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n isReadOnly,\n })}\n\n {(errorMessage || errorMessageList) && (\n <FieldError\n id={errorMessageElementId}\n message={errorMessage}\n messageList={errorMessageList}\n />\n )}\n </MuiFormControl>\n );\n};\n\nconst MemoizedField = memo(Field);\nMemoizedField.displayName = \"Field\";\n\nexport { MemoizedField as Field };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,IAAI,EAAgBC,OAAO,QAAQ,OAAO;AAGnD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,sBAAsB;AAElD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,kBAAkB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAE/C,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAU;AAqD3D,MAAMC,KAAK,GAAGA,CAAC;EACbC,eAAe;EACfC,YAAY;EACZC,gBAAgB;EAChBC,SAAS;EACTC,eAAe;EACfC,IAAI;EACJC,i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Y;IACvBwB,IAAI,EAAEvB,YAAY,GAAG,YAAY,GAAGO,SAAU;IAAAiB,QAAA,GAE7CjC,SAAS,KAAK,OAAO,GACpBR,KAAA,CAAA0C,UAAA;MAAcV,SAAS,EAAC,QAAQ;MAACpB,EAAE,EAAEc,cAAe;MAAAe,QAAA,GACjDrB,KAAK,EAAE,GAAG,EACVF,UAAU,IAAIE,KAAK,IAClBpB,KAAA,CAACH,UAAU;QAAC8C,KAAK,EAAC,eAAe;QAACX,SAAS,EAAC,MAAM;QAAAS,QAAA,GAAC,GAChD,EAACnB,CAAC,CAAC,0BAA0B,CAAC,EAAC,GAClC;MAAA,CAAY,CACb;IAAA,CACW,CAAC,GAEfpB,IAAA,CAACR,UAAU;MACTe,eAAe,EAAEA,eAAgB;MACjCG,EAAE,EAAEc,cAAe;MACnBkB,OAAO,EAAEhC,EAAG;MACZM,UAAU,EAAEA,UAAW;MACvB2B,IAAI,EAAEzB;IAAM,CACb,CACF,EAEAV,IAAI,IACHR,IAAA,CAACT,SAAS;MAACmB,EAAE,EAAEW,MAAO;MAACuB,aAAa,EAAEnC,iBAAkB;MAACkC,IAAI,EAAEnC;IAAK,CAAE,CACvE,EAEAW,oBAAoB,CAAC;MACpBhB,eAAe,EAAEsB,oBAAoB;MACrCF,qBAAqB;MACrBb,EAAE;MACFc,cAAc;MACdP;IACF,CAAC,CAAC,EAED,CAACb,YAAY,IAAIC,gBAAgB,KAChCL,IAAA,CAACV,UAAU;MACToB,EAAE,EAAEa,qBAAsB;MAC1BsB,OAAO,EAAEzC,YAAa;MACtB0C,WAAW,EAAEzC;IAAiB,CAC/B,CACF;EAAA,CACa,CAAC;AAErB,CAAC;AAED,MAAM0C,aAAa,GAAG3D,IAAI,CAACc,KAAK,CAAC;AACjC6C,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAI7C,KAAK","ignoreList":[]}
@@ -11,9 +11,9 @@ import _FormHelperText from "@mui/material/FormHelperText";
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 { useTranslation } from "react-i18next";
15
14
  import { Box } from "./Box.js";
16
15
  import { ErrorMessageList } from "./ErrorMessageList.js";
16
+ import { useTranslation } from "./i18n.generated/i18n.js";
17
17
  import { ScreenReaderText } from "./ScreenReaderText.js";
18
18
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  const FieldError = ({
@@ -1 +1 @@
1
- {"version":3,"file":"FieldError.js","names":["memo","useTranslation","Box","ErrorMessageList","ScreenReaderText","jsx","_jsx","jsxs","_jsxs","FieldError","id","message","messageList","testId","translate","t","_FormHelperText","component","error","children","errorMessages","MemoizedFieldError","displayName"],"sources":["../../src/FieldError.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 { FormHelperText } from \"@mui/material\";\nimport { memo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Box } from \"./Box.js\";\nimport { ErrorMessageList } from \"./ErrorMessageList.js\";\nimport { ScreenReaderText } from \"./ScreenReaderText.js\";\n\nexport type FieldErrorProps = {\n id?: string;\n message?: string;\n messageList?: string[];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst FieldError = ({\n id,\n message,\n messageList,\n testId,\n translate,\n}: FieldErrorProps) => {\n const { t } = useTranslation();\n\n return (\n <FormHelperText\n component=\"div\"\n data-se={testId}\n error\n id={id}\n translate={translate}\n >\n <ScreenReaderText translate={translate}>{`${t(\n \"fielderror.screenreader.text\",\n )}:`}</ScreenReaderText>\n <Box>\n {message}\n {messageList && <ErrorMessageList errorMessages={messageList} />}\n </Box>\n </FormHelperText>\n );\n};\n\nconst MemoizedFieldError = memo(FieldError);\nMemoizedFieldError.displayName = \"FieldError\";\n\nexport { MemoizedFieldError as FieldError };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,cAAc,QAAQ,eAAe;AAI9C,SAASC,GAAG,QAAQ,UAAU;AAC9B,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,gBAAgB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQzD,MAAMC,UAAU,GAAGA,CAAC;EAClBC,EAAE;EACFC,OAAO;EACPC,WAAW;EACXC,MAAM;EACNC;AACe,CAAC,KAAK;EACrB,MAAM;IAAEC;EAAE,CAAC,GAAGd,cAAc,CAAC,CAAC;EAE9B,OACEO,KAAA,CAAAQ,eAAA;IACEC,SAAS,EAAC,KAAK;IACf,WAASJ,MAAO;IAChBK,KAAK;IACLR,EAAE,EAAEA,EAAG;IACPI,SAAS,EAAEA,SAAU;IAAAK,QAAA,GAErBb,IAAA,CAACF,gBAAgB;MAACU,SAAS,EAAEA,SAAU;MAAAK,QAAA,EAAE,GAAGJ,CAAC,CAC3C,8BACF,CAAC;IAAG,CAAmB,CAAC,EACxBP,KAAA,CAACN,GAAG;MAAAiB,QAAA,GACDR,OAAO,EACPC,WAAW,IAAIN,IAAA,CAACH,gBAAgB;QAACiB,aAAa,EAAER;MAAY,CAAE,CAAC;IAAA,CAC7D,CAAC;EAAA,CACQ,CAAC;AAErB,CAAC;AAED,MAAMS,kBAAkB,GAAGrB,IAAI,CAACS,UAAU,CAAC;AAC3CY,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIZ,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"FieldError.js","names":["memo","Box","ErrorMessageList","useTranslation","ScreenReaderText","jsx","_jsx","jsxs","_jsxs","FieldError","id","message","messageList","testId","translate","t","_FormHelperText","component","error","children","errorMessages","MemoizedFieldError","displayName"],"sources":["../../src/FieldError.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 { FormHelperText } from \"@mui/material\";\nimport { memo } from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { Box } from \"./Box.js\";\nimport { ErrorMessageList } from \"./ErrorMessageList.js\";\nimport { useTranslation } from \"./i18n.generated/i18n.js\";\nimport { ScreenReaderText } from \"./ScreenReaderText.js\";\n\nexport type FieldErrorProps = {\n id?: string;\n message?: string;\n messageList?: string[];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst FieldError = ({\n id,\n message,\n messageList,\n testId,\n translate,\n}: FieldErrorProps) => {\n const { t } = useTranslation();\n\n return (\n <FormHelperText\n component=\"div\"\n data-se={testId}\n error\n id={id}\n translate={translate}\n >\n <ScreenReaderText translate={translate}>{`${t(\n \"fielderror.screenreader.text\",\n )}:`}</ScreenReaderText>\n <Box>\n {message}\n {messageList && <ErrorMessageList errorMessages={messageList} />}\n </Box>\n </FormHelperText>\n );\n};\n\nconst MemoizedFieldError = memo(FieldError);\nMemoizedFieldError.displayName = \"FieldError\";\n\nexport { MemoizedFieldError as FieldError };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,QAAQ,OAAO;AAI5B,SAASC,GAAG,QAAQ,UAAU;AAC9B,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,gBAAgB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAQzD,MAAMC,UAAU,GAAGA,CAAC;EAClBC,EAAE;EACFC,OAAO;EACPC,WAAW;EACXC,MAAM;EACNC;AACe,CAAC,KAAK;EACrB,MAAM;IAAEC;EAAE,CAAC,GAAGZ,cAAc,CAAC,CAAC;EAE9B,OACEK,KAAA,CAAAQ,eAAA;IACEC,SAAS,EAAC,KAAK;IACf,WAASJ,MAAO;IAChBK,KAAK;IACLR,EAAE,EAAEA,EAAG;IACPI,SAAS,EAAEA,SAAU;IAAAK,QAAA,GAErBb,IAAA,CAACF,gBAAgB;MAACU,SAAS,EAAEA,SAAU;MAAAK,QAAA,EAAE,GAAGJ,CAAC,CAC3C,8BACF,CAAC;IAAG,CAAmB,CAAC,EACxBP,KAAA,CAACP,GAAG;MAAAkB,QAAA,GACDR,OAAO,EACPC,WAAW,IAAIN,IAAA,CAACJ,gBAAgB;QAACkB,aAAa,EAAER;MAAY,CAAE,CAAC;IAAA,CAC7D,CAAC;EAAA,CACQ,CAAC;AAErB,CAAC;AAED,MAAMS,kBAAkB,GAAGrB,IAAI,CAACS,UAAU,CAAC;AAC3CY,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIZ,UAAU","ignoreList":[]}
@@ -11,7 +11,7 @@ import _InputLabel from "@mui/material/InputLabel";
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
13
  import { memo, useMemo } from "react";
14
- import { useTranslation } from "react-i18next";
14
+ import { useTranslation } from "./i18n.generated/i18n.js";
15
15
  import { ScreenReaderText } from "./ScreenReaderText.js";
16
16
  import { Subordinate } from "./Typography.js";
17
17
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLabel.js","names":["memo","useMemo","useTranslation","ScreenReaderText","Subordinate","jsx","_jsx","jsxs","_jsxs","FieldLabel","hasVisibleLabel","id","inputId","isOptional","testId","translate","text","t","inputLabel","_InputLabel","htmlFor","children","MemoizedFieldLabel","displayName"],"sources":["../../src/FieldLabel.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 { InputLabel as MuiInputLabel } from \"@mui/material\";\nimport { memo, useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { ScreenReaderText } from \"./ScreenReaderText.js\";\nimport { Subordinate } from \"./Typography.js\";\n\nexport type FieldLabelProps = {\n hasVisibleLabel: boolean;\n id: string;\n inputId: string;\n isOptional: boolean;\n text: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst FieldLabel = ({\n hasVisibleLabel,\n id,\n inputId,\n isOptional,\n testId,\n translate,\n text,\n}: FieldLabelProps) => {\n const { t } = useTranslation();\n\n const inputLabel = useMemo(\n () => (\n <MuiInputLabel\n data-se={testId}\n htmlFor={inputId}\n id={id}\n translate={translate}\n >\n <span>{text}</span>\n {isOptional && (\n <Subordinate>{t(\"fieldlabel.optional.text\")}</Subordinate>\n )}\n </MuiInputLabel>\n ),\n [id, inputId, isOptional, testId, translate, text, t],\n );\n\n return hasVisibleLabel ? (\n inputLabel\n ) : (\n <ScreenReaderText translate={translate}>{inputLabel}</ScreenReaderText>\n );\n};\n\nconst MemoizedFieldLabel = memo(FieldLabel);\nMemoizedFieldLabel.displayName = \"FieldLabel\";\n\nexport { MemoizedFieldLabel as FieldLabel };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AACrC,SAASC,cAAc,QAAQ,eAAe;AAI9C,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,WAAW,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU9C,MAAMC,UAAU,GAAGA,CAAC;EAClBC,eAAe;EACfC,EAAE;EACFC,OAAO;EACPC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC;AACe,CAAC,KAAK;EACrB,MAAM;IAAEC;EAAE,CAAC,GAAGf,cAAc,CAAC,CAAC;EAE9B,MAAMgB,UAAU,GAAGjB,OAAO,CACxB,MACEO,KAAA,CAAAW,WAAA;IACE,WAASL,MAAO;IAChBM,OAAO,EAAER,OAAQ;IACjBD,EAAE,EAAEA,EAAG;IACPI,SAAS,EAAEA,SAAU;IAAAM,QAAA,GAErBf,IAAA;MAAAe,QAAA,EAAOL;IAAI,CAAO,CAAC,EAClBH,UAAU,IACTP,IAAA,CAACF,WAAW;MAAAiB,QAAA,EAAEJ,CAAC,CAAC,0BAA0B;IAAC,CAAc,CAC1D;EAAA,CACY,CAChB,EACD,CAACN,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,CAAC,CACtD,CAAC;EAED,OAAOP,eAAe,GACpBQ,UAAU,GAEVZ,IAAA,CAACH,gBAAgB;IAACY,SAAS,EAAEA,SAAU;IAAAM,QAAA,EAAEH;EAAU,CAAmB,CACvE;AACH,CAAC;AAED,MAAMI,kBAAkB,GAAGtB,IAAI,CAACS,UAAU,CAAC;AAC3Ca,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIb,UAAU","ignoreList":[]}
1
+ {"version":3,"file":"FieldLabel.js","names":["memo","useMemo","useTranslation","ScreenReaderText","Subordinate","jsx","_jsx","jsxs","_jsxs","FieldLabel","hasVisibleLabel","id","inputId","isOptional","testId","translate","text","t","inputLabel","_InputLabel","htmlFor","children","MemoizedFieldLabel","displayName"],"sources":["../../src/FieldLabel.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 { InputLabel as MuiInputLabel } from \"@mui/material\";\nimport { memo, useMemo } from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps.js\";\n\nimport { useTranslation } from \"./i18n.generated/i18n.js\";\nimport { ScreenReaderText } from \"./ScreenReaderText.js\";\nimport { Subordinate } from \"./Typography.js\";\n\nexport type FieldLabelProps = {\n hasVisibleLabel: boolean;\n id: string;\n inputId: string;\n isOptional: boolean;\n text: string;\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst FieldLabel = ({\n hasVisibleLabel,\n id,\n inputId,\n isOptional,\n testId,\n translate,\n text,\n}: FieldLabelProps) => {\n const { t } = useTranslation();\n\n const inputLabel = useMemo(\n () => (\n <MuiInputLabel\n data-se={testId}\n htmlFor={inputId}\n id={id}\n translate={translate}\n >\n <span>{text}</span>\n {isOptional && (\n <Subordinate>{t(\"fieldlabel.optional.text\")}</Subordinate>\n )}\n </MuiInputLabel>\n ),\n [id, inputId, isOptional, testId, translate, text, t],\n );\n\n return hasVisibleLabel ? (\n inputLabel\n ) : (\n <ScreenReaderText translate={translate}>{inputLabel}</ScreenReaderText>\n );\n};\n\nconst MemoizedFieldLabel = memo(FieldLabel);\nMemoizedFieldLabel.displayName = \"FieldLabel\";\n\nexport { MemoizedFieldLabel as FieldLabel };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAASA,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAIrC,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,WAAW,QAAQ,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAU9C,MAAMC,UAAU,GAAGA,CAAC;EAClBC,eAAe;EACfC,EAAE;EACFC,OAAO;EACPC,UAAU;EACVC,MAAM;EACNC,SAAS;EACTC;AACe,CAAC,KAAK;EACrB,MAAM;IAAEC;EAAE,CAAC,GAAGf,cAAc,CAAC,CAAC;EAE9B,MAAMgB,UAAU,GAAGjB,OAAO,CACxB,MACEO,KAAA,CAAAW,WAAA;IACE,WAASL,MAAO;IAChBM,OAAO,EAAER,OAAQ;IACjBD,EAAE,EAAEA,EAAG;IACPI,SAAS,EAAEA,SAAU;IAAAM,QAAA,GAErBf,IAAA;MAAAe,QAAA,EAAOL;IAAI,CAAO,CAAC,EAClBH,UAAU,IACTP,IAAA,CAACF,WAAW;MAAAiB,QAAA,EAAEJ,CAAC,CAAC,0BAA0B;IAAC,CAAc,CAC1D;EAAA,CACY,CAChB,EACD,CAACN,EAAE,EAAEC,OAAO,EAAEC,UAAU,EAAEC,MAAM,EAAEC,SAAS,EAAEC,IAAI,EAAEC,CAAC,CACtD,CAAC;EAED,OAAOP,eAAe,GACpBQ,UAAU,GAEVZ,IAAA,CAACH,gBAAgB;IAACY,SAAS,EAAEA,SAAU;IAAAM,QAAA,EAAEH;EAAU,CAAmB,CACvE;AACH,CAAC;AAED,MAAMI,kBAAkB,GAAGtB,IAAI,CAACS,UAAU,CAAC;AAC3Ca,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIb,UAAU","ignoreList":[]}
@@ -13,7 +13,7 @@ import _IconButton from "@mui/material/IconButton";
13
13
 
14
14
  import styled from "@emotion/styled";
15
15
  import { memo, useCallback } from "react";
16
- import { useTranslation } from "react-i18next";
16
+ import { useTranslation } from "../i18n.generated/i18n.js";
17
17
  import { DeleteIcon } from "../icons.generated/index.js";
18
18
  import { MuiPropsContext } from "../MuiPropsContext.js";
19
19
  import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploadPreview.js","names":["styled","memo","useCallback","useTranslation","DeleteIcon","MuiPropsContext","useOdysseyDesignTokens","Tooltip","jsx","_jsx","jsxs","_jsxs","PreviewContainer","div","isDisabled","odysseyDesignTokens","color","TypographyColorDisabled","marginBlockStart","Spacing2","pointerEvents","UploadedFileContainer","display","justifyContent","alignItems","button","transform","padding","Spacing1","borderRadius","BorderRadiusMain","transition","TransitionTimingMain","backgroundColor","HueNeutral100","borderColor","FocusOutlineColorPrimary","boxShadow","outline","FocusOutlineWidthMain","FocusOutlineStyle","UploadedFile","name","onFileRemove","t","deleteHandler","renderDeleteButton","muiProps","_IconButton","onClick","size","children","tabIndex","ariaType","placement","text","Consumer","FileUploadPreview","fileNames","map","index","MemoizedFileUploadPreview","displayName"],"sources":["../../../src/FileUploader/FileUploadPreview.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 { IconButton } from \"@mui/material\";\nimport { memo, useCallback } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { DeleteIcon } from \"../icons.generated/index.js\";\nimport { MuiPropsContext, MuiPropsContextType } from \"../MuiPropsContext.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { Tooltip } from \"../Tooltip.js\";\nimport { FileUploaderProps } from \"./FileUploader.js\";\n\nconst PreviewContainer = styled.div<{\n isDisabled: FileUploaderProps[\"isDisabled\"];\n odysseyDesignTokens: DesignTokens;\n}>(({ isDisabled, odysseyDesignTokens }) => ({\n color: isDisabled ? odysseyDesignTokens.TypographyColorDisabled : \"inherit\",\n marginBlockStart: odysseyDesignTokens.Spacing2,\n pointerEvents: isDisabled ? \"none\" : \"auto\",\n}));\n\nconst UploadedFileContainer = styled.div<{ odysseyDesignTokens: DesignTokens }>(\n {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n\n button: {\n transform: \"scale(0)\",\n },\n\n \"&:hover, &:focus-within, &:focus\": {\n button: {\n transform: \"scale(1)\",\n },\n },\n },\n ({ odysseyDesignTokens }) => ({\n padding: `${odysseyDesignTokens.Spacing1} ${odysseyDesignTokens.Spacing2}`,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n transition: `background-color ${odysseyDesignTokens.TransitionTimingMain}`,\n\n \"&:hover, &:focus-within\": {\n backgroundColor: odysseyDesignTokens.HueNeutral100,\n },\n\n \"&:focus\": {\n borderColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n boxShadow: `0 0 0 2px ${odysseyDesignTokens.FocusOutlineColorPrimary}`,\n outline: `${odysseyDesignTokens.FocusOutlineWidthMain} ${odysseyDesignTokens.FocusOutlineStyle} transparent`,\n },\n }),\n);\n\ntype UploadedFileProps = {\n name: string;\n onFileRemove?: (name: string) => void;\n};\n\nconst UploadedFile = ({ name, onFileRemove }: UploadedFileProps) => {\n const { t } = useTranslation();\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const deleteHandler = useCallback(() => {\n onFileRemove?.(name);\n }, [onFileRemove, name]);\n\n const renderDeleteButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <IconButton\n {...muiProps}\n aria-label={t(\"fileupload.removefile.text\")}\n onClick={deleteHandler}\n size=\"small\"\n >\n <DeleteIcon />\n </IconButton>\n );\n },\n [deleteHandler, t],\n );\n\n return (\n <UploadedFileContainer\n odysseyDesignTokens={odysseyDesignTokens}\n // tabindex added to make this element focusable\n tabIndex={0}\n >\n {name}\n <Tooltip\n ariaType=\"description\"\n placement=\"top\"\n text={t(\"fileupload.removefile.text\")}\n >\n <MuiPropsContext.Consumer>\n {renderDeleteButton}\n </MuiPropsContext.Consumer>\n </Tooltip>\n </UploadedFileContainer>\n );\n};\n\ntype FileUploadPreviewProps = {\n fileNames: string[];\n isDisabled: FileUploaderProps[\"isDisabled\"];\n onFileRemove?: (name: string) => void;\n};\n\nconst FileUploadPreview = ({\n fileNames,\n isDisabled,\n onFileRemove,\n}: FileUploadPreviewProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <PreviewContainer\n data-file-preview-container=\"true\"\n isDisabled={isDisabled}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {fileNames?.map((name, index) => (\n <UploadedFile\n key={`${index}-${name}`}\n name={name}\n onFileRemove={onFileRemove}\n />\n ))}\n </PreviewContainer>\n );\n};\n\nconst MemoizedFileUploadPreview = memo(FileUploadPreview);\nMemoizedFileUploadPreview.displayName = \"FileUploadPreview\";\n\nexport { MemoizedFileUploadPreview as FileUploadPreview };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SAASC,IAAI,EAAEC,WAAW,QAAQ,OAAO;AACzC,SAASC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CAACG,gBAAgB;IACf,+BAA4B,MAAM;IAClCE,UAAU,EAAEA,UAAW;IACvBC,mBAAmB,EAAEA,mBAAoB;IAAAoC,QAAA,EAExCO,SAAS,EAAEC,GAAG,CAAC,CAACjB,IAAI,EAAEkB,KAAK,KAC1BnD,IAAA,CAACgC,YAAY;MAEXC,IAAI,EAAEA,IAAK;MACXC,YAAY,EAAEA;IAAa,GAFtB,GAAGiB,KAAK,IAAIlB,IAAI,EAGtB,CACF;EAAC,CACc,CAAC;AAEvB,CAAC;AAED,MAAMmB,yBAAyB,GAAG5D,IAAI,CAACwD,iBAAiB,CAAC;AACzDI,yBAAyB,CAACC,WAAW,GAAG,mBAAmB;AAE3D,SAASD,yBAAyB,IAAIJ,iBAAiB","ignoreList":[]}
1
+ {"version":3,"file":"FileUploadPreview.js","names":["styled","memo","useCallback","useTranslation","DeleteIcon","MuiPropsContext","useOdysseyDesignTokens","Tooltip","jsx","_jsx","jsxs","_jsxs","PreviewContainer","div","isDisabled","odysseyDesignTokens","color","TypographyColorDisabled","marginBlockStart","Spacing2","pointerEvents","UploadedFileContainer","display","justifyContent","alignItems","button","transform","padding","Spacing1","borderRadius","BorderRadiusMain","transition","TransitionTimingMain","backgroundColor","HueNeutral100","borderColor","FocusOutlineColorPrimary","boxShadow","outline","FocusOutlineWidthMain","FocusOutlineStyle","UploadedFile","name","onFileRemove","t","deleteHandler","renderDeleteButton","muiProps","_IconButton","onClick","size","children","tabIndex","ariaType","placement","text","Consumer","FileUploadPreview","fileNames","map","index","MemoizedFileUploadPreview","displayName"],"sources":["../../../src/FileUploader/FileUploadPreview.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 { IconButton } from \"@mui/material\";\nimport { memo, useCallback } from \"react\";\n\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport { DeleteIcon } from \"../icons.generated/index.js\";\nimport { MuiPropsContext, MuiPropsContextType } from \"../MuiPropsContext.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { Tooltip } from \"../Tooltip.js\";\nimport { FileUploaderProps } from \"./FileUploader.js\";\n\nconst PreviewContainer = styled.div<{\n isDisabled: FileUploaderProps[\"isDisabled\"];\n odysseyDesignTokens: DesignTokens;\n}>(({ isDisabled, odysseyDesignTokens }) => ({\n color: isDisabled ? odysseyDesignTokens.TypographyColorDisabled : \"inherit\",\n marginBlockStart: odysseyDesignTokens.Spacing2,\n pointerEvents: isDisabled ? \"none\" : \"auto\",\n}));\n\nconst UploadedFileContainer = styled.div<{ odysseyDesignTokens: DesignTokens }>(\n {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n\n button: {\n transform: \"scale(0)\",\n },\n\n \"&:hover, &:focus-within, &:focus\": {\n button: {\n transform: \"scale(1)\",\n },\n },\n },\n ({ odysseyDesignTokens }) => ({\n padding: `${odysseyDesignTokens.Spacing1} ${odysseyDesignTokens.Spacing2}`,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n transition: `background-color ${odysseyDesignTokens.TransitionTimingMain}`,\n\n \"&:hover, &:focus-within\": {\n backgroundColor: odysseyDesignTokens.HueNeutral100,\n },\n\n \"&:focus\": {\n borderColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n boxShadow: `0 0 0 2px ${odysseyDesignTokens.FocusOutlineColorPrimary}`,\n outline: `${odysseyDesignTokens.FocusOutlineWidthMain} ${odysseyDesignTokens.FocusOutlineStyle} transparent`,\n },\n }),\n);\n\ntype UploadedFileProps = {\n name: string;\n onFileRemove?: (name: string) => void;\n};\n\nconst UploadedFile = ({ name, onFileRemove }: UploadedFileProps) => {\n const { t } = useTranslation();\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const deleteHandler = useCallback(() => {\n onFileRemove?.(name);\n }, [onFileRemove, name]);\n\n const renderDeleteButton = useCallback(\n (muiProps: MuiPropsContextType) => {\n return (\n <IconButton\n {...muiProps}\n aria-label={t(\"fileupload.removefile.text\")}\n onClick={deleteHandler}\n size=\"small\"\n >\n <DeleteIcon />\n </IconButton>\n );\n },\n [deleteHandler, t],\n );\n\n return (\n <UploadedFileContainer\n odysseyDesignTokens={odysseyDesignTokens}\n // tabindex added to make this element focusable\n tabIndex={0}\n >\n {name}\n <Tooltip\n ariaType=\"description\"\n placement=\"top\"\n text={t(\"fileupload.removefile.text\")}\n >\n <MuiPropsContext.Consumer>\n {renderDeleteButton}\n </MuiPropsContext.Consumer>\n </Tooltip>\n </UploadedFileContainer>\n );\n};\n\ntype FileUploadPreviewProps = {\n fileNames: string[];\n isDisabled: FileUploaderProps[\"isDisabled\"];\n onFileRemove?: (name: string) => void;\n};\n\nconst FileUploadPreview = ({\n fileNames,\n isDisabled,\n onFileRemove,\n}: FileUploadPreviewProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <PreviewContainer\n data-file-preview-container=\"true\"\n isDisabled={isDisabled}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {fileNames?.map((name, index) => (\n <UploadedFile\n key={`${index}-${name}`}\n name={name}\n onFileRemove={onFileRemove}\n />\n ))}\n </PreviewContainer>\n );\n};\n\nconst MemoizedFileUploadPreview = memo(FileUploadPreview);\nMemoizedFileUploadPreview.displayName = \"FileUploadPreview\";\n\nexport { MemoizedFileUploadPreview as FileUploadPreview };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,S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AmB,GAAGT,sBAAsB,CAAC,CAAC;EAEpD,OACEG,IAAA,CAACG,gBAAgB;IACf,+BAA4B,MAAM;IAClCE,UAAU,EAAEA,UAAW;IACvBC,mBAAmB,EAAEA,mBAAoB;IAAAoC,QAAA,EAExCO,SAAS,EAAEC,GAAG,CAAC,CAACjB,IAAI,EAAEkB,KAAK,KAC1BnD,IAAA,CAACgC,YAAY;MAEXC,IAAI,EAAEA,IAAK;MACXC,YAAY,EAAEA;IAAa,GAFtB,GAAGiB,KAAK,IAAIlB,IAAI,EAGtB,CACF;EAAC,CACc,CAAC;AAEvB,CAAC;AAED,MAAMmB,yBAAyB,GAAG5D,IAAI,CAACwD,iBAAiB,CAAC;AACzDI,yBAAyB,CAACC,WAAW,GAAG,mBAAmB;AAE3D,SAASD,yBAAyB,IAAIJ,iBAAiB","ignoreList":[]}
@@ -12,9 +12,9 @@
12
12
 
13
13
  import styled from "@emotion/styled";
14
14
  import { memo, useCallback, useEffect, useRef, useState } from "react";
15
- import { useTranslation } from "react-i18next";
16
15
  import { Button } from "../Buttons/index.js";
17
16
  import { Field } from "../Field.js";
17
+ import { useTranslation } from "../i18n.generated/i18n.js";
18
18
  import { UploadIcon } from "../icons.generated/index.js";
19
19
  import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
20
20
  import { Support } from "../Typography.js";
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploader.js","names":["styled","memo","useCallback","useEffect","useRef","useState","useTranslation","Button","Field","UploadIcon","useOdysseyDesignTokens","Support","FileUploadIllustration","FileUploadPreview","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","fileUploadTypes","fileUploadVariants","BaseInputWrapper","div","position","alignSelf","input","width","height","opacity","InputContainer","display","alignItems","justifyContent","borderStyle","hasError","odysseyDesignTokens","padding","Spacing6","Spacing3","border","PaletteDangerMain","HueNeutral300","borderRadius","BorderRadiusMain","transition","TransitionTimingMain","borderColor","HueNeutral700","FocusOutlineColorPrimary","boxShadow","outline","FocusOutlineWidthMain","FocusOutlineStyle","outlineOffset","FocusOutlineOffsetTight","backgroundColor","HueNeutral50","BorderColorDisabled","color","TypographyColorDisabled","ButtonAndInfoContainer","flexDirection","CenterAlignedSupportText","textAlign","FileUploader","acceptedFileTypes","errorMessage","id","isDisabled","isFullWidth","isOptional","hint","HintLinkComponent","label","onChange","type","variant","t","inputRef","filesToUpload","setFilesToUpload","updateFilesToUpload","event","files","target","length","mergedFiles","concat","Array","from","slice","value","triggerFileInputClick","current","click","removeFileFromFilesToUploadList","name","deletedFileFilteredOut","filter","file","renderFileInput","ariaDescribedBy","errorMessageElementId","labelElementId","acceptedFileTypesAsString","join","Input","accept","disabled","multiple","ref","title","children","onClick","startIcon","Boolean","fieldType","hasVisibleLabel","renderFieldComponent","fileNames","map","onFileRemove","MemoizedFileUploader","displayName","FileUpload"],"sources":["../../../src/FileUploader/FileUploader.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 ChangeEvent,\n memo,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button } from \"../Buttons/index.js\";\nimport { Field, RenderFieldComponentProps } from \"../Field.js\";\nimport { FieldComponentProps } from \"../FieldComponentProps.js\";\nimport { UploadIcon } from \"../icons.generated/index.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { Support } from \"../Typography.js\";\nimport { FileUploadIllustration } from \"./FileUploadIllustration.js\";\nimport { FileUploadPreview } from \"./FileUploadPreview.js\";\n\nexport const fileUploadTypes = [\"single\", \"multiple\"] as const;\nexport const fileUploadVariants = [\n \"button\",\n \"dragAndDrop\",\n \"dragAndDropWithIcon\",\n] as const;\n\nconst BaseInputWrapper = styled.div({\n position: \"relative\",\n alignSelf: \"flex-start\",\n\n input: {\n position: \"absolute\",\n width: \"100%\",\n height: \"100%\",\n opacity: 0,\n },\n});\n\nconst InputContainer = styled(BaseInputWrapper)<{\n hasError: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(\n {\n display: \"flex\",\n alignSelf: \"unset\",\n alignItems: \"center\",\n justifyContent: \"center\",\n\n \"&:has(input:focus)\": {\n borderStyle: \"solid\",\n },\n },\n ({ hasError, odysseyDesignTokens }) => ({\n padding: `${odysseyDesignTokens.Spacing6} ${odysseyDesignTokens.Spacing3}`,\n border: hasError\n ? `1px solid ${odysseyDesignTokens.PaletteDangerMain}`\n : `1px dashed ${odysseyDesignTokens.HueNeutral300}`,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n transition: `border-color ${odysseyDesignTokens.TransitionTimingMain}, box-shadow ${odysseyDesignTokens.TransitionTimingMain}`,\n\n \"&:hover\": {\n borderColor: odysseyDesignTokens.HueNeutral700,\n },\n\n \"&:has(input:focus)\": {\n borderColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n boxShadow: `0 0 0 1px ${odysseyDesignTokens.FocusOutlineColorPrimary}`,\n outline: `${odysseyDesignTokens.FocusOutlineWidthMain} ${odysseyDesignTokens.FocusOutlineStyle} transparent`,\n outlineOffset: odysseyDesignTokens.FocusOutlineOffsetTight,\n },\n\n \"&:has(input:disabled)\": {\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n border: `1px solid ${odysseyDesignTokens.BorderColorDisabled}`,\n color: odysseyDesignTokens.TypographyColorDisabled,\n\n \"&:hover\": {\n borderColor: odysseyDesignTokens.BorderColorDisabled,\n },\n },\n }),\n);\n\nconst ButtonAndInfoContainer = styled.div({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n});\n\nconst CenterAlignedSupportText = styled.div({\n textAlign: \"center\",\n});\n\nexport type FileUploaderProps = {\n /**\n * an array of file types the user is able to upload. @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers for examples\n */\n acceptedFileTypes?: string[];\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Function that is called when the list of ifles to upload is changed\n */\n onChange: (files: File[]) => void;\n /**\n * Either `single` or `multiple`. If `multiple`, multiple files can be uploaded\n */\n type?: (typeof fileUploadTypes)[number];\n /**\n * Either `button`, `dragAndDrop` or `dragAndDropWithIcon`. Will determine how component appears visually\n */\n variant: (typeof fileUploadVariants)[number];\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n>;\n\nconst FileUploader = ({\n acceptedFileTypes,\n errorMessage,\n id,\n isDisabled = false,\n isFullWidth,\n isOptional,\n hint,\n HintLinkComponent,\n label,\n onChange,\n type,\n variant,\n}: FileUploaderProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const [filesToUpload, setFilesToUpload] = useState<File[]>([]);\n\n useEffect(() => {\n onChange(filesToUpload);\n }, [filesToUpload, onChange]);\n\n const updateFilesToUpload = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const { files } = event.target;\n\n if (files && files.length > 0) {\n const mergedFiles =\n type === \"multiple\"\n ? filesToUpload.concat(Array.from(files))\n : Array.from(files).slice();\n\n setFilesToUpload(mergedFiles);\n }\n\n // reset input value to allow re-upload of a file with the same name\n event.target.value = \"\";\n },\n [type, filesToUpload],\n );\n\n const triggerFileInputClick = useCallback(() => {\n inputRef.current?.click();\n }, [inputRef]);\n\n const removeFileFromFilesToUploadList = useCallback<(name: string) => void>(\n (name) => {\n const deletedFileFilteredOut = filesToUpload.filter(\n (file) => file.name !== name,\n );\n setFilesToUpload(deletedFileFilteredOut);\n },\n [filesToUpload],\n );\n\n const renderFileInput = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: RenderFieldComponentProps) => {\n const acceptedFileTypesAsString = acceptedFileTypes?.join(\",\");\n\n const Input = () => (\n <input\n accept={acceptedFileTypesAsString}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n disabled={isDisabled}\n id={id}\n multiple={type === \"multiple\"}\n onChange={updateFilesToUpload}\n ref={inputRef}\n title=\"\"\n type=\"file\"\n />\n );\n\n if (variant === \"button\") {\n return (\n <>\n <BaseInputWrapper>\n <Input />\n <Button\n isDisabled={isDisabled}\n label={t(\"fileupload.button.text\")}\n onClick={triggerFileInputClick}\n startIcon={<UploadIcon />}\n variant=\"secondary\"\n />\n </BaseInputWrapper>\n </>\n );\n }\n\n return (\n <>\n <InputContainer\n hasError={Boolean(errorMessage)}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Input />\n <ButtonAndInfoContainer>\n {variant === \"dragAndDropWithIcon\" && <FileUploadIllustration />}\n <CenterAlignedSupportText>\n <Support color=\"textSecondary\">\n {t(\"fileupload.prompt.text\")}\n </Support>\n </CenterAlignedSupportText>\n <Button\n isDisabled={isDisabled}\n label={t(\"fileupload.button.text\")}\n onClick={triggerFileInputClick}\n startIcon={<UploadIcon />}\n variant=\"secondary\"\n />\n </ButtonAndInfoContainer>\n </InputContainer>\n </>\n );\n },\n [\n acceptedFileTypes,\n errorMessage,\n isDisabled,\n inputRef,\n odysseyDesignTokens,\n triggerFileInputClick,\n t,\n type,\n updateFilesToUpload,\n variant,\n ],\n );\n\n return (\n <>\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={id}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth && variant !== \"button\"}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFileInput}\n />\n {filesToUpload.length > 0 && (\n <FileUploadPreview\n fileNames={filesToUpload.map((file) => file.name)}\n isDisabled={isDisabled}\n onFileRemove={removeFileFromFilesToUploadList}\n />\n )}\n </>\n );\n};\n\nconst MemoizedFileUploader = memo(FileUploader);\nMemoizedFileUploader.displayName = \"FileUploader\";\n\nexport { MemoizedFileUploader as FileUpload };\nexport { MemoizedFileUploader as FileUploader };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAEEC,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,cAAc,QAAQ,eAAe;AAE9C,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,KAAK,QAAmC,aAAa;AAE9D,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAEEC,sBAAsB,QACjB,kCAAkC;AACzC,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,sBAAsB,QAAQ,6BAA6B;AACpE,SAASC,iBAAiB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE3D,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAU;AAC9D,OAAO,MAAMC,kBAAkB,GAAG,CAChC,QAAQ,EACR,aAAa,EACb,qBAAqB,CACb;AAEV,MAAMC,gBAAgB,GAAGtB,MAAM,CAACuB,GAAG,CAAC;EAClCC,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,YAAY;EAEvBC,KAAK,EAAE;IACLF,QAAQ,EAAE,UAAU;IACpBG,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,OAAO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AAY,EAAEA,YAAa;MAC3BkD,SAAS,EAAC,QAAQ;MAClBC,eAAe;MACf9C,IAAI,EAAEA,IAAK;MACXC,iBAAiB,EAAEA,iBAAkB;MACrCL,EAAE,EAAEA,EAAG;MACPC,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEA,WAAW,IAAIO,OAAO,KAAK,QAAS;MACjDN,UAAU,EAAEA,UAAW;MACvBG,KAAK,EAAEA,KAAM;MACb6C,oBAAoB,EAAElB;IAAgB,CACvC,CAAC,EACDrB,aAAa,CAACM,MAAM,GAAG,CAAC,IACvBvE,IAAA,CAACF,iBAAiB;MAChB2G,SAAS,EAAExC,aAAa,CAACyC,GAAG,CAAErB,IAAI,IAAKA,IAAI,CAACH,IAAI,CAAE;MAClD5B,UAAU,EAAEA,UAAW;MACvBqD,YAAY,EAAE1B;IAAgC,CAC/C,CACF;EAAA,CACD,CAAC;AAEP,CAAC;AAED,MAAM2B,oBAAoB,GAAG1H,IAAI,CAACgE,YAAY,CAAC;AAC/C0D,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIE,UAAU;AAC3C,SAASF,oBAAoB,IAAI1D,YAAY","ignoreList":[]}
1
+ {"version":3,"file":"FileUploader.js","names":["styled","memo","useCallback","useEffect","useRef","useState","Button","Field","useTranslation","UploadIcon","useOdysseyDesignTokens","Support","FileUploadIllustration","FileUploadPreview","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","fileUploadTypes","fileUploadVariants","BaseInputWrapper","div","position","alignSelf","input","width","height","opacity","InputContainer","display","alignItems","justifyContent","borderStyle","hasError","odysseyDesignTokens","padding","Spacing6","Spacing3","border","PaletteDangerMain","HueNeutral300","borderRadius","BorderRadiusMain","transition","TransitionTimingMain","borderColor","HueNeutral700","FocusOutlineColorPrimary","boxShadow","outline","FocusOutlineWidthMain","FocusOutlineStyle","outlineOffset","FocusOutlineOffsetTight","backgroundColor","HueNeutral50","BorderColorDisabled","color","TypographyColorDisabled","ButtonAndInfoContainer","flexDirection","CenterAlignedSupportText","textAlign","FileUploader","acceptedFileTypes","errorMessage","id","isDisabled","isFullWidth","isOptional","hint","HintLinkComponent","label","onChange","type","variant","t","inputRef","filesToUpload","setFilesToUpload","updateFilesToUpload","event","files","target","length","mergedFiles","concat","Array","from","slice","value","triggerFileInputClick","current","click","removeFileFromFilesToUploadList","name","deletedFileFilteredOut","filter","file","renderFileInput","ariaDescribedBy","errorMessageElementId","labelElementId","acceptedFileTypesAsString","join","Input","accept","disabled","multiple","ref","title","children","onClick","startIcon","Boolean","fieldType","hasVisibleLabel","renderFieldComponent","fileNames","map","onFileRemove","MemoizedFileUploader","displayName","FileUpload"],"sources":["../../../src/FileUploader/FileUploader.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 ChangeEvent,\n memo,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\nimport { Button } from \"../Buttons/index.js\";\nimport { Field, RenderFieldComponentProps } from \"../Field.js\";\nimport { FieldComponentProps } from \"../FieldComponentProps.js\";\nimport { useTranslation } from \"../i18n.generated/i18n.js\";\nimport { UploadIcon } from \"../icons.generated/index.js\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"../OdysseyDesignTokensContext.js\";\nimport { Support } from \"../Typography.js\";\nimport { FileUploadIllustration } from \"./FileUploadIllustration.js\";\nimport { FileUploadPreview } from \"./FileUploadPreview.js\";\n\nexport const fileUploadTypes = [\"single\", \"multiple\"] as const;\nexport const fileUploadVariants = [\n \"button\",\n \"dragAndDrop\",\n \"dragAndDropWithIcon\",\n] as const;\n\nconst BaseInputWrapper = styled.div({\n position: \"relative\",\n alignSelf: \"flex-start\",\n\n input: {\n position: \"absolute\",\n width: \"100%\",\n height: \"100%\",\n opacity: 0,\n },\n});\n\nconst InputContainer = styled(BaseInputWrapper)<{\n hasError: boolean;\n odysseyDesignTokens: DesignTokens;\n}>(\n {\n display: \"flex\",\n alignSelf: \"unset\",\n alignItems: \"center\",\n justifyContent: \"center\",\n\n \"&:has(input:focus)\": {\n borderStyle: \"solid\",\n },\n },\n ({ hasError, odysseyDesignTokens }) => ({\n padding: `${odysseyDesignTokens.Spacing6} ${odysseyDesignTokens.Spacing3}`,\n border: hasError\n ? `1px solid ${odysseyDesignTokens.PaletteDangerMain}`\n : `1px dashed ${odysseyDesignTokens.HueNeutral300}`,\n borderRadius: odysseyDesignTokens.BorderRadiusMain,\n transition: `border-color ${odysseyDesignTokens.TransitionTimingMain}, box-shadow ${odysseyDesignTokens.TransitionTimingMain}`,\n\n \"&:hover\": {\n borderColor: odysseyDesignTokens.HueNeutral700,\n },\n\n \"&:has(input:focus)\": {\n borderColor: odysseyDesignTokens.FocusOutlineColorPrimary,\n boxShadow: `0 0 0 1px ${odysseyDesignTokens.FocusOutlineColorPrimary}`,\n outline: `${odysseyDesignTokens.FocusOutlineWidthMain} ${odysseyDesignTokens.FocusOutlineStyle} transparent`,\n outlineOffset: odysseyDesignTokens.FocusOutlineOffsetTight,\n },\n\n \"&:has(input:disabled)\": {\n backgroundColor: odysseyDesignTokens.HueNeutral50,\n border: `1px solid ${odysseyDesignTokens.BorderColorDisabled}`,\n color: odysseyDesignTokens.TypographyColorDisabled,\n\n \"&:hover\": {\n borderColor: odysseyDesignTokens.BorderColorDisabled,\n },\n },\n }),\n);\n\nconst ButtonAndInfoContainer = styled.div({\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n});\n\nconst CenterAlignedSupportText = styled.div({\n textAlign: \"center\",\n});\n\nexport type FileUploaderProps = {\n /**\n * an array of file types the user is able to upload. @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/accept#unique_file_type_specifiers for examples\n */\n acceptedFileTypes?: string[];\n /**\n * The label for the `input` element.\n */\n label: string;\n /**\n * Function that is called when the list of ifles to upload is changed\n */\n onChange: (files: File[]) => void;\n /**\n * Either `single` or `multiple`. If `multiple`, multiple files can be uploaded\n */\n type?: (typeof fileUploadTypes)[number];\n /**\n * Either `button`, `dragAndDrop` or `dragAndDropWithIcon`. Will determine how component appears visually\n */\n variant: (typeof fileUploadVariants)[number];\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n>;\n\nconst FileUploader = ({\n acceptedFileTypes,\n errorMessage,\n id,\n isDisabled = false,\n isFullWidth,\n isOptional,\n hint,\n HintLinkComponent,\n label,\n onChange,\n type,\n variant,\n}: FileUploaderProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n const inputRef = useRef<HTMLInputElement>(null);\n const [filesToUpload, setFilesToUpload] = useState<File[]>([]);\n\n useEffect(() => {\n onChange(filesToUpload);\n }, [filesToUpload, onChange]);\n\n const updateFilesToUpload = useCallback(\n (event: ChangeEvent<HTMLInputElement>) => {\n const { files } = event.target;\n\n if (files && files.length > 0) {\n const mergedFiles =\n type === \"multiple\"\n ? filesToUpload.concat(Array.from(files))\n : Array.from(files).slice();\n\n setFilesToUpload(mergedFiles);\n }\n\n // reset input value to allow re-upload of a file with the same name\n event.target.value = \"\";\n },\n [type, filesToUpload],\n );\n\n const triggerFileInputClick = useCallback(() => {\n inputRef.current?.click();\n }, [inputRef]);\n\n const removeFileFromFilesToUploadList = useCallback<(name: string) => void>(\n (name) => {\n const deletedFileFilteredOut = filesToUpload.filter(\n (file) => file.name !== name,\n );\n setFilesToUpload(deletedFileFilteredOut);\n },\n [filesToUpload],\n );\n\n const renderFileInput = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: RenderFieldComponentProps) => {\n const acceptedFileTypesAsString = acceptedFileTypes?.join(\",\");\n\n const Input = () => (\n <input\n accept={acceptedFileTypesAsString}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n disabled={isDisabled}\n id={id}\n multiple={type === \"multiple\"}\n onChange={updateFilesToUpload}\n ref={inputRef}\n title=\"\"\n type=\"file\"\n />\n );\n\n if (variant === \"button\") {\n return (\n <>\n <BaseInputWrapper>\n <Input />\n <Button\n isDisabled={isDisabled}\n label={t(\"fileupload.button.text\")}\n onClick={triggerFileInputClick}\n startIcon={<UploadIcon />}\n variant=\"secondary\"\n />\n </BaseInputWrapper>\n </>\n );\n }\n\n return (\n <>\n <InputContainer\n hasError={Boolean(errorMessage)}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Input />\n <ButtonAndInfoContainer>\n {variant === \"dragAndDropWithIcon\" && <FileUploadIllustration />}\n <CenterAlignedSupportText>\n <Support color=\"textSecondary\">\n {t(\"fileupload.prompt.text\")}\n </Support>\n </CenterAlignedSupportText>\n <Button\n isDisabled={isDisabled}\n label={t(\"fileupload.button.text\")}\n onClick={triggerFileInputClick}\n startIcon={<UploadIcon />}\n variant=\"secondary\"\n />\n </ButtonAndInfoContainer>\n </InputContainer>\n </>\n );\n },\n [\n acceptedFileTypes,\n errorMessage,\n isDisabled,\n inputRef,\n odysseyDesignTokens,\n triggerFileInputClick,\n t,\n type,\n updateFilesToUpload,\n variant,\n ],\n );\n\n return (\n <>\n <Field\n errorMessage={errorMessage}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={id}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth && variant !== \"button\"}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFileInput}\n />\n {filesToUpload.length > 0 && (\n <FileUploadPreview\n fileNames={filesToUpload.map((file) => file.name)}\n isDisabled={isDisabled}\n onFileRemove={removeFileFromFilesToUploadList}\n />\n )}\n </>\n );\n};\n\nconst MemoizedFileUploader = memo(FileUploader);\nMemoizedFileUploader.displayName = \"FileUploader\";\n\nexport { MemoizedFileUploader as FileUpload };\nexport { MemoizedFileUploader as FileUploader };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAEEC,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,OAAO;AAEd,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,KAAK,QAAmC,aAAa;AAE9D,SAASC,cAAc,QAAQ,2BAA2B;AAC1D,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAEEC,sBAAsB,QACjB,kCAAkC;AACzC,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,sBAAsB,QAAQ,6BAA6B;AACpE,SAASC,iBAAiB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE3D,OAAO,MAAMC,eAAe,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAU;AAC9D,OAAO,MAAMC,kBAAkB,GAAG,CAChC,QAAQ,EACR,aAAa,EACb,qBAAqB,CACb;AAEV,MAAMC,gBAAgB,GAAGtB,MAAM,CAACuB,GAAG,CAAC;EAClCC,QAAQ,EAAE,UAAU;EACpBC,SAAS,EAAE,YAAY;EAEvBC,KAAK,EAAE;IACLF,QAAQ,EAAE,UAAU;IACpBG,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,MAAMC,cAAc,GAAG9B,MAAM,CAACsB,gBAAgB,CAAC,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K;MACXC,iBAAiB,EAAEA,iBAAkB;MACrCL,EAAE,EAAEA,EAAG;MACPC,UAAU,EAAEA,UAAW;MACvBC,WAAW,EAAEA,WAAW,IAAIO,OAAO,KAAK,QAAS;MACjDN,UAAU,EAAEA,UAAW;MACvBG,KAAK,EAAEA,KAAM;MACb6C,oBAAoB,EAAElB;IAAgB,CACvC,CAAC,EACDrB,aAAa,CAACM,MAAM,GAAG,CAAC,IACvBvE,IAAA,CAACF,iBAAiB;MAChB2G,SAAS,EAAExC,aAAa,CAACyC,GAAG,CAAErB,IAAI,IAAKA,IAAI,CAACH,IAAI,CAAE;MAClD5B,UAAU,EAAEA,UAAW;MACvBqD,YAAY,EAAE1B;IAAgC,CAC/C,CACF;EAAA,CACD,CAAC;AAEP,CAAC;AAED,MAAM2B,oBAAoB,GAAG1H,IAAI,CAACgE,YAAY,CAAC;AAC/C0D,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIE,UAAU;AAC3C,SAASF,oBAAoB,IAAI1D,YAAY","ignoreList":[]}
@@ -0,0 +1,35 @@
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 { memo } from "react";
14
+ import { useFullScreenOverlayContext } from "./FullScreenOverlayContext.js";
15
+ import { OdysseyProvider } from "./OdysseyProvider.js";
16
+ import { jsx as _jsx } from "react/jsx-runtime";
17
+ const FullScreenOverlay = ({
18
+ children
19
+ }) => {
20
+ const {
21
+ overlayEmotionRootElement,
22
+ overlayShadowRootElement
23
+ } = useFullScreenOverlayContext();
24
+ return _jsx(OdysseyProvider, {
25
+ emotionRootElement: overlayEmotionRootElement,
26
+ hasScopedCssBaseline: false,
27
+ hasWrapperElement: false,
28
+ shadowRootElement: overlayShadowRootElement,
29
+ children: children
30
+ });
31
+ };
32
+ const MemoizedFullScreenOverlay = memo(FullScreenOverlay);
33
+ MemoizedFullScreenOverlay.displayName = "FullScreenOverlay";
34
+ export { MemoizedFullScreenOverlay as FullScreenOverlay };
35
+ //# sourceMappingURL=FullScreenOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullScreenOverlay.js","names":["memo","useFullScreenOverlayContext","OdysseyProvider","jsx","_jsx","FullScreenOverlay","children","overlayEmotionRootElement","overlayShadowRootElement","emotionRootElement","hasScopedCssBaseline","hasWrapperElement","shadowRootElement","MemoizedFullScreenOverlay","displayName"],"sources":["../../src/FullScreenOverlay.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 { memo, type ReactNode } from \"react\";\n\nimport {\n type FullScreenOverlayProviderProps,\n useFullScreenOverlayContext,\n} from \"./FullScreenOverlayContext.js\";\nimport { OdysseyProvider } from \"./OdysseyProvider.js\";\n\nexport type FullScreenOverlayProps = {\n children: ReactNode;\n};\n\nconst FullScreenOverlay = ({ children }: FullScreenOverlayProviderProps) => {\n const { overlayEmotionRootElement, overlayShadowRootElement } =\n useFullScreenOverlayContext();\n\n return (\n <OdysseyProvider\n emotionRootElement={overlayEmotionRootElement}\n hasScopedCssBaseline={false}\n hasWrapperElement={false}\n shadowRootElement={overlayShadowRootElement}\n >\n {children}\n </OdysseyProvider>\n );\n};\n\nconst MemoizedFullScreenOverlay = memo(FullScreenOverlay);\nMemoizedFullScreenOverlay.displayName = \"FullScreenOverlay\";\n\nexport { MemoizedFullScreenOverlay as FullScreenOverlay };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAwB,OAAO;AAE5C,SAEEC,2BAA2B,QACtB,+BAA+B;AACtC,SAASC,eAAe,QAAQ,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMvD,MAAMC,iBAAiB,GAAGA,CAAC;EAAEC;AAAyC,CAAC,KAAK;EAC1E,MAAM;IAAEC,yBAAyB;IAAEC;EAAyB,CAAC,GAC3DP,2BAA2B,CAAC,CAAC;EAE/B,OACEG,IAAA,CAACF,eAAe;IACdO,kBAAkB,EAAEF,yBAA0B;IAC9CG,oBAAoB,EAAE,KAAM;IAC5BC,iBAAiB,EAAE,KAAM;IACzBC,iBAAiB,EAAEJ,wBAAyB;IAAAF,QAAA,EAE3CA;EAAQ,CACM,CAAC;AAEtB,CAAC;AAED,MAAMO,yBAAyB,GAAGb,IAAI,CAACK,iBAAiB,CAAC;AACzDQ,yBAAyB,CAACC,WAAW,GAAG,mBAAmB;AAE3D,SAASD,yBAAyB,IAAIR,iBAAiB","ignoreList":[]}
@@ -0,0 +1,66 @@
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, useEffect, useMemo } from "react";
14
+ import { createShadowDomElements } from "./web-component/createShadowDomElements.js";
15
+ import { jsx as _jsx } from "react/jsx-runtime";
16
+ export const FullScreenOverlayContext = createContext({});
17
+ export const useFullScreenOverlayContext = () => useContext(FullScreenOverlayContext);
18
+ const FullScreenOverlayProvider = ({
19
+ children,
20
+ hasShadowDom,
21
+ overlayParentElement: overlayParentElementProp
22
+ }) => {
23
+ const {
24
+ overlayEmotionRootElement,
25
+ overlayParentElement,
26
+ overlayShadowRootElement
27
+ } = useMemo(() => {
28
+ const overlayParentElement = overlayParentElementProp || document.createElement("div");
29
+ if (hasShadowDom) {
30
+ const {
31
+ emotionRootElement,
32
+ shadowRootElement
33
+ } = createShadowDomElements(overlayParentElement);
34
+ return {
35
+ overlayEmotionRootElement: emotionRootElement,
36
+ overlayParentElement,
37
+ overlayShadowRootElement: shadowRootElement
38
+ };
39
+ }
40
+ return {
41
+ overlayEmotionRootElement: undefined,
42
+ overlayParentElement,
43
+ overlayShadowRootElement: undefined
44
+ };
45
+ }, [hasShadowDom, overlayParentElementProp]);
46
+ useEffect(() => {
47
+ if (overlayParentElement) {
48
+ document.body.append(overlayParentElement);
49
+ }
50
+ return () => {
51
+ overlayParentElement.remove();
52
+ };
53
+ }, [overlayParentElement]);
54
+ const providerValue = useMemo(() => ({
55
+ overlayEmotionRootElement,
56
+ overlayShadowRootElement
57
+ }), [overlayEmotionRootElement, overlayShadowRootElement]);
58
+ return _jsx(FullScreenOverlayContext.Provider, {
59
+ value: providerValue,
60
+ children: children
61
+ });
62
+ };
63
+ const MemoizedFullScreenOverlayProvider = memo(FullScreenOverlayProvider);
64
+ MemoizedFullScreenOverlayProvider.displayName = "FullScreenOverlayProvider";
65
+ export { MemoizedFullScreenOverlayProvider as FullScreenOverlayProvider };
66
+ //# sourceMappingURL=FullScreenOverlayContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullScreenOverlayContext.js","names":["createContext","memo","useContext","useEffect","useMemo","createShadowDomElements","jsx","_jsx","FullScreenOverlayContext","useFullScreenOverlayContext","FullScreenOverlayProvider","children","hasShadowDom","overlayParentElement","overlayParentElementProp","overlayEmotionRootElement","overlayShadowRootElement","document","createElement","emotionRootElement","shadowRootElement","undefined","body","append","remove","providerValue","Provider","value","MemoizedFullScreenOverlayProvider","displayName"],"sources":["../../src/FullScreenOverlayContext.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 {\n createContext,\n memo,\n type ReactNode,\n useContext,\n useEffect,\n useMemo,\n} from \"react\";\n\nimport { createShadowDomElements } from \"./web-component/createShadowDomElements.js\";\n\nexport type FullScreenOverlayContextType = {\n overlayEmotionRootElement?: HTMLDivElement | HTMLElement;\n overlayShadowRootElement?: HTMLDivElement | HTMLElement;\n};\n\nexport const FullScreenOverlayContext =\n createContext<FullScreenOverlayContextType>({});\n\nexport const useFullScreenOverlayContext = () =>\n useContext(FullScreenOverlayContext);\n\nexport type FullScreenOverlayProviderProps = {\n children: ReactNode;\n hasShadowDom?: boolean;\n /**\n * @experimental This is the element overlays will render into. By default, it's set to `document.body`.\n *\n * If you specify this value , it will render overlays into this container, such as the `shadowRootElement` over the document body. Most likely, you don't need to change this value, but you might run into strange issues related iframes and other shadow roots. This is here as a safeguard; not meant to be used.\n */\n overlayParentElement?: HTMLDivElement | HTMLElement;\n};\n\nconst FullScreenOverlayProvider = ({\n children,\n hasShadowDom,\n overlayParentElement: overlayParentElementProp,\n}: FullScreenOverlayProviderProps) => {\n const {\n overlayEmotionRootElement,\n overlayParentElement,\n overlayShadowRootElement,\n } = useMemo(() => {\n const overlayParentElement =\n overlayParentElementProp || document.createElement(\"div\");\n\n if (hasShadowDom) {\n const { emotionRootElement, shadowRootElement } =\n createShadowDomElements(overlayParentElement);\n\n return {\n overlayEmotionRootElement: emotionRootElement,\n overlayParentElement,\n overlayShadowRootElement: shadowRootElement,\n };\n }\n\n return {\n overlayEmotionRootElement: undefined,\n overlayParentElement,\n overlayShadowRootElement: undefined,\n };\n }, [hasShadowDom, overlayParentElementProp]);\n\n useEffect(() => {\n if (overlayParentElement) {\n document.body.append(overlayParentElement);\n }\n\n return () => {\n overlayParentElement.remove();\n };\n }, [overlayParentElement]);\n\n const providerValue = useMemo(\n () => ({\n overlayEmotionRootElement,\n overlayShadowRootElement,\n }),\n [overlayEmotionRootElement, overlayShadowRootElement],\n );\n\n return (\n <FullScreenOverlayContext.Provider value={providerValue}>\n {children}\n </FullScreenOverlayContext.Provider>\n );\n};\n\nconst MemoizedFullScreenOverlayProvider = memo(FullScreenOverlayProvider);\nMemoizedFullScreenOverlayProvider.displayName = \"FullScreenOverlayProvider\";\n\nexport { MemoizedFullScreenOverlayProvider as FullScreenOverlayProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,IAAI,EAEJC,UAAU,EACVC,SAAS,EACTC,OAAO,QACF,OAAO;AAEd,SAASC,uBAAuB,QAAQ,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAOrF,OAAO,MAAMC,wBAAwB,GACnCR,aAAa,CAA+B,CAAC,CAAC,CAAC;AAEjD,OAAO,MAAMS,2BAA2B,GAAGA,CAAA,KACzCP,UAAU,CAACM,wBAAwB,CAAC;AAatC,MAAME,yBAAyB,GAAGA,CAAC;EACjCC,QAAQ;EACRC,YAAY;EACZC,oBAAoB,EAAEC;AACQ,CAAC,KAAK;EACpC,MAAM;IACJC,yBAAyB;I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