@okta/odyssey-react-mui 1.15.8 → 1.20.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 (973) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +4 -0
  3. package/dist/Accordion.js +2 -0
  4. package/dist/Accordion.js.map +1 -1
  5. package/dist/Autocomplete.js +9 -0
  6. package/dist/Autocomplete.js.map +1 -1
  7. package/dist/Badge.js +1 -0
  8. package/dist/Badge.js.map +1 -1
  9. package/dist/Banner.js +6 -5
  10. package/dist/Banner.js.map +1 -1
  11. package/dist/Button.js +15 -11
  12. package/dist/Button.js.map +1 -1
  13. package/dist/Callout.js +45 -7
  14. package/dist/Callout.js.map +1 -1
  15. package/dist/{Tile.js → Card.js} +43 -28
  16. package/dist/Card.js.map +1 -0
  17. package/dist/DataTable/DataTable.js +68 -40
  18. package/dist/DataTable/DataTable.js.map +1 -1
  19. package/dist/DataTable/DataTableRowActions.js.map +1 -1
  20. package/dist/DataTable/constants.js +0 -1
  21. package/dist/DataTable/constants.js.map +1 -1
  22. package/dist/DataTable/index.js +0 -1
  23. package/dist/DataTable/index.js.map +1 -1
  24. package/dist/Dialog.js +9 -3
  25. package/dist/Dialog.js.map +1 -1
  26. package/dist/{labs/Drawer.js → Drawer.js} +5 -5
  27. package/dist/Drawer.js.map +1 -0
  28. package/dist/{DataTable/DataTableEmptyState.js → EmptyState.js} +17 -15
  29. package/dist/EmptyState.js.map +1 -0
  30. package/dist/ErrorMessageList.js +1 -1
  31. package/dist/ErrorMessageList.js.map +1 -1
  32. package/dist/FieldError.js +3 -2
  33. package/dist/FieldError.js.map +1 -1
  34. package/dist/HtmlProps.js.map +1 -1
  35. package/dist/MenuItem.js +1 -0
  36. package/dist/MenuItem.js.map +1 -1
  37. package/dist/OdysseyCacheProvider.js +5 -2
  38. package/dist/OdysseyCacheProvider.js.map +1 -1
  39. package/dist/OdysseyProvider.js +1 -1
  40. package/dist/OdysseyProvider.js.map +1 -1
  41. package/dist/OdysseyTranslationProvider.js +1 -6
  42. package/dist/OdysseyTranslationProvider.js.map +1 -1
  43. package/dist/{DataTable/DataTablePagination.js → Pagination/Pagination.js} +56 -59
  44. package/dist/Pagination/Pagination.js.map +1 -0
  45. package/dist/Pagination/constants.js +14 -0
  46. package/dist/Pagination/constants.js.map +1 -0
  47. package/dist/Pagination/index.js +15 -0
  48. package/dist/Pagination/index.js.map +1 -0
  49. package/dist/Pagination/usePagination.js +51 -0
  50. package/dist/Pagination/usePagination.js.map +1 -0
  51. package/dist/Radio.js +17 -5
  52. package/dist/Radio.js.map +1 -1
  53. package/dist/ScreenReaderText.js +4 -0
  54. package/dist/ScreenReaderText.js.map +1 -1
  55. package/dist/Select.js +33 -42
  56. package/dist/Select.js.map +1 -1
  57. package/dist/Status.js +5 -3
  58. package/dist/Status.js.map +1 -1
  59. package/dist/Surface.js +38 -0
  60. package/dist/Surface.js.map +1 -0
  61. package/dist/Tabs.js +22 -0
  62. package/dist/Tabs.js.map +1 -1
  63. package/dist/TextField.js +48 -0
  64. package/dist/TextField.js.map +1 -1
  65. package/dist/Toast.js +37 -34
  66. package/dist/Toast.js.map +1 -1
  67. package/dist/assertEnv.d.ts +18 -0
  68. package/dist/assertEnv.d.ts.map +1 -0
  69. package/dist/assertEnv.js +32 -0
  70. package/dist/icons.generated/Add.js +1 -1
  71. package/dist/icons.generated/Add.js.map +1 -1
  72. package/dist/icons.generated/AddCircle.js +1 -1
  73. package/dist/icons.generated/AddCircle.js.map +1 -1
  74. package/dist/icons.generated/Apps.js +1 -1
  75. package/dist/icons.generated/Apps.js.map +1 -1
  76. package/dist/icons.generated/ArrowBottom.js +2 -2
  77. package/dist/icons.generated/ArrowBottom.js.map +1 -1
  78. package/dist/icons.generated/ArrowDown.js +1 -1
  79. package/dist/icons.generated/ArrowDown.js.map +1 -1
  80. package/dist/icons.generated/ArrowLeft.js +1 -1
  81. package/dist/icons.generated/ArrowLeft.js.map +1 -1
  82. package/dist/icons.generated/ArrowLowerLeft.js +1 -1
  83. package/dist/icons.generated/ArrowLowerLeft.js.map +1 -1
  84. package/dist/icons.generated/ArrowLowerRight.js +1 -1
  85. package/dist/icons.generated/ArrowLowerRight.js.map +1 -1
  86. package/dist/icons.generated/ArrowRight.js +1 -1
  87. package/dist/icons.generated/ArrowRight.js.map +1 -1
  88. package/dist/icons.generated/ArrowTop.js +2 -2
  89. package/dist/icons.generated/ArrowTop.js.map +1 -1
  90. package/dist/icons.generated/ArrowUnsorted.js +1 -1
  91. package/dist/icons.generated/ArrowUnsorted.js.map +1 -1
  92. package/dist/icons.generated/ArrowUp.js +1 -1
  93. package/dist/icons.generated/ArrowUp.js.map +1 -1
  94. package/dist/icons.generated/ArrowUpperLeft.js +1 -1
  95. package/dist/icons.generated/ArrowUpperLeft.js.map +1 -1
  96. package/dist/icons.generated/ArrowUpperRight.js +1 -1
  97. package/dist/icons.generated/ArrowUpperRight.js.map +1 -1
  98. package/dist/icons.generated/Bug.js +1 -1
  99. package/dist/icons.generated/Bug.js.map +1 -1
  100. package/dist/icons.generated/Calendar.js +1 -1
  101. package/dist/icons.generated/Calendar.js.map +1 -1
  102. package/dist/icons.generated/Call.js +1 -1
  103. package/dist/icons.generated/Call.js.map +1 -1
  104. package/dist/icons.generated/Chat.js +1 -1
  105. package/dist/icons.generated/Chat.js.map +1 -1
  106. package/dist/icons.generated/Check.js +1 -1
  107. package/dist/icons.generated/Check.js.map +1 -1
  108. package/dist/icons.generated/CheckCircleFilled.js +1 -1
  109. package/dist/icons.generated/CheckCircleFilled.js.map +1 -1
  110. package/dist/icons.generated/ChevronDown.js +1 -1
  111. package/dist/icons.generated/ChevronDown.js.map +1 -1
  112. package/dist/icons.generated/ChevronLeft.js +1 -1
  113. package/dist/icons.generated/ChevronLeft.js.map +1 -1
  114. package/dist/icons.generated/ChevronRight.js +1 -1
  115. package/dist/icons.generated/ChevronRight.js.map +1 -1
  116. package/dist/icons.generated/ChevronUp.js +1 -1
  117. package/dist/icons.generated/ChevronUp.js.map +1 -1
  118. package/dist/icons.generated/Clock.js +1 -1
  119. package/dist/icons.generated/Clock.js.map +1 -1
  120. package/dist/icons.generated/Close.js +1 -1
  121. package/dist/icons.generated/Close.js.map +1 -1
  122. package/dist/icons.generated/CloseCircleFilled.js +1 -1
  123. package/dist/icons.generated/CloseCircleFilled.js.map +1 -1
  124. package/dist/icons.generated/CollapseLeft.js +1 -1
  125. package/dist/icons.generated/CollapseLeft.js.map +1 -1
  126. package/dist/icons.generated/CollapseRight.js +1 -1
  127. package/dist/icons.generated/CollapseRight.js.map +1 -1
  128. package/dist/icons.generated/Copy.js +1 -1
  129. package/dist/icons.generated/Copy.js.map +1 -1
  130. package/dist/icons.generated/Custom.js +39 -0
  131. package/dist/icons.generated/Custom.js.map +1 -0
  132. package/dist/icons.generated/DangerDiamond.js +1 -1
  133. package/dist/icons.generated/DangerDiamond.js.map +1 -1
  134. package/dist/icons.generated/DangerDiamondFilled.js +1 -1
  135. package/dist/icons.generated/DangerDiamondFilled.js.map +1 -1
  136. package/dist/icons.generated/Delete.js +1 -1
  137. package/dist/icons.generated/Delete.js.map +1 -1
  138. package/dist/icons.generated/Deny.js +1 -1
  139. package/dist/icons.generated/Deny.js.map +1 -1
  140. package/dist/icons.generated/Devices.js +1 -1
  141. package/dist/icons.generated/Devices.js.map +1 -1
  142. package/dist/icons.generated/Directory.js +1 -1
  143. package/dist/icons.generated/Directory.js.map +1 -1
  144. package/dist/icons.generated/Documentation.js +1 -1
  145. package/dist/icons.generated/Documentation.js.map +1 -1
  146. package/dist/icons.generated/Download.js +1 -1
  147. package/dist/icons.generated/Download.js.map +1 -1
  148. package/dist/icons.generated/DragIndicator.js +1 -1
  149. package/dist/icons.generated/DragIndicator.js.map +1 -1
  150. package/dist/icons.generated/Duo.js +47 -0
  151. package/dist/icons.generated/Duo.js.map +1 -0
  152. package/dist/icons.generated/Edit.js +1 -1
  153. package/dist/icons.generated/Edit.js.map +1 -1
  154. package/dist/icons.generated/Email.js +38 -0
  155. package/dist/icons.generated/Email.js.map +1 -0
  156. package/dist/icons.generated/ExpandLeft.js +1 -1
  157. package/dist/icons.generated/ExpandLeft.js.map +1 -1
  158. package/dist/icons.generated/ExpandRight.js +1 -1
  159. package/dist/icons.generated/ExpandRight.js.map +1 -1
  160. package/dist/icons.generated/ExternalLink.js +1 -1
  161. package/dist/icons.generated/ExternalLink.js.map +1 -1
  162. package/dist/icons.generated/Fido2.js +57 -0
  163. package/dist/icons.generated/Fido2.js.map +1 -0
  164. package/dist/icons.generated/Filter.js +1 -1
  165. package/dist/icons.generated/Filter.js.map +1 -1
  166. package/dist/icons.generated/Folder.js +1 -1
  167. package/dist/icons.generated/Folder.js.map +1 -1
  168. package/dist/icons.generated/Globe.js +1 -1
  169. package/dist/icons.generated/Globe.js.map +1 -1
  170. package/dist/icons.generated/GoogleAuth.js +54 -0
  171. package/dist/icons.generated/GoogleAuth.js.map +1 -0
  172. package/dist/icons.generated/Grid.js +1 -1
  173. package/dist/icons.generated/Grid.js.map +1 -1
  174. package/dist/icons.generated/Group.js +1 -1
  175. package/dist/icons.generated/Group.js.map +1 -1
  176. package/dist/icons.generated/Hide.js +1 -1
  177. package/dist/icons.generated/Hide.js.map +1 -1
  178. package/dist/icons.generated/Home.js +1 -1
  179. package/dist/icons.generated/Home.js.map +1 -1
  180. package/dist/icons.generated/Idp.js +42 -0
  181. package/dist/icons.generated/Idp.js.map +1 -0
  182. package/dist/icons.generated/InformationCircle.js +1 -1
  183. package/dist/icons.generated/InformationCircle.js.map +1 -1
  184. package/dist/icons.generated/InformationCircleFilled.js +1 -1
  185. package/dist/icons.generated/InformationCircleFilled.js.map +1 -1
  186. package/dist/icons.generated/Link.js +1 -1
  187. package/dist/icons.generated/Link.js.map +1 -1
  188. package/dist/icons.generated/List.js +1 -1
  189. package/dist/icons.generated/List.js.map +1 -1
  190. package/dist/icons.generated/Lock.js +1 -1
  191. package/dist/icons.generated/Lock.js.map +1 -1
  192. package/dist/icons.generated/More.js +1 -1
  193. package/dist/icons.generated/More.js.map +1 -1
  194. package/dist/icons.generated/Notification.js +1 -1
  195. package/dist/icons.generated/Notification.js.map +1 -1
  196. package/dist/icons.generated/OktaVerify.js +33 -0
  197. package/dist/icons.generated/OktaVerify.js.map +1 -0
  198. package/dist/icons.generated/OnPremMfa.js +39 -0
  199. package/dist/icons.generated/OnPremMfa.js.map +1 -0
  200. package/dist/icons.generated/OneTimePassword.js +49 -0
  201. package/dist/icons.generated/OneTimePassword.js.map +1 -0
  202. package/dist/icons.generated/Password.js +61 -0
  203. package/dist/icons.generated/Password.js.map +1 -0
  204. package/dist/icons.generated/Pause.js +1 -1
  205. package/dist/icons.generated/Pause.js.map +1 -1
  206. package/dist/icons.generated/QuestionCircle.js +1 -1
  207. package/dist/icons.generated/QuestionCircle.js.map +1 -1
  208. package/dist/icons.generated/QuestionCircleFilled.js +1 -1
  209. package/dist/icons.generated/QuestionCircleFilled.js.map +1 -1
  210. package/dist/icons.generated/Refresh.js +1 -1
  211. package/dist/icons.generated/Refresh.js.map +1 -1
  212. package/dist/icons.generated/Reset.js +1 -1
  213. package/dist/icons.generated/Reset.js.map +1 -1
  214. package/dist/icons.generated/Resume.js +1 -1
  215. package/dist/icons.generated/Resume.js.map +1 -1
  216. package/dist/icons.generated/Search.js +1 -1
  217. package/dist/icons.generated/Search.js.map +1 -1
  218. package/dist/icons.generated/SecurityQuestion.js +41 -0
  219. package/dist/icons.generated/SecurityQuestion.js.map +1 -0
  220. package/dist/icons.generated/Server.js +1 -1
  221. package/dist/icons.generated/Server.js.map +1 -1
  222. package/dist/icons.generated/Settings.js +1 -1
  223. package/dist/icons.generated/Settings.js.map +1 -1
  224. package/dist/icons.generated/Show.js +1 -1
  225. package/dist/icons.generated/Show.js.map +1 -1
  226. package/dist/icons.generated/SmartCard.js +49 -0
  227. package/dist/icons.generated/SmartCard.js.map +1 -0
  228. package/dist/icons.generated/Sms.js +49 -0
  229. package/dist/icons.generated/Sms.js.map +1 -0
  230. package/dist/icons.generated/Subtract.js +1 -1
  231. package/dist/icons.generated/Subtract.js.map +1 -1
  232. package/dist/icons.generated/SymantecVip.js +38 -0
  233. package/dist/icons.generated/SymantecVip.js.map +1 -0
  234. package/dist/icons.generated/Sync.js +1 -1
  235. package/dist/icons.generated/Sync.js.map +1 -1
  236. package/dist/icons.generated/ThumbsDown.js +33 -0
  237. package/dist/icons.generated/ThumbsDown.js.map +1 -0
  238. package/dist/icons.generated/ThumbsUp.js +33 -0
  239. package/dist/icons.generated/ThumbsUp.js.map +1 -0
  240. package/dist/icons.generated/Unlock.js +1 -1
  241. package/dist/icons.generated/Unlock.js.map +1 -1
  242. package/dist/icons.generated/Upload.js +1 -1
  243. package/dist/icons.generated/Upload.js.map +1 -1
  244. package/dist/icons.generated/User.js +1 -1
  245. package/dist/icons.generated/User.js.map +1 -1
  246. package/dist/icons.generated/Video.js +1 -1
  247. package/dist/icons.generated/Video.js.map +1 -1
  248. package/dist/icons.generated/VoiceCall.js +54 -0
  249. package/dist/icons.generated/VoiceCall.js.map +1 -0
  250. package/dist/icons.generated/Warning.js +1 -1
  251. package/dist/icons.generated/Warning.js.map +1 -1
  252. package/dist/icons.generated/WarningFilled.js +1 -1
  253. package/dist/icons.generated/WarningFilled.js.map +1 -1
  254. package/dist/icons.generated/Yubikey.js +31 -0
  255. package/dist/icons.generated/Yubikey.js.map +1 -0
  256. package/dist/icons.generated/index.js +18 -0
  257. package/dist/icons.generated/index.js.map +1 -1
  258. package/dist/index.d.ts +24 -0
  259. package/dist/index.d.ts.map +1 -0
  260. package/dist/index.js +7 -2
  261. package/dist/index.js.map +1 -1
  262. package/dist/index.scss +457 -0
  263. package/dist/labs/DataComponents/BulkActionsMenu.js +77 -0
  264. package/dist/labs/DataComponents/BulkActionsMenu.js.map +1 -0
  265. package/dist/labs/DataComponents/DataStack.js +79 -0
  266. package/dist/labs/DataComponents/DataStack.js.map +1 -0
  267. package/dist/labs/DataComponents/DataTable.js +90 -0
  268. package/dist/labs/DataComponents/DataTable.js.map +1 -0
  269. package/dist/labs/DataComponents/DataView.js +278 -0
  270. package/dist/labs/DataComponents/DataView.js.map +1 -0
  271. package/dist/{src/DataTable/DataTableEmptyState.d.ts → labs/DataComponents/DetailPanel.js} +14 -9
  272. package/dist/labs/DataComponents/DetailPanel.js.map +1 -0
  273. package/dist/labs/DataComponents/LayoutSwitcher.js +53 -0
  274. package/dist/labs/DataComponents/LayoutSwitcher.js.map +1 -0
  275. package/dist/labs/DataComponents/RowActions.js +80 -0
  276. package/dist/labs/DataComponents/RowActions.js.map +1 -0
  277. package/dist/labs/DataComponents/StackCard.js +163 -0
  278. package/dist/labs/DataComponents/StackCard.js.map +1 -0
  279. package/dist/labs/DataComponents/StackContent.js +143 -0
  280. package/dist/labs/DataComponents/StackContent.js.map +1 -0
  281. package/dist/labs/DataComponents/TableContent.js +248 -0
  282. package/dist/labs/DataComponents/TableContent.js.map +1 -0
  283. package/dist/labs/DataComponents/TableSettings.js +96 -0
  284. package/dist/labs/DataComponents/TableSettings.js.map +1 -0
  285. package/dist/labs/DataComponents/componentTypes.js +2 -0
  286. package/dist/labs/DataComponents/componentTypes.js.map +1 -0
  287. package/dist/labs/DataComponents/constants.js +17 -0
  288. package/dist/labs/DataComponents/constants.js.map +1 -0
  289. package/dist/labs/DataComponents/dataTypes.js +2 -0
  290. package/dist/labs/DataComponents/dataTypes.js.map +1 -0
  291. package/dist/labs/DataComponents/fetchData.js +33 -0
  292. package/dist/labs/DataComponents/fetchData.js.map +1 -0
  293. package/dist/labs/DataComponents/index.js +18 -0
  294. package/dist/labs/DataComponents/index.js.map +1 -0
  295. package/dist/labs/DataComponents/tableConstants.js +146 -0
  296. package/dist/labs/DataComponents/tableConstants.js.map +1 -0
  297. package/dist/labs/DataComponents/useFilterConversion.js +58 -0
  298. package/dist/labs/DataComponents/useFilterConversion.js.map +1 -0
  299. package/dist/labs/DataFilters.js +139 -82
  300. package/dist/labs/DataFilters.js.map +1 -1
  301. package/dist/labs/DateField.js +77 -0
  302. package/dist/labs/DateField.js.map +1 -0
  303. package/dist/labs/DatePicker.js +186 -23
  304. package/dist/labs/DatePicker.js.map +1 -1
  305. package/dist/labs/{DatePicker.types.js → DatePicker.types.d.js} +1 -1
  306. package/dist/labs/DatePicker.types.d.js.map +1 -0
  307. package/dist/labs/FileUpload.js +28 -25
  308. package/dist/labs/FileUpload.js.map +1 -1
  309. package/dist/labs/FileUploadIllustration.js +1 -1
  310. package/dist/labs/FileUploadIllustration.js.map +1 -1
  311. package/dist/labs/FileUploadPreview.js +1 -0
  312. package/dist/labs/FileUploadPreview.js.map +1 -1
  313. package/dist/labs/Layout.js +49 -0
  314. package/dist/labs/Layout.js.map +1 -0
  315. package/dist/labs/NavAccordion.js +80 -0
  316. package/dist/labs/NavAccordion.js.map +1 -0
  317. package/dist/labs/PageTemplate.js +140 -0
  318. package/dist/labs/PageTemplate.js.map +1 -0
  319. package/dist/labs/SideNav.js +478 -0
  320. package/dist/labs/SideNav.js.map +1 -0
  321. package/dist/labs/Switch.js +186 -77
  322. package/dist/labs/Switch.js.map +1 -1
  323. package/dist/labs/datePickerTheme.js +138 -80
  324. package/dist/labs/datePickerTheme.js.map +1 -1
  325. package/dist/labs/index.js +5 -1
  326. package/dist/labs/index.js.map +1 -1
  327. package/dist/labs/useDatePickerTranslations.js +71 -0
  328. package/dist/labs/useDatePickerTranslations.js.map +1 -0
  329. package/dist/preset.d.ts +23 -0
  330. package/dist/preset.d.ts.map +1 -0
  331. package/dist/preset.js +35 -0
  332. package/dist/properties/ts/odyssey-react-mui.js +68 -10
  333. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  334. package/dist/properties/ts/odyssey-react-mui_cs.js +77 -2
  335. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  336. package/dist/properties/ts/odyssey-react-mui_da.js +77 -2
  337. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  338. package/dist/properties/ts/odyssey-react-mui_de.js +77 -2
  339. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  340. package/dist/properties/ts/odyssey-react-mui_el.js +77 -2
  341. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  342. package/dist/properties/ts/odyssey-react-mui_es.js +77 -2
  343. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  344. package/dist/properties/ts/odyssey-react-mui_fi.js +77 -2
  345. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  346. package/dist/properties/ts/odyssey-react-mui_fr.js +77 -2
  347. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  348. package/dist/properties/ts/odyssey-react-mui_ht.js +98 -0
  349. package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -0
  350. package/dist/properties/ts/odyssey-react-mui_hu.js +77 -2
  351. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  352. package/dist/properties/ts/odyssey-react-mui_id.js +77 -2
  353. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  354. package/dist/properties/ts/odyssey-react-mui_it.js +77 -2
  355. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  356. package/dist/properties/ts/odyssey-react-mui_ja.js +77 -2
  357. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  358. package/dist/properties/ts/odyssey-react-mui_ko.js +77 -2
  359. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  360. package/dist/properties/ts/odyssey-react-mui_ms.js +77 -2
  361. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  362. package/dist/properties/ts/odyssey-react-mui_nb.js +77 -2
  363. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  364. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +77 -2
  365. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  366. package/dist/properties/ts/odyssey-react-mui_ok_PL.js +34 -3
  367. package/dist/properties/ts/odyssey-react-mui_ok_PL.js.map +1 -1
  368. package/dist/properties/ts/odyssey-react-mui_ok_SK.js +34 -3
  369. package/dist/properties/ts/odyssey-react-mui_ok_SK.js.map +1 -1
  370. package/dist/properties/ts/odyssey-react-mui_pl.js +77 -2
  371. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  372. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +77 -2
  373. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  374. package/dist/properties/ts/odyssey-react-mui_ro.js +77 -2
  375. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  376. package/dist/properties/ts/odyssey-react-mui_ru.js +77 -2
  377. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  378. package/dist/properties/ts/odyssey-react-mui_sv.js +77 -2
  379. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  380. package/dist/properties/ts/odyssey-react-mui_th.js +77 -2
  381. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  382. package/dist/properties/ts/odyssey-react-mui_tr.js +77 -2
  383. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  384. package/dist/properties/ts/odyssey-react-mui_uk.js +77 -2
  385. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  386. package/dist/properties/ts/odyssey-react-mui_vi.js +77 -2
  387. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  388. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +77 -2
  389. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  390. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +77 -2
  391. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  392. package/dist/remUtils.js +14 -0
  393. package/dist/remUtils.js.map +1 -0
  394. package/dist/scripts/generateTestSelectorsJson.d.ts +13 -0
  395. package/dist/scripts/generateTestSelectorsJson.d.ts.map +1 -0
  396. package/dist/src/Accordion.d.ts +1 -1
  397. package/dist/src/Accordion.d.ts.map +1 -1
  398. package/dist/src/Autocomplete.d.ts +7 -1
  399. package/dist/src/Autocomplete.d.ts.map +1 -1
  400. package/dist/src/Badge.d.ts +2 -2
  401. package/dist/src/Badge.d.ts.map +1 -1
  402. package/dist/src/Banner.d.ts.map +1 -1
  403. package/dist/src/Button.d.ts +10 -6
  404. package/dist/src/Button.d.ts.map +1 -1
  405. package/dist/src/Callout.d.ts +38 -2
  406. package/dist/src/Callout.d.ts.map +1 -1
  407. package/dist/src/{Tile.d.ts → Card.d.ts} +6 -27
  408. package/dist/src/Card.d.ts.map +1 -0
  409. package/dist/src/DataTable/DataTable.d.ts +70 -50
  410. package/dist/src/DataTable/DataTable.d.ts.map +1 -1
  411. package/dist/src/DataTable/DataTableRowActions.d.ts +1 -1
  412. package/dist/src/DataTable/DataTableRowActions.d.ts.map +1 -1
  413. package/dist/src/DataTable/constants.d.ts +0 -1
  414. package/dist/src/DataTable/constants.d.ts.map +1 -1
  415. package/dist/src/DataTable/index.d.ts +2 -3
  416. package/dist/src/DataTable/index.d.ts.map +1 -1
  417. package/dist/src/DataTable/reorderDataRowsLocally.d.ts.map +1 -1
  418. package/dist/src/DataTable/useRowReordering.d.ts +3 -3
  419. package/dist/src/DataTable/useRowReordering.d.ts.map +1 -1
  420. package/dist/src/Dialog.d.ts +19 -7
  421. package/dist/src/Dialog.d.ts.map +1 -1
  422. package/dist/src/{labs/Drawer.d.ts → Drawer.d.ts} +3 -3
  423. package/dist/src/Drawer.d.ts.map +1 -0
  424. package/dist/src/EmptyState.d.ts +34 -0
  425. package/dist/src/EmptyState.d.ts.map +1 -0
  426. package/dist/src/ErrorMessageList.d.ts.map +1 -1
  427. package/dist/src/FieldError.d.ts.map +1 -1
  428. package/dist/src/HtmlProps.d.ts +1 -0
  429. package/dist/src/HtmlProps.d.ts.map +1 -1
  430. package/dist/src/MenuItem.d.ts.map +1 -1
  431. package/dist/src/OdysseyCacheProvider.d.ts +6 -2
  432. package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
  433. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  434. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  435. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  436. package/dist/src/Pagination/Pagination.d.ts +70 -0
  437. package/dist/src/Pagination/Pagination.d.ts.map +1 -0
  438. package/dist/src/Pagination/constants.d.ts +13 -0
  439. package/dist/src/Pagination/constants.d.ts.map +1 -0
  440. package/dist/src/Pagination/index.d.ts +15 -0
  441. package/dist/src/Pagination/index.d.ts.map +1 -0
  442. package/dist/src/Pagination/usePagination.d.ts +23 -0
  443. package/dist/src/Pagination/usePagination.d.ts.map +1 -0
  444. package/dist/src/Radio.d.ts +2 -2
  445. package/dist/src/Radio.d.ts.map +1 -1
  446. package/dist/src/ScreenReaderText.d.ts +3 -2
  447. package/dist/src/ScreenReaderText.d.ts.map +1 -1
  448. package/dist/src/Select.d.ts.map +1 -1
  449. package/dist/src/Status.d.ts +7 -2
  450. package/dist/src/Status.d.ts.map +1 -1
  451. package/dist/src/{labs/DatePicker.types.d.ts → Surface.d.ts} +7 -8
  452. package/dist/src/Surface.d.ts.map +1 -0
  453. package/dist/src/Tabs.d.ts +22 -0
  454. package/dist/src/Tabs.d.ts.map +1 -1
  455. package/dist/src/TextField.d.ts +48 -0
  456. package/dist/src/TextField.d.ts.map +1 -1
  457. package/dist/src/Toast.d.ts.map +1 -1
  458. package/dist/src/icons.generated/Add.d.ts +1 -1
  459. package/dist/src/icons.generated/AddCircle.d.ts +1 -1
  460. package/dist/src/icons.generated/Apps.d.ts +1 -1
  461. package/dist/src/icons.generated/ArrowBottom.d.ts +1 -1
  462. package/dist/src/icons.generated/ArrowDown.d.ts +1 -1
  463. package/dist/src/icons.generated/ArrowLeft.d.ts +1 -1
  464. package/dist/src/icons.generated/ArrowLowerLeft.d.ts +1 -1
  465. package/dist/src/icons.generated/ArrowLowerRight.d.ts +1 -1
  466. package/dist/src/icons.generated/ArrowRight.d.ts +1 -1
  467. package/dist/src/icons.generated/ArrowTop.d.ts +1 -1
  468. package/dist/src/icons.generated/ArrowUnsorted.d.ts +1 -1
  469. package/dist/src/icons.generated/ArrowUp.d.ts +1 -1
  470. package/dist/src/icons.generated/ArrowUpperLeft.d.ts +1 -1
  471. package/dist/src/icons.generated/ArrowUpperRight.d.ts +1 -1
  472. package/dist/src/icons.generated/Bug.d.ts +1 -1
  473. package/dist/src/icons.generated/Calendar.d.ts +1 -1
  474. package/dist/src/icons.generated/Call.d.ts +1 -1
  475. package/dist/src/icons.generated/Chat.d.ts +1 -1
  476. package/dist/src/icons.generated/Check.d.ts +1 -1
  477. package/dist/src/icons.generated/CheckCircleFilled.d.ts +1 -1
  478. package/dist/src/icons.generated/ChevronDown.d.ts +1 -1
  479. package/dist/src/icons.generated/ChevronLeft.d.ts +1 -1
  480. package/dist/src/icons.generated/ChevronRight.d.ts +1 -1
  481. package/dist/src/icons.generated/ChevronUp.d.ts +1 -1
  482. package/dist/src/icons.generated/Clock.d.ts +1 -1
  483. package/dist/src/icons.generated/Close.d.ts +1 -1
  484. package/dist/src/icons.generated/CloseCircleFilled.d.ts +1 -1
  485. package/dist/src/icons.generated/CollapseLeft.d.ts +1 -1
  486. package/dist/src/icons.generated/CollapseRight.d.ts +1 -1
  487. package/dist/src/icons.generated/Copy.d.ts +1 -1
  488. package/dist/src/icons.generated/Custom.d.ts +16 -0
  489. package/dist/src/icons.generated/Custom.d.ts.map +1 -0
  490. package/dist/src/icons.generated/DangerDiamond.d.ts +1 -1
  491. package/dist/src/icons.generated/DangerDiamondFilled.d.ts +1 -1
  492. package/dist/src/icons.generated/Delete.d.ts +1 -1
  493. package/dist/src/icons.generated/Deny.d.ts +1 -1
  494. package/dist/src/icons.generated/Devices.d.ts +1 -1
  495. package/dist/src/icons.generated/Directory.d.ts +1 -1
  496. package/dist/src/icons.generated/Documentation.d.ts +1 -1
  497. package/dist/src/icons.generated/Download.d.ts +1 -1
  498. package/dist/src/icons.generated/DragIndicator.d.ts +1 -1
  499. package/dist/src/icons.generated/Duo.d.ts +16 -0
  500. package/dist/src/icons.generated/Duo.d.ts.map +1 -0
  501. package/dist/src/icons.generated/Edit.d.ts +1 -1
  502. package/dist/src/icons.generated/Email.d.ts +16 -0
  503. package/dist/src/icons.generated/Email.d.ts.map +1 -0
  504. package/dist/src/icons.generated/ExpandLeft.d.ts +1 -1
  505. package/dist/src/icons.generated/ExpandRight.d.ts +1 -1
  506. package/dist/src/icons.generated/ExternalLink.d.ts +1 -1
  507. package/dist/src/icons.generated/Fido2.d.ts +16 -0
  508. package/dist/src/icons.generated/Fido2.d.ts.map +1 -0
  509. package/dist/src/icons.generated/Filter.d.ts +1 -1
  510. package/dist/src/icons.generated/Folder.d.ts +1 -1
  511. package/dist/src/icons.generated/Globe.d.ts +1 -1
  512. package/dist/src/icons.generated/GoogleAuth.d.ts +16 -0
  513. package/dist/src/icons.generated/GoogleAuth.d.ts.map +1 -0
  514. package/dist/src/icons.generated/Grid.d.ts +1 -1
  515. package/dist/src/icons.generated/Group.d.ts +1 -1
  516. package/dist/src/icons.generated/Hide.d.ts +1 -1
  517. package/dist/src/icons.generated/Home.d.ts +1 -1
  518. package/dist/src/icons.generated/Idp.d.ts +16 -0
  519. package/dist/src/icons.generated/Idp.d.ts.map +1 -0
  520. package/dist/src/icons.generated/InformationCircle.d.ts +1 -1
  521. package/dist/src/icons.generated/InformationCircleFilled.d.ts +1 -1
  522. package/dist/src/icons.generated/Link.d.ts +1 -1
  523. package/dist/src/icons.generated/List.d.ts +1 -1
  524. package/dist/src/icons.generated/Lock.d.ts +1 -1
  525. package/dist/src/icons.generated/More.d.ts +1 -1
  526. package/dist/src/icons.generated/Notification.d.ts +1 -1
  527. package/dist/src/icons.generated/OktaVerify.d.ts +16 -0
  528. package/dist/src/icons.generated/OktaVerify.d.ts.map +1 -0
  529. package/dist/src/icons.generated/OnPremMfa.d.ts +16 -0
  530. package/dist/src/icons.generated/OnPremMfa.d.ts.map +1 -0
  531. package/dist/src/icons.generated/OneTimePassword.d.ts +16 -0
  532. package/dist/src/icons.generated/OneTimePassword.d.ts.map +1 -0
  533. package/dist/src/icons.generated/Password.d.ts +16 -0
  534. package/dist/src/icons.generated/Password.d.ts.map +1 -0
  535. package/dist/src/icons.generated/Pause.d.ts +1 -1
  536. package/dist/src/icons.generated/QuestionCircle.d.ts +1 -1
  537. package/dist/src/icons.generated/QuestionCircleFilled.d.ts +1 -1
  538. package/dist/src/icons.generated/Refresh.d.ts +1 -1
  539. package/dist/src/icons.generated/Reset.d.ts +1 -1
  540. package/dist/src/icons.generated/Resume.d.ts +1 -1
  541. package/dist/src/icons.generated/Search.d.ts +1 -1
  542. package/dist/src/icons.generated/SecurityQuestion.d.ts +16 -0
  543. package/dist/src/icons.generated/SecurityQuestion.d.ts.map +1 -0
  544. package/dist/src/icons.generated/Server.d.ts +1 -1
  545. package/dist/src/icons.generated/Settings.d.ts +1 -1
  546. package/dist/src/icons.generated/Show.d.ts +1 -1
  547. package/dist/src/icons.generated/SmartCard.d.ts +16 -0
  548. package/dist/src/icons.generated/SmartCard.d.ts.map +1 -0
  549. package/dist/src/icons.generated/Sms.d.ts +16 -0
  550. package/dist/src/icons.generated/Sms.d.ts.map +1 -0
  551. package/dist/src/icons.generated/Subtract.d.ts +1 -1
  552. package/dist/src/icons.generated/SymantecVip.d.ts +16 -0
  553. package/dist/src/icons.generated/SymantecVip.d.ts.map +1 -0
  554. package/dist/src/icons.generated/Sync.d.ts +1 -1
  555. package/dist/src/icons.generated/ThumbsDown.d.ts +16 -0
  556. package/dist/src/icons.generated/ThumbsDown.d.ts.map +1 -0
  557. package/dist/src/icons.generated/ThumbsUp.d.ts +16 -0
  558. package/dist/src/icons.generated/ThumbsUp.d.ts.map +1 -0
  559. package/dist/src/icons.generated/Unlock.d.ts +1 -1
  560. package/dist/src/icons.generated/Upload.d.ts +1 -1
  561. package/dist/src/icons.generated/User.d.ts +1 -1
  562. package/dist/src/icons.generated/Video.d.ts +1 -1
  563. package/dist/src/icons.generated/VoiceCall.d.ts +16 -0
  564. package/dist/src/icons.generated/VoiceCall.d.ts.map +1 -0
  565. package/dist/src/icons.generated/Warning.d.ts +1 -1
  566. package/dist/src/icons.generated/WarningFilled.d.ts +1 -1
  567. package/dist/src/icons.generated/Yubikey.d.ts +16 -0
  568. package/dist/src/icons.generated/Yubikey.d.ts.map +1 -0
  569. package/dist/src/icons.generated/index.d.ts +18 -0
  570. package/dist/src/icons.generated/index.d.ts.map +1 -1
  571. package/dist/src/index.d.ts +7 -2
  572. package/dist/src/index.d.ts.map +1 -1
  573. package/dist/src/inputUtils.d.ts.map +1 -1
  574. package/dist/src/labs/DataComponents/BulkActionsMenu.d.ts +23 -0
  575. package/dist/src/labs/DataComponents/BulkActionsMenu.d.ts.map +1 -0
  576. package/dist/src/labs/DataComponents/DataStack.d.ts +21 -0
  577. package/dist/src/labs/DataComponents/DataStack.d.ts.map +1 -0
  578. package/dist/src/labs/DataComponents/DataTable.d.ts +17 -0
  579. package/dist/src/labs/DataComponents/DataTable.d.ts.map +1 -0
  580. package/dist/src/labs/DataComponents/DataView.d.ts +17 -0
  581. package/dist/src/labs/DataComponents/DataView.d.ts.map +1 -0
  582. package/dist/src/labs/DataComponents/DetailPanel.d.ts +20 -0
  583. package/dist/src/labs/DataComponents/DetailPanel.d.ts.map +1 -0
  584. package/dist/src/labs/DataComponents/LayoutSwitcher.d.ts +21 -0
  585. package/dist/src/labs/DataComponents/LayoutSwitcher.d.ts.map +1 -0
  586. package/dist/src/labs/DataComponents/RowActions.d.ts +31 -0
  587. package/dist/src/labs/DataComponents/RowActions.d.ts.map +1 -0
  588. package/dist/src/labs/DataComponents/StackCard.d.ts +36 -0
  589. package/dist/src/labs/DataComponents/StackCard.d.ts.map +1 -0
  590. package/dist/src/labs/DataComponents/StackContent.d.ts +64 -0
  591. package/dist/src/labs/DataComponents/StackContent.d.ts.map +1 -0
  592. package/dist/src/labs/DataComponents/TableContent.d.ts +66 -0
  593. package/dist/src/labs/DataComponents/TableContent.d.ts.map +1 -0
  594. package/dist/src/labs/DataComponents/TableSettings.d.ts +21 -0
  595. package/dist/src/labs/DataComponents/TableSettings.d.ts.map +1 -0
  596. package/dist/src/labs/DataComponents/componentTypes.d.ts +81 -0
  597. package/dist/src/labs/DataComponents/componentTypes.d.ts.map +1 -0
  598. package/dist/src/labs/DataComponents/constants.d.ts +16 -0
  599. package/dist/src/labs/DataComponents/constants.d.ts.map +1 -0
  600. package/dist/src/labs/DataComponents/dataTypes.d.ts +52 -0
  601. package/dist/src/labs/DataComponents/dataTypes.d.ts.map +1 -0
  602. package/dist/src/labs/DataComponents/fetchData.d.ts +26 -0
  603. package/dist/src/labs/DataComponents/fetchData.d.ts.map +1 -0
  604. package/dist/src/labs/DataComponents/index.d.ts +18 -0
  605. package/dist/src/labs/DataComponents/index.d.ts.map +1 -0
  606. package/dist/src/labs/DataComponents/tableConstants.d.ts +100 -0
  607. package/dist/src/labs/DataComponents/tableConstants.d.ts.map +1 -0
  608. package/dist/src/labs/DataComponents/useFilterConversion.d.ts +20 -0
  609. package/dist/src/labs/DataComponents/useFilterConversion.d.ts.map +1 -0
  610. package/dist/src/labs/DataFilters.d.ts +14 -7
  611. package/dist/src/labs/DataFilters.d.ts.map +1 -1
  612. package/dist/src/labs/DateField.d.ts +23 -0
  613. package/dist/src/labs/DateField.d.ts.map +1 -0
  614. package/dist/src/labs/DatePicker.d.ts +31 -8
  615. package/dist/src/labs/DatePicker.d.ts.map +1 -1
  616. package/dist/src/labs/FileUpload.d.ts +2 -2
  617. package/dist/src/labs/FileUpload.d.ts.map +1 -1
  618. package/dist/src/labs/FileUploadPreview.d.ts.map +1 -1
  619. package/dist/src/labs/GroupPicker.d.ts.map +1 -1
  620. package/dist/src/labs/Layout.d.ts +28 -0
  621. package/dist/src/labs/Layout.d.ts.map +1 -0
  622. package/dist/src/labs/NavAccordion.d.ts +52 -0
  623. package/dist/src/labs/NavAccordion.d.ts.map +1 -0
  624. package/dist/src/labs/PageTemplate.d.ts +57 -0
  625. package/dist/src/labs/PageTemplate.d.ts.map +1 -0
  626. package/dist/src/labs/PaginatedTable.d.ts.map +1 -1
  627. package/dist/src/labs/SideNav.d.ts +120 -0
  628. package/dist/src/labs/SideNav.d.ts.map +1 -0
  629. package/dist/src/labs/StaticTable.d.ts.map +1 -1
  630. package/dist/src/labs/Switch.d.ts +3 -7
  631. package/dist/src/labs/Switch.d.ts.map +1 -1
  632. package/dist/src/labs/datePickerTheme.d.ts.map +1 -1
  633. package/dist/src/labs/index.d.ts +5 -1
  634. package/dist/src/labs/index.d.ts.map +1 -1
  635. package/dist/src/labs/useDatePickerTranslations.d.ts +15 -0
  636. package/dist/src/labs/useDatePickerTranslations.d.ts.map +1 -0
  637. package/dist/src/properties/ts/odyssey-react-mui.d.ts +66 -8
  638. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  639. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +77 -2
  640. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  641. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +77 -2
  642. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  643. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +77 -2
  644. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  645. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +77 -2
  646. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  647. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +77 -2
  648. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  649. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +77 -2
  650. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  651. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +77 -2
  652. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  653. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts +98 -0
  654. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -0
  655. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +77 -2
  656. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  657. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +77 -2
  658. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  659. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +77 -2
  660. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  661. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +77 -2
  662. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  663. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +77 -2
  664. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  665. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +77 -2
  666. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  667. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +77 -2
  668. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  669. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +77 -2
  670. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  671. package/dist/src/properties/ts/odyssey-react-mui_ok_PL.d.ts +33 -2
  672. package/dist/src/properties/ts/odyssey-react-mui_ok_PL.d.ts.map +1 -1
  673. package/dist/src/properties/ts/odyssey-react-mui_ok_SK.d.ts +33 -2
  674. package/dist/src/properties/ts/odyssey-react-mui_ok_SK.d.ts.map +1 -1
  675. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +77 -2
  676. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  677. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +77 -2
  678. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  679. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +77 -2
  680. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  681. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +77 -2
  682. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  683. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +77 -2
  684. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  685. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +77 -2
  686. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  687. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +77 -2
  688. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  689. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +77 -2
  690. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  691. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +77 -2
  692. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  693. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +77 -2
  694. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  695. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +77 -2
  696. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  697. package/dist/src/remUtils.d.ts +24 -0
  698. package/dist/src/remUtils.d.ts.map +1 -0
  699. package/dist/src/test-selectors/featureTestSelector.d.ts +31 -0
  700. package/dist/src/test-selectors/featureTestSelector.d.ts.map +1 -0
  701. package/dist/src/test-selectors/index.d.ts +15 -0
  702. package/dist/src/test-selectors/index.d.ts.map +1 -0
  703. package/dist/src/test-selectors/odysseyTestSelectors.d.ts +120 -0
  704. package/dist/src/test-selectors/odysseyTestSelectors.d.ts.map +1 -0
  705. package/dist/src/test-selectors/querySelector.d.ts +3632 -0
  706. package/dist/src/test-selectors/querySelector.d.ts.map +1 -0
  707. package/dist/src/theme/components.d.ts +1 -1
  708. package/dist/src/theme/components.d.ts.map +1 -1
  709. package/dist/src/theme/components.types.d.ts +5 -3
  710. package/dist/src/theme/components.types.d.ts.map +1 -1
  711. package/dist/src/theme/createOdysseyMuiTheme.d.ts +1 -1
  712. package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
  713. package/dist/src/theme/mixins.d.ts.map +1 -1
  714. package/dist/src/theme/palette.d.ts.map +1 -1
  715. package/dist/src/theme/shape.d.ts.map +1 -1
  716. package/dist/src/theme/spacing.d.ts.map +1 -1
  717. package/dist/src/theme/typography.d.ts.map +1 -1
  718. package/dist/test-selectors/featureTestSelector.js +2 -0
  719. package/dist/test-selectors/featureTestSelector.js.map +1 -0
  720. package/dist/test-selectors/index.js +15 -0
  721. package/dist/test-selectors/index.js.map +1 -0
  722. package/dist/test-selectors/odysseyTestSelectors.js +20 -0
  723. package/dist/test-selectors/odysseyTestSelectors.js.map +1 -0
  724. package/dist/test-selectors/querySelector.js +78 -0
  725. package/dist/test-selectors/querySelector.js.map +1 -0
  726. package/dist/test-selectors/testSelectors.json +1 -0
  727. package/dist/theme/components.js +261 -181
  728. package/dist/theme/components.js.map +1 -1
  729. package/dist/theme/components.types.js.map +1 -1
  730. package/dist/tsconfig.production.tsbuildinfo +1 -1
  731. package/dist/tsconfig.tsbuildinfo +1 -0
  732. package/i18n.config.json +3 -1
  733. package/package.json +13 -5
  734. package/scripts/generateTestSelectorsJson.ts +28 -0
  735. package/src/Accordion.tsx +3 -0
  736. package/src/Autocomplete.tsx +13 -0
  737. package/src/Badge.tsx +4 -3
  738. package/src/Banner.tsx +4 -4
  739. package/src/Button.tsx +30 -16
  740. package/src/Callout.tsx +59 -12
  741. package/src/{Tile.tsx → Card.tsx} +63 -57
  742. package/src/DataTable/DataTable.tsx +195 -108
  743. package/src/DataTable/DataTableRowActions.tsx +1 -1
  744. package/src/DataTable/constants.ts +0 -1
  745. package/src/DataTable/index.tsx +2 -2
  746. package/src/Dialog.tsx +38 -13
  747. package/src/{labs/Drawer.tsx → Drawer.tsx} +10 -9
  748. package/src/{DataTable/DataTableEmptyState.tsx → EmptyState.tsx} +34 -19
  749. package/src/ErrorMessageList.tsx +6 -1
  750. package/src/FieldError.tsx +10 -5
  751. package/src/HtmlProps.ts +1 -0
  752. package/src/MenuItem.tsx +1 -0
  753. package/src/OdysseyCacheProvider.tsx +11 -3
  754. package/src/OdysseyProvider.tsx +1 -1
  755. package/src/OdysseyTranslationProvider.tsx +1 -17
  756. package/src/{DataTable/DataTablePagination.tsx → Pagination/Pagination.tsx} +107 -74
  757. package/src/Pagination/constants.ts +13 -0
  758. package/src/Pagination/index.ts +15 -0
  759. package/src/Pagination/usePagination.ts +49 -0
  760. package/src/Radio.tsx +18 -6
  761. package/src/ScreenReaderText.tsx +15 -3
  762. package/src/Select.tsx +84 -92
  763. package/src/Status.tsx +14 -2
  764. package/src/Surface.tsx +48 -0
  765. package/src/Tabs.tsx +24 -0
  766. package/src/TextField.tsx +50 -0
  767. package/src/Toast.tsx +44 -40
  768. package/src/icons.generated/Add.tsx +1 -1
  769. package/src/icons.generated/AddCircle.tsx +1 -1
  770. package/src/icons.generated/Apps.tsx +1 -1
  771. package/src/icons.generated/ArrowBottom.tsx +2 -2
  772. package/src/icons.generated/ArrowDown.tsx +1 -1
  773. package/src/icons.generated/ArrowLeft.tsx +1 -1
  774. package/src/icons.generated/ArrowLowerLeft.tsx +1 -1
  775. package/src/icons.generated/ArrowLowerRight.tsx +1 -1
  776. package/src/icons.generated/ArrowRight.tsx +1 -1
  777. package/src/icons.generated/ArrowTop.tsx +2 -2
  778. package/src/icons.generated/ArrowUnsorted.tsx +1 -1
  779. package/src/icons.generated/ArrowUp.tsx +1 -1
  780. package/src/icons.generated/ArrowUpperLeft.tsx +1 -1
  781. package/src/icons.generated/ArrowUpperRight.tsx +1 -1
  782. package/src/icons.generated/Bug.tsx +1 -1
  783. package/src/icons.generated/Calendar.tsx +1 -1
  784. package/src/icons.generated/Call.tsx +1 -1
  785. package/src/icons.generated/Chat.tsx +1 -1
  786. package/src/icons.generated/Check.tsx +1 -1
  787. package/src/icons.generated/CheckCircleFilled.tsx +1 -1
  788. package/src/icons.generated/ChevronDown.tsx +1 -1
  789. package/src/icons.generated/ChevronLeft.tsx +1 -1
  790. package/src/icons.generated/ChevronRight.tsx +1 -1
  791. package/src/icons.generated/ChevronUp.tsx +1 -1
  792. package/src/icons.generated/Clock.tsx +1 -1
  793. package/src/icons.generated/Close.tsx +1 -1
  794. package/src/icons.generated/CloseCircleFilled.tsx +1 -1
  795. package/src/icons.generated/CollapseLeft.tsx +1 -1
  796. package/src/icons.generated/CollapseRight.tsx +1 -1
  797. package/src/icons.generated/Copy.tsx +1 -1
  798. package/src/icons.generated/Custom.tsx +49 -0
  799. package/src/icons.generated/DangerDiamond.tsx +1 -1
  800. package/src/icons.generated/DangerDiamondFilled.tsx +1 -1
  801. package/src/icons.generated/Delete.tsx +1 -1
  802. package/src/icons.generated/Deny.tsx +1 -1
  803. package/src/icons.generated/Devices.tsx +1 -1
  804. package/src/icons.generated/Directory.tsx +1 -1
  805. package/src/icons.generated/Documentation.tsx +1 -1
  806. package/src/icons.generated/Download.tsx +1 -1
  807. package/src/icons.generated/DragIndicator.tsx +1 -1
  808. package/src/icons.generated/Duo.tsx +59 -0
  809. package/src/icons.generated/Edit.tsx +1 -1
  810. package/src/icons.generated/Email.tsx +48 -0
  811. package/src/icons.generated/ExpandLeft.tsx +1 -1
  812. package/src/icons.generated/ExpandRight.tsx +1 -1
  813. package/src/icons.generated/ExternalLink.tsx +1 -1
  814. package/src/icons.generated/Fido2.tsx +71 -0
  815. package/src/icons.generated/Filter.tsx +1 -1
  816. package/src/icons.generated/Folder.tsx +1 -1
  817. package/src/icons.generated/Globe.tsx +1 -1
  818. package/src/icons.generated/GoogleAuth.tsx +67 -0
  819. package/src/icons.generated/Grid.tsx +1 -1
  820. package/src/icons.generated/Group.tsx +1 -1
  821. package/src/icons.generated/Hide.tsx +1 -1
  822. package/src/icons.generated/Home.tsx +1 -1
  823. package/src/icons.generated/Idp.tsx +51 -0
  824. package/src/icons.generated/InformationCircle.tsx +1 -1
  825. package/src/icons.generated/InformationCircleFilled.tsx +1 -1
  826. package/src/icons.generated/Link.tsx +1 -1
  827. package/src/icons.generated/List.tsx +1 -1
  828. package/src/icons.generated/Lock.tsx +1 -1
  829. package/src/icons.generated/More.tsx +1 -1
  830. package/src/icons.generated/Notification.tsx +1 -1
  831. package/src/icons.generated/OktaVerify.tsx +43 -0
  832. package/src/icons.generated/OnPremMfa.tsx +49 -0
  833. package/src/icons.generated/OneTimePassword.tsx +63 -0
  834. package/src/icons.generated/Password.tsx +77 -0
  835. package/src/icons.generated/Pause.tsx +1 -1
  836. package/src/icons.generated/QuestionCircle.tsx +1 -1
  837. package/src/icons.generated/QuestionCircleFilled.tsx +1 -1
  838. package/src/icons.generated/Refresh.tsx +1 -1
  839. package/src/icons.generated/Reset.tsx +1 -1
  840. package/src/icons.generated/Resume.tsx +1 -1
  841. package/src/icons.generated/Search.tsx +1 -1
  842. package/src/icons.generated/SecurityQuestion.tsx +48 -0
  843. package/src/icons.generated/Server.tsx +1 -1
  844. package/src/icons.generated/Settings.tsx +1 -1
  845. package/src/icons.generated/Show.tsx +1 -1
  846. package/src/icons.generated/SmartCard.tsx +62 -0
  847. package/src/icons.generated/Sms.tsx +52 -0
  848. package/src/icons.generated/Subtract.tsx +1 -1
  849. package/src/icons.generated/SymantecVip.tsx +49 -0
  850. package/src/icons.generated/Sync.tsx +1 -1
  851. package/src/icons.generated/ThumbsDown.tsx +43 -0
  852. package/src/icons.generated/ThumbsUp.tsx +43 -0
  853. package/src/icons.generated/Unlock.tsx +1 -1
  854. package/src/icons.generated/Upload.tsx +1 -1
  855. package/src/icons.generated/User.tsx +1 -1
  856. package/src/icons.generated/Video.tsx +1 -1
  857. package/src/icons.generated/VoiceCall.tsx +59 -0
  858. package/src/icons.generated/Warning.tsx +1 -1
  859. package/src/icons.generated/WarningFilled.tsx +1 -1
  860. package/src/icons.generated/Yubikey.tsx +41 -0
  861. package/src/icons.generated/index.ts +18 -0
  862. package/src/index.ts +7 -2
  863. package/src/labs/DataComponents/BulkActionsMenu.tsx +97 -0
  864. package/src/labs/DataComponents/DataStack.tsx +99 -0
  865. package/src/labs/DataComponents/DataTable.tsx +111 -0
  866. package/src/labs/DataComponents/DataView.tsx +394 -0
  867. package/src/labs/DataComponents/DetailPanel.tsx +31 -0
  868. package/src/labs/DataComponents/LayoutSwitcher.tsx +73 -0
  869. package/src/labs/DataComponents/RowActions.tsx +122 -0
  870. package/src/labs/DataComponents/StackCard.tsx +256 -0
  871. package/src/labs/DataComponents/StackContent.tsx +254 -0
  872. package/src/labs/DataComponents/TableContent.tsx +390 -0
  873. package/src/labs/DataComponents/TableSettings.tsx +138 -0
  874. package/src/labs/DataComponents/componentTypes.ts +111 -0
  875. package/src/labs/DataComponents/constants.tsx +20 -0
  876. package/src/labs/DataComponents/dataTypes.ts +77 -0
  877. package/src/labs/DataComponents/fetchData.ts +47 -0
  878. package/src/labs/DataComponents/index.tsx +19 -0
  879. package/src/labs/DataComponents/tableConstants.tsx +162 -0
  880. package/src/labs/DataComponents/useFilterConversion.ts +92 -0
  881. package/src/labs/DataFilters.tsx +250 -162
  882. package/src/labs/DateField.tsx +119 -0
  883. package/src/labs/DatePicker.tsx +304 -31
  884. package/src/labs/{DatePicker.types.ts → DatePicker.types.d.ts} +0 -10
  885. package/src/labs/FileUpload.tsx +30 -21
  886. package/src/labs/FileUploadIllustration.tsx +1 -1
  887. package/src/labs/FileUploadPreview.tsx +1 -0
  888. package/src/labs/Layout.tsx +85 -0
  889. package/src/labs/NavAccordion.tsx +133 -0
  890. package/src/labs/PageTemplate.tsx +225 -0
  891. package/src/labs/SideNav.tsx +745 -0
  892. package/src/labs/Switch.tsx +240 -119
  893. package/src/labs/datePickerTheme.tsx +119 -83
  894. package/src/labs/index.ts +7 -1
  895. package/src/labs/useDatePickerTranslations.ts +92 -0
  896. package/src/properties/odyssey-react-mui.properties +76 -10
  897. package/src/properties/translations/odyssey-react-mui_cs.properties +92 -2
  898. package/src/properties/translations/odyssey-react-mui_da.properties +92 -2
  899. package/src/properties/translations/odyssey-react-mui_de.properties +92 -2
  900. package/src/properties/translations/odyssey-react-mui_el.properties +92 -2
  901. package/src/properties/translations/odyssey-react-mui_es.properties +92 -2
  902. package/src/properties/translations/odyssey-react-mui_fi.properties +92 -2
  903. package/src/properties/translations/odyssey-react-mui_fr.properties +92 -2
  904. package/src/properties/translations/odyssey-react-mui_ht.properties +112 -0
  905. package/src/properties/translations/odyssey-react-mui_hu.properties +92 -2
  906. package/src/properties/translations/odyssey-react-mui_id.properties +92 -2
  907. package/src/properties/translations/odyssey-react-mui_it.properties +92 -2
  908. package/src/properties/translations/odyssey-react-mui_ja.properties +92 -2
  909. package/src/properties/translations/odyssey-react-mui_ko.properties +92 -2
  910. package/src/properties/translations/odyssey-react-mui_ms.properties +92 -2
  911. package/src/properties/translations/odyssey-react-mui_nb.properties +92 -2
  912. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +92 -2
  913. package/src/properties/translations/odyssey-react-mui_ok_PL.properties +33 -2
  914. package/src/properties/translations/odyssey-react-mui_ok_SK.properties +33 -2
  915. package/src/properties/translations/odyssey-react-mui_pl.properties +92 -2
  916. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +92 -2
  917. package/src/properties/translations/odyssey-react-mui_ro.properties +92 -2
  918. package/src/properties/translations/odyssey-react-mui_ru.properties +92 -2
  919. package/src/properties/translations/odyssey-react-mui_sv.properties +92 -2
  920. package/src/properties/translations/odyssey-react-mui_th.properties +92 -2
  921. package/src/properties/translations/odyssey-react-mui_tr.properties +92 -2
  922. package/src/properties/translations/odyssey-react-mui_uk.properties +92 -2
  923. package/src/properties/translations/odyssey-react-mui_vi.properties +92 -2
  924. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +92 -2
  925. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +92 -2
  926. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  927. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  928. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  929. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  930. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  931. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  932. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  933. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  934. package/src/properties/ts/odyssey-react-mui_ht.ts +1 -0
  935. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  936. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  937. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  938. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  939. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  940. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  941. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  942. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  943. package/src/properties/ts/odyssey-react-mui_ok_PL.ts +1 -1
  944. package/src/properties/ts/odyssey-react-mui_ok_SK.ts +1 -1
  945. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  946. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  947. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  948. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  949. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  950. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  951. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  952. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  953. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  954. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  955. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  956. package/src/remUtils.ts +27 -0
  957. package/src/test-selectors/featureTestSelector.ts +41 -0
  958. package/src/test-selectors/index.ts +15 -0
  959. package/src/test-selectors/odysseyTestSelectors.ts +22 -0
  960. package/src/test-selectors/querySelector.ts +198 -0
  961. package/src/theme/components.tsx +285 -192
  962. package/src/theme/components.types.ts +5 -3
  963. package/dist/DataTable/DataTableEmptyState.js.map +0 -1
  964. package/dist/DataTable/DataTablePagination.js.map +0 -1
  965. package/dist/Tile.js.map +0 -1
  966. package/dist/labs/DatePicker.types.js.map +0 -1
  967. package/dist/labs/Drawer.js.map +0 -1
  968. package/dist/src/DataTable/DataTableEmptyState.d.ts.map +0 -1
  969. package/dist/src/DataTable/DataTablePagination.d.ts +0 -33
  970. package/dist/src/DataTable/DataTablePagination.d.ts.map +0 -1
  971. package/dist/src/Tile.d.ts.map +0 -1
  972. package/dist/src/labs/DatePicker.types.d.ts.map +0 -1
  973. package/dist/src/labs/Drawer.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableRowActions.js","names":["memo","useCallback","MenuItem","MenuButton","ArrowBottomIcon","ArrowDownIcon","ArrowTopIcon","ArrowUpIcon","MoreIcon","Trans","useTranslation","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DataTableRowActions","row","rowIndex","rowActionButtons","rowActionMenuItems","totalRows","updateRowOrder","t","handleToFrontClick","rowId","id","newRowIndex","handleForwardClick","Math","max","handleBackwardClick","handleToBackClick","_Box","display","children","endIcon","size","buttonVariant","ariaLabel","menuAlignment","isDisabled","onClick","i18nKey","MemoizedDataTableRowActions","displayName"],"sources":["../../src/DataTable/DataTableRowActions.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 { MRT_Row, MRT_RowData } from \"material-react-table\";\nimport { Fragment, ReactElement, memo, useCallback } from \"react\";\nimport { Button } from \"../Button\";\nimport { MenuItem } from \"../MenuItem\";\nimport { Box as MuiBox } from \"@mui/material\";\nimport { MenuButton, MenuButtonProps } from \"../MenuButton\";\nimport {\n ArrowBottomIcon,\n ArrowDownIcon,\n ArrowTopIcon,\n ArrowUpIcon,\n MoreIcon,\n} from \"../icons.generated\";\nimport { DataTableProps } from \"./DataTable\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nexport type DataTableRowActionsProps = {\n row: MRT_Row<MRT_RowData>;\n rowIndex: number;\n rowActionButtons?: (\n row: MRT_RowData,\n ) => ReactElement<typeof Button | typeof Fragment>;\n rowActionMenuItems?: (row: MRT_RowData) => MenuButtonProps[\"children\"];\n totalRows?: DataTableProps[\"totalRows\"];\n updateRowOrder?: ({\n rowId,\n newRowIndex,\n }: {\n rowId: string;\n newRowIndex: number;\n }) => void;\n};\n\nconst DataTableRowActions = ({\n row,\n rowIndex,\n rowActionButtons,\n rowActionMenuItems,\n totalRows,\n updateRowOrder,\n}: DataTableRowActionsProps) => {\n const { t } = useTranslation();\n\n const handleToFrontClick = useCallback(() => {\n updateRowOrder && updateRowOrder({ rowId: row.id, newRowIndex: 0 });\n }, [row.id, updateRowOrder]);\n\n const handleForwardClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({ rowId: row.id, newRowIndex: Math.max(0, rowIndex - 1) });\n }, [row.id, rowIndex, updateRowOrder]);\n\n const handleBackwardClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({ rowId: row.id, newRowIndex: rowIndex + 1 });\n }, [row.id, rowIndex, updateRowOrder]);\n\n const handleToBackClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({\n rowId: row.id,\n newRowIndex: totalRows ? totalRows - 1 : rowIndex,\n });\n }, [row.id, rowIndex, totalRows, updateRowOrder]);\n\n return (\n <MuiBox display=\"flex\">\n {rowActionButtons?.(row)}\n {(rowActionMenuItems || updateRowOrder) && (\n <MenuButton\n endIcon={<MoreIcon />}\n size=\"small\"\n buttonVariant=\"floating\"\n ariaLabel={t(\"table.moreactions.arialabel\")}\n menuAlignment=\"right\"\n >\n {rowActionMenuItems && <>{rowActionMenuItems(row)}</>}\n {rowActionMenuItems && updateRowOrder && <hr />}\n {updateRowOrder && (\n <>\n <MenuItem isDisabled={rowIndex <= 0} onClick={handleToFrontClick}>\n <ArrowTopIcon /> <Trans i18nKey=\"table.reorder.tofront\" />\n </MenuItem>\n <MenuItem isDisabled={rowIndex <= 0} onClick={handleForwardClick}>\n <ArrowUpIcon /> <Trans i18nKey=\"table.reorder.forward\" />\n </MenuItem>\n <MenuItem\n isDisabled={totalRows ? rowIndex >= totalRows - 1 : false}\n onClick={handleBackwardClick}\n >\n <ArrowDownIcon /> <Trans i18nKey=\"table.reorder.backward\" />\n </MenuItem>\n {totalRows && (\n <MenuItem\n isDisabled={rowIndex >= totalRows - 1}\n onClick={handleToBackClick}\n >\n <ArrowBottomIcon /> <Trans i18nKey=\"table.reorder.toback\" />\n </MenuItem>\n )}\n </>\n )}\n </MenuButton>\n )}\n </MuiBox>\n );\n};\n\nconst MemoizedDataTableRowActions = memo(DataTableRowActions);\nMemoizedDataTableRowActions.displayName = \"DataTableRowActions\";\n\nexport { MemoizedDataTableRowActions as DataTableRowActions };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAAiCA,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAAC,SAEzDC,QAAQ;AAAA,SAERC,UAAU;AAAA,SAEjBC,eAAe,EACfC,aAAa,EACbC,YAAY,EACZC,WAAW,EACXC,QAAQ;AAGV,SAASC,KAAK,EAAEC,c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B,SAAS,GAAGH,QAAQ,IAAIG,SAAS,GAAG,CAAC,GAAG,KAAM;UAC1DqB,OAAO,EAAEX,mBAAoB;UAAAI,QAAA,GAE7BxB,IAAA,CAACP,aAAa,IAAE,CAAC,KAAC,EAAAO,IAAA,CAACH,KAAK;YAACmC,OAAO,EAAC;UAAwB,CAAE,CAAC;QAAA,CACpD,CAAC,EACVtB,SAAS,IACRN,KAAA,CAACd,QAAQ;UACPwC,UAAU,EAAEvB,QAAQ,IAAIG,SAAS,GAAG,CAAE;UACtCqB,OAAO,EAAEV,iBAAkB;UAAAG,QAAA,GAE3BxB,IAAA,CAACR,eAAe,IAAE,CAAC,KAAC,EAAAQ,IAAA,CAACH,KAAK;YAACmC,OAAO,EAAC;UAAsB,CAAE,CAAC;QAAA,CACpD,CACX;MAAA,CACD,CACH;IAAA,CACS,CACb;EAAA,CACK,CAAC;AAEb,CAAC;AAED,MAAMC,2BAA2B,GAAG7C,IAAI,CAACiB,mBAAmB,CAAC;AAC7D4B,2BAA2B,CAACC,WAAW,GAAG,qBAAqB;AAE/D,SAASD,2BAA2B,IAAI5B,mBAAmB"}
1
+ {"version":3,"file":"DataTableRowActions.js","names":["memo","useCallback","MenuItem","MenuButton","ArrowBottomIcon","ArrowDownIcon","ArrowTopIcon","ArrowUpIcon","MoreIcon","Trans","useTranslation","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DataTableRowActions","row","rowIndex","rowActionButtons","rowActionMenuItems","totalRows","updateRowOrder","t","handleToFrontClick","rowId","id","newRowIndex","handleForwardClick","Math","max","handleBackwardClick","handleToBackClick","_Box","display","children","endIcon","size","buttonVariant","ariaLabel","menuAlignment","isDisabled","onClick","i18nKey","MemoizedDataTableRowActions","displayName"],"sources":["../../src/DataTable/DataTableRowActions.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 { MRT_Row, MRT_RowData } from \"material-react-table\";\nimport { Fragment, ReactElement, memo, useCallback } from \"react\";\nimport { Button } from \"../Button\";\nimport { MenuItem } from \"../MenuItem\";\nimport { Box as MuiBox } from \"@mui/material\";\nimport { MenuButton, MenuButtonProps } from \"../MenuButton\";\nimport {\n ArrowBottomIcon,\n ArrowDownIcon,\n ArrowTopIcon,\n ArrowUpIcon,\n MoreIcon,\n} from \"../icons.generated\";\nimport { DataTableProps } from \"./DataTable\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nexport type DataTableRowActionsProps = {\n row: MRT_Row<MRT_RowData> | MRT_RowData;\n rowIndex: number;\n rowActionButtons?: (\n row: MRT_RowData,\n ) => ReactElement<typeof Button | typeof Fragment>;\n rowActionMenuItems?: (row: MRT_RowData) => MenuButtonProps[\"children\"];\n totalRows?: DataTableProps[\"totalRows\"];\n updateRowOrder?: ({\n rowId,\n newRowIndex,\n }: {\n rowId: string;\n newRowIndex: number;\n }) => void;\n};\n\nconst DataTableRowActions = ({\n row,\n rowIndex,\n rowActionButtons,\n rowActionMenuItems,\n totalRows,\n updateRowOrder,\n}: DataTableRowActionsProps) => {\n const { t } = useTranslation();\n\n const handleToFrontClick = useCallback(() => {\n updateRowOrder && updateRowOrder({ rowId: row.id, newRowIndex: 0 });\n }, [row.id, updateRowOrder]);\n\n const handleForwardClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({ rowId: row.id, newRowIndex: Math.max(0, rowIndex - 1) });\n }, [row.id, rowIndex, updateRowOrder]);\n\n const handleBackwardClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({ rowId: row.id, newRowIndex: rowIndex + 1 });\n }, [row.id, rowIndex, updateRowOrder]);\n\n const handleToBackClick = useCallback(() => {\n updateRowOrder &&\n updateRowOrder({\n rowId: row.id,\n newRowIndex: totalRows ? totalRows - 1 : rowIndex,\n });\n }, [row.id, rowIndex, totalRows, updateRowOrder]);\n\n return (\n <MuiBox display=\"flex\">\n {rowActionButtons?.(row)}\n {(rowActionMenuItems || updateRowOrder) && (\n <MenuButton\n endIcon={<MoreIcon />}\n size=\"small\"\n buttonVariant=\"floating\"\n ariaLabel={t(\"table.moreactions.arialabel\")}\n menuAlignment=\"right\"\n >\n {rowActionMenuItems && <>{rowActionMenuItems(row)}</>}\n {rowActionMenuItems && updateRowOrder && <hr />}\n {updateRowOrder && (\n <>\n <MenuItem isDisabled={rowIndex <= 0} onClick={handleToFrontClick}>\n <ArrowTopIcon /> <Trans i18nKey=\"table.reorder.tofront\" />\n </MenuItem>\n <MenuItem isDisabled={rowIndex <= 0} onClick={handleForwardClick}>\n <ArrowUpIcon /> <Trans i18nKey=\"table.reorder.forward\" />\n </MenuItem>\n <MenuItem\n isDisabled={totalRows ? rowIndex >= totalRows - 1 : false}\n onClick={handleBackwardClick}\n >\n <ArrowDownIcon /> <Trans i18nKey=\"table.reorder.backward\" />\n </MenuItem>\n {totalRows && (\n <MenuItem\n isDisabled={rowIndex >= totalRows - 1}\n onClick={handleToBackClick}\n >\n <ArrowBottomIcon /> <Trans i18nKey=\"table.reorder.toback\" />\n </MenuItem>\n )}\n </>\n )}\n </MenuButton>\n )}\n </MuiBox>\n );\n};\n\nconst MemoizedDataTableRowActions = memo(DataTableRowActions);\nMemoizedDataTableRowActions.displayName = \"DataTableRowActions\";\n\nexport { MemoizedDataTableRowActions as DataTableRowActions };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA,SAAiCA,IAAI,EAAEC,WAAW,QAAQ,OAAO;AAAC,SAEzDC,QAAQ;AAAA,SAERC,UAAU;AAAA,SAEjBC,eAAe,EACfC,aAAa,EACbC,YA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jD,CAAC,EACX5B,KAAA,CAACd,QAAQ;UACPwC,UAAU,EAAEpB,SAAS,GAAGH,QAAQ,IAAIG,SAAS,GAAG,CAAC,GAAG,KAAM;UAC1DqB,OAAO,EAAEX,mBAAoB;UAAAI,QAAA,GAE7BxB,IAAA,CAACP,aAAa,IAAE,CAAC,KAAC,EAAAO,IAAA,CAACH,KAAK;YAACmC,OAAO,EAAC;UAAwB,CAAE,CAAC;QAAA,CACpD,CAAC,EACVtB,SAAS,IACRN,KAAA,CAACd,QAAQ;UACPwC,UAAU,EAAEvB,QAAQ,IAAIG,SAAS,GAAG,CAAE;UACtCqB,OAAO,EAAEV,iBAAkB;UAAAG,QAAA,GAE3BxB,IAAA,CAACR,eAAe,IAAE,CAAC,KAAC,EAAAQ,IAAA,CAACH,KAAK;YAACmC,OAAO,EAAC;UAAsB,CAAE,CAAC;QAAA,CACpD,CACX;MAAA,CACD,CACH;IAAA,CACS,CACb;EAAA,CACK,CAAC;AAEb,CAAC;AAED,MAAMC,2BAA2B,GAAG7C,IAAI,CAACiB,mBAAmB,CAAC;AAC7D4B,2BAA2B,CAACC,WAAW,GAAG,qBAAqB;AAE/D,SAASD,2BAA2B,IAAI5B,mBAAmB"}
@@ -11,5 +11,4 @@
11
11
  */
12
12
 
13
13
  export const densityValues = ["comfortable", "spacious", "compact"];
14
- export const paginationTypeValues = ["paged", "loadMore"];
15
14
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["densityValues","paginationTypeValues"],"sources":["../../src/DataTable/constants.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport const densityValues = [\"comfortable\", \"spacious\", \"compact\"] as const;\nexport const paginationTypeValues = [\"paged\", \"loadMore\"] as const;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,aAAa,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,SAAS,CAAU;AAC5E,OAAO,MAAMC,oBAAoB,GAAG,CAAC,OAAO,EAAE,UAAU,CAAU"}
1
+ {"version":3,"file":"constants.js","names":["densityValues"],"sources":["../../src/DataTable/constants.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport const densityValues = [\"comfortable\", \"spacious\", \"compact\"] as const;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,aAAa,GAAG,CAAC,aAAa,EAAE,UAAU,EAAE,SAAS,CAAU"}
@@ -10,6 +10,5 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
  export { DataTable } from "./DataTable.js";
13
- export { DataTableEmptyState } from "./DataTableEmptyState.js";
14
13
  export { densityValues } from "./constants.js";
15
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DataTable","DataTableEmptyState","densityValues"],"sources":["../../src/DataTable/index.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\nexport {\n DataTable,\n type DataTableProps,\n type DataTableGetDataType,\n type DataTableOnReorderRowsType,\n} from \"./DataTable\";\nexport { DataTableEmptyState } from \"./DataTableEmptyState\";\nexport { densityValues } from \"./constants\";\nexport type {\n MRT_ColumnFiltersState as DataTableFiltersState,\n MRT_SortingState as DataTableSortingState,\n MRT_RowSelectionState as DataTableRowSelectionState,\n MRT_ColumnDef as DataTableColumn,\n MRT_RowData as DataTableRowData,\n MRT_Row as DataTableRow,\n} from \"material-react-table\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAaEA,SAAS;AAAA,SAKFC,mBAAmB;AAAA,SACnBC,aAAa"}
1
+ {"version":3,"file":"index.js","names":["DataTable","densityValues"],"sources":["../../src/DataTable/index.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\nexport {\n DataTable,\n type DataTableColumn,\n type DataTableProps,\n type DataTableGetDataType,\n type DataTableOnReorderRowsType,\n type DataTableRenderDetailPanelType,\n} from \"./DataTable\";\nexport { densityValues } from \"./constants\";\nexport type {\n MRT_ColumnFiltersState as DataTableFiltersState,\n MRT_SortingState as DataTableSortingState,\n MRT_RowSelectionState as DataTableRowSelectionState,\n MRT_RowData as DataTableRowData,\n MRT_Row as DataTableRow,\n} from \"material-react-table\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAaEA,SAAS;AAAA,SAOFC,aAAa"}
package/dist/Dialog.js CHANGED
@@ -18,13 +18,16 @@ import _DialogContentText from "@mui/material/DialogContentText";
18
18
  import { useTranslation } from "react-i18next";
19
19
  import { Button } from "./Button.js";
20
20
  import { CloseIcon } from "./icons.generated/index.js";
21
- import { memo, useState, useEffect, useRef } from "react";
21
+ import { cloneElement, memo, useState, useEffect, useRef } from "react";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
24
24
  const Dialog = ({
25
25
  primaryCallToActionComponent,
26
26
  secondaryCallToActionComponent,
27
27
  tertiaryCallToActionComponent,
28
+ callToActionFirstComponent,
29
+ callToActionSecondComponent,
30
+ callToActionLastComponent,
28
31
  children,
29
32
  isOpen,
30
33
  onClose,
@@ -57,6 +60,7 @@ const Dialog = ({
57
60
  const content = typeof children === "string" ? _jsx(_DialogContentText, {
58
61
  children: children
59
62
  }) : children;
63
+ const actionButtons = [tertiaryCallToActionComponent || callToActionLastComponent, secondaryCallToActionComponent || callToActionSecondComponent, primaryCallToActionComponent || callToActionFirstComponent].filter(Boolean);
60
64
  return _jsxs(_Dialog, {
61
65
  "data-se": testId,
62
66
  open: isOpen,
@@ -77,8 +81,10 @@ const Dialog = ({
77
81
  dividers: isContentScrollable,
78
82
  ref: dialogContentRef,
79
83
  children: content
80
- }), (primaryCallToActionComponent || secondaryCallToActionComponent || tertiaryCallToActionComponent) && _jsxs(_DialogActions, {
81
- children: [tertiaryCallToActionComponent, secondaryCallToActionComponent, primaryCallToActionComponent]
84
+ }), actionButtons.length > 0 && _jsx(_DialogActions, {
85
+ children: actionButtons.map((actionButton, index) => actionButton ? cloneElement(actionButton, {
86
+ key: index
87
+ }) : null)
82
88
  })]
83
89
  });
84
90
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","names":["useTranslation","Button","CloseIcon","memo","useState","useEffect","useRef","jsx","_jsx","jsxs","_jsxs","Dialog","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","children","isOpen","onClose","testId","title","translate","t","isContentScrollable","setIsContentScrollable","dialogContentRef","frameId","handleContentScroll","dialogContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","content","_DialogContentText","_Dialog","open","_DialogTitle","ariaLabel","onClick","size","startIcon","variant","_DialogContent","tabIndex","dividers","ref","_DialogActions","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 { useTranslation } from \"react-i18next\";\nimport { Dialog as MuiDialog } from \"@mui/material\";\nimport {\n DialogTitle,\n DialogContent,\n DialogContentText,\n DialogActions,\n} from \"@mui/material\";\nimport { Button } from \"./Button\";\nimport { CloseIcon } from \"./icons.generated\";\nimport {\n memo,\n ReactNode,\n useState,\n useEffect,\n useRef,\n ReactElement,\n} from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type DialogProps = {\n /**\n * @deprecated `aria-label` for close button comes from translation file\n */\n ariaLabel?: string;\n /**\n * An optional Button object to be situated in the Dialog footer. Should almost always be of variant `primary`.\n */\n primaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer, alongside the `callToActionPrimaryComponent`.\n */\n secondaryCallToActionComponent?: ReactElement<typeof Button>;\n /**\n * An optional Button object to be situated in the Dialog footer, alongside the other two `callToAction` components.\n */\n tertiaryCallToActionComponent?: 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: () => void;\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 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\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 return (\n <MuiDialog data-se={testId} open={isOpen} onClose={onClose}>\n <DialogTitle translate={translate}>\n {title}\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onClose}\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 {(primaryCallToActionComponent ||\n secondaryCallToActionComponent ||\n tertiaryCallToActionComponent) && (\n <DialogActions>\n {tertiaryCallToActionComponent}\n {secondaryCallToActionComponent}\n {primaryCallToActionComponent}\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;;AAEA,SAASA,cAAc,QAAQ,eAAe;AAAC,SAQtCC,MAAM;AAAA,SACNC,SAAS;AAClB,SACEC,IAAI,EAEJC,QAAQ,EACRC,SAAS,EACTC,MAAM,QAED,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAuCf,MAAMC,MAAM,GAAGA,CAAC;EACdC,4BAA4B;EAC5BC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,QAAQ;EACRC,MAAM;EACNC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC;AACW,CAAC,KAAK;EACjB,MAAM;IAAEC;EAAE,CAAC,GAAGrB,cAAc,CAAC,CAAC;EAC9B,MAAM,CAACsB,mBAAmB,EAAEC,sBAAsB,CAAC,GAAGnB,QAAQ,CAAC,KAAK,CAAC;EACrE,MAAMoB,gBAAgB,GAAGlB,MAAM,CAAiB,IAAI,CAAC;EAErDD,SAAS,CAAC,MAAM;IACd,IAAIoB,OAAe;IAEnB,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;MAChC,MAAMC,oBAAoB,GAAGH,gBAAgB,CAACI,OAAO;MACrD,IAAID,oBAAoB,EAAE;QACxBE,oBAAoB,CAACJ,OAAO,CAAC;QAC7BF,sBAAsB,CACpBI,oBAAoB,CAACG,YAAY,GAAGH,oBAAoB,CAACI,YAC3D,CAAC;MACH;MACAN,OAAO,GAAGO,qBAAqB,CAACN,mBAAmB,C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,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIrC,MAAM"}
1
+ {"version":3,"file":"Dialog.js","names":["useTranslation","Button","CloseIcon","cloneElement","memo","useState","useEffect","useRef","jsx","_jsx","jsxs","_jsxs","Dialog","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","callToActionFirstComponent","callToActionSecondComponent","callToActionLastComponent","children","isOpen","onClose","testId","title","translate","t","isContentScrollable","setIsContentScrollable","dialogContentRef","frameId","handleContentScroll","dialogContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","content","_DialogContentText","actionButtons","filter","Boolean","_Dialog","open","_DialogTitle","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 { useTranslation } from \"react-i18next\";\nimport { Dialog as MuiDialog } from \"@mui/material\";\nimport {\n DialogTitle,\n DialogContent,\n DialogContentText,\n DialogActions,\n} from \"@mui/material\";\nimport { Button } from \"./Button\";\nimport { CloseIcon } from \"./icons.generated\";\nimport {\n cloneElement,\n memo,\n useState,\n useEffect,\n useRef,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type DialogProps = {\n /**\n * @deprecated `aria-label` for close button comes from translation file\n */\n ariaLabel?: string;\n\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 * @deprecated Will be removed in a future Odyssey version. Use `primaryCallToActionComponent` instead.\n */\n callToActionFirstComponent?: ReactElement<typeof Button>;\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 * @deprecated Will be removed in a future Odyssey version. Use `secondaryCallToActionComponent` instead.\n */\n callToActionSecondComponent?: ReactElement<typeof Button>;\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 * @deprecated Will be removed in a future Odyssey version. Use `tertiaryCallToActionComponent` instead.\n */\n callToActionLastComponent?: 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 /**\n * When set to `true`, the Dialog will be visible.\n */\n isOpen: boolean;\n\n /**\n * Callback that controls what happens when the Dialog is dismissed.\n */\n onClose: () => void;\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\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 return (\n <MuiDialog data-se={testId} open={isOpen} onClose={onClose}>\n <DialogTitle translate={translate}>\n {title}\n <Button\n ariaLabel={t(\"close.text\")}\n onClick={onClose}\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;;AAEA,SAASA,cAAc,QAAQ,eAAe;AAAC,SAQtCC,MAAM;AAAA,SACNC,SAAS;AAClB,SACEC,YAAY,EACZC,IAAI,EACJC,QAAQ,EACRC,SAAS,EACTC,MAAM,QAGD,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAuDf,MAAMC,MAAM,GAAGA,CAAC;EACdC,4BAA4B;EAC5BC,8BAA8B;EAC9BC,6BAA6B;EAC7BC,0BAA0B;EAC1BC,2BAA2B;EAC3BC,yBAAyB;EACzBC,QAAQ;EACRC,MAAM;EAC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YAAA;MAAapB,SAAS,EAAEA,SAAU;MAAAL,QAAA,GAC/BI,KAAK,EACNd,IAAA,CAACR,MAAM;QACL4C,SAAS,EAAEpB,CAAC,CAAC,YAAY,CAAE;QAC3BqB,OAAO,EAAEzB,OAAQ;QACjB0B,IAAI,EAAC,OAAO;QACZC,SAAS,EAAEvC,IAAA,CAACP,SAAS,IAAE,CAAE;QACzB+C,OAAO,EAAC;MAAU,CACnB,CAAC;IAAA,CACS,CAAC,EACdxC,IAAA,CAAAyC,cAAA;MAAA,IACOxB,mBAAmB,IAAI;QAE1ByB,QAAQ,EAAE;MACZ,CAAC;MACDC,QAAQ,EAAE1B,mBAAoB;MAC9B2B,GAAG,EAAEzB,gBAAiB;MAAAT,QAAA,EAErBkB;IAAO,CACK,CAAC,EAEfE,aAAa,CAACe,MAAM,GAAG,CAAC,IACvB7C,IAAA,CAAA8C,cAAA;MAAApC,QAAA,EACGoB,aAAa,CAACiB,GAAG,CAAC,CAACC,YAAY,EAAEC,KAAK,KACrCD,YAAY,GAAGtD,YAAY,CAACsD,YAAY,EAAE;QAAEE,GAAG,EAAED;MAAM,CAAC,CAAC,GAAG,IAC9D;IAAC,CACY,CAChB;EAAA,CACQ,CAAC;AAEhB,CAAC;AAED,MAAME,cAAc,GAAGxD,IAAI,CAACQ,MAAM,CAAC;AACnCgD,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIhD,MAAM"}
@@ -11,13 +11,13 @@ import _Drawer from "@mui/material/Drawer";
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
13
 
14
- import { memo, useState, useEffect, useMemo, useRef } from "react";
14
+ import { memo, useEffect, useMemo, useRef, useState } from "react";
15
15
  import styled from "@emotion/styled";
16
16
  import { useTranslation } from "react-i18next";
17
- import { Button } from "../Button.js";
18
- import { CloseIcon } from "../icons.generated/index.js";
19
- import { Heading5 } from "../Typography.js";
20
- import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
17
+ import { Button } from "./Button.js";
18
+ import { CloseIcon } from "./icons.generated/index.js";
19
+ import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
20
+ import { Heading5 } from "./Typography.js";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
23
  export const variantValues = ["temporary", "persistent"];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.js","names":["memo","useEffect","useMemo","useRef","useState","styled","useTranslation","Button","CloseIcon","useOdysseyDesignTokens","Heading5","jsx","_jsx","jsxs","_jsxs","variantValues","DrawerHeader","shouldForwardProp","prop","odysseyDesignTokens","Spacing4","Spacing5","HueNeutral900","HueNeutralWhite","showDividers","HueNeutral200","DrawerContentWrapper","DrawerContent","DrawerFooter","Drawer","ariaLabel","children","isOpen","onClose","primaryCallToActionComponent","secondaryCallToActionComponent","tertiaryCallToActionComponent","testId","title","translate","variant","isContentScrollable","setIsContentScrollable","drawerContentRef","i18n","anchorDirection","dir","frameId","handleContentScroll","drawerContentElement","current","cancelAnimationFrame","scrollHeight","clientHeight","requestAnimationFrame","dividersVisible","hasFooter","_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 {\n memo,\n ReactElement,\n ReactNode,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { Drawer as MuiDrawer } from \"@mui/material\";\nimport styled from \"@emotion/styled\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button } from \"./Button\";\nimport { CloseIcon } from \"./icons.generated\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { Heading5 } from \"./Typography\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport const variantValues = [\"temporary\", \"persistent\"] as const;\n\nexport type DrawerProps = {\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 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: () => void;\n /**\n * Shows divider lines separating header, content, and footer (if using action buttons)\n */\n showDividers: boolean;\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\ninterface DrawerStyleProps {\n odysseyDesignTokens: DesignTokens;\n showDividers: boolean;\n}\nconst DrawerHeader = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\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: ${({ showDividers, odysseyDesignTokens }) =>\n showDividers ? `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) => prop !== \"odysseyDesignTokens\",\n})<DrawerStyleProps>`\n padding: ${({ showDividers, odysseyDesignTokens }) =>\n showDividers\n ? `${odysseyDesignTokens.Spacing5}`\n : `0 ${odysseyDesignTokens.Spacing5}`};\n`;\n\nconst DrawerFooter = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\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: ${({ showDividers, odysseyDesignTokens }) =>\n showDividers ? `1px solid ${odysseyDesignTokens.HueNeutral200}` : \"none\"};\n background-color: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.HueNeutralWhite};\n`;\n\nconst Drawer = ({\n ariaLabel,\n children,\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 //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 showDividers || isContentScrollable;\n }, [showDividers, isContentScrollable]);\n\n const hasFooter = useMemo(\n () =>\n primaryCallToActionComponent ||\n secondaryCallToActionComponent ||\n tertiaryCallToActionComponent,\n [\n primaryCallToActionComponent,\n secondaryCallToActionComponent,\n tertiaryCallToActionComponent,\n ],\n );\n\n return (\n <MuiDrawer\n data-se={testId}\n anchor={anchorDirection}\n open={isOpen}\n onClose={onClose}\n variant={variant}\n sx={{\n //Overrides defualt MUI inline style\n ...(variant === \"persistent\" && {\n \"& .MuiDrawer-paper\": {\n transition: \"none\",\n },\n }),\n }}\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 translate={translate}\n odysseyDesignTokens={odysseyDesignTokens}\n showDividers={dividersVisible}\n >\n <Heading5>{title}</Heading5>\n <Button\n ariaLabel={ariaLabel}\n onClick={onClose}\n size=\"small\"\n startIcon={<CloseIcon />}\n variant=\"floating\"\n />\n </DrawerHeader>\n <DrawerContent\n showDividers={dividersVisible}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {children}\n </DrawerContent>\n </DrawerContentWrapper>\n {hasFooter && (\n <DrawerFooter\n odysseyDesignTokens={odysseyDesignTokens}\n showDividers={dividersVisible}\n >\n {tertiaryCallToActionComponent}\n {secondaryCallToActionComponent}\n {primaryCallToActionComponent}\n </DrawerFooter>\n )}\n </MuiDrawer>\n );\n};\n\nconst MemoizedDrawer = memo(Drawer);\nMemoizedDrawer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AiB;MAAAZ,QAAA,GAEtBjB,KAAA,CAACE,YAAY;QACXuB,SAAS,EAAEA,SAAU;QACrBpB,mBAAmB,EAAEA,mBAAoB;QACzCK,YAAY,EAAE+B,eAAgB;QAAAxB,QAAA,GAE9BnB,IAAA,CAACF,QAAQ;UAAAqB,QAAA,EAAEO;QAAK,CAAW,CAAC,EAC5B1B,IAAA,CAACL,MAAM;UACLuB,SAAS,EAAEA,SAAU;UACrBkC,OAAO,EAAE/B,OAAQ;UACjBgC,IAAI,EAAC,OAAO;UACZC,SAAS,EAAEtD,IAAA,CAACJ,SAAS,IAAE,CAAE;UACzBgC,OAAO,EAAC;QAAU,CACnB,CAAC;MAAA,CACU,CAAC,EACf5B,IAAA,CAACe,aAAa;QACZH,YAAY,EAAE+B,eAAgB;QAC9BpC,mBAAmB,EAAEA,mBAAoB;QAAAY,QAAA,EAExCA;MAAQ,CACI,CAAC;IAAA,CACI,CAAC,EACtByB,SAAS,IACR1C,KAAA,CAACc,YAAY;MACXT,mBAAmB,EAAEA,mBAAoB;MACzCK,YAAY,EAAE+B,eAAgB;MAAAxB,QAAA,GAE7BK,6BAA6B,EAC7BD,8BAA8B,EAC9BD,4BAA4B;IAAA,CACjB,CACf;EAAA,CACQ,CAAC;AAEhB,CAAC;AAED,MAAMiC,cAAc,GAAGnE,IAAI,CAAC6B,MAAM,CAAC;AACnCsC,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAItC,MAAM"}
@@ -11,10 +11,10 @@
11
11
  */
12
12
 
13
13
  import { memo } from "react";
14
- import { Heading4, Paragraph } from "../Typography.js";
15
- import { Box } from "../Box.js";
14
+ import { Heading4, Paragraph } from "./Typography.js";
15
+ import { Box } from "./Box.js";
16
16
  import styled from "@emotion/styled";
17
- import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
17
+ import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  import { jsxs as _jsxs } from "react/jsx-runtime";
20
20
  const EmptyContainer = styled("div", {
@@ -27,13 +27,14 @@ const EmptyContainer = styled("div", {
27
27
  marginBlock: odysseyDesignTokens.Spacing9,
28
28
  padding: odysseyDesignTokens.Spacing5,
29
29
  textAlign: "center",
30
- width: "100%"
30
+ width: "100%",
31
+ alignItems: "center"
31
32
  }));
32
- const DataTableEmptyState = ({
33
+ const EmptyState = ({
33
34
  heading,
34
- text,
35
- primaryButton,
36
- secondaryButton
35
+ description,
36
+ PrimaryCallToActionComponent,
37
+ SecondaryCallToActionComponent
37
38
  }) => {
38
39
  const odysseyDesignTokens = useOdysseyDesignTokens();
39
40
  return _jsxs(EmptyContainer, {
@@ -41,16 +42,17 @@ const DataTableEmptyState = ({
41
42
  children: [_jsx(Heading4, {
42
43
  children: heading
43
44
  }), _jsx(Paragraph, {
44
- children: text
45
- }), (primaryButton || secondaryButton) && _jsxs(Box, {
45
+ children: description
46
+ }), (PrimaryCallToActionComponent || SecondaryCallToActionComponent) && _jsxs(Box, {
46
47
  sx: {
47
48
  marginBlockStart: 5
48
49
  },
49
- children: [secondaryButton, primaryButton]
50
+ children: [SecondaryCallToActionComponent, PrimaryCallToActionComponent]
50
51
  })]
51
52
  });
52
53
  };
53
- const MemoizedDataTableEmptyState = memo(DataTableEmptyState);
54
- MemoizedDataTableEmptyState.displayName = "DataTableEmptyState";
55
- export { MemoizedDataTableEmptyState as DataTableEmptyState };
56
- //# sourceMappingURL=DataTableEmptyState.js.map
54
+ const MemoizedEmptyState = memo(EmptyState);
55
+ MemoizedEmptyState.displayName = "EmptyState";
56
+ export { MemoizedEmptyState as EmptyState };
57
+ export { MemoizedEmptyState as DataTableEmptyState };
58
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.js","names":["memo","Heading4","Paragraph","Box","styled","useOdysseyDesignTokens","jsx","_jsx","jsxs","_jsxs","EmptyContainer","shouldForwardProp","prop","odysseyDesignTokens","display","flexDirection","marginBlock","Spacing9","padding","Spacing5","textAlign","width","alignItems","EmptyState","heading","description","PrimaryCallToActionComponent","SecondaryCallToActionComponent","children","sx","marginBlockStart","MemoizedEmptyState","displayName","DataTableEmptyState"],"sources":["../src/EmptyState.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 { ReactNode, memo } from \"react\";\nimport { Heading4, Paragraph } from \"./Typography\";\nimport { Box } from \"./Box\";\nimport styled from \"@emotion/styled\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext\";\n\nconst EmptyContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({\n display: \"flex\",\n flexDirection: \"column\",\n marginBlock: odysseyDesignTokens.Spacing9,\n padding: odysseyDesignTokens.Spacing5,\n textAlign: \"center\",\n width: \"100%\",\n alignItems: \"center\",\n}));\n\nexport type EmptyStateProps = {\n /**\n * Main heading of the empty state\n */\n heading: string;\n /**\n * A descriptive text explaining more context as to why we don't have data.\n */\n description: string;\n /**\n * Primary call to action\n */\n PrimaryCallToActionComponent?: ReactNode;\n /**\n * Secondary call to action\n */\n SecondaryCallToActionComponent?: ReactNode;\n};\n\nconst EmptyState = ({\n heading,\n description,\n PrimaryCallToActionComponent,\n SecondaryCallToActionComponent,\n}: EmptyStateProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n return (\n <EmptyContainer odysseyDesignTokens={odysseyDesignTokens}>\n <Heading4>{heading}</Heading4>\n <Paragraph>{description}</Paragraph>\n {(PrimaryCallToActionComponent || SecondaryCallToActionComponent) && (\n <Box sx={{ marginBlockStart: 5 }}>\n {SecondaryCallToActionComponent}\n {PrimaryCallToActionComponent}\n </Box>\n )}\n </EmptyContainer>\n );\n};\n\nconst MemoizedEmptyState = memo(EmptyState);\nMemoizedEmptyState.displayName = \"EmptyState\";\n\nexport { MemoizedEmptyState as EmptyState };\nexport { MemoizedEmptyState as DataTableEmptyState };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,IAAI,QAAQ,OAAO;AAAC,SAC/BC,QAAQ,EAAEC,SAAS;AAAA,SACnBC,GAAG;AACZ,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAEnCC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAIxB,MAAMC,cAAc,GAAGN,MAAM,CAAC,KAAK,EAAE;EACnCO,iBAAiB,EAAGC,IAAI,IAAKA,IAAI,KAAK;AACxC,CAAC,CAAC,CAAC,CAAC;EAAEC;AAA2D,CAAC,MAAM;EACtEC,OAAO,EAAE,MAAM;EACfC,aAAa,EAAE,QAAQ;EACvBC,WAAW,EAAEH,mBAAmB,CAACI,QAAQ;EACzCC,OAAO,EAAEL,mBAAmB,CAACM,QAAQ;EACrCC,SAAS,EAAE,QAAQ;EACnBC,KAAK,EAAE,MAAM;EACbC,UAAU,EAAE;AACd,CAAC,CAAC,CAAC;AAqBH,MAAMC,UAAU,GAAGA,CAAC;EAClBC,OAAO;EACPC,WAAW;EACXC,4BAA4B;EAC5BC;AACe,CAAC,KAAK;EACrB,MAAMd,mBAAmB,GAAGR,sBAAsB,CAAC,CAAC;EAEpD,OACEI,KAAA,CAACC,cAAc;IAACG,mBAAmB,EAAEA,mBAAoB;IAAAe,QAAA,GACvDrB,IAAA,CAACN,QAAQ;MAAA2B,QAAA,EAAEJ;IAAO,CAAW,CAAC,EAC9BjB,IAAA,CAACL,SAAS;MAAA0B,QAAA,EAAEH;IAAW,CAAY,CAAC,EACnC,CAACC,4BAA4B,IAAIC,8BAA8B,KAC9DlB,KAAA,CAACN,GAAG;MAAC0B,EAAE,EAAE;QAAEC,gBAAgB,EAAE;MAAE,CAAE;MAAAF,QAAA,GAC9BD,8BAA8B,EAC9BD,4BAA4B;IAAA,CAC1B,CACN;EAAA,CACa,CAAC;AAErB,CAAC;AAED,MAAMK,kBAAkB,GAAG/B,IAAI,CAACuB,UAAU,CAAC;AAC3CQ,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIR,UAAU;AACzC,SAASQ,kBAAkB,IAAIE,mBAAmB"}
@@ -35,7 +35,7 @@ const ErrorMessageList = ({
35
35
  dense: true,
36
36
  sx: listItemStyles,
37
37
  children: errorMessage
38
- }))
38
+ }, errorMessage))
39
39
  });
40
40
  };
41
41
  const MemoizedErrorMessageList = memo(ErrorMessageList);
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorMessageList.js","names":["useOdysseyDesignTokens","memo","useMemo","jsx","_jsx","listItemStyles","display","paddingInlineStart","ErrorMessageList","errorMessages","odysseyDesignTokens","listStyles","listStyle","Spacing4","_List","disablePadding","dense","sx","children","map","errorMessage","_ListItem","MemoizedErrorMessageList","displayName"],"sources":["../src/ErrorMessageList.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 { List as MuiList, ListItem as MuiListItem } from \"@mui/material\";\nimport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\nimport { memo, useMemo } from \"react\";\n\nexport type ErrorMessageListProps = {\n errorMessages: string[];\n};\n\nconst listItemStyles = {\n display: \"list-item\",\n paddingInlineStart: 0,\n};\n\nconst ErrorMessageList = ({ errorMessages }: ErrorMessageListProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const listStyles = useMemo(\n () => ({\n listStyle: \"disc\",\n paddingInlineStart: odysseyDesignTokens.Spacing4,\n }),\n [odysseyDesignTokens],\n );\n\n return (\n <MuiList disablePadding dense sx={listStyles}>\n {errorMessages.map((errorMessage) => (\n <MuiListItem disablePadding dense sx={listItemStyles}>\n {errorMessage}\n </MuiListItem>\n ))}\n </MuiList>\n );\n};\n\nconst MemoizedErrorMessageList = memo(ErrorMessageList);\nMemoizedErrorMessageList.displayName = \"ErrorMessageList\";\n\nexport { MemoizedErrorMessageList as ErrorMessageList };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAaSA,sBAAsB;AAC/B,SAASC,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMtC,MAAMC,cAAc,GAAG;EACrBC,OAAO,EAAE,WAAW;EACpBC,kBAAkB,EAAE;AACtB,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC;AAAqC,CAAC,KAAK;EACrE,MAAMC,mBAAmB,GAAGV,sBAAsB,CAAC,CAAC;EAEpD,MAAMW,UAAU,GAAGT,OAAO,CACxB,OAAO;IACLU,SAAS,EAAE,MAAM;IACjBL,kBAAkB,EAAEG,mBAAmB,CAACG;EAC1C,CAAC,CAAC,EACF,CAACH,mBAAmB,CACtB,CAAC;EAED,OACEN,IAAA,CAAAU,KAAA;IAASC,cAAc;IAACC,KAAK;IAACC,EAAE,EAAEN,UAAW;IAAAO,QAAA,EAC1CT,aAAa,CAACU,GAAG,CAAEC,YAAY,IAC9BhB,IAAA,CAAAiB,SAAA;MAAaN,cAAc;MAACC,KAAK;MAACC,EAAE,EAAEZ,cAAe;MAAAa,QAAA,EAClDE;IAAY,CACF,CACd;EAAC,CACK,CAAC;AAEd,CAAC;AAED,MAAME,wBAAwB,GAAGrB,IAAI,CAACO,gBAAgB,CAAC;AACvDc,wBAAwB,CAACC,WAAW,GAAG,kBAAkB;AAEzD,SAASD,wBAAwB,IAAId,gBAAgB"}
1
+ {"version":3,"file":"ErrorMessageList.js","names":["useOdysseyDesignTokens","memo","useMemo","jsx","_jsx","listItemStyles","display","paddingInlineStart","ErrorMessageList","errorMessages","odysseyDesignTokens","listStyles","listStyle","Spacing4","_List","disablePadding","dense","sx","children","map","errorMessage","_ListItem","MemoizedErrorMessageList","displayName"],"sources":["../src/ErrorMessageList.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 { List as MuiList, ListItem as MuiListItem } from \"@mui/material\";\nimport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\nimport { memo, useMemo } from \"react\";\n\nexport type ErrorMessageListProps = {\n errorMessages: string[];\n};\n\nconst listItemStyles = {\n display: \"list-item\",\n paddingInlineStart: 0,\n};\n\nconst ErrorMessageList = ({ errorMessages }: ErrorMessageListProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const listStyles = useMemo(\n () => ({\n listStyle: \"disc\",\n paddingInlineStart: odysseyDesignTokens.Spacing4,\n }),\n [odysseyDesignTokens],\n );\n\n return (\n <MuiList disablePadding dense sx={listStyles}>\n {errorMessages.map((errorMessage) => (\n <MuiListItem\n key={errorMessage}\n disablePadding\n dense\n sx={listItemStyles}\n >\n {errorMessage}\n </MuiListItem>\n ))}\n </MuiList>\n );\n};\n\nconst MemoizedErrorMessageList = memo(ErrorMessageList);\nMemoizedErrorMessageList.displayName = \"ErrorMessageList\";\n\nexport { MemoizedErrorMessageList as ErrorMessageList };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAaSA,sBAAsB;AAC/B,SAASC,IAAI,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMtC,MAAMC,cAAc,GAAG;EACrBC,OAAO,EAAE,WAAW;EACpBC,kBAAkB,EAAE;AACtB,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC;AAAqC,CAAC,KAAK;EACrE,MAAMC,mBAAmB,GAAGV,sBAAsB,CAAC,CAAC;EAEpD,MAAMW,UAAU,GAAGT,OAAO,CACxB,OAAO;IACLU,SAAS,EAAE,MAAM;IACjBL,kBAAkB,EAAEG,mBAAmB,CAACG;EAC1C,CAAC,CAAC,EACF,CAACH,mBAAmB,CACtB,CAAC;EAED,OACEN,IAAA,CAAAU,KAAA;IAASC,cAAc;IAACC,KAAK;IAACC,EAAE,EAAEN,UAAW;IAAAO,QAAA,EAC1CT,aAAa,CAACU,GAAG,CAAEC,YAAY,IAC9BhB,IAAA,CAAAiB,SAAA;MAEEN,cAAc;MACdC,KAAK;MACLC,EAAE,EAAEZ,cAAe;MAAAa,QAAA,EAElBE;IAAY,GALRA,YAMM,CACd;EAAC,CACK,CAAC;AAEd,CAAC;AAED,MAAME,wBAAwB,GAAGrB,IAAI,CAACO,gBAAgB,CAAC;AACvDc,wBAAwB,CAACC,WAAW,GAAG,kBAAkB;AAEzD,SAASD,wBAAwB,IAAId,gBAAgB"}
@@ -12,10 +12,10 @@ import _FormHelperText from "@mui/material/FormHelperText";
12
12
  */
13
13
 
14
14
  import { memo } from "react";
15
- import { ScreenReaderText } from "./ScreenReaderText.js";
16
- import { ErrorMessageList } from "./ErrorMessageList.js";
17
15
  import { useTranslation } from "react-i18next";
18
16
  import { Box } from "./Box.js";
17
+ import { ErrorMessageList } from "./ErrorMessageList.js";
18
+ import { ScreenReaderText } from "./ScreenReaderText.js";
19
19
  import { jsx as _jsx } from "react/jsx-runtime";
20
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
21
21
  const FieldError = ({
@@ -29,6 +29,7 @@ const FieldError = ({
29
29
  t
30
30
  } = useTranslation();
31
31
  return _jsxs(_FormHelperText, {
32
+ component: "div",
32
33
  "data-se": testId,
33
34
  error: true,
34
35
  id: id,
@@ -1 +1 @@
1
- {"version":3,"file":"FieldError.js","names":["memo","ScreenReaderText","ErrorMessageList","useTranslation","Box","jsx","_jsx","jsxs","_jsxs","FieldError","id","message","messageList","testId","translate","t","_FormHelperText","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 { memo } from \"react\";\n\nimport { FormHelperText } from \"@mui/material\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\nimport { ErrorMessageList } from \"./ErrorMessageList\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { Box } from \"./Box\";\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 data-se={testId} error id={id} translate={translate}>\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;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAAC,SAGpBC,gBAAgB;AAAA,SAChBC,gBAAgB;AACzB,SAASC,cAAc,QAAQ,eAAe;AAAC,SAGtCC,GAAG;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAQZ,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;IAAgB,WAASH,MAAO;IAACI,KAAK;IAACP,EAAE,EAAEA,EAAG;IAACI,SAAS,EAAEA,SAAU;IAAAI,QAAA,GAClEZ,IAAA,CAACL,gBAAgB;MAACa,SAAS,EAAEA,SAAU;MAAAI,QAAA,EAAG,GAAEH,CAAC,CAC3C,8BACF,CAAE;IAAE,CAAmB,CAAC,EACxBP,KAAA,CAACJ,GAAG;MAAAc,QAAA,GACDP,OAAO,EACPC,WAAW,IAAIN,IAAA,CAACJ,gBAAgB;QAACiB,aAAa,EAAEP;MAAY,CAAE,CAAC;IAAA,CAC7D,CAAC;EAAA,CACQ,CAAC;AAErB,CAAC;AAED,MAAMQ,kBAAkB,GAAGpB,IAAI,CAACS,UAAU,CAAC;AAC3CW,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIX,UAAU"}
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 { memo } from \"react\";\nimport { FormHelperText } from \"@mui/material\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Box } from \"./Box\";\nimport { ErrorMessageList } from \"./ErrorMessageList\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { ScreenReaderText } from \"./ScreenReaderText\";\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;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAE5B,SAASC,cAAc,QAAQ,eAAe;AAAC,SAEtCC,GAAG;AAAA,SACHC,gBAAgB;AAAA,SAEhBC,gBAAgB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAQzB,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,EAAG,GAAEJ,CAAC,CAC3C,8BACF,CAAE;IAAE,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"HtmlProps.js","names":[],"sources":["../src/HtmlProps.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { HTMLAttributes } from \"react\";\n\nexport type HtmlProps = {\n /**\n * Used in [ARIA live regions](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions), the global aria-busy state indicates an element is being modified and that assistive technologies may want to wait until the changes are complete before informing the user about the update.\n */\n ariaBusy?: HTMLAttributes<HTMLElement>[\"aria-busy\"];\n /**\n * The `aria-checked` attribute indicates the current \"checked\" state of checkboxes, radio buttons, and other widgets.\n *\n * NOTE: Where possible use an HTML `<input>` element with `type=\"checkbox\"` and `type=\"radio\"` as these have built in semantics and do not require ARIA attributes.\n */\n ariaChecked?: HTMLAttributes<HTMLElement>[\"aria-checked\"];\n /**\n * The global `aria-controls` property identifies the element (or elements) whose contents or presence are controlled by the element on which this attribute is set.\n *\n * Value: A space-separated list of one or more ID values referencing the elements being controlled by the current element\n */\n ariaControls?: HTMLAttributes<HTMLElement>[\"aria-controls\"];\n /**\n * The global `aria-describedby` attribute identifies the element (or elements) that describes the element on which the attribute is set.\n *\n * Value: The id or space-separated list of element ids that describe the current element.\n *\n * Note: The `aria-describedby` attribute is not designed to reference descriptions from external resources. It must reference elements in the same DOM document.\n */\n ariaDescribedBy?: HTMLAttributes<HTMLElement>[\"aria-describedby\"];\n /**\n * The `aria-errormessage` attribute on an object identifies the element that provides an error message for that object.\n *\n * Value: The value of the id of the element containing the error message for the current element\n */\n ariaErrorMessage?: HTMLAttributes<HTMLElement>[\"aria-errormessage\"];\n /**\n * The `aria-expanded` attribute is set on an element to indicate if a control is expanded or collapsed, and whether or not the controlled elements are displayed or hidden.\n */\n ariaExpanded?: HTMLAttributes<HTMLElement>[\"aria-expanded\"];\n /**\n * The `aria-haspopup` attribute indicates the availability and type of interactive popup element that can be triggered by the element on which the attribute is set.\n */\n ariaHasPopup?: HTMLAttributes<HTMLElement>[\"aria-haspopup\"];\n /**\n * The `aria-label` attribute defines a string value that labels an interactive element.\n */\n ariaLabel?: HTMLAttributes<HTMLElement>[\"aria-label\"];\n /**\n * The `aria-labelledby` attribute identifies the element (or elements) that labels the element it is applied to.\n *\n * Value: Space separated list of one or more ID values referencing the elements that label the current element.\n */\n ariaLabelledBy?: HTMLAttributes<HTMLElement>[\"aria-labelledby\"];\n /**\n * The `aria-pressed` attribute indicates the current \"pressed\" state of a toggle button.\n */\n ariaPressed?: HTMLAttributes<HTMLElement>[\"aria-pressed\"];\n /**\n * The `tabindex` global attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable\n *\n * Note: Manipulating the natural tab order is generally advised against\n */\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * This prop puts a `data` attribute on an HTML element in this component with the value provided.\n *\n * @deprecated **WARNING:** You should be using Semantic Selectors instead of this property. This is a temporary measure for backwards compatibility with existing Selenium tests.\n */\n testId?: string;\n /**\n * This prop puts a `translate` attribute on an HTML element. It should be used to indicate whether text within the element should be translated.\n */\n translate?: \"yes\" | \"no\";\n};\n"],"mappings":""}
1
+ {"version":3,"file":"HtmlProps.js","names":[],"sources":["../src/HtmlProps.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { HTMLAttributes } from \"react\";\n\nexport type HtmlProps = {\n /**\n * Used in [ARIA live regions](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions), the global aria-busy state indicates an element is being modified and that assistive technologies may want to wait until the changes are complete before informing the user about the update.\n */\n ariaBusy?: HTMLAttributes<HTMLElement>[\"aria-busy\"];\n /**\n * The `aria-checked` attribute indicates the current \"checked\" state of checkboxes, radio buttons, and other widgets.\n *\n * NOTE: Where possible use an HTML `<input>` element with `type=\"checkbox\"` and `type=\"radio\"` as these have built in semantics and do not require ARIA attributes.\n */\n ariaChecked?: HTMLAttributes<HTMLElement>[\"aria-checked\"];\n /**\n * The global `aria-controls` property identifies the element (or elements) whose contents or presence are controlled by the element on which this attribute is set.\n *\n * Value: A space-separated list of one or more ID values referencing the elements being controlled by the current element\n */\n ariaControls?: HTMLAttributes<HTMLElement>[\"aria-controls\"];\n /**\n * The global `aria-describedby` attribute identifies the element (or elements) that describes the element on which the attribute is set.\n *\n * Value: The id or space-separated list of element ids that describe the current element.\n *\n * Note: The `aria-describedby` attribute is not designed to reference descriptions from external resources. It must reference elements in the same DOM document.\n */\n ariaDescribedBy?: HTMLAttributes<HTMLElement>[\"aria-describedby\"];\n /**\n * The `aria-errormessage` attribute on an object identifies the element that provides an error message for that object.\n *\n * Value: The value of the id of the element containing the error message for the current element\n */\n ariaErrorMessage?: HTMLAttributes<HTMLElement>[\"aria-errormessage\"];\n /**\n * The `aria-expanded` attribute is set on an element to indicate if a control is expanded or collapsed, and whether or not the controlled elements are displayed or hidden.\n */\n ariaExpanded?: HTMLAttributes<HTMLElement>[\"aria-expanded\"];\n /**\n * The `aria-haspopup` attribute indicates the availability and type of interactive popup element that can be triggered by the element on which the attribute is set.\n */\n ariaHasPopup?: HTMLAttributes<HTMLElement>[\"aria-haspopup\"];\n ariaHidden?: HTMLAttributes<HTMLElement>[\"aria-hidden\"];\n /**\n * The `aria-label` attribute defines a string value that labels an interactive element.\n */\n ariaLabel?: HTMLAttributes<HTMLElement>[\"aria-label\"];\n /**\n * The `aria-labelledby` attribute identifies the element (or elements) that labels the element it is applied to.\n *\n * Value: Space separated list of one or more ID values referencing the elements that label the current element.\n */\n ariaLabelledBy?: HTMLAttributes<HTMLElement>[\"aria-labelledby\"];\n /**\n * The `aria-pressed` attribute indicates the current \"pressed\" state of a toggle button.\n */\n ariaPressed?: HTMLAttributes<HTMLElement>[\"aria-pressed\"];\n /**\n * The `tabindex` global attribute allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable\n *\n * Note: Manipulating the natural tab order is generally advised against\n */\n tabIndex?: HTMLAttributes<HTMLElement>[\"tabIndex\"];\n /**\n * This prop puts a `data` attribute on an HTML element in this component with the value provided.\n *\n * @deprecated **WARNING:** You should be using Semantic Selectors instead of this property. This is a temporary measure for backwards compatibility with existing Selenium tests.\n */\n testId?: string;\n /**\n * This prop puts a `translate` attribute on an HTML element. It should be used to indicate whether text within the element should be translated.\n */\n translate?: \"yes\" | \"no\";\n};\n"],"mappings":""}
package/dist/MenuItem.js CHANGED
@@ -42,6 +42,7 @@ const MenuItem = ({
42
42
  onClick: onClick,
43
43
  selected: isSelected,
44
44
  value: value,
45
+ tabIndex: 0,
45
46
  children: children
46
47
  });
47
48
  };
@@ -1 +1 @@
1
- {"version":3,"file":"MenuItem.js","names":["menuItemClasses","memo","useCallback","useContext","MenuContext","jsx","_jsx","MenuItem","children","hasInitialFocus","isSelected","isDisabled","onClick","onClickProp","testId","value","variant","closeMenu","shouldCloseOnSelect","event","_MenuItem","autoFocus","className","root","undefined","disabled","selected","MemoizedMenuItem","displayName"],"sources":["../src/MenuItem.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 MenuItem as MuiMenuItem,\n MenuItemProps as MuiMenuItemProps,\n} from \"@mui/material\";\nimport { menuItemClasses } from \"@mui/material/MenuItem\";\nimport { memo, useCallback, useContext, type ReactNode } from \"react\";\n\nimport { MenuContext } from \"./MenuContext\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type MenuItemProps = {\n /**\n * The content of the menu item.\n */\n children: ReactNode;\n /**\n * If `true`, the menu item will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * If `true`, the menu item will be visually marked as selected.\n */\n isSelected?: boolean;\n /**\n * If `true`, the menu item will be visually marked as disabled.\n */\n isDisabled?: boolean;\n /**\n * Callback fired when the menu item is clicked.\n */\n onClick?: MuiMenuItemProps[\"onClick\"];\n /**\n * The value associated with the menu item.\n */\n value?: string;\n /**\n * The variant of the menu item.\n * - \"default\": The default variant.\n * - \"destructive\": A variant indicating a destructive action.\n */\n variant?: \"default\" | \"destructive\";\n} & Pick<HtmlProps, \"testId\">;\n\nconst MenuItem = ({\n children,\n hasInitialFocus,\n isSelected,\n isDisabled,\n onClick: onClickProp,\n testId,\n value,\n variant = \"default\",\n}: MenuItemProps) => {\n const { closeMenu, shouldCloseOnSelect } = useContext(MenuContext);\n\n const onClick = useCallback<NonNullable<MuiMenuItemProps[\"onClick\"]>>(\n (event) => {\n onClickProp?.(event);\n if (shouldCloseOnSelect) {\n closeMenu();\n }\n },\n [onClickProp, closeMenu, shouldCloseOnSelect],\n );\n\n return (\n <MuiMenuItem\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n className={\n variant === \"destructive\"\n ? `${menuItemClasses.root}-destructive`\n : undefined\n }\n data-se={testId}\n disabled={isDisabled}\n onClick={onClick}\n selected={isSelected}\n value={value}\n >\n {children}\n </MuiMenuItem>\n );\n};\n\nconst MemoizedMenuItem = memo(MenuItem);\nMemoizedMenuItem.displayName = \"MenuItem\";\n\nexport { MemoizedMenuItem as MenuItem };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,eAAe,QAAQ,wBAAwB;AACxD,SAASC,IAAI,EAAEC,WAAW,EAAEC,UAAU,QAAwB,OAAO;AAAC,SAE7DC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAoCpB,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,QAAQ;EACRC,eAAe;EACfC,UAAU;EACVC,UAAU;EACVC,OAAO,EAAEC,WAAW;EACpBC,MAAM;EACNC,KAAK;EACLC,OAAO,GAAG;AACG,CAAC,KAAK;EACnB,MAAM;IAAEC,SAAS;IAAEC;EAAoB,CAAC,GAAGf,UAAU,CAACC,WAAW,CAAC;EAElE,MAAMQ,OAAO,GAAGV,WAAW,CACxBiB,KAAK,IAAK;IACTN,WAAW,GAAGM,KAAK,CAAC;IACpB,IAAID,mBAAmB,EAAE;MACvBD,SAAS,CAAC,CAAC;IACb;EACF,CAAC,EACD,CAACJ,WAAW,EAAEI,SAAS,EAAEC,mBAAmB,CAC9C,CAAC;EAED,OACEZ,IAAA,CAAAc,SAAA;IAEEC,SAAS,EAAEZ,eAAgB;IAC3Ba,SAAS,EACPN,OAAO,KAAK,aAAa,GACpB,GAAEhB,eAAe,CAACuB,IAAK,cAAa,GACrCC,SACL;IACD,WAASV,MAAO;IAChBW,QAAQ,EAAEd,UAAW;IACrBC,OAAO,EAAEA,OAAQ;IACjBc,QAAQ,EAAEhB,UAAW;IACrBK,KAAK,EAAEA,KAAM;IAAAP,QAAA,EAEZA;EAAQ,CACE,CAAC;AAElB,CAAC;AAED,MAAMmB,gBAAgB,GAAG1B,IAAI,CAACM,QAAQ,CAAC;AACvCoB,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAIpB,QAAQ"}
1
+ {"version":3,"file":"MenuItem.js","names":["menuItemClasses","memo","useCallback","useContext","MenuContext","jsx","_jsx","MenuItem","children","hasInitialFocus","isSelected","isDisabled","onClick","onClickProp","testId","value","variant","closeMenu","shouldCloseOnSelect","event","_MenuItem","autoFocus","className","root","undefined","disabled","selected","tabIndex","MemoizedMenuItem","displayName"],"sources":["../src/MenuItem.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 MenuItem as MuiMenuItem,\n MenuItemProps as MuiMenuItemProps,\n} from \"@mui/material\";\nimport { menuItemClasses } from \"@mui/material/MenuItem\";\nimport { memo, useCallback, useContext, type ReactNode } from \"react\";\n\nimport { MenuContext } from \"./MenuContext\";\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type MenuItemProps = {\n /**\n * The content of the menu item.\n */\n children: ReactNode;\n /**\n * If `true`, the menu item will receive focus automatically.\n */\n hasInitialFocus?: boolean;\n /**\n * If `true`, the menu item will be visually marked as selected.\n */\n isSelected?: boolean;\n /**\n * If `true`, the menu item will be visually marked as disabled.\n */\n isDisabled?: boolean;\n /**\n * Callback fired when the menu item is clicked.\n */\n onClick?: MuiMenuItemProps[\"onClick\"];\n /**\n * The value associated with the menu item.\n */\n value?: string;\n /**\n * The variant of the menu item.\n * - \"default\": The default variant.\n * - \"destructive\": A variant indicating a destructive action.\n */\n variant?: \"default\" | \"destructive\";\n} & Pick<HtmlProps, \"testId\">;\n\nconst MenuItem = ({\n children,\n hasInitialFocus,\n isSelected,\n isDisabled,\n onClick: onClickProp,\n testId,\n value,\n variant = \"default\",\n}: MenuItemProps) => {\n const { closeMenu, shouldCloseOnSelect } = useContext(MenuContext);\n\n const onClick = useCallback<NonNullable<MuiMenuItemProps[\"onClick\"]>>(\n (event) => {\n onClickProp?.(event);\n if (shouldCloseOnSelect) {\n closeMenu();\n }\n },\n [onClickProp, closeMenu, shouldCloseOnSelect],\n );\n\n return (\n <MuiMenuItem\n /* eslint-disable-next-line jsx-a11y/no-autofocus */\n autoFocus={hasInitialFocus}\n className={\n variant === \"destructive\"\n ? `${menuItemClasses.root}-destructive`\n : undefined\n }\n data-se={testId}\n disabled={isDisabled}\n onClick={onClick}\n selected={isSelected}\n value={value}\n tabIndex={0}\n >\n {children}\n </MuiMenuItem>\n );\n};\n\nconst MemoizedMenuItem = memo(MenuItem);\nMemoizedMenuItem.displayName = \"MenuItem\";\n\nexport { MemoizedMenuItem as MenuItem };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,eAAe,QAAQ,wBAAwB;AACxD,SAASC,IAAI,EAAEC,WAAW,EAAEC,UAAU,QAAwB,OAAO;AAAC,SAE7DC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAoCpB,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,QAAQ;EACRC,eAAe;EACfC,UAAU;EACVC,UAAU;EACVC,OAAO,EAAEC,WAAW;EACpBC,MAAM;EACNC,KAAK;EACLC,OAAO,GAAG;AACG,CAAC,KAAK;EACnB,MAAM;IAAEC,SAAS;IAAEC;EAAoB,CAAC,GAAGf,UAAU,CAACC,WAAW,CAAC;EAElE,MAAMQ,OAAO,GAAGV,WAAW,CACxBiB,KAAK,IAAK;IACTN,WAAW,GAAGM,KAAK,CAAC;IACpB,IAAID,mBAAmB,EAAE;MACvBD,SAAS,CAAC,CAAC;IACb;EACF,CAAC,EACD,CAACJ,WAAW,EAAEI,SAAS,EAAEC,mBAAmB,CAC9C,CAAC;EAED,OACEZ,IAAA,CAAAc,SAAA;IAEEC,SAAS,EAAEZ,eAAgB;IAC3Ba,SAAS,EACPN,OAAO,KAAK,aAAa,GACpB,GAAEhB,eAAe,CAACuB,IAAK,cAAa,GACrCC,SACL;IACD,WAASV,MAAO;IAChBW,QAAQ,EAAEd,UAAW;IACrBC,OAAO,EAAEA,OAAQ;IACjBc,QAAQ,EAAEhB,UAAW;IACrBK,KAAK,EAAEA,KAAM;IACbY,QAAQ,EAAE,CAAE;IAAAnB,QAAA,EAEXA;EAAQ,CACE,CAAC;AAElB,CAAC;AAED,MAAMoB,gBAAgB,GAAG3B,IAAI,CAACM,QAAQ,CAAC;AACvCqB,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAIrB,QAAQ"}
@@ -18,10 +18,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
18
18
  const OdysseyCacheProvider = ({
19
19
  children,
20
20
  emotionRoot,
21
+ hasShadowDom: hasShadowDomProp,
21
22
  nonce,
23
+ shadowDomElement,
22
24
  stylisPlugins
23
25
  }) => {
24
26
  const uniqueAlphabeticalId = useUniqueAlphabeticalId();
27
+ const hasShadowDom = hasShadowDomProp || shadowDomElement;
25
28
  const emotionCache = useMemo(() => {
26
29
  return createCache({
27
30
  ...(emotionRoot && {
@@ -30,12 +33,12 @@ const OdysseyCacheProvider = ({
30
33
  key: uniqueAlphabeticalId,
31
34
  nonce: nonce ?? window.cspNonce,
32
35
  prepend: true,
33
- speedy: false,
36
+ speedy: hasShadowDom ? false : true,
34
37
  ...(stylisPlugins && {
35
38
  stylisPlugins
36
39
  })
37
40
  });
38
- }, [emotionRoot, nonce, stylisPlugins, uniqueAlphabeticalId]);
41
+ }, [emotionRoot, hasShadowDom, nonce, stylisPlugins, uniqueAlphabeticalId]);
39
42
  return _jsx(CacheProvider, {
40
43
  value: emotionCache,
41
44
  children: children
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","memo","useMemo","useUniqueAlphabeticalId","CacheProvider","jsx","_jsx","OdysseyCacheProvider","children","emotionRoot","nonce","stylisPlugins","uniqueAlphabeticalId","emotionCache","container","key","window","cspNonce","prepend","speedy","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../src/OdysseyCacheProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\ndeclare global {\n interface Window {\n cspNonce: string;\n }\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { memo, useMemo, ReactNode } from \"react\";\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId\";\nimport { CacheProvider } from \"@emotion/react\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n nonce?: string;\n /**\n * Emotion caches styles into the style element.\n * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.\n */\n emotionRoot?: HTMLStyleElement;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n emotionRoot,\n nonce,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const emotionCache = useMemo(() => {\n return createCache({\n ...(emotionRoot && { container: emotionRoot }),\n key: uniqueAlphabeticalId,\n nonce: nonce ?? window.cspNonce,\n prepend: true,\n speedy: false, // <-- Needs to be set to false when shadow-dom is used!! https://github.com/emotion-js/emotion/issues/2053#issuecomment-713429122\n ...(stylisPlugins && { stylisPlugins }),\n });\n }, [emotionRoot, nonce, stylisPlugins, uniqueAlphabeticalId]);\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,WAAW,MAAwB,gBAAgB;AAC1D,SAASC,IAAI,EAAEC,OAAO,QAAmB,OAAO;AAAC,SACxCC,uBAAuB;AAChC,SAASC,aAAa,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAkB/C,MAAMC,oBAAoB,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,WAAW;EACXC,KAAK;EACLC;AACyB,CAAC,KAAK;EAC/B,MAAMC,oBAAoB,GAAGT,uBAAuB,CAAC,CAAC;EAEtD,MAAMU,YAAY,GAAGX,OAAO,CAAC,MAAM;IACjC,OAAOF,WAAW,CAAC;MACjB,IAAIS,WAAW,IAAI;QAAEK,SAAS,EAAEL;MAAY,CAAC,CAAC;MAC9CM,GAAG,EAAEH,oBAAoB;MACzBF,KAAK,EAAEA,KAAK,IAAIM,MAAM,CAACC,QAAQ;MAC/BC,OAAO,EAAE,IAAI;MACbC,MAAM,EAAE,KAAK;MACb,IAAIR,aAAa,IAAI;QAAEA;MAAc,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,EAAE,CAACF,WAAW,EAAEC,KAAK,EAAEC,aAAa,EAAEC,oBAAoB,CAAC,CAAC;EAE7D,OAAON,IAAA,CAACF,aAAa;IAACgB,KAAK,EAAEP,YAAa;IAAAL,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AACvE,CAAC;AAED,MAAMa,4BAA4B,GAAGpB,IAAI,CAACM,oBAAoB,CAAC;AAC/Dc,4BAA4B,CAACC,WAAW,GAAG,sBAAsB;AAEjE,SAASD,4BAA4B,IAAId,oBAAoB"}
1
+ {"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","memo","useMemo","useUniqueAlphabeticalId","CacheProvider","jsx","_jsx","OdysseyCacheProvider","children","emotionRoot","hasShadowDom","hasShadowDomProp","nonce","shadowDomElement","stylisPlugins","uniqueAlphabeticalId","emotionCache","container","key","window","cspNonce","prepend","speedy","value","MemoizedOdysseyCacheProvider","displayName"],"sources":["../src/OdysseyCacheProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\ndeclare global {\n interface Window {\n cspNonce: string;\n }\n}\n\nimport createCache, { StylisPlugin } from \"@emotion/cache\";\nimport { memo, useMemo, ReactNode } from \"react\";\nimport { useUniqueAlphabeticalId } from \"./useUniqueAlphabeticalId\";\nimport { CacheProvider } from \"@emotion/react\";\n\nexport type OdysseyCacheProviderProps = {\n children: ReactNode;\n /**\n * Emotion caches styles into the style element.\n * When enabling this prop, Emotion caches the styles at this element, rather than in <head>.\n */\n emotionRoot?: HTMLStyleElement;\n hasShadowDom?: boolean;\n nonce?: string;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n */\n /**\n * @deprecated Will be removed in a future Odyssey version. Use `hasShadowDomElement` instead.\n */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n emotionRoot,\n hasShadowDom: hasShadowDomProp,\n nonce,\n shadowDomElement,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const hasShadowDom = hasShadowDomProp || shadowDomElement;\n\n const emotionCache = useMemo(() => {\n return createCache({\n ...(emotionRoot && { container: emotionRoot }),\n key: uniqueAlphabeticalId,\n nonce: nonce ?? window.cspNonce,\n prepend: true,\n speedy: hasShadowDom ? false : true, // <-- Needs to be set to false when shadow-dom is used!! https://github.com/emotion-js/emotion/issues/2053#issuecomment-713429122\n ...(stylisPlugins && { stylisPlugins }),\n });\n }, [emotionRoot, hasShadowDom, nonce, stylisPlugins, uniqueAlphabeticalId]);\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAQA,OAAOA,WAAW,MAAwB,gBAAgB;AAC1D,SAASC,IAAI,EAAEC,OAAO,QAAmB,OAAO;AAAC,SACxCC,uBAAuB;AAChC,SAASC,aAAa,QAAQ,gBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAsB/C,MAAMC,oBAAoB,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,WAAW;EACXC,YAAY,EAAEC,gBAAgB;EAC9BC,KAAK;EACLC,gBAAgB;EAChBC;AACyB,CAAC,KAAK;EAC/B,MAAMC,oBAAoB,GAAGZ,uBAAuB,CAAC,CAAC;EAEtD,MAAMO,YAAY,GAAGC,gBAAgB,IAAIE,gBAAgB;EAEzD,MAAMG,YAAY,GAAGd,OAAO,CAAC,MAAM;IACjC,OAAOF,WAAW,CAAC;MACjB,IAAIS,WAAW,IAAI;QAAEQ,SAAS,EAAER;MAAY,CAAC,CAAC;MAC9CS,GAAG,EAAEH,oBAAoB;MACzBH,KAAK,EAAEA,KAAK,IAAIO,MAAM,CAACC,QAAQ;MAC/BC,OAAO,EAAE,IAAI;MACbC,MAAM,EAAEZ,YAAY,GAAG,KAAK,GAAG,IAAI;MACnC,IAAII,aAAa,IAAI;QAAEA;MAAc,CAAC;IACxC,CAAC,CAAC;EACJ,CAAC,EAAE,CAACL,WAAW,EAAEC,YAAY,EAAEE,KAAK,EAAEE,aAAa,EAAEC,oBAAoB,CAAC,CAAC;EAE3E,OAAOT,IAAA,CAACF,aAAa;IAACmB,KAAK,EAAEP,YAAa;IAAAR,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AACvE,CAAC;AAED,MAAMgB,4BAA4B,GAAGvB,IAAI,CAACM,oBAAoB,CAAC;AAC/DiB,4BAA4B,CAACC,WAAW,GAAG,sBAAsB;AAEjE,SAASD,4BAA4B,IAAIjB,oBAAoB"}
@@ -29,7 +29,7 @@ const OdysseyProvider = ({
29
29
  }) => _jsx(OdysseyCacheProvider, {
30
30
  nonce: nonce,
31
31
  emotionRoot: emotionRoot,
32
- shadowDomElement: shadowDomElement,
32
+ hasShadowDom: Boolean(shadowDomElement),
33
33
  stylisPlugins: stylisPlugins,
34
34
  children: _jsx(OdysseyThemeProvider, {
35
35
  designTokensOverride: designTokensOverride,
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","OdysseyProvider","children","designTokensOverride","emotionRoot","shadowDomElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","_ScopedCssBaseline","MemoizedThemeProvider"],"sources":["../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { ScopedCssBaseline } from \"@mui/material\";\n\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider\";\nimport {\n OdysseyTranslationProvider,\n OdysseyTranslationProviderProps,\n} from \"./OdysseyTranslationProvider\";\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n designTokensOverride,\n emotionRoot,\n shadowDomElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n nonce={nonce}\n emotionRoot={emotionRoot}\n shadowDomElement={shadowDomElement}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n designTokensOverride={designTokensOverride}\n shadowDomElement={shadowDomElement}\n themeOverride={themeOverride}\n >\n <ScopedCssBaseline>\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n </ScopedCssBaseline>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\n\nconst MemoizedThemeProvider = memo(OdysseyProvider) as typeof OdysseyProvider;\n\nexport { MemoizedThemeProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAItCC,oBAAoB;AAAA,SAIpBC,oBAAoB;AAAA,SAIpBC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAa5B,MAAMC,eAAe,GAAGA,CAAoC;EAC1DC,QAAQ;EACRC,oBAAoB;EACpBC,WAAW;EACXC,gBAAgB;EAChBC,YAAY;EACZC,KAAK;EACLC,aAAa;EACbC,aAAa;EACbC;AACwC,CAAC,KACzCV,IAAA,CAACJ,oBAAoB;EACnBW,KAAK,EAAEA,KAAM;EACbH,WAAW,EAAEA,WAAY;EACzBC,gBAAgB,EAAEA,gBAAiB;EACnCG,aAAa,EAAEA,aAAc;EAAAN,QAAA,EAE7BF,IAAA,CAACH,oBAAoB;IACnBM,oBAAoB,EAAEA,oBAAqB;IAC3CE,gBAAgB,EAAEA,gBAAiB;IACnCI,aAAa,EAAEA,aAAc;IAAAP,QAAA,EAE7BF,IAAA,CAAAW,kBAAA;MAAAT,QAAA,EACEF,IAAA,CAACF,0BAA0B;QACzBQ,YAAY,EAAEA,YAAa;QAC3BI,oBAAoB,EAAEA,oBAAqB;QAAAR,QAAA,EAE1CA;MAAQ,CACiB;IAAC,CACZ;EAAC,CACA;AAAC,CACH,CACvB;AAED,MAAMU,qBAAqB,GAAGjB,IAAI,CAACM,eAAe,CAA2B;AAE7E,SAASW,qBAAqB,IAAIX,eAAe"}
1
+ {"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","OdysseyProvider","children","designTokensOverride","emotionRoot","shadowDomElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","hasShadowDom","Boolean","_ScopedCssBaseline","MemoizedThemeProvider"],"sources":["../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { ScopedCssBaseline } from \"@mui/material\";\n\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider\";\nimport {\n OdysseyTranslationProvider,\n OdysseyTranslationProviderProps,\n} from \"./OdysseyTranslationProvider\";\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n designTokensOverride,\n emotionRoot,\n shadowDomElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n nonce={nonce}\n emotionRoot={emotionRoot}\n hasShadowDom={Boolean(shadowDomElement)}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n designTokensOverride={designTokensOverride}\n shadowDomElement={shadowDomElement}\n themeOverride={themeOverride}\n >\n <ScopedCssBaseline>\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n </ScopedCssBaseline>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\n\nconst MemoizedThemeProvider = memo(OdysseyProvider) as typeof OdysseyProvider;\n\nexport { MemoizedThemeProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAItCC,oBAAoB;AAAA,SAIpBC,oBAAoB;AAAA,SAIpBC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAa5B,MAAMC,eAAe,GAAGA,CAAoC;EAC1DC,QAAQ;EACRC,oBAAoB;EACpBC,WAAW;EACXC,gBAAgB;EAChBC,YAAY;EACZC,KAAK;EACLC,aAAa;EACbC,aAAa;EACbC;AACwC,CAAC,KACzCV,IAAA,CAACJ,oBAAoB;EACnBW,KAAK,EAAEA,KAAM;EACbH,WAAW,EAAEA,WAAY;EACzBO,YAAY,EAAEC,OAAO,CAACP,gBAAgB,CAAE;EACxCG,aAAa,EAAEA,aAAc;EAAAN,QAAA,EAE7BF,IAAA,CAACH,oBAAoB;IACnBM,oBAAoB,EAAEA,oBAAqB;IAC3CE,gBAAgB,EAAEA,gBAAiB;IACnCI,aAAa,EAAEA,aAAc;IAAAP,QAAA,EAE7BF,IAAA,CAAAa,kBAAA;MAAAX,QAAA,EACEF,IAAA,CAACF,0BAA0B;QACzBQ,YAAY,EAAEA,YAAa;QAC3BI,oBAAoB,EAAEA,oBAAqB;QAAAR,QAAA,EAE1CA;MAAQ,CACiB;IAAC,CACZ;EAAC,CACA;AAAC,CACH,CACvB;AAED,MAAMY,qBAAqB,GAAGnB,IAAI,CAACM,eAAe,CAA2B;AAE7E,SAASa,qBAAqB,IAAIb,eAAe"}
@@ -24,18 +24,13 @@ const mergeBundleOverrides = (languageCode, translationOverrides) => {
24
24
  ...translationStringOverrides
25
25
  };
26
26
  };
27
- const formatLanguageCodeToHyphenated = languageCode => languageCode?.replaceAll("_", "-");
28
27
  export const OdysseyTranslationProvider = ({
29
28
  children,
30
29
  languageCode,
31
30
  translationOverrides
32
31
  }) => {
33
32
  useEffect(() => {
34
- const normalizedLanguageCode = formatLanguageCodeToHyphenated(languageCode);
35
- const changeHtmlElementLanguageAttribute = () => {
36
- window.document.documentElement.setAttribute("lang", normalizedLanguageCode || "en");
37
- };
38
- i18n.changeLanguage(languageCode || window.navigator.language, changeHtmlElementLanguageAttribute);
33
+ i18n.changeLanguage(languageCode || window.navigator.language);
39
34
  }, [languageCode]);
40
35
  useEffect(() => {
41
36
  if (translationOverrides) {
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyTranslationProvider.js","names":["useEffect","i18n","defaultNS","resources","I18nextProvider","getTypedObjectKeys","jsx","_jsx","odysseyI18nResourceKeysList","mergeBundleOverrides","languageCode","translationOverrides","translationStrings","translationStringOverrides","formatLanguageCodeToHyphenated","replaceAll","OdysseyTranslationProvider","children","normalizedLanguageCode","changeHtmlElementLanguageAttribute","window","document","documentElement","setAttribute","changeLanguage","navigator","language","forEach","bundle","addResourceBundle"],"sources":["../src/OdysseyTranslationProvider.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 { ReactNode, useEffect } from \"react\";\n\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nimport { i18n, defaultNS, resources } from \"./i18n\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { getTypedObjectKeys } from \"./getTypedObjectKeys\";\n\nexport type OdysseyI18nResourceKeys = (typeof resources)[\"en\"];\nexport const odysseyI18nResourceKeysList = getTypedObjectKeys(resources[\"en\"]);\n\nexport type TranslationOverrides<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = Record<SupportedLanguages, Partial<OdysseyI18nResourceKeys>>;\n\nconst mergeBundleOverrides = <SupportedLanguages extends string>(\n languageCode: SupportedLanguages,\n translationOverrides: TranslationOverrides<SupportedLanguages>,\n) => {\n const translationStrings = resources[languageCode] || {};\n const translationStringOverrides = translationOverrides[languageCode];\n return {\n ...translationStrings,\n ...translationStringOverrides,\n };\n};\n\nexport type OdysseyTranslationProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = {\n children: ReactNode;\n languageCode?: SupportedLanguages | DefaultSupportedLanguages;\n translationOverrides?: TranslationOverrides<SupportedLanguages>;\n};\n\nconst formatLanguageCodeToHyphenated = <SupportedLanguages extends string>(\n languageCode: OdysseyTranslationProviderProps<SupportedLanguages>[\"languageCode\"],\n) => languageCode?.replaceAll(\"_\", \"-\");\n\nexport const OdysseyTranslationProvider = <SupportedLanguages extends string>({\n children,\n languageCode,\n translationOverrides,\n}: OdysseyTranslationProviderProps<SupportedLanguages>) => {\n useEffect(() => {\n const normalizedLanguageCode =\n formatLanguageCodeToHyphenated<SupportedLanguages>(languageCode);\n\n const changeHtmlElementLanguageAttribute = () => {\n window.document.documentElement.setAttribute(\n \"lang\",\n normalizedLanguageCode || \"en\",\n );\n };\n // Defaults to the browser's language if available otherwise `en` will be used\n i18n.changeLanguage(\n languageCode || window.navigator.language,\n changeHtmlElementLanguageAttribute,\n );\n }, [languageCode]);\n\n useEffect(() => {\n if (translationOverrides) {\n getTypedObjectKeys(translationOverrides).forEach((language) => {\n const bundle = mergeBundleOverrides<SupportedLanguages>(\n language,\n translationOverrides,\n );\n i18n.addResourceBundle(language, defaultNS, bundle);\n });\n }\n }, [translationOverrides]);\n\n return <I18nextProvider i18n={i18n}>{children}</I18nextProvider>;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,SAAS,QAAQ,OAAO;AAAC,SAIpCC,IAAI,EAAEC,SAAS,EAAEC,SAAS;AACnC,SAASC,eAAe,QAAQ,eAAe;AAAC,SACvCC,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG3B,OAAO,MAAMC,2BAA2B,GAAGH,kBAAkB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;IAACH,IAAI,EAAEA,IAAK;IAAAgB,QAAA,EAAEA;EAAQ,CAAkB,CAAC;AAClE,CAAC"}
1
+ {"version":3,"file":"OdysseyTranslationProvider.js","names":["useEffect","i18n","defaultNS","resources","I18nextProvider","getTypedObjectKeys","jsx","_jsx","odysseyI18nResourceKeysList","mergeBundleOverrides","languageCode","translationOverrides","translationStrings","translationStringOverrides","OdysseyTranslationProvider","children","changeLanguage","window","navigator","language","forEach","bundle","addResourceBundle"],"sources":["../src/OdysseyTranslationProvider.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 { ReactNode, useEffect } from \"react\";\n\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nimport { i18n, defaultNS, resources } from \"./i18n\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { getTypedObjectKeys } from \"./getTypedObjectKeys\";\n\nexport type OdysseyI18nResourceKeys = (typeof resources)[\"en\"];\nexport const odysseyI18nResourceKeysList = getTypedObjectKeys(resources[\"en\"]);\n\nexport type TranslationOverrides<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = Record<SupportedLanguages, Partial<OdysseyI18nResourceKeys>>;\n\nconst mergeBundleOverrides = <SupportedLanguages extends string>(\n languageCode: SupportedLanguages,\n translationOverrides: TranslationOverrides<SupportedLanguages>,\n) => {\n const translationStrings = resources[languageCode] || {};\n const translationStringOverrides = translationOverrides[languageCode];\n return {\n ...translationStrings,\n ...translationStringOverrides,\n };\n};\n\nexport type OdysseyTranslationProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = {\n children: ReactNode;\n languageCode?: SupportedLanguages | DefaultSupportedLanguages;\n translationOverrides?: TranslationOverrides<SupportedLanguages>;\n};\n\nexport const OdysseyTranslationProvider = <SupportedLanguages extends string>({\n children,\n languageCode,\n translationOverrides,\n}: OdysseyTranslationProviderProps<SupportedLanguages>) => {\n useEffect(() => {\n // Defaults to the browser's language if available otherwise `en` will be used\n i18n.changeLanguage(languageCode || window.navigator.language);\n }, [languageCode]);\n\n useEffect(() => {\n if (translationOverrides) {\n getTypedObjectKeys(translationOverrides).forEach((language) => {\n const bundle = mergeBundleOverrides<SupportedLanguages>(\n language,\n translationOverrides,\n );\n i18n.addResourceBundle(language, defaultNS, bundle);\n });\n }\n }, [translationOverrides]);\n\n return <I18nextProvider i18n={i18n}>{children}</I18nextProvider>;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAoBA,SAAS,QAAQ,OAAO;AAAC,SAIpCC,IAAI,EAAEC,SAAS,EAAEC,SAAS;AACnC,SAASC,eAAe,QAAQ,eAAe;AAAC,SACvCC,kBAAkB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAG3B,OAAO,MAAMC,2BAA2B,GAAGH,kBAAkB,CAACF,SAAS,CAAC,IAAI,CAAC,CAAC;AAM9E,MAAMM,oBAAoB,GAAGA,CAC3BC,YAAgC,EAChCC,oBAA8D,KAC3D;EACH,MAAMC,kBAAkB,GAAGT,SAAS,CAACO,YAAY,CAAC,IAAI,CAAC,CAAC;EACxD,MAAMG,0BAA0B,GAAGF,oBAAoB,CAACD,YAAY,CAAC;EACrE,OAAO;IACL,GAAGE,kBAAkB;IACrB,GAAGC;EACL,CAAC;AACH,CAAC;AAUD,OAAO,MAAMC,0BAA0B,GAAGA,CAAoC;EAC5EC,QAAQ;EACRL,YAAY;EACZC;AACmD,CAAC,KAAK;EACzDX,SAAS,CAAC,MAAM;IAEdC,IAAI,CAACe,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