@okta/odyssey-react-mui 1.21.2 → 1.23.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 (593) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/@types/i18next.d.js.map +1 -1
  3. package/dist/Autocomplete.js +106 -38
  4. package/dist/Autocomplete.js.map +1 -1
  5. package/dist/Callout.js +12 -24
  6. package/dist/Callout.js.map +1 -1
  7. package/dist/Checkbox.js +26 -11
  8. package/dist/Checkbox.js.map +1 -1
  9. package/dist/CheckboxGroup.js +14 -3
  10. package/dist/CheckboxGroup.js.map +1 -1
  11. package/dist/DataTable/DataTable.js +10 -2
  12. package/dist/DataTable/DataTable.js.map +1 -1
  13. package/dist/DataTable/useScrollIndication.js +9 -5
  14. package/dist/DataTable/useScrollIndication.js.map +1 -1
  15. package/dist/Field.js +3 -1
  16. package/dist/Field.js.map +1 -1
  17. package/dist/FileUploader/FileUploadIllustration.js.map +1 -0
  18. package/dist/FileUploader/FileUploadPreview.js.map +1 -0
  19. package/dist/{labs/FileUpload.js → FileUploader/FileUploader.js} +6 -5
  20. package/dist/FileUploader/FileUploader.js.map +1 -0
  21. package/dist/FileUploader/index.js +13 -0
  22. package/dist/FileUploader/index.js.map +1 -0
  23. package/dist/OdysseyCacheProvider.js +4 -3
  24. package/dist/OdysseyCacheProvider.js.map +1 -1
  25. package/dist/OdysseyProvider.js +10 -3
  26. package/dist/OdysseyProvider.js.map +1 -1
  27. package/dist/OdysseyThemeProvider.js +3 -2
  28. package/dist/OdysseyThemeProvider.js.map +1 -1
  29. package/dist/Radio.js +33 -6
  30. package/dist/Radio.js.map +1 -1
  31. package/dist/RadioGroup.js +17 -5
  32. package/dist/RadioGroup.js.map +1 -1
  33. package/dist/Select.js +89 -31
  34. package/dist/Select.js.map +1 -1
  35. package/dist/{labs/Switch.js → Switch.js} +77 -23
  36. package/dist/Switch.js.map +1 -0
  37. package/dist/Tabs.js +7 -9
  38. package/dist/Tabs.js.map +1 -1
  39. package/dist/Tag.js +102 -4
  40. package/dist/Tag.js.map +1 -1
  41. package/dist/TextField.js +16 -39
  42. package/dist/TextField.js.map +1 -1
  43. package/dist/Toast.js +2 -2
  44. package/dist/Toast.js.map +1 -1
  45. package/dist/ToastStack.js.map +1 -1
  46. package/dist/createShadowDomElements.js +43 -0
  47. package/dist/createShadowDomElements.js.map +1 -0
  48. package/dist/i18n.js +1 -1
  49. package/dist/i18n.js.map +1 -1
  50. package/dist/index.js +3 -2
  51. package/dist/index.js.map +1 -1
  52. package/dist/index.scss +96 -8
  53. package/dist/labs/AppTile.js +124 -0
  54. package/dist/labs/AppTile.js.map +1 -0
  55. package/dist/labs/DataView/BulkActionsMenu.js.map +1 -0
  56. package/dist/labs/{DataComponents/StackContent.js → DataView/CardLayoutContent.js} +14 -14
  57. package/dist/labs/DataView/CardLayoutContent.js.map +1 -0
  58. package/dist/labs/{DataComponents/StackCard.js → DataView/DataCard.js} +6 -6
  59. package/dist/labs/DataView/DataCard.js.map +1 -0
  60. package/dist/labs/{DataComponents → DataView}/DataTable.js +6 -2
  61. package/dist/labs/DataView/DataTable.js.map +1 -0
  62. package/dist/labs/{DataComponents → DataView}/DataView.js +79 -30
  63. package/dist/labs/DataView/DataView.js.map +1 -0
  64. package/dist/labs/DataView/DetailPanel.js.map +1 -0
  65. package/dist/labs/DataView/LayoutSwitcher.js.map +1 -0
  66. package/dist/labs/DataView/RowActions.js.map +1 -0
  67. package/dist/labs/{DataComponents/TableContent.js → DataView/TableLayoutContent.js} +34 -20
  68. package/dist/labs/DataView/TableLayoutContent.js.map +1 -0
  69. package/dist/labs/{DataComponents → DataView}/TableSettings.js +2 -2
  70. package/dist/labs/DataView/TableSettings.js.map +1 -0
  71. package/dist/labs/DataView/componentTypes.js.map +1 -0
  72. package/dist/labs/{DataComponents → DataView}/constants.js +2 -2
  73. package/dist/labs/DataView/constants.js.map +1 -0
  74. package/dist/labs/DataView/dataTypes.js.map +1 -0
  75. package/dist/labs/DataView/fetchData.js.map +1 -0
  76. package/dist/labs/{DataComponents → DataView}/index.js +0 -1
  77. package/dist/labs/DataView/index.js.map +1 -0
  78. package/dist/labs/DataView/tableConstants.js.map +1 -0
  79. package/dist/labs/DataView/useFilterConversion.js.map +1 -0
  80. package/dist/labs/DateField.js +2 -0
  81. package/dist/labs/DateField.js.map +1 -1
  82. package/dist/labs/DatePicker.js +5 -1
  83. package/dist/labs/DatePicker.js.map +1 -1
  84. package/dist/labs/SideNav/CollapseIcon.js +44 -0
  85. package/dist/labs/SideNav/CollapseIcon.js.map +1 -0
  86. package/dist/labs/SideNav/OktaLogo.js +36 -0
  87. package/dist/labs/SideNav/OktaLogo.js.map +1 -0
  88. package/dist/labs/SideNav/SideNav.js +335 -0
  89. package/dist/labs/SideNav/SideNav.js.map +1 -0
  90. package/dist/labs/SideNav/SideNavFooterContent.js +49 -0
  91. package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -0
  92. package/dist/labs/SideNav/SideNavHeader.js +81 -0
  93. package/dist/labs/SideNav/SideNavHeader.js.map +1 -0
  94. package/dist/labs/SideNav/SideNavItemContent.js +157 -0
  95. package/dist/labs/SideNav/SideNavItemContent.js.map +1 -0
  96. package/dist/labs/SideNav/SideNavItemLinkContent.js +71 -0
  97. package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -0
  98. package/dist/labs/SideNav/index.js +14 -0
  99. package/dist/labs/SideNav/index.js.map +1 -0
  100. package/dist/labs/SideNav/types.js +2 -0
  101. package/dist/labs/SideNav/types.js.map +1 -0
  102. package/dist/labs/TopNav.js +2 -1
  103. package/dist/labs/TopNav.js.map +1 -1
  104. package/dist/labs/index.js +3 -4
  105. package/dist/labs/index.js.map +1 -1
  106. package/dist/labs/useDateFieldsTranslations.js +1 -1
  107. package/dist/labs/useDateFieldsTranslations.js.map +1 -1
  108. package/dist/properties/ts/odyssey-react-mui.js +3 -1
  109. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  110. package/dist/properties/ts/odyssey-react-mui_cs.js +17 -3
  111. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  112. package/dist/properties/ts/odyssey-react-mui_da.js +17 -3
  113. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  114. package/dist/properties/ts/odyssey-react-mui_de.js +16 -2
  115. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  116. package/dist/properties/ts/odyssey-react-mui_el.js +18 -4
  117. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  118. package/dist/properties/ts/odyssey-react-mui_es.js +17 -3
  119. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  120. package/dist/properties/ts/odyssey-react-mui_fi.js +17 -3
  121. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  122. package/dist/properties/ts/odyssey-react-mui_fr.js +17 -3
  123. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  124. package/dist/properties/ts/odyssey-react-mui_ht.js +18 -4
  125. package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  126. package/dist/properties/ts/odyssey-react-mui_hu.js +17 -3
  127. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  128. package/dist/properties/ts/odyssey-react-mui_id.js +17 -3
  129. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  130. package/dist/properties/ts/odyssey-react-mui_it.js +17 -3
  131. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  132. package/dist/properties/ts/odyssey-react-mui_ja.js +16 -2
  133. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  134. package/dist/properties/ts/odyssey-react-mui_ko.js +16 -2
  135. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  136. package/dist/properties/ts/odyssey-react-mui_ms.js +17 -3
  137. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  138. package/dist/properties/ts/odyssey-react-mui_nb.js +17 -3
  139. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  140. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +17 -3
  141. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  142. package/dist/properties/ts/odyssey-react-mui_pl.js +17 -3
  143. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  144. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +17 -3
  145. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  146. package/dist/properties/ts/odyssey-react-mui_ro.js +17 -3
  147. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  148. package/dist/properties/ts/odyssey-react-mui_ru.js +17 -3
  149. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  150. package/dist/properties/ts/odyssey-react-mui_sv.js +17 -3
  151. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  152. package/dist/properties/ts/odyssey-react-mui_th.js +16 -2
  153. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  154. package/dist/properties/ts/odyssey-react-mui_tr.js +17 -3
  155. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  156. package/dist/properties/ts/odyssey-react-mui_uk.js +17 -3
  157. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  158. package/dist/properties/ts/odyssey-react-mui_vi.js +17 -3
  159. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  160. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +16 -2
  161. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  162. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +16 -2
  163. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  164. package/dist/src/Autocomplete.d.ts +30 -0
  165. package/dist/src/Autocomplete.d.ts.map +1 -1
  166. package/dist/src/Callout.d.ts +11 -23
  167. package/dist/src/Callout.d.ts.map +1 -1
  168. package/dist/src/Checkbox.d.ts +2 -2
  169. package/dist/src/Checkbox.d.ts.map +1 -1
  170. package/dist/src/CheckboxGroup.d.ts +3 -3
  171. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  172. package/dist/src/DataTable/DataTable.d.ts +9 -1
  173. package/dist/src/DataTable/DataTable.d.ts.map +1 -1
  174. package/dist/src/DataTable/useScrollIndication.d.ts.map +1 -1
  175. package/dist/src/Field.d.ts +3 -2
  176. package/dist/src/Field.d.ts.map +1 -1
  177. package/dist/src/FileUploader/FileUploadIllustration.d.ts.map +1 -0
  178. package/dist/src/{labs → FileUploader}/FileUploadPreview.d.ts +2 -2
  179. package/dist/src/FileUploader/FileUploadPreview.d.ts.map +1 -0
  180. package/dist/src/{labs/FileUpload.d.ts → FileUploader/FileUploader.d.ts} +5 -4
  181. package/dist/src/FileUploader/FileUploader.d.ts.map +1 -0
  182. package/dist/src/FileUploader/index.d.ts +13 -0
  183. package/dist/src/FileUploader/index.d.ts.map +1 -0
  184. package/dist/src/NativeSelect.d.ts +1 -1
  185. package/dist/src/OdysseyCacheProvider.d.ts +7 -3
  186. package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
  187. package/dist/src/OdysseyProvider.d.ts +1 -1
  188. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  189. package/dist/src/OdysseyThemeProvider.d.ts +3 -1
  190. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  191. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  192. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  193. package/dist/src/PasswordField.d.ts +1 -1
  194. package/dist/src/Radio.d.ts +6 -8
  195. package/dist/src/Radio.d.ts.map +1 -1
  196. package/dist/src/RadioGroup.d.ts +4 -5
  197. package/dist/src/RadioGroup.d.ts.map +1 -1
  198. package/dist/src/SearchField.d.ts +1 -1
  199. package/dist/src/Select.d.ts +38 -2
  200. package/dist/src/Select.d.ts.map +1 -1
  201. package/dist/src/{labs/Switch.d.ts → Switch.d.ts} +8 -4
  202. package/dist/src/Switch.d.ts.map +1 -0
  203. package/dist/src/Tabs.d.ts +6 -8
  204. package/dist/src/Tabs.d.ts.map +1 -1
  205. package/dist/src/Tag.d.ts +7 -1
  206. package/dist/src/Tag.d.ts.map +1 -1
  207. package/dist/src/TextField.d.ts +17 -40
  208. package/dist/src/TextField.d.ts.map +1 -1
  209. package/dist/src/ToastStack.d.ts +2 -2
  210. package/dist/src/ToastStack.d.ts.map +1 -1
  211. package/dist/src/{createShadowRootElement.d.ts → createShadowDomElements.d.ts} +6 -1
  212. package/dist/src/createShadowDomElements.d.ts.map +1 -0
  213. package/dist/src/i18n.d.ts +2 -2
  214. package/dist/src/i18n.d.ts.map +1 -1
  215. package/dist/src/index.d.ts +3 -2
  216. package/dist/src/index.d.ts.map +1 -1
  217. package/dist/src/labs/AppTile.d.ts +39 -0
  218. package/dist/src/labs/AppTile.d.ts.map +1 -0
  219. package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -0
  220. package/dist/src/labs/{DataComponents/StackContent.d.ts → DataView/CardLayoutContent.d.ts} +7 -7
  221. package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -0
  222. package/dist/src/labs/{DataComponents/StackCard.d.ts → DataView/DataCard.d.ts} +4 -4
  223. package/dist/src/labs/DataView/DataCard.d.ts.map +1 -0
  224. package/dist/src/labs/DataView/DataTable.d.ts +16 -0
  225. package/dist/src/labs/DataView/DataTable.d.ts.map +1 -0
  226. package/dist/src/labs/{DataComponents → DataView}/DataView.d.ts +1 -1
  227. package/dist/src/labs/DataView/DataView.d.ts.map +1 -0
  228. package/dist/src/labs/{DataComponents → DataView}/DetailPanel.d.ts +2 -2
  229. package/dist/src/labs/DataView/DetailPanel.d.ts.map +1 -0
  230. package/dist/src/labs/DataView/LayoutSwitcher.d.ts.map +1 -0
  231. package/dist/src/labs/DataView/RowActions.d.ts.map +1 -0
  232. package/dist/src/labs/{DataComponents/TableContent.d.ts → DataView/TableLayoutContent.d.ts} +8 -7
  233. package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -0
  234. package/dist/src/labs/{DataComponents → DataView}/TableSettings.d.ts +3 -3
  235. package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -0
  236. package/dist/src/labs/{DataComponents → DataView}/componentTypes.d.ts +21 -9
  237. package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -0
  238. package/dist/src/labs/{DataComponents → DataView}/constants.d.ts +1 -1
  239. package/dist/src/labs/DataView/constants.d.ts.map +1 -0
  240. package/dist/src/labs/DataView/dataTypes.d.ts.map +1 -0
  241. package/dist/src/labs/DataView/fetchData.d.ts.map +1 -0
  242. package/dist/src/labs/{DataComponents → DataView}/index.d.ts +0 -1
  243. package/dist/src/labs/DataView/index.d.ts.map +1 -0
  244. package/dist/src/labs/DataView/tableConstants.d.ts.map +1 -0
  245. package/dist/src/labs/{DataComponents → DataView}/useFilterConversion.d.ts +2 -2
  246. package/dist/src/labs/DataView/useFilterConversion.d.ts.map +1 -0
  247. package/dist/src/labs/DateField.d.ts +2 -2
  248. package/dist/src/labs/DateField.d.ts.map +1 -1
  249. package/dist/src/labs/DatePicker.d.ts +2 -2
  250. package/dist/src/labs/DatePicker.d.ts.map +1 -1
  251. package/dist/src/labs/SideNav/CollapseIcon.d.ts +17 -0
  252. package/dist/src/labs/SideNav/CollapseIcon.d.ts.map +1 -0
  253. package/dist/src/labs/SideNav/OktaLogo.d.ts +14 -0
  254. package/dist/src/labs/SideNav/OktaLogo.d.ts.map +1 -0
  255. package/dist/src/labs/SideNav/SideNav.d.ts +16 -0
  256. package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -0
  257. package/dist/{test-selectors/odysseyTestSelectors.js → src/labs/SideNav/SideNavFooterContent.d.ts} +6 -9
  258. package/dist/src/labs/SideNav/SideNavFooterContent.d.ts.map +1 -0
  259. package/dist/src/labs/SideNav/SideNavHeader.d.ts +16 -0
  260. package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -0
  261. package/dist/src/labs/SideNav/SideNavItemContent.d.ts +33 -0
  262. package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -0
  263. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts +16 -0
  264. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts.map +1 -0
  265. package/dist/src/labs/SideNav/index.d.ts +14 -0
  266. package/dist/src/labs/SideNav/index.d.ts.map +1 -0
  267. package/dist/src/labs/{SideNav.d.ts → SideNav/types.d.ts} +54 -33
  268. package/dist/src/labs/SideNav/types.d.ts.map +1 -0
  269. package/dist/src/labs/TopNav.d.ts +1 -0
  270. package/dist/src/labs/TopNav.d.ts.map +1 -1
  271. package/dist/src/labs/index.d.ts +2 -3
  272. package/dist/src/labs/index.d.ts.map +1 -1
  273. package/dist/src/properties/ts/odyssey-react-mui.d.ts +2 -0
  274. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  275. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +15 -1
  276. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  277. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +15 -1
  278. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  279. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +15 -1
  280. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  281. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +15 -1
  282. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  283. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +15 -1
  284. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  285. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +15 -1
  286. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  287. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +15 -1
  288. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  289. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts +16 -2
  290. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  291. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +15 -1
  292. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  293. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +15 -1
  294. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  295. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +15 -1
  296. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  297. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +15 -1
  298. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  299. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +15 -1
  300. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  301. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +15 -1
  302. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  303. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +15 -1
  304. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  305. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +15 -1
  306. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  307. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +15 -1
  308. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  309. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +15 -1
  310. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  311. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +15 -1
  312. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  313. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +15 -1
  314. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  315. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +15 -1
  316. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  317. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +15 -1
  318. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  319. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +15 -1
  320. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  321. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +15 -1
  322. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  323. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +15 -1
  324. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  325. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +15 -1
  326. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  327. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +15 -1
  328. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  329. package/dist/src/test-selectors/getByQuerySelector.d.ts +148 -0
  330. package/dist/src/test-selectors/getByQuerySelector.d.ts.map +1 -0
  331. package/dist/src/test-selectors/getComputedAccessibleErrorMessageText.d.ts +14 -0
  332. package/dist/src/test-selectors/getComputedAccessibleErrorMessageText.d.ts.map +1 -0
  333. package/dist/src/test-selectors/getComputedAccessibleText.d.ts +23 -0
  334. package/dist/src/test-selectors/getComputedAccessibleText.d.ts.map +1 -0
  335. package/dist/src/test-selectors/index.d.ts +2 -2
  336. package/dist/src/test-selectors/index.d.ts.map +1 -1
  337. package/{src/test-selectors/odysseyTestSelectors.ts → dist/src/test-selectors/interpolateString.d.ts} +4 -11
  338. package/dist/src/test-selectors/interpolateString.d.ts.map +1 -0
  339. package/dist/src/test-selectors/linkedHtmlSelectors.d.ts +24 -0
  340. package/dist/src/test-selectors/linkedHtmlSelectors.d.ts.map +1 -0
  341. package/dist/src/test-selectors/queryOdysseySelector.d.ts +5755 -0
  342. package/dist/src/test-selectors/queryOdysseySelector.d.ts.map +1 -0
  343. package/dist/src/test-selectors/querySelector.d.ts +59 -3613
  344. package/dist/src/test-selectors/querySelector.d.ts.map +1 -1
  345. package/dist/src/test-selectors/sanityChecks.d.ts +18 -0
  346. package/dist/src/test-selectors/sanityChecks.d.ts.map +1 -0
  347. package/dist/src/test-selectors/testSelector.d.ts +46 -0
  348. package/dist/src/test-selectors/testSelector.d.ts.map +1 -0
  349. package/dist/src/theme/components.d.ts +3 -1
  350. package/dist/src/theme/components.d.ts.map +1 -1
  351. package/dist/src/theme/createOdysseyMuiTheme.d.ts +3 -1
  352. package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
  353. package/dist/test-selectors/getByQuerySelector.js +64 -0
  354. package/dist/test-selectors/getByQuerySelector.js.map +1 -0
  355. package/dist/test-selectors/getComputedAccessibleErrorMessageText.js +25 -0
  356. package/dist/test-selectors/getComputedAccessibleErrorMessageText.js.map +1 -0
  357. package/dist/test-selectors/getComputedAccessibleText.js +24 -0
  358. package/dist/test-selectors/getComputedAccessibleText.js.map +1 -0
  359. package/dist/test-selectors/index.js +2 -2
  360. package/dist/test-selectors/index.js.map +1 -1
  361. package/dist/test-selectors/interpolateString.js +25 -0
  362. package/dist/test-selectors/interpolateString.js.map +1 -0
  363. package/dist/test-selectors/linkedHtmlSelectors.js +34 -0
  364. package/dist/test-selectors/linkedHtmlSelectors.js.map +1 -0
  365. package/dist/test-selectors/queryOdysseySelector.js +26 -0
  366. package/dist/test-selectors/queryOdysseySelector.js.map +1 -0
  367. package/dist/test-selectors/querySelector.js +82 -58
  368. package/dist/test-selectors/querySelector.js.map +1 -1
  369. package/dist/test-selectors/sanityChecks.js +33 -0
  370. package/dist/test-selectors/sanityChecks.js.map +1 -0
  371. package/dist/test-selectors/testSelector.js +2 -0
  372. package/dist/test-selectors/testSelector.js.map +1 -0
  373. package/dist/test-selectors/testSelectors.json +1 -1
  374. package/dist/theme/components.js +231 -146
  375. package/dist/theme/components.js.map +1 -1
  376. package/dist/theme/createOdysseyMuiTheme.js +3 -2
  377. package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
  378. package/dist/tsconfig.production.tsbuildinfo +1 -1
  379. package/dist/tsconfig.tsbuildinfo +1 -1
  380. package/jest.setup.js +3 -0
  381. package/package.json +5 -5
  382. package/scripts/generateTestSelectorsJson.ts +1 -1
  383. package/src/@types/i18next.d.ts +1 -1
  384. package/src/Autocomplete.tsx +140 -45
  385. package/src/Callout.tsx +13 -25
  386. package/src/Checkbox.tsx +39 -9
  387. package/src/CheckboxGroup.tsx +20 -4
  388. package/src/DataTable/DataTable.tsx +24 -1
  389. package/src/DataTable/useScrollIndication.tsx +11 -4
  390. package/src/Field.tsx +5 -2
  391. package/src/{labs → FileUploader}/FileUploadPreview.tsx +3 -3
  392. package/src/{labs/FileUpload.tsx → FileUploader/FileUploader.tsx} +7 -6
  393. package/src/FileUploader/index.ts +13 -0
  394. package/src/OdysseyCacheProvider.test.tsx +1 -0
  395. package/src/OdysseyCacheProvider.tsx +18 -4
  396. package/src/OdysseyProvider.tsx +12 -4
  397. package/src/OdysseyThemeProvider.tsx +6 -2
  398. package/src/Radio.tsx +41 -12
  399. package/src/RadioGroup.tsx +26 -7
  400. package/src/Select.tsx +116 -45
  401. package/src/{labs/Switch.tsx → Switch.tsx} +95 -41
  402. package/src/Tabs.tsx +8 -10
  403. package/src/Tag.tsx +134 -3
  404. package/src/TextField.tsx +18 -41
  405. package/src/Toast.tsx +1 -1
  406. package/src/ToastStack.tsx +2 -2
  407. package/src/createShadowDomElements.ts +53 -0
  408. package/src/i18n.ts +3 -3
  409. package/src/index.ts +7 -2
  410. package/src/labs/AppTile.tsx +200 -0
  411. package/src/labs/{DataComponents/StackContent.tsx → DataView/CardLayoutContent.tsx} +24 -19
  412. package/src/labs/{DataComponents/StackCard.tsx → DataView/DataCard.tsx} +7 -7
  413. package/src/labs/{DataComponents → DataView}/DataTable.tsx +8 -4
  414. package/src/labs/DataView/DataView.test.tsx +158 -0
  415. package/src/labs/{DataComponents → DataView}/DataView.tsx +119 -42
  416. package/src/labs/{DataComponents → DataView}/DetailPanel.tsx +2 -2
  417. package/src/labs/{DataComponents/TableContent.tsx → DataView/TableLayoutContent.tsx} +59 -27
  418. package/src/labs/{DataComponents → DataView}/TableSettings.tsx +5 -4
  419. package/src/labs/{DataComponents → DataView}/componentTypes.ts +24 -9
  420. package/src/labs/{DataComponents → DataView}/constants.tsx +2 -2
  421. package/src/labs/{DataComponents → DataView}/index.tsx +0 -1
  422. package/src/labs/{DataComponents → DataView}/useFilterConversion.ts +2 -2
  423. package/src/labs/DateField.tsx +3 -0
  424. package/src/labs/DatePicker.tsx +12 -1
  425. package/src/labs/SideNav/CollapseIcon.tsx +48 -0
  426. package/src/labs/SideNav/OktaLogo.tsx +39 -0
  427. package/src/labs/SideNav/SideNav.tsx +486 -0
  428. package/src/labs/SideNav/SideNavFooterContent.tsx +64 -0
  429. package/src/labs/SideNav/SideNavHeader.tsx +88 -0
  430. package/src/labs/SideNav/SideNavItemContent.tsx +216 -0
  431. package/src/labs/SideNav/SideNavItemLinkContent.tsx +87 -0
  432. package/src/labs/SideNav/index.ts +15 -0
  433. package/src/labs/SideNav/types.ts +152 -0
  434. package/src/labs/TopNav.tsx +3 -1
  435. package/src/labs/index.ts +3 -4
  436. package/src/labs/useDateFieldsTranslations.ts +1 -1
  437. package/src/properties/odyssey-react-mui.properties +2 -1
  438. package/src/properties/translations/odyssey-react-mui_cs.properties +15 -3
  439. package/src/properties/translations/odyssey-react-mui_da.properties +15 -3
  440. package/src/properties/translations/odyssey-react-mui_de.properties +14 -2
  441. package/src/properties/translations/odyssey-react-mui_el.properties +16 -4
  442. package/src/properties/translations/odyssey-react-mui_es.properties +15 -3
  443. package/src/properties/translations/odyssey-react-mui_fi.properties +15 -3
  444. package/src/properties/translations/odyssey-react-mui_fr.properties +15 -3
  445. package/src/properties/translations/odyssey-react-mui_ht.properties +17 -6
  446. package/src/properties/translations/odyssey-react-mui_hu.properties +15 -3
  447. package/src/properties/translations/odyssey-react-mui_id.properties +15 -3
  448. package/src/properties/translations/odyssey-react-mui_it.properties +15 -3
  449. package/src/properties/translations/odyssey-react-mui_ja.properties +14 -2
  450. package/src/properties/translations/odyssey-react-mui_ko.properties +14 -2
  451. package/src/properties/translations/odyssey-react-mui_ms.properties +15 -3
  452. package/src/properties/translations/odyssey-react-mui_nb.properties +15 -3
  453. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +15 -3
  454. package/src/properties/translations/odyssey-react-mui_pl.properties +15 -3
  455. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +15 -3
  456. package/src/properties/translations/odyssey-react-mui_ro.properties +15 -3
  457. package/src/properties/translations/odyssey-react-mui_ru.properties +15 -3
  458. package/src/properties/translations/odyssey-react-mui_sv.properties +15 -3
  459. package/src/properties/translations/odyssey-react-mui_th.properties +14 -2
  460. package/src/properties/translations/odyssey-react-mui_tr.properties +15 -3
  461. package/src/properties/translations/odyssey-react-mui_uk.properties +15 -3
  462. package/src/properties/translations/odyssey-react-mui_vi.properties +15 -3
  463. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +14 -2
  464. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +14 -2
  465. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  466. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  467. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  468. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  469. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  470. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  471. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  472. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  473. package/src/properties/ts/odyssey-react-mui_ht.ts +1 -1
  474. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  475. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  476. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  477. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  478. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  479. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  480. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  481. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  482. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  483. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  484. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  485. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  486. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  487. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  488. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  489. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  490. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  491. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  492. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  493. package/src/test-selectors/getByQuerySelector.ts +176 -0
  494. package/src/test-selectors/getComputedAccessibleErrorMessageText.ts +52 -0
  495. package/src/test-selectors/getComputedAccessibleText.ts +36 -0
  496. package/src/test-selectors/index.ts +2 -2
  497. package/src/test-selectors/interpolateString.ts +41 -0
  498. package/src/test-selectors/linkedHtmlSelectors.ts +73 -0
  499. package/src/test-selectors/queryOdysseySelector.ts +36 -0
  500. package/src/test-selectors/querySelector.ts +221 -170
  501. package/src/test-selectors/sanityChecks.ts +53 -0
  502. package/src/test-selectors/testSelector.ts +143 -0
  503. package/src/theme/components.tsx +238 -150
  504. package/src/theme/createOdysseyMuiTheme.ts +4 -1
  505. package/dist/createShadowRootElement.js +0 -26
  506. package/dist/createShadowRootElement.js.map +0 -1
  507. package/dist/labs/DataComponents/BulkActionsMenu.js.map +0 -1
  508. package/dist/labs/DataComponents/DataStack.js +0 -85
  509. package/dist/labs/DataComponents/DataStack.js.map +0 -1
  510. package/dist/labs/DataComponents/DataTable.js.map +0 -1
  511. package/dist/labs/DataComponents/DataView.js.map +0 -1
  512. package/dist/labs/DataComponents/DetailPanel.js.map +0 -1
  513. package/dist/labs/DataComponents/LayoutSwitcher.js.map +0 -1
  514. package/dist/labs/DataComponents/RowActions.js.map +0 -1
  515. package/dist/labs/DataComponents/StackCard.js.map +0 -1
  516. package/dist/labs/DataComponents/StackContent.js.map +0 -1
  517. package/dist/labs/DataComponents/TableContent.js.map +0 -1
  518. package/dist/labs/DataComponents/TableSettings.js.map +0 -1
  519. package/dist/labs/DataComponents/componentTypes.js.map +0 -1
  520. package/dist/labs/DataComponents/constants.js.map +0 -1
  521. package/dist/labs/DataComponents/dataTypes.js.map +0 -1
  522. package/dist/labs/DataComponents/fetchData.js.map +0 -1
  523. package/dist/labs/DataComponents/index.js.map +0 -1
  524. package/dist/labs/DataComponents/tableConstants.js.map +0 -1
  525. package/dist/labs/DataComponents/useFilterConversion.js.map +0 -1
  526. package/dist/labs/FileUpload.js.map +0 -1
  527. package/dist/labs/FileUploadIllustration.js.map +0 -1
  528. package/dist/labs/FileUploadPreview.js.map +0 -1
  529. package/dist/labs/SideNav.js +0 -478
  530. package/dist/labs/SideNav.js.map +0 -1
  531. package/dist/labs/Switch.js.map +0 -1
  532. package/dist/src/createShadowRootElement.d.ts.map +0 -1
  533. package/dist/src/labs/DataComponents/BulkActionsMenu.d.ts.map +0 -1
  534. package/dist/src/labs/DataComponents/DataStack.d.ts +0 -20
  535. package/dist/src/labs/DataComponents/DataStack.d.ts.map +0 -1
  536. package/dist/src/labs/DataComponents/DataTable.d.ts +0 -16
  537. package/dist/src/labs/DataComponents/DataTable.d.ts.map +0 -1
  538. package/dist/src/labs/DataComponents/DataView.d.ts.map +0 -1
  539. package/dist/src/labs/DataComponents/DetailPanel.d.ts.map +0 -1
  540. package/dist/src/labs/DataComponents/LayoutSwitcher.d.ts.map +0 -1
  541. package/dist/src/labs/DataComponents/RowActions.d.ts.map +0 -1
  542. package/dist/src/labs/DataComponents/StackCard.d.ts.map +0 -1
  543. package/dist/src/labs/DataComponents/StackContent.d.ts.map +0 -1
  544. package/dist/src/labs/DataComponents/TableContent.d.ts.map +0 -1
  545. package/dist/src/labs/DataComponents/TableSettings.d.ts.map +0 -1
  546. package/dist/src/labs/DataComponents/componentTypes.d.ts.map +0 -1
  547. package/dist/src/labs/DataComponents/constants.d.ts.map +0 -1
  548. package/dist/src/labs/DataComponents/dataTypes.d.ts.map +0 -1
  549. package/dist/src/labs/DataComponents/fetchData.d.ts.map +0 -1
  550. package/dist/src/labs/DataComponents/index.d.ts.map +0 -1
  551. package/dist/src/labs/DataComponents/tableConstants.d.ts.map +0 -1
  552. package/dist/src/labs/DataComponents/useFilterConversion.d.ts.map +0 -1
  553. package/dist/src/labs/FileUpload.d.ts.map +0 -1
  554. package/dist/src/labs/FileUploadIllustration.d.ts.map +0 -1
  555. package/dist/src/labs/FileUploadPreview.d.ts.map +0 -1
  556. package/dist/src/labs/SideNav.d.ts.map +0 -1
  557. package/dist/src/labs/Switch.d.ts.map +0 -1
  558. package/dist/src/test-selectors/featureTestSelector.d.ts +0 -31
  559. package/dist/src/test-selectors/featureTestSelector.d.ts.map +0 -1
  560. package/dist/src/test-selectors/odysseyTestSelectors.d.ts +0 -120
  561. package/dist/src/test-selectors/odysseyTestSelectors.d.ts.map +0 -1
  562. package/dist/test-selectors/featureTestSelector.js +0 -2
  563. package/dist/test-selectors/featureTestSelector.js.map +0 -1
  564. package/dist/test-selectors/odysseyTestSelectors.js.map +0 -1
  565. package/src/createShadowRootElement.ts +0 -31
  566. package/src/labs/DataComponents/DataStack.tsx +0 -105
  567. package/src/labs/SideNav.tsx +0 -745
  568. package/src/test-selectors/featureTestSelector.ts +0 -41
  569. /package/dist/{labs → FileUploader}/FileUploadIllustration.js +0 -0
  570. /package/dist/{labs → FileUploader}/FileUploadPreview.js +0 -0
  571. /package/dist/labs/{DataComponents → DataView}/BulkActionsMenu.js +0 -0
  572. /package/dist/labs/{DataComponents → DataView}/DetailPanel.js +0 -0
  573. /package/dist/labs/{DataComponents → DataView}/LayoutSwitcher.js +0 -0
  574. /package/dist/labs/{DataComponents → DataView}/RowActions.js +0 -0
  575. /package/dist/labs/{DataComponents → DataView}/componentTypes.js +0 -0
  576. /package/dist/labs/{DataComponents → DataView}/dataTypes.js +0 -0
  577. /package/dist/labs/{DataComponents → DataView}/fetchData.js +0 -0
  578. /package/dist/labs/{DataComponents → DataView}/tableConstants.js +0 -0
  579. /package/dist/labs/{DataComponents → DataView}/useFilterConversion.js +0 -0
  580. /package/dist/src/{labs → FileUploader}/FileUploadIllustration.d.ts +0 -0
  581. /package/dist/src/labs/{DataComponents → DataView}/BulkActionsMenu.d.ts +0 -0
  582. /package/dist/src/labs/{DataComponents → DataView}/LayoutSwitcher.d.ts +0 -0
  583. /package/dist/src/labs/{DataComponents → DataView}/RowActions.d.ts +0 -0
  584. /package/dist/src/labs/{DataComponents → DataView}/dataTypes.d.ts +0 -0
  585. /package/dist/src/labs/{DataComponents → DataView}/fetchData.d.ts +0 -0
  586. /package/dist/src/labs/{DataComponents → DataView}/tableConstants.d.ts +0 -0
  587. /package/src/{labs → FileUploader}/FileUploadIllustration.tsx +0 -0
  588. /package/src/labs/{DataComponents → DataView}/BulkActionsMenu.tsx +0 -0
  589. /package/src/labs/{DataComponents → DataView}/LayoutSwitcher.tsx +0 -0
  590. /package/src/labs/{DataComponents → DataView}/RowActions.tsx +0 -0
  591. /package/src/labs/{DataComponents → DataView}/dataTypes.ts +0 -0
  592. /package/src/labs/{DataComponents → DataView}/fetchData.ts +0 -0
  593. /package/src/labs/{DataComponents → DataView}/tableConstants.tsx +0 -0
@@ -0,0 +1,13 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+ export * from "./FileUploader.js";
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/FileUploader/index.ts"],"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\nexport * from \"./FileUploader\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA"}
@@ -18,6 +18,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
18
18
  const OdysseyCacheProvider = ({
19
19
  children,
20
20
  emotionRoot,
21
+ emotionRootElement,
21
22
  hasShadowDom: hasShadowDomProp,
22
23
  nonce,
23
24
  shadowDomElement,
@@ -27,8 +28,8 @@ const OdysseyCacheProvider = ({
27
28
  const hasShadowDom = hasShadowDomProp || shadowDomElement;
28
29
  const emotionCache = useMemo(() => {
29
30
  return createCache({
30
- ...(emotionRoot && {
31
- container: emotionRoot
31
+ ...((emotionRootElement || emotionRoot) && {
32
+ container: emotionRootElement || emotionRoot
32
33
  }),
33
34
  key: uniqueAlphabeticalId,
34
35
  nonce: nonce ?? window.cspNonce,
@@ -38,7 +39,7 @@ const OdysseyCacheProvider = ({
38
39
  stylisPlugins
39
40
  })
40
41
  });
41
- }, [emotionRoot, hasShadowDom, nonce, stylisPlugins, uniqueAlphabeticalId]);
42
+ }, [emotionRoot, emotionRootElement, hasShadowDom, nonce, stylisPlugins, uniqueAlphabeticalId]);
42
43
  return _jsx(CacheProvider, {
43
44
  value: emotionCache,
44
45
  children: children
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"OdysseyCacheProvider.js","names":["createCache","memo","useMemo","useUniqueAlphabeticalId","CacheProvider","jsx","_jsx","OdysseyCacheProvider","children","emotionRoot","emotionRootElement","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 * @deprecated Use `EmotionRootElement` instead. This was incorrectly configured as an `HTMLStyleElement`, but then we're rendering `<style>` inside `<style>`. We need this to be a `<div>` instead.\n */\n emotionRoot?: HTMLStyleElement;\n /**\n * Emotion adds `<style>` elements into this DOM node. Normally, Emotion puts these in `document.head`.\n * This is useful if you want to render into a Shadow DOM or iframe.\n */\n emotionRootElement?: HTMLElement;\n hasShadowDom?: boolean;\n nonce?: string;\n /**\n * Emotion renders into this HTML element.\n * When enabling this prop, Emotion renders at the top of this component rather than the bottom like it does in the HTML `<head>`.\n * @deprecated Will be removed in a future Odyssey version. Use `hasShadowDomElement` instead.\n */\n shadowDomElement?: HTMLDivElement | HTMLElement;\n stylisPlugins?: StylisPlugin[];\n};\n\nconst OdysseyCacheProvider = ({\n children,\n emotionRoot,\n emotionRootElement,\n hasShadowDom: hasShadowDomProp,\n nonce,\n shadowDomElement,\n stylisPlugins,\n}: OdysseyCacheProviderProps) => {\n const uniqueAlphabeticalId = useUniqueAlphabeticalId();\n\n const hasShadowDom = hasShadowDomProp || shadowDomElement;\n\n const emotionCache = useMemo(() => {\n return createCache({\n ...((emotionRootElement || emotionRoot) && {\n container: emotionRootElement || emotionRoot,\n }),\n key: uniqueAlphabeticalId,\n nonce: nonce ?? 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 }, [\n emotionRoot,\n emotionRootElement,\n hasShadowDom,\n nonce,\n stylisPlugins,\n uniqueAlphabeticalId,\n ]);\n\n return <CacheProvider value={emotionCache}>{children}</CacheProvider>;\n};\n\nconst MemoizedOdysseyCacheProvider = memo(OdysseyCacheProvider);\nMemoizedOdysseyCacheProvider.displayName = \"OdysseyCacheProvider\";\n\nexport { MemoizedOdysseyCacheProvider as OdysseyCacheProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;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;AA0B/C,MAAMC,oBAAoB,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,WAAW;EACXC,kBAAkB;EAClBC,YAAY,EAAEC,gBAAgB;EAC9BC,KAAK;EACLC,gBAAgB;EAChBC;AACyB,CAAC,KAAK;EAC/B,MAAMC,oBAAoB,GAAGb,uBAAuB,CAAC,CAAC;EAEtD,MAAMQ,YAAY,GAAGC,gBAAgB,IAAIE,gBAAgB;EAEzD,MAAMG,YAAY,GAAGf,OAAO,CAAC,MAAM;IACjC,OAAOF,WAAW,CAAC;MACjB,IAAI,CAACU,kBAAkB,IAAID,WAAW,KAAK;QACzCS,SAAS,EAAER,kBAAkB,IAAID;MACnC,CAAC,CAAC;MACFU,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,CACDN,WAAW,EACXC,kBAAkB,EAClBC,YAAY,EACZE,KAAK,EACLE,aAAa,EACbC,oBAAoB,CACrB,CAAC;EAEF,OAAOV,IAAA,CAACF,aAAa;IAACoB,KAAK,EAAEP,YAAa;IAAAT,QAAA,EAAEA;EAAQ,CAAgB,CAAC;AACvE,CAAC;AAED,MAAMiB,4BAA4B,GAAGxB,IAAI,CAACM,oBAAoB,CAAC;AAC/DkB,4BAA4B,CAACC,WAAW,GAAG,sBAAsB;AAEjE,SAASD,4BAA4B,IAAIlB,oBAAoB"}
@@ -16,26 +16,33 @@ import { OdysseyCacheProvider } from "./OdysseyCacheProvider.js";
16
16
  import { OdysseyThemeProvider } from "./OdysseyThemeProvider.js";
17
17
  import { OdysseyTranslationProvider } from "./OdysseyTranslationProvider.js";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
+ const scopedCssBaselineStyles = {
20
+ height: "inherit"
21
+ };
19
22
  const OdysseyProvider = ({
20
23
  children,
21
24
  designTokensOverride,
22
25
  emotionRoot,
26
+ emotionRootElement,
23
27
  shadowDomElement,
28
+ shadowRootElement,
24
29
  languageCode,
25
30
  nonce,
26
31
  stylisPlugins,
27
32
  themeOverride,
28
33
  translationOverrides
29
34
  }) => _jsx(OdysseyCacheProvider, {
30
- nonce: nonce,
31
35
  emotionRoot: emotionRoot,
32
- hasShadowDom: Boolean(shadowDomElement),
36
+ emotionRootElement: emotionRootElement,
37
+ hasShadowDom: Boolean(shadowRootElement || shadowDomElement),
38
+ nonce: nonce,
33
39
  stylisPlugins: stylisPlugins,
34
40
  children: _jsx(OdysseyThemeProvider, {
35
41
  designTokensOverride: designTokensOverride,
36
- shadowDomElement: shadowDomElement,
42
+ shadowRootElement: shadowRootElement || shadowDomElement,
37
43
  themeOverride: themeOverride,
38
44
  children: _jsx(_ScopedCssBaseline, {
45
+ sx: scopedCssBaselineStyles,
39
46
  children: _jsx(OdysseyTranslationProvider, {
40
47
  languageCode: languageCode,
41
48
  translationOverrides: translationOverrides,
@@ -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","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"}
1
+ {"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","scopedCssBaselineStyles","height","OdysseyProvider","children","designTokensOverride","emotionRoot","emotionRootElement","shadowDomElement","shadowRootElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","hasShadowDom","Boolean","_ScopedCssBaseline","sx","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\nconst scopedCssBaselineStyles = {\n height: \"inherit\",\n};\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n designTokensOverride,\n emotionRoot,\n emotionRootElement,\n shadowDomElement,\n shadowRootElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n emotionRoot={emotionRoot}\n emotionRootElement={emotionRootElement}\n hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}\n nonce={nonce}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n designTokensOverride={designTokensOverride}\n shadowRootElement={shadowRootElement || shadowDomElement}\n themeOverride={themeOverride}\n >\n {/* This component creates a div; for flexibility of layout of children, make it inherit its parent's height */}\n <ScopedCssBaseline sx={scopedCssBaselineStyles}>\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;AAK5B,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE;AACV,CAAC;AAUD,MAAMC,eAAe,GAAGA,CAAoC;EAC1DC,QAAQ;EACRC,oBAAoB;EACpBC,WAAW;EACXC,kBAAkB;EAClBC,gBAAgB;EAChBC,iBAAiB;EACjBC,YAAY;EACZC,KAAK;EACLC,aAAa;EACbC,aAAa;EACbC;AACwC,CAAC,KACzCd,IAAA,CAACJ,oBAAoB;EACnBU,WAAW,EAAEA,WAAY;EACzBC,kBAAkB,EAAEA,kBAAmB;EACvCQ,YAAY,EAAEC,OAAO,CAACP,iBAAiB,IAAID,gBAAgB,CAAE;EAC7DG,KAAK,EAAEA,KAAM;EACbC,aAAa,EAAEA,aAAc;EAAAR,QAAA,EAE7BJ,IAAA,CAACH,oBAAoB;IACnBQ,oBAAoB,EAAEA,oBAAqB;IAC3CI,iBAAiB,EAAEA,iBAAiB,IAAID,gBAAiB;IACzDK,aAAa,EAAEA,aAAc;IAAAT,QAAA,EAG7BJ,IAAA,CAAAiB,kBAAA;MAAmBC,EAAE,EAAEjB,uBAAwB;MAAAG,QAAA,EAC7CJ,IAAA,CAACF,0BAA0B;QACzBY,YAAY,EAAEA,YAAa;QAC3BI,oBAAoB,EAAEA,oBAAqB;QAAAV,QAAA,EAE1CA;MAAQ,CACiB;IAAC,CACZ;EAAC,CACA;AAAC,CACH,CACvB;AAED,MAAMe,qBAAqB,GAAGxB,IAAI,CAACQ,eAAe,CAA2B;AAE7E,SAASgB,qBAAqB,IAAIhB,eAAe"}
@@ -21,6 +21,7 @@ const OdysseyThemeProvider = ({
21
21
  children,
22
22
  designTokensOverride,
23
23
  shadowDomElement,
24
+ shadowRootElement,
24
25
  themeOverride
25
26
  }) => {
26
27
  const odysseyTokens = useMemo(() => ({
@@ -29,8 +30,8 @@ const OdysseyThemeProvider = ({
29
30
  }), [designTokensOverride]);
30
31
  const odysseyTheme = useMemo(() => createOdysseyMuiTheme({
31
32
  odysseyTokens,
32
- shadowDomElement
33
- }), [odysseyTokens, shadowDomElement]);
33
+ shadowRootElement: shadowRootElement || shadowDomElement
34
+ }), [odysseyTokens, shadowDomElement, shadowRootElement]);
34
35
  const customOdysseyTheme = useMemo(() => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)), [odysseyTheme, themeOverride]);
35
36
  return _jsx(MuiThemeProvider, {
36
37
  theme: customOdysseyTheme ?? odysseyTheme,
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","jsx","_jsx","OdysseyThemeProvider","children","designTokensOverride","shadowDomElement","themeOverride","odysseyTokens","odysseyTheme","customOdysseyTheme","theme","Provider","value","MemoizedOdysseyThemeProvider"],"sources":["../src/OdysseyThemeProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { ThemeOptions } from \"@mui/material\";\nimport { deepmerge } from \"@mui/utils\";\nimport { createOdysseyMuiTheme, DesignTokensOverride } from \"./theme\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { OdysseyDesignTokensContext } from \"./OdysseyDesignTokensContext\";\n\nexport type OdysseyThemeProviderProps = {\n children: ReactNode;\n designTokensOverride?: DesignTokensOverride;\n shadowDomElement?: HTMLDivElement | HTMLElement | undefined;\n themeOverride?: ThemeOptions;\n};\n\n/**\n * This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.\n *\n * Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.\n */\nconst OdysseyThemeProvider = ({\n children,\n designTokensOverride,\n shadowDomElement,\n themeOverride,\n}: OdysseyThemeProviderProps) => {\n const odysseyTokens = useMemo(\n () => ({ ...Tokens, ...designTokensOverride }),\n [designTokensOverride],\n );\n const odysseyTheme = useMemo(\n () =>\n createOdysseyMuiTheme({\n odysseyTokens,\n shadowDomElement,\n }),\n [odysseyTokens, shadowDomElement],\n );\n\n const customOdysseyTheme = useMemo(\n () => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)),\n [odysseyTheme, themeOverride],\n );\n\n return (\n <MuiThemeProvider theme={customOdysseyTheme ?? odysseyTheme}>\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </MuiThemeProvider>\n );\n};\n\nconst MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);\n\nexport { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,WAAW,EACXC,aAAa,IAAIC,gBAAgB,QAC5B,sBAAsB;AAC7B,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAGhD,SAASC,SAAS,QAAQ,YAAY;AAAC,SAC9BC,qBAAqB;AAC9B,OAAO,KAAKC,MAAM,MAAM,6BAA6B;AAAC,SAC7CC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAcnC,MAAMC,oBAAoB,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,oBAAoB;EACpBC,gBAAgB;EAChBC;AACyB,CAAC,KAAK;EAC/B,MAAMC,aAAa,GAAGZ,OAAO,CAC3B,OAAO;IAAE,GAAGG,MAAM;IAAE,GAAGM;EAAqB,CAAC,CAAC,EAC9C,CAACA,oBAAoB,CACvB,CAAC;EACD,MAAMI,YAAY,GAAGb,OAAO,CAC1B,MACEE,qBAAqB,CAAC;IACpBU,aAAa;IACbF;EACF,CAAC,CAAC,EACJ,CAACE,aAAa,EAAEF,gBAAgB,CAClC,CAAC;EAED,MAAMI,kBAAkB,GAAGd,OAAO,CAChC,MAAMW,aAAa,IAAIf,WAAW,CAACK,SAAS,CAACY,YAAY,EAAEF,aAAa,CAAC,CAAC,EAC1E,CAACE,YAAY,EAAEF,aAAa,CAC9B,CAAC;EAED,OACEL,IAAA,CAACR,gBAAgB;IAACiB,KAAK,EAAED,kBAAkB,IAAID,YAAa;IAAAL,QAAA,EAC1DF,IAAA,CAACF,0BAA0B,CAACY,QAAQ;MAACC,KAAK,EAAEL,aAAc;MAAAJ,QAAA,EACvDA;IAAQ,CAC0B;EAAC,CACtB,CAAC;AAEvB,CAAC;AAED,MAAMU,4BAA4B,GAAGnB,IAAI,CAACQ,oBAAoB,CAAC;AAE/D,SAASW,4BAA4B,IAAIX,oBAAoB"}
1
+ {"version":3,"file":"OdysseyThemeProvider.js","names":["createTheme","ThemeProvider","MuiThemeProvider","memo","useMemo","deepmerge","createOdysseyMuiTheme","Tokens","OdysseyDesignTokensContext","jsx","_jsx","OdysseyThemeProvider","children","designTokensOverride","shadowDomElement","shadowRootElement","themeOverride","odysseyTokens","odysseyTheme","customOdysseyTheme","theme","Provider","value","MemoizedOdysseyThemeProvider"],"sources":["../src/OdysseyThemeProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n createTheme,\n ThemeProvider as MuiThemeProvider,\n} from \"@mui/material/styles\";\nimport { memo, ReactNode, useMemo } from \"react\";\n\nimport { ThemeOptions } from \"@mui/material\";\nimport { deepmerge } from \"@mui/utils\";\nimport { createOdysseyMuiTheme, DesignTokensOverride } from \"./theme\";\nimport * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { OdysseyDesignTokensContext } from \"./OdysseyDesignTokensContext\";\n\nexport type OdysseyThemeProviderProps = {\n children: ReactNode;\n designTokensOverride?: DesignTokensOverride;\n /** @deprecated Use `shadowRootElement` instead. */\n shadowDomElement?: HTMLDivElement | HTMLElement | undefined;\n shadowRootElement?: HTMLDivElement | HTMLElement;\n themeOverride?: ThemeOptions;\n};\n\n/**\n * This function doesn't include the Emotion Cache or Translations. You should probably be using `OdysseyProvider`.\n *\n * Some teams have a need to wrap separately (SIW), but most teams will never need to use this explicitly.\n */\nconst OdysseyThemeProvider = ({\n children,\n designTokensOverride,\n shadowDomElement,\n shadowRootElement,\n themeOverride,\n}: OdysseyThemeProviderProps) => {\n const odysseyTokens = useMemo(\n () => ({ ...Tokens, ...designTokensOverride }),\n [designTokensOverride],\n );\n\n const odysseyTheme = useMemo(\n () =>\n createOdysseyMuiTheme({\n odysseyTokens,\n shadowRootElement: shadowRootElement || shadowDomElement,\n }),\n [odysseyTokens, shadowDomElement, shadowRootElement],\n );\n\n const customOdysseyTheme = useMemo(\n () => themeOverride && createTheme(deepmerge(odysseyTheme, themeOverride)),\n [odysseyTheme, themeOverride],\n );\n\n return (\n <MuiThemeProvider theme={customOdysseyTheme ?? odysseyTheme}>\n <OdysseyDesignTokensContext.Provider value={odysseyTokens}>\n {children}\n </OdysseyDesignTokensContext.Provider>\n </MuiThemeProvider>\n );\n};\n\nconst MemoizedOdysseyThemeProvider = memo(OdysseyThemeProvider);\n\nexport { MemoizedOdysseyThemeProvider as OdysseyThemeProvider };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,WAAW,EACXC,aAAa,IAAIC,gBAAgB,QAC5B,sBAAsB;AAC7B,SAASC,IAAI,EAAaC,OAAO,QAAQ,OAAO;AAGhD,SAASC,SAAS,QAAQ,YAAY;AAAC,SAC9BC,qBAAqB;AAC9B,OAAO,KAAKC,MAAM,MAAM,6BAA6B;AAAC,SAC7CC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAgBnC,MAAMC,oBAAoB,GAAGA,CAAC;EAC5BC,QAAQ;EACRC,oBAAoB;EACpBC,gBAAgB;EAChBC,iBAAiB;EACjBC;AACyB,CAAC,KAAK;EAC/B,MAAMC,aAAa,GAAGb,OAAO,CAC3B,OAAO;IAAE,GAAGG,MAAM;IAAE,GAAGM;EAAqB,CAAC,CAAC,EAC9C,CAACA,oBAAoB,CACvB,CAAC;EAED,MAAMK,YAAY,GAAGd,OAAO,CAC1B,MACEE,qBAAqB,CAAC;IACpBW,aAAa;IACbF,iBAAiB,EAAEA,iBAAiB,IAAID;EAC1C,CAAC,CAAC,EACJ,CAACG,aAAa,EAAEH,gBAAgB,EAAEC,iBAAiB,CACrD,CAAC;EAED,MAAMI,kBAAkB,GAAGf,OAAO,CAChC,MAAMY,aAAa,IAAIhB,WAAW,CAACK,SAAS,CAACa,YAAY,EAAEF,aAAa,CAAC,CAAC,EAC1E,CAACE,YAAY,EAAEF,aAAa,CAC9B,CAAC;EAED,OACEN,IAAA,CAACR,gBAAgB;IAACkB,KAAK,EAAED,kBAAkB,IAAID,YAAa;IAAAN,QAAA,EAC1DF,IAAA,CAACF,0BAA0B,CAACa,QAAQ;MAACC,KAAK,EAAEL,aAAc;MAAAL,QAAA,EACvDA;IAAQ,CAC0B;EAAC,CACtB,CAAC;AAEvB,CAAC;AAED,MAAMW,4BAA4B,GAAGpB,IAAI,CAACQ,oBAAoB,CAAC;AAE/D,SAASY,4BAA4B,IAAIZ,oBAAoB"}
package/dist/Radio.js CHANGED
@@ -28,8 +28,10 @@ const Radio = ({
28
28
  testId,
29
29
  translate,
30
30
  value,
31
+ isReadOnly,
31
32
  onChange: onChangeProp,
32
- onBlur: onBlurProp
33
+ onBlur: onBlurProp,
34
+ onClick
33
35
  }) => {
34
36
  const localInputRef = useRef(null);
35
37
  useImperativeHandle(inputRef, () => {
@@ -48,7 +50,19 @@ const Radio = ({
48
50
  children: hint
49
51
  })]
50
52
  }), [labelProp, hint, translate]);
51
- const onChange = useCallback((event, checked) => onChangeProp?.(event, checked), [onChangeProp]);
53
+ const onChange = useCallback((event, checked) => {
54
+ if (isReadOnly) {
55
+ event.preventDefault();
56
+ } else {
57
+ onChangeProp?.(event, checked);
58
+ }
59
+ }, [onChangeProp, isReadOnly]);
60
+ const handleClick = useCallback(event => {
61
+ if (isReadOnly) {
62
+ event.stopPropagation();
63
+ event.preventDefault();
64
+ }
65
+ }, [isReadOnly]);
52
66
  const onBlur = useCallback(event => {
53
67
  onBlurProp?.(event);
54
68
  }, [onBlurProp]);
@@ -57,17 +71,30 @@ const Radio = ({
57
71
  className: isInvalid ? "Mui-error" : "",
58
72
  control: _jsx(_Radio, {
59
73
  inputProps: {
60
- "data-se": testId
74
+ "data-se": testId,
75
+ "aria-disabled": isDisabled || isReadOnly,
76
+ readOnly: isReadOnly,
77
+ tabIndex: isReadOnly ? 0 : undefined
61
78
  },
62
79
  inputRef: localInputRef,
63
- onChange: onChange
80
+ onChange: onChange,
81
+ onClick: onClick || handleClick,
82
+ disabled: isDisabled
64
83
  }),
65
- disabled: isDisabled,
66
84
  label: label,
67
85
  name: name,
68
86
  translate: translate,
69
87
  value: value,
70
- onBlur: onBlur
88
+ onBlur: onBlur,
89
+ disabled: isDisabled,
90
+ sx: {
91
+ ...(isReadOnly && {
92
+ cursor: "default",
93
+ "& .MuiTypography-root": {
94
+ cursor: "default"
95
+ }
96
+ })
97
+ }
71
98
  });
72
99
  };
73
100
  const MemoizedRadio = memo(Radio);
package/dist/Radio.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.js","names":["memo","useCallback","useMemo","useRef","useImperativeHandle","Typography","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Radio","hint","inputRef","isChecked","isDisabled","isInvalid","label","labelProp","name","testId","translate","value","onChange","onChangeProp","onBlur","onBlurProp","localInputRef","focus","current","children","component","_FormHelperText","event","checked","_FormControlLabel","className","control","_Radio","inputProps","disabled","MemoizedRadio","displayName"],"sources":["../src/Radio.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 FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n FormHelperText,\n Radio as MuiRadio,\n RadioProps as MuiRadioProps,\n} from \"@mui/material\";\n\nimport { memo, useCallback, useMemo, useRef, useImperativeHandle } from \"react\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\nimport { Typography } from \"./Typography\";\n\nexport type RadioProps = {\n /**\n * The ref forwarded to the Radio\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * If `true`, the Radio is selected\n */\n isChecked?: boolean;\n /**\n * If `true`, the Radio has an invalid value\n */\n isInvalid?: boolean;\n /**\n * The label text for the Radio\n */\n label: string;\n /**\n * The value attribute of the Radio\n */\n value: string;\n /**\n * Callback fired when the state is changed. Provides event and checked value.\n */\n onChange?: MuiRadioProps[\"onChange\"];\n /**\n * Callback fired when the blur event happens. Provides event value.\n */\n onBlur?: MuiFormControlLabelProps[\"onBlur\"];\n} & Pick<FieldComponentProps, \"hint\" | \"id\" | \"isDisabled\" | \"name\"> &\n Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Radio = ({\n hint,\n inputRef,\n isChecked,\n isDisabled,\n isInvalid,\n label: labelProp,\n name,\n testId,\n translate,\n value,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n}: RadioProps) => {\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n const label = useMemo(\n () => (\n <>\n <Typography component=\"span\">{labelProp}</Typography>\n {hint && <FormHelperText translate={translate}>{hint}</FormHelperText>}\n </>\n ),\n [labelProp, hint, translate],\n );\n\n const onChange = useCallback<NonNullable<MuiRadioProps[\"onChange\"]>>(\n (event, checked) => onChangeProp?.(event, checked),\n [onChangeProp],\n );\n\n const onBlur = useCallback<NonNullable<MuiFormControlLabelProps[\"onBlur\"]>>(\n (event) => {\n onBlurProp?.(event);\n },\n [onBlurProp],\n );\n\n return (\n <FormControlLabel\n checked={isChecked}\n className={isInvalid ? \"Mui-error\" : \"\"}\n control={\n <MuiRadio\n inputProps={{\n \"data-se\": testId,\n }}\n inputRef={localInputRef}\n onChange={onChange}\n />\n }\n disabled={isDisabled}\n label={label}\n name={name}\n translate={translate}\n value={value}\n onBlur={onBlur}\n />\n );\n};\n\nconst MemoizedRadio = memo(Radio);\nMemoizedRadio.displayName = \"Radio\";\n\nexport { MemoizedRadio as Radio };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA,SAASA,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,mBAAmB,QAAQ,OAAO;AAAC,SAKvEC,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAkCnB,MAAMC,KAAK,GAAGA,CAAC;EACbC,IAAI;EACJC,QAAQ;EACRC,SAAS;EACTC,UAAU;EACVC,SAAS;EACTC,KAAK,EAAEC,SAAS;EAChBC,IAAI;EACJC,MAAM;EACNC,SAAS;EACTC,KAAK;EACLC,QAAQ,EAAEC,YAAY;EACtBC,MAAM,EAAEC;AACE,CAAC,KAAK;EAChB,MAAMC,aAAa,GAAGzB,MAAM,CAAmB,IAAI,CAAC;EACpDC,mBAAmB,CACjBU,QAAQ,EACR,MAAM;IACJ,OAAO;MACLe,KAAK,EAAEA,CAAA,KAAM;QACXD,aAAa,CAACE,OAAO,EAAED,KAAK,CAAC,CAAC;MAChC;IACF,CAAC;EACH,CAAC,EACD,EACF,CAAC;EAED,MAAMX,KAAK,GAAGhB,OAAO,CACnB,MACES,KAAA,CAAAF,SAAA;IAAAsB,QAAA,GACExB,IAAA,CAACF,UAAU;MAAC2B,SAAS,EAAC,MAAM;MAAAD,QAAA,EAAEZ;IAAS,CAAa,CAAC,EACpDN,IAAI,IAAIN,IAAA,CAAA0B,eAAA;MAAgBX,SAAS,EAAEA,SAAU;MAAAS,QAAA,EAAElB;IAAI,CAAiB,CAAC;EAAA,CACtE,CACH,EACD,CAACM,SAAS,EAAEN,IAAI,EAAES,SAAS,CAC7B,CAAC;EAED,MAAME,QAAQ,GAAGvB,WAAW,CAC1B,CAACiC,KAAK,EAAEC,OAAO,KAAKV,YAAY,GAAGS,KAAK,EAAEC,OAAO,CAAC,EAClD,CAACV,YAAY,CACf,CAAC;EAED,MAAMC,MAAM,GAAGzB,WAAW,CACvBiC,KAAK,IAAK;IACTP,UAAU,GAAGO,KAAK,CAAC;EACrB,CAAC,EACD,CAACP,UAAU,CACb,CAAC;EAED,OACEpB,IAAA,CAAA6B,iBAAA;IACED,OAAO,EAAEpB,SAAU;IACnBsB,SAAS,EAAEpB,SAAS,GAAG,WAAW,GAAG,EAAG;IACxCqB,OAAO,EACL/B,IAAA,CAAAgC,MAAA;MACEC,UAAU,EAAE;QACV,SAAS,EAAEnB;MACb,CAAE;MACFP,QAAQ,EAAEc,aAAc;MACxBJ,QAAQ,EAAEA;IAAS,CACpB,CACF;IACDiB,QAAQ,EAAEzB,UAAW;IACrBE,KAAK,EAAEA,KAAM;IACbE,IAAI,EAAEA,IAAK;IACXE,SAAS,EAAEA,SAAU;IACrBC,KAAK,EAAEA,KAAM;IACbG,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAED,MAAMgB,aAAa,GAAG1C,IAAI,CAACY,KAAK,CAAC;AACjC8B,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAI9B,KAAK"}
1
+ {"version":3,"file":"Radio.js","names":["memo","useCallback","useMemo","useRef","useImperativeHandle","Typography","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Radio","hint","inputRef","isChecked","isDisabled","isInvalid","label","labelProp","name","testId","translate","value","isReadOnly","onChange","onChangeProp","onBlur","onBlurProp","onClick","localInputRef","focus","current","children","component","_FormHelperText","event","checked","preventDefault","handleClick","stopPropagation","_FormControlLabel","className","control","_Radio","inputProps","readOnly","tabIndex","undefined","disabled","sx","cursor","MemoizedRadio","displayName"],"sources":["../src/Radio.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 FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n FormHelperText,\n Radio as MuiRadio,\n RadioProps as MuiRadioProps,\n} from \"@mui/material\";\nimport { memo, useCallback, useMemo, useRef, useImperativeHandle } from \"react\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { FocusHandle } from \"./inputUtils\";\nimport { Typography } from \"./Typography\";\n\nexport type RadioProps = {\n /**\n * The ref forwarded to the Radio\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Determines whether the Radio button is checked\n */\n isChecked?: boolean;\n /**\n * If `true`, the radio button has an invalid value\n */\n isInvalid?: boolean;\n /**\n * The label text for the Radio\n */\n label: string;\n /**\n * The value attribute of the Radio\n */\n value: string;\n /**\n * Callback fired when the blur event happens. Provides event value.\n */\n onChange?: MuiRadioProps[\"onChange\"];\n onBlur?: MuiFormControlLabelProps[\"onBlur\"];\n onClick?: React.MouseEventHandler<HTMLSpanElement>;\n} & Pick<\n FieldComponentProps,\n \"hint\" | \"id\" | \"isDisabled\" | \"isReadOnly\" | \"name\"\n> &\n Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Radio = ({\n hint,\n inputRef,\n isChecked,\n isDisabled,\n isInvalid,\n label: labelProp,\n name,\n testId,\n translate,\n value,\n isReadOnly,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n onClick,\n}: RadioProps) => {\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n const label = useMemo(\n () => (\n <>\n <Typography component=\"span\">{labelProp}</Typography>\n {hint && <FormHelperText translate={translate}>{hint}</FormHelperText>}\n </>\n ),\n [labelProp, hint, translate],\n );\n\n const onChange = useCallback<NonNullable<MuiRadioProps[\"onChange\"]>>(\n (event, checked) => {\n if (isReadOnly) {\n event.preventDefault();\n } else {\n onChangeProp?.(event, checked);\n }\n },\n [onChangeProp, isReadOnly],\n );\n\n const handleClick = useCallback<React.MouseEventHandler<HTMLSpanElement>>(\n (event) => {\n if (isReadOnly) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n [isReadOnly],\n );\n const onBlur = useCallback<NonNullable<MuiFormControlLabelProps[\"onBlur\"]>>(\n (event) => {\n onBlurProp?.(event);\n },\n [onBlurProp],\n );\n\n return (\n <FormControlLabel\n checked={isChecked}\n className={isInvalid ? \"Mui-error\" : \"\"}\n control={\n <MuiRadio\n inputProps={{\n \"data-se\": testId,\n \"aria-disabled\": isDisabled || isReadOnly,\n readOnly: isReadOnly,\n tabIndex: isReadOnly ? 0 : undefined,\n }}\n inputRef={localInputRef}\n onChange={onChange}\n onClick={onClick || handleClick}\n disabled={isDisabled}\n />\n }\n label={label}\n name={name}\n translate={translate}\n value={value}\n onBlur={onBlur}\n disabled={isDisabled}\n sx={{\n ...(isReadOnly && {\n cursor: \"default\",\n \"& .MuiTypography-root\": {\n cursor: \"default\",\n },\n }),\n }}\n />\n );\n};\n\nconst MemoizedRadio = memo(Radio);\nMemoizedRadio.displayName = \"Radio\";\n\nexport { MemoizedRadio as Radio };\n"],"mappings":"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"}
@@ -10,9 +10,10 @@ import _RadioGroup from "@mui/material/RadioGroup";
10
10
  *
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
- import { memo, useCallback, useRef } from "react";
13
+ import React, { memo, useCallback, useRef, useMemo } from "react";
14
14
  import { Field } from "./Field.js";
15
15
  import { getControlState, useInputValues } from "./inputUtils.js";
16
+ import { Radio } from "./Radio.js";
16
17
  import { jsx as _jsx } from "react/jsx-runtime";
17
18
  const RadioGroup = ({
18
19
  ariaDescribedBy,
@@ -24,6 +25,7 @@ const RadioGroup = ({
24
25
  HintLinkComponent,
25
26
  id: idOverride,
26
27
  isDisabled,
28
+ isReadOnly = false,
27
29
  label,
28
30
  name: nameOverride,
29
31
  onChange: onChangeProp,
@@ -40,9 +42,18 @@ const RadioGroup = ({
40
42
  value,
41
43
  controlState: controlledStateRef.current
42
44
  });
43
- const onChange = useCallback((event, value) => {
44
- onChangeProp?.(event, value);
45
+ const onChange = useCallback((event, newValue) => {
46
+ onChangeProp?.(event, newValue);
45
47
  }, [onChangeProp]);
48
+ const memoizedChildren = useMemo(() => React.Children.map(children, child => {
49
+ if (React.isValidElement(child) && child.type === Radio) {
50
+ return React.cloneElement(child, {
51
+ isDisabled: isDisabled,
52
+ isReadOnly: isReadOnly
53
+ });
54
+ }
55
+ return child;
56
+ }), [children, isDisabled, isReadOnly]);
46
57
  const renderFieldComponent = useCallback(({
47
58
  ariaDescribedBy,
48
59
  errorMessageElementId,
@@ -58,8 +69,8 @@ const RadioGroup = ({
58
69
  name: nameOverride ?? id,
59
70
  onChange: onChange,
60
71
  translate: translate,
61
- children: children
62
- }), [children, inputValues, nameOverride, onChange, testId, translate]);
72
+ children: memoizedChildren
73
+ }), [inputValues, nameOverride, onChange, memoizedChildren, testId, translate]);
63
74
  return _jsx(Field, {
64
75
  ariaDescribedBy: ariaDescribedBy,
65
76
  errorMessage: errorMessage,
@@ -70,6 +81,7 @@ const RadioGroup = ({
70
81
  HintLinkComponent: HintLinkComponent,
71
82
  id: idOverride,
72
83
  isDisabled: isDisabled,
84
+ isReadOnly: isReadOnly,
73
85
  label: label,
74
86
  renderFieldComponent: renderFieldComponent
75
87
  });
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.js","names":["memo","useCallback","useRef","Field","getControlState","useInputValues","jsx","_jsx","RadioGroup","ariaDescribedBy","children","defaultValue","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","isDisabled","label","name","nameOverride","onChange","onChangeProp","testId","translate","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","event","renderFieldComponent","errorMessageElementId","labelElementId","_RadioGroup","fieldType","hasVisibleLabel","MemoizedRadioGroup","displayName"],"sources":["../src/RadioGroup.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 RadioGroup as MuiRadioGroup,\n type RadioGroupProps as MuiRadioGroupProps,\n} from \"@mui/material\";\nimport { memo, ReactNode, useCallback, useRef } from \"react\";\n\nimport { RadioProps } from \"./Radio\";\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { getControlState, useInputValues } from \"./inputUtils\";\n\nexport type RadioGroupProps = {\n /**\n * The Radio components within the group. Must include two or more.\n */\n children: ReactNode;\n /**\n * The text value of the Radio that should be selected by default\n */\n defaultValue?: string;\n /**\n * The text label for the RadioGroup\n */\n label: string;\n /**\n * Listen for changes in the browser that change `value`\n */\n onChange?: MuiRadioGroupProps[\"onChange\"];\n /**\n * The `value` on the selected Radio\n */\n value?: RadioProps[\"value\"];\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst RadioGroup = ({\n ariaDescribedBy,\n children,\n defaultValue,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n testId,\n translate,\n value,\n}: RadioGroupProps) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiRadioGroupProps[\"onChange\"]>>(\n (event, value) => {\n onChangeProp?.(event, value);\n },\n [onChangeProp],\n );\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <MuiRadioGroup\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n data-se={testId}\n id={id}\n name={nameOverride ?? id}\n onChange={onChange}\n translate={translate}\n >\n {children}\n </MuiRadioGroup>\n ),\n [children, inputValues, nameOverride, onChange, testId, translate],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"group\"\n hasVisibleLabel={false}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\nMemoizedRadioGroup.displayName = \"RadioGroup\";\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,SAASA,IAAI,EAAaC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAAC,SAGpDC,KAAK;AAAA,SAMLC,eAAe,EAAEC,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAwCxC,MAAMC,UAAU,GAAGA,CAAC;EAClBC,eAAe;EACfC,QAAQ;EACRC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,IAAI;EACJC,iBAAiB;EACjBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,KAAK;EACLC,IAAI,EAAEC,YAAY;EAClBC,QAAQ,EAAEC,YAAY;EACtBC,MAAM;EACNC,SAAS;EACTC;AACe,CAAC,KAAK;EACrB,MAAMC,kBAAkB,GAAGzB,MAAM,CAC/BE,eAAe,CAAC;IACdwB,eAAe,EAAEF,KAAK;IACtBG,iBAAiB,EAAElB;EACrB,CAAC,CACH,CAAC;EACD,MAAMmB,WAAW,GAAGzB,cAAc,CAAC;IACjCM,YAAY;IACZe,KAAK;IACLK,YAAY,EAAEJ,kBAAkB,CAACK;EACnC,CAAC,CAAC;EAEF,MAAMV,QAAQ,GAAGrB,WAAW,CAC1B,CAACgC,KAAK,EAAEP,KAAK,KAAK;IAChBH,YAAY,GAAGU,KAAK,EAAEP,KAAK,CAAC;EAC9B,CAAC,EACD,CAACH,YAAY,CACf,CAAC;EACD,MAAMW,oBAAoB,GAAGjC,WAAW,CACtC,CAAC;IACCQ,eAAe;IACf0B,qBAAqB;IACrBnB,EAAE;IACFoB;EACgB,CAAC,KACjB7B,IAAA,CAAA8B,WAAA;IAAA,GACMP,WAAW;IACf,oBAAkBrB,eAAgB;IAClC,qBAAmB0B,qBAAsB;IACzC,mBAAiBC,cAAe;IAChC,WAASZ,MAAO;IAChBR,EAAE,EAAEA,EAAG;IACPI,IAAI,EAAEC,YAAY,IAAIL,EAAG;IACzBM,QAAQ,EAAEA,QAAS;IACnBG,SAAS,EAAEA,SAAU;IAAAf,QAAA,EAEpBA;EAAQ,CACI,CAChB,EACD,CAACA,QAAQ,EAAEoB,WAAW,EAAET,YAAY,EAAEC,QAAQ,EAAEE,MAAM,EAAEC,SAAS,CACnE,CAAC;EAED,OACElB,IAAA,CAACJ,KAAK;IACJM,eAAe,EAAEA,eAAgB;IACjCG,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCyB,SAAS,EAAC,OAAO;IACjBC,eAAe,EAAE,KAAM;IACvBzB,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbe,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMM,kBAAkB,GAAGxC,IAAI,CAACQ,UAAU,CAAC;AAC3CgC,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIhC,UAAU"}
1
+ {"version":3,"file":"RadioGroup.js","names":["React","memo","useCallback","useRef","useMemo","Field","getControlState","useInputValues","Radio","jsx","_jsx","RadioGroup","ariaDescribedBy","children","defaultValue","errorMessage","errorMessageList","hint","HintLinkComponent","id","idOverride","isDisabled","isReadOnly","label","name","nameOverride","onChange","onChangeProp","testId","translate","value","controlledStateRef","controlledValue","uncontrolledValue","inputValues","controlState","current","event","newValue","memoizedChildren","Children","map","child","isValidElement","type","cloneElement","renderFieldComponent","errorMessageElementId","labelElementId","_RadioGroup","fieldType","hasVisibleLabel","MemoizedRadioGroup","displayName"],"sources":["../src/RadioGroup.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 RadioGroup as MuiRadioGroup,\n type RadioGroupProps as MuiRadioGroupProps,\n} from \"@mui/material\";\nimport React, { memo, ReactNode, useCallback, useRef, useMemo } from \"react\";\n\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { getControlState, useInputValues } from \"./inputUtils\";\nimport { Radio, RadioProps } from \"./Radio\";\n\nexport type RadioGroupProps = {\n /**\n * The Radio components within the group. Must include two or more.\n */\n children: ReactNode;\n /**\n * The text value of the Radio that should be selected by default\n */\n defaultValue?: string;\n /**\n * The text label for the RadioGroup\n */\n label: string;\n /**\n * Listen for changes in the browser that change `value`\n */\n onChange?: MuiRadioGroupProps[\"onChange\"];\n /**\n * The `value` on the selected Radio\n */\n value?: string;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isReadOnly\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype FieldRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\nconst RadioGroup = ({\n ariaDescribedBy,\n children,\n defaultValue,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n id: idOverride,\n isDisabled,\n isReadOnly = false,\n label,\n name: nameOverride,\n onChange: onChangeProp,\n testId,\n translate,\n value,\n}: RadioGroupProps) => {\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiRadioGroupProps[\"onChange\"]>>(\n (event, newValue) => {\n onChangeProp?.(event, newValue);\n },\n [onChangeProp],\n );\n\n const memoizedChildren = useMemo(\n () =>\n React.Children.map(children, (child) => {\n if (React.isValidElement<RadioProps>(child) && child.type === Radio) {\n return React.cloneElement(child, {\n isDisabled: isDisabled,\n isReadOnly: isReadOnly,\n });\n }\n return child;\n }),\n [children, isDisabled, isReadOnly],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: FieldRenderProps) => (\n <MuiRadioGroup\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n aria-labelledby={labelElementId}\n data-se={testId}\n id={id}\n name={nameOverride ?? id}\n onChange={onChange}\n translate={translate}\n >\n {memoizedChildren}\n </MuiRadioGroup>\n ),\n [inputValues, nameOverride, onChange, memoizedChildren, testId, translate],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"group\"\n hasVisibleLabel={false}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedRadioGroup = memo(RadioGroup);\nMemoizedRadioGroup.displayName = \"RadioGroup\";\n\nexport { MemoizedRadioGroup as RadioGroup };\n"],"mappings":"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"}
package/dist/Select.js CHANGED
@@ -27,6 +27,42 @@ import { useOdysseyDesignTokens } from "./OdysseyDesignTokensContext.js";
27
27
  import { jsx as _jsx } from "react/jsx-runtime";
28
28
  import { Fragment as _Fragment } from "react/jsx-runtime";
29
29
  import { jsxs as _jsxs } from "react/jsx-runtime";
30
+ export const SelectTestSelector = {
31
+ accessibleText: {
32
+ errorMessage: "errorMessage",
33
+ hint: "description",
34
+ label: "label"
35
+ },
36
+ children: {
37
+ list: {
38
+ accessibleText: {
39
+ label: "label"
40
+ },
41
+ children: {
42
+ listItem: {
43
+ accessibleText: {
44
+ label: "label"
45
+ },
46
+ elementSelector: {
47
+ method: "ByRole",
48
+ options: {
49
+ label: "name"
50
+ },
51
+ role: "option"
52
+ }
53
+ }
54
+ },
55
+ isControlledElement: true
56
+ }
57
+ },
58
+ elementSelector: {
59
+ method: "ByRole",
60
+ options: {
61
+ label: "name"
62
+ },
63
+ role: "combobox"
64
+ }
65
+ };
30
66
  const SelectContainer = styled.div`
31
67
  position: relative;
32
68
  width: 100%;
@@ -69,7 +105,7 @@ const NonInteractiveIcon = styled(CloseCircleFilledIcon, {
69
105
  margin-block-end: -1px;
70
106
  `;
71
107
  const ChipsInnerContainer = styled(_Box, {
72
- shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isInteractive"
108
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isInteractive" && prop !== "isReadOnly"
73
109
  })`
74
110
  display: flex;
75
111
  flex-wrap: wrap;
@@ -78,8 +114,9 @@ const ChipsInnerContainer = styled(_Box, {
78
114
  }) => odysseyDesignTokens.Spacing1};
79
115
  pointer-events: none;
80
116
  opacity: ${({
81
- isInteractive
82
- }) => isInteractive ? 1 : 0};
117
+ isInteractive,
118
+ isReadOnly
119
+ }) => isInteractive || isReadOnly ? 1 : 0};
83
120
  min-height: ${({
84
121
  odysseyDesignTokens
85
122
  }) => odysseyDesignTokens.Spacing6};
@@ -101,6 +138,7 @@ const Select = ({
101
138
  isFullWidth = false,
102
139
  isMultiSelect,
103
140
  isOptional = false,
141
+ isReadOnly = false,
104
142
  label,
105
143
  name: nameOverride,
106
144
  onBlur,
@@ -111,6 +149,7 @@ const Select = ({
111
149
  translate,
112
150
  value
113
151
  }) => {
152
+ const selectRef = useRef(null);
114
153
  const hasMultipleChoices = useMemo(() => hasMultipleChoicesProp === undefined ? isMultiSelect : hasMultipleChoicesProp, [hasMultipleChoicesProp, isMultiSelect]);
115
154
  const controlledStateRef = useRef(getControlState({
116
155
  controlledValue: value,
@@ -137,31 +176,39 @@ const Select = ({
137
176
  controlState: controlledStateRef.current
138
177
  });
139
178
  const onChange = useCallback((event, child) => {
140
- const {
141
- target: {
142
- value
179
+ if (isReadOnly) {
180
+ event.preventDefault();
181
+ } else {
182
+ const {
183
+ target: {
184
+ value
185
+ }
186
+ } = event;
187
+ if (controlledStateRef.current !== CONTROLLED) {
188
+ setInternalSelectedValues(typeof value === "string" && hasMultipleChoices ? value.split(",") : value);
143
189
  }
144
- } = event;
145
- if (controlledStateRef.current !== CONTROLLED) {
146
- setInternalSelectedValues(typeof value === "string" && hasMultipleChoices ? value.split(",") : value);
190
+ onChangeProp?.(event, child);
147
191
  }
148
- onChangeProp?.(event, child);
149
- }, [hasMultipleChoices, onChangeProp]);
150
- const normalizedOptions = useMemo(() => options.map(option => {
151
- if (typeof option === "object") {
152
- const value = option?.value === "" ? option.value : option.value || option.text;
192
+ }, [hasMultipleChoices, onChangeProp, isReadOnly]);
193
+ const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {
194
+ const normalizedOptions = options.map(option => {
195
+ if (typeof option === "object") {
196
+ const value = option?.value === "" ? option.value : option.value || option.text;
197
+ return {
198
+ text: option.text,
199
+ value,
200
+ type: option.type === "heading" ? "heading" : "option"
201
+ };
202
+ }
153
203
  return {
154
- text: option.text,
155
- value,
156
- type: option.type === "heading" ? "heading" : "option"
204
+ text: option,
205
+ value: option,
206
+ type: "option"
157
207
  };
158
- }
159
- return {
160
- text: option,
161
- value: option,
162
- type: "option"
163
- };
164
- }), [options]);
208
+ });
209
+ const normalizedOptionsMap = new Map(normalizedOptions.map(option => [option.value, option]));
210
+ return [normalizedOptions, normalizedOptionsMap];
211
+ }, [options]);
165
212
  const removeSelectedValue = useCallback(selectedValue => {
166
213
  if (Array.isArray(internalSelectedValues)) {
167
214
  const newValue = internalSelectedValues.filter(internalSelectedValue => internalSelectedValue !== selectedValue);
@@ -174,16 +221,18 @@ const Select = ({
174
221
  }
175
222
  }, [internalSelectedValues, onChange]);
176
223
  const Chips = useCallback(({
177
- isInteractive
224
+ isInteractive,
225
+ isReadOnly
178
226
  }) => {
179
227
  const stopPropagation = event => event.stopPropagation();
180
228
  const hasNonInteractiveIcon = !isInteractive && controlledStateRef.current === CONTROLLED && hasMultipleChoices;
181
229
  return Array.isArray(internalSelectedValues) && _jsx(ChipsInnerContainer, {
182
230
  isInteractive: isInteractive,
231
+ isReadOnly: isReadOnly,
183
232
  odysseyDesignTokens: odysseyDesignTokens,
184
233
  children: internalSelectedValues.map(item => item?.length > 0 && _jsx(_Chip, {
185
234
  label: _jsxs(_Fragment, {
186
- children: [item, hasNonInteractiveIcon && _jsx(NonInteractiveIcon, {
235
+ children: [normalizedOptionsMap.get(item)?.text, hasNonInteractiveIcon && _jsx(NonInteractiveIcon, {
187
236
  odysseyDesignTokens: odysseyDesignTokens
188
237
  })]
189
238
  }),
@@ -197,7 +246,7 @@ const Select = ({
197
246
  })
198
247
  }, item))
199
248
  });
200
- }, [controlledStateRef, hasMultipleChoices, internalSelectedValues, odysseyDesignTokens, removeSelectedValue]);
249
+ }, [controlledStateRef, hasMultipleChoices, internalSelectedValues, odysseyDesignTokens, removeSelectedValue, normalizedOptionsMap]);
201
250
  const renderedOptions = useMemo(() => normalizedOptions.map((option, index) => {
202
251
  if (option.type === "heading") {
203
252
  return _jsxs(_ListSubheader, {
@@ -206,6 +255,7 @@ const Select = ({
206
255
  }
207
256
  const isSelected = hasMultipleChoices ? internalSelectedValues?.includes(option.value) : internalSelectedValues === option.value;
208
257
  return _jsxs(_MenuItem, {
258
+ "data-empty": !option.text,
209
259
  value: option.value,
210
260
  selected: isSelected,
211
261
  children: [hasMultipleChoices && _jsx(_Checkbox, {
@@ -231,9 +281,16 @@ const Select = ({
231
281
  displayEmpty: true,
232
282
  id: id,
233
283
  inputProps: {
234
- "data-se": testId
284
+ "data-se": testId,
285
+ "aria-disabled": isDisabled || isReadOnly,
286
+ readOnly: isReadOnly
287
+ },
288
+ inputRef: el => {
289
+ if (localInputRef.current !== el) {
290
+ localInputRef.current = el;
291
+ }
292
+ selectRef.current = el;
235
293
  },
236
- inputRef: localInputRef,
237
294
  labelId: labelElementId,
238
295
  multiple: hasMultipleChoices,
239
296
  name: nameOverride ?? id,
@@ -247,11 +304,12 @@ const Select = ({
247
304
  children: _jsx(ChipsPositioningContainer, {
248
305
  odysseyDesignTokens: odysseyDesignTokens,
249
306
  children: _jsx(Chips, {
250
- isInteractive: true
307
+ isInteractive: !isReadOnly,
308
+ isReadOnly: isReadOnly
251
309
  })
252
310
  })
253
311
  })]
254
- }), [Chips, inputValues, hasMultipleChoices, nameOverride, odysseyDesignTokens, onBlur, onChange, onFocus, renderedOptions, renderValue, testId, translate]);
312
+ }), [Chips, inputValues, hasMultipleChoices, isDisabled, isReadOnly, nameOverride, odysseyDesignTokens, onBlur, onChange, onFocus, renderedOptions, renderValue, testId, translate]);
255
313
  return _jsx(Field, {
256
314
  ariaDescribedBy: ariaDescribedBy,
257
315
  errorMessage: errorMessage,