@okta/odyssey-react-mui 1.21.2 → 1.22.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 (432) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/Autocomplete.js +76 -38
  3. package/dist/Autocomplete.js.map +1 -1
  4. package/dist/Checkbox.js +26 -11
  5. package/dist/Checkbox.js.map +1 -1
  6. package/dist/CheckboxGroup.js +14 -3
  7. package/dist/CheckboxGroup.js.map +1 -1
  8. package/dist/DataTable/DataTable.js +10 -2
  9. package/dist/DataTable/DataTable.js.map +1 -1
  10. package/dist/DataTable/useScrollIndication.js +2 -2
  11. package/dist/DataTable/useScrollIndication.js.map +1 -1
  12. package/dist/Field.js +3 -1
  13. package/dist/Field.js.map +1 -1
  14. package/dist/OdysseyCacheProvider.js +4 -3
  15. package/dist/OdysseyCacheProvider.js.map +1 -1
  16. package/dist/OdysseyProvider.js +6 -3
  17. package/dist/OdysseyProvider.js.map +1 -1
  18. package/dist/OdysseyThemeProvider.js +3 -2
  19. package/dist/OdysseyThemeProvider.js.map +1 -1
  20. package/dist/Radio.js +34 -7
  21. package/dist/Radio.js.map +1 -1
  22. package/dist/RadioGroup.js +17 -5
  23. package/dist/RadioGroup.js.map +1 -1
  24. package/dist/Select.js +53 -31
  25. package/dist/Select.js.map +1 -1
  26. package/dist/ToastStack.js.map +1 -1
  27. package/dist/{createShadowRootElement.js → createShadowDomElements.js} +22 -6
  28. package/dist/createShadowDomElements.js.map +1 -0
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.scss +5 -5
  32. package/dist/labs/AppTile.js +124 -0
  33. package/dist/labs/AppTile.js.map +1 -0
  34. package/dist/labs/DataView/BulkActionsMenu.js.map +1 -0
  35. package/dist/labs/{DataComponents/StackContent.js → DataView/CardLayoutContent.js} +14 -14
  36. package/dist/labs/DataView/CardLayoutContent.js.map +1 -0
  37. package/dist/labs/{DataComponents/StackCard.js → DataView/DataCard.js} +6 -6
  38. package/dist/labs/DataView/DataCard.js.map +1 -0
  39. package/dist/labs/{DataComponents → DataView}/DataTable.js +6 -2
  40. package/dist/labs/DataView/DataTable.js.map +1 -0
  41. package/dist/labs/{DataComponents → DataView}/DataView.js +25 -15
  42. package/dist/labs/DataView/DataView.js.map +1 -0
  43. package/dist/labs/DataView/DetailPanel.js.map +1 -0
  44. package/dist/labs/DataView/LayoutSwitcher.js.map +1 -0
  45. package/dist/labs/DataView/RowActions.js.map +1 -0
  46. package/dist/labs/{DataComponents/TableContent.js → DataView/TableLayoutContent.js} +17 -17
  47. package/dist/labs/DataView/TableLayoutContent.js.map +1 -0
  48. package/dist/labs/{DataComponents → DataView}/TableSettings.js +2 -2
  49. package/dist/labs/DataView/TableSettings.js.map +1 -0
  50. package/dist/labs/DataView/componentTypes.js.map +1 -0
  51. package/dist/labs/{DataComponents → DataView}/constants.js +2 -2
  52. package/dist/labs/DataView/constants.js.map +1 -0
  53. package/dist/labs/DataView/dataTypes.js.map +1 -0
  54. package/dist/labs/DataView/fetchData.js.map +1 -0
  55. package/dist/labs/{DataComponents → DataView}/index.js +0 -1
  56. package/dist/labs/DataView/index.js.map +1 -0
  57. package/dist/labs/DataView/tableConstants.js.map +1 -0
  58. package/dist/labs/DataView/useFilterConversion.js.map +1 -0
  59. package/dist/labs/SideNav/CollapseIcon.js +44 -0
  60. package/dist/labs/SideNav/CollapseIcon.js.map +1 -0
  61. package/dist/labs/SideNav/SideNav.js +246 -0
  62. package/dist/labs/SideNav/SideNav.js.map +1 -0
  63. package/dist/labs/SideNav/SideNavFooterContent.js +49 -0
  64. package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -0
  65. package/dist/labs/SideNav/SideNavHeader.js +58 -0
  66. package/dist/labs/SideNav/SideNavHeader.js.map +1 -0
  67. package/dist/labs/SideNav/SideNavItemContent.js +157 -0
  68. package/dist/labs/SideNav/SideNavItemContent.js.map +1 -0
  69. package/dist/labs/SideNav/SideNavItemLinkContent.js +71 -0
  70. package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -0
  71. package/dist/labs/SideNav/index.js +14 -0
  72. package/dist/labs/SideNav/index.js.map +1 -0
  73. package/dist/labs/SideNav/types.js +2 -0
  74. package/dist/labs/SideNav/types.js.map +1 -0
  75. package/dist/labs/Switch.js +70 -16
  76. package/dist/labs/Switch.js.map +1 -1
  77. package/dist/labs/index.js +3 -2
  78. package/dist/labs/index.js.map +1 -1
  79. package/dist/properties/ts/odyssey-react-mui_cs.js +17 -3
  80. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  81. package/dist/properties/ts/odyssey-react-mui_da.js +17 -3
  82. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  83. package/dist/properties/ts/odyssey-react-mui_de.js +16 -2
  84. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  85. package/dist/properties/ts/odyssey-react-mui_el.js +18 -4
  86. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  87. package/dist/properties/ts/odyssey-react-mui_es.js +17 -3
  88. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  89. package/dist/properties/ts/odyssey-react-mui_fi.js +17 -3
  90. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  91. package/dist/properties/ts/odyssey-react-mui_fr.js +17 -3
  92. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  93. package/dist/properties/ts/odyssey-react-mui_ht.js +18 -4
  94. package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  95. package/dist/properties/ts/odyssey-react-mui_hu.js +17 -3
  96. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  97. package/dist/properties/ts/odyssey-react-mui_id.js +17 -3
  98. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  99. package/dist/properties/ts/odyssey-react-mui_it.js +17 -3
  100. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  101. package/dist/properties/ts/odyssey-react-mui_ja.js +16 -2
  102. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  103. package/dist/properties/ts/odyssey-react-mui_ko.js +16 -2
  104. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  105. package/dist/properties/ts/odyssey-react-mui_ms.js +17 -3
  106. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  107. package/dist/properties/ts/odyssey-react-mui_nb.js +17 -3
  108. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  109. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +17 -3
  110. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  111. package/dist/properties/ts/odyssey-react-mui_pl.js +17 -3
  112. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  113. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +17 -3
  114. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  115. package/dist/properties/ts/odyssey-react-mui_ro.js +17 -3
  116. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  117. package/dist/properties/ts/odyssey-react-mui_ru.js +17 -3
  118. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  119. package/dist/properties/ts/odyssey-react-mui_sv.js +17 -3
  120. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  121. package/dist/properties/ts/odyssey-react-mui_th.js +16 -2
  122. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  123. package/dist/properties/ts/odyssey-react-mui_tr.js +17 -3
  124. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  125. package/dist/properties/ts/odyssey-react-mui_uk.js +17 -3
  126. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  127. package/dist/properties/ts/odyssey-react-mui_vi.js +17 -3
  128. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  129. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +16 -2
  130. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  131. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +16 -2
  132. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  133. package/dist/src/Autocomplete.d.ts.map +1 -1
  134. package/dist/src/Checkbox.d.ts +2 -2
  135. package/dist/src/Checkbox.d.ts.map +1 -1
  136. package/dist/src/CheckboxGroup.d.ts +3 -3
  137. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  138. package/dist/src/DataTable/DataTable.d.ts +9 -1
  139. package/dist/src/DataTable/DataTable.d.ts.map +1 -1
  140. package/dist/src/Field.d.ts +3 -2
  141. package/dist/src/Field.d.ts.map +1 -1
  142. package/dist/src/OdysseyCacheProvider.d.ts +7 -3
  143. package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
  144. package/dist/src/OdysseyProvider.d.ts +1 -1
  145. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  146. package/dist/src/OdysseyThemeProvider.d.ts +3 -1
  147. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  148. package/dist/src/Radio.d.ts +6 -8
  149. package/dist/src/Radio.d.ts.map +1 -1
  150. package/dist/src/RadioGroup.d.ts +4 -5
  151. package/dist/src/RadioGroup.d.ts.map +1 -1
  152. package/dist/src/Select.d.ts +2 -2
  153. package/dist/src/Select.d.ts.map +1 -1
  154. package/dist/src/ToastStack.d.ts +2 -2
  155. package/dist/src/ToastStack.d.ts.map +1 -1
  156. package/dist/src/{createShadowRootElement.d.ts → createShadowDomElements.d.ts} +6 -1
  157. package/dist/src/createShadowDomElements.d.ts.map +1 -0
  158. package/dist/src/index.d.ts +1 -1
  159. package/dist/src/labs/AppTile.d.ts +39 -0
  160. package/dist/src/labs/AppTile.d.ts.map +1 -0
  161. package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -0
  162. package/dist/src/labs/{DataComponents/StackContent.d.ts → DataView/CardLayoutContent.d.ts} +7 -7
  163. package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -0
  164. package/dist/src/labs/{DataComponents/StackCard.d.ts → DataView/DataCard.d.ts} +4 -4
  165. package/dist/src/labs/DataView/DataCard.d.ts.map +1 -0
  166. package/dist/src/labs/DataView/DataTable.d.ts +16 -0
  167. package/dist/src/labs/DataView/DataTable.d.ts.map +1 -0
  168. package/dist/src/labs/{DataComponents → DataView}/DataView.d.ts +1 -1
  169. package/dist/src/labs/DataView/DataView.d.ts.map +1 -0
  170. package/dist/src/labs/{DataComponents → DataView}/DetailPanel.d.ts +2 -2
  171. package/dist/src/labs/DataView/DetailPanel.d.ts.map +1 -0
  172. package/dist/src/labs/DataView/LayoutSwitcher.d.ts.map +1 -0
  173. package/dist/src/labs/DataView/RowActions.d.ts.map +1 -0
  174. package/dist/src/labs/{DataComponents/TableContent.d.ts → DataView/TableLayoutContent.d.ts} +7 -7
  175. package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -0
  176. package/dist/src/labs/{DataComponents → DataView}/TableSettings.d.ts +3 -3
  177. package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -0
  178. package/dist/src/labs/{DataComponents → DataView}/componentTypes.d.ts +11 -9
  179. package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -0
  180. package/dist/src/labs/{DataComponents → DataView}/constants.d.ts +1 -1
  181. package/dist/src/labs/DataView/constants.d.ts.map +1 -0
  182. package/dist/src/labs/DataView/dataTypes.d.ts.map +1 -0
  183. package/dist/src/labs/DataView/fetchData.d.ts.map +1 -0
  184. package/dist/src/labs/{DataComponents → DataView}/index.d.ts +0 -1
  185. package/dist/src/labs/DataView/index.d.ts.map +1 -0
  186. package/dist/src/labs/DataView/tableConstants.d.ts.map +1 -0
  187. package/dist/src/labs/{DataComponents → DataView}/useFilterConversion.d.ts +2 -2
  188. package/dist/src/labs/DataView/useFilterConversion.d.ts.map +1 -0
  189. package/dist/src/labs/SideNav/CollapseIcon.d.ts +17 -0
  190. package/dist/src/labs/SideNav/CollapseIcon.d.ts.map +1 -0
  191. package/dist/src/labs/SideNav/SideNav.d.ts +15 -0
  192. package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -0
  193. package/dist/src/labs/SideNav/SideNavFooterContent.d.ts +17 -0
  194. package/dist/src/labs/SideNav/SideNavFooterContent.d.ts.map +1 -0
  195. package/dist/src/labs/SideNav/SideNavHeader.d.ts +16 -0
  196. package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -0
  197. package/dist/src/labs/SideNav/SideNavItemContent.d.ts +33 -0
  198. package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -0
  199. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts +16 -0
  200. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts.map +1 -0
  201. package/dist/src/labs/SideNav/index.d.ts +14 -0
  202. package/dist/src/labs/SideNav/index.d.ts.map +1 -0
  203. package/dist/src/labs/{SideNav.d.ts → SideNav/types.d.ts} +31 -33
  204. package/dist/src/labs/SideNav/types.d.ts.map +1 -0
  205. package/dist/src/labs/Switch.d.ts +5 -1
  206. package/dist/src/labs/Switch.d.ts.map +1 -1
  207. package/dist/src/labs/index.d.ts +2 -1
  208. package/dist/src/labs/index.d.ts.map +1 -1
  209. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +15 -1
  210. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  211. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +15 -1
  212. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  213. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +15 -1
  214. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  215. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +15 -1
  216. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  217. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +15 -1
  218. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  219. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +15 -1
  220. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  221. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +15 -1
  222. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  223. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts +16 -2
  224. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  225. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +15 -1
  226. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  227. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +15 -1
  228. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  229. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +15 -1
  230. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  231. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +15 -1
  232. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  233. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +15 -1
  234. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  235. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +15 -1
  236. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  237. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +15 -1
  238. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  239. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +15 -1
  240. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  241. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +15 -1
  242. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  243. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +15 -1
  244. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  245. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +15 -1
  246. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  247. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +15 -1
  248. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  249. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +15 -1
  250. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  251. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +15 -1
  252. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  253. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +15 -1
  254. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  255. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +15 -1
  256. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  257. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +15 -1
  258. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  259. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +15 -1
  260. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  261. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +15 -1
  262. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  263. package/dist/src/theme/components.d.ts +3 -1
  264. package/dist/src/theme/components.d.ts.map +1 -1
  265. package/dist/src/theme/createOdysseyMuiTheme.d.ts +3 -1
  266. package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
  267. package/dist/theme/components.js +232 -146
  268. package/dist/theme/components.js.map +1 -1
  269. package/dist/theme/createOdysseyMuiTheme.js +3 -2
  270. package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
  271. package/dist/tsconfig.production.tsbuildinfo +1 -1
  272. package/package.json +3 -4
  273. package/src/Autocomplete.tsx +108 -45
  274. package/src/Checkbox.tsx +39 -9
  275. package/src/CheckboxGroup.tsx +20 -4
  276. package/src/DataTable/DataTable.tsx +24 -1
  277. package/src/DataTable/useScrollIndication.tsx +2 -2
  278. package/src/Field.tsx +5 -2
  279. package/src/OdysseyCacheProvider.tsx +18 -4
  280. package/src/OdysseyProvider.tsx +6 -3
  281. package/src/OdysseyThemeProvider.tsx +6 -2
  282. package/src/Radio.tsx +42 -13
  283. package/src/RadioGroup.tsx +26 -7
  284. package/src/Select.tsx +78 -45
  285. package/src/ToastStack.tsx +2 -2
  286. package/src/{createShadowRootElement.ts → createShadowDomElements.ts} +24 -5
  287. package/src/index.ts +1 -1
  288. package/src/labs/AppTile.tsx +200 -0
  289. package/src/labs/{DataComponents/StackContent.tsx → DataView/CardLayoutContent.tsx} +24 -19
  290. package/src/labs/{DataComponents/StackCard.tsx → DataView/DataCard.tsx} +7 -7
  291. package/src/labs/{DataComponents → DataView}/DataTable.tsx +8 -4
  292. package/src/labs/{DataComponents → DataView}/DataView.tsx +46 -17
  293. package/src/labs/{DataComponents → DataView}/DetailPanel.tsx +2 -2
  294. package/src/labs/{DataComponents/TableContent.tsx → DataView/TableLayoutContent.tsx} +31 -26
  295. package/src/labs/{DataComponents → DataView}/TableSettings.tsx +5 -4
  296. package/src/labs/{DataComponents → DataView}/componentTypes.ts +11 -9
  297. package/src/labs/{DataComponents → DataView}/constants.tsx +2 -2
  298. package/src/labs/{DataComponents → DataView}/index.tsx +0 -1
  299. package/src/labs/{DataComponents → DataView}/useFilterConversion.ts +2 -2
  300. package/src/labs/SideNav/CollapseIcon.tsx +48 -0
  301. package/src/labs/SideNav/SideNav.tsx +350 -0
  302. package/src/labs/SideNav/SideNavFooterContent.tsx +64 -0
  303. package/src/labs/SideNav/SideNavHeader.tsx +65 -0
  304. package/src/labs/SideNav/SideNavItemContent.tsx +216 -0
  305. package/src/labs/SideNav/SideNavItemLinkContent.tsx +87 -0
  306. package/src/labs/SideNav/index.ts +15 -0
  307. package/src/labs/SideNav/types.ts +125 -0
  308. package/src/labs/Switch.tsx +85 -31
  309. package/src/labs/index.ts +3 -1
  310. package/src/properties/translations/odyssey-react-mui_cs.properties +15 -3
  311. package/src/properties/translations/odyssey-react-mui_da.properties +15 -3
  312. package/src/properties/translations/odyssey-react-mui_de.properties +14 -2
  313. package/src/properties/translations/odyssey-react-mui_el.properties +16 -4
  314. package/src/properties/translations/odyssey-react-mui_es.properties +15 -3
  315. package/src/properties/translations/odyssey-react-mui_fi.properties +15 -3
  316. package/src/properties/translations/odyssey-react-mui_fr.properties +15 -3
  317. package/src/properties/translations/odyssey-react-mui_ht.properties +17 -6
  318. package/src/properties/translations/odyssey-react-mui_hu.properties +15 -3
  319. package/src/properties/translations/odyssey-react-mui_id.properties +15 -3
  320. package/src/properties/translations/odyssey-react-mui_it.properties +15 -3
  321. package/src/properties/translations/odyssey-react-mui_ja.properties +14 -2
  322. package/src/properties/translations/odyssey-react-mui_ko.properties +14 -2
  323. package/src/properties/translations/odyssey-react-mui_ms.properties +15 -3
  324. package/src/properties/translations/odyssey-react-mui_nb.properties +15 -3
  325. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +15 -3
  326. package/src/properties/translations/odyssey-react-mui_pl.properties +15 -3
  327. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +15 -3
  328. package/src/properties/translations/odyssey-react-mui_ro.properties +15 -3
  329. package/src/properties/translations/odyssey-react-mui_ru.properties +15 -3
  330. package/src/properties/translations/odyssey-react-mui_sv.properties +15 -3
  331. package/src/properties/translations/odyssey-react-mui_th.properties +14 -2
  332. package/src/properties/translations/odyssey-react-mui_tr.properties +15 -3
  333. package/src/properties/translations/odyssey-react-mui_uk.properties +15 -3
  334. package/src/properties/translations/odyssey-react-mui_vi.properties +15 -3
  335. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +14 -2
  336. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +14 -2
  337. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  338. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  339. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  340. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  341. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  342. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  343. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  344. package/src/properties/ts/odyssey-react-mui_ht.ts +1 -1
  345. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  346. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  347. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  348. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  349. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  350. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  351. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  352. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  353. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  354. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  355. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  356. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  357. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  358. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  359. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  360. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  361. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  362. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  363. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  364. package/src/theme/components.tsx +240 -150
  365. package/src/theme/createOdysseyMuiTheme.ts +4 -1
  366. package/dist/createShadowRootElement.js.map +0 -1
  367. package/dist/labs/DataComponents/BulkActionsMenu.js.map +0 -1
  368. package/dist/labs/DataComponents/DataStack.js +0 -85
  369. package/dist/labs/DataComponents/DataStack.js.map +0 -1
  370. package/dist/labs/DataComponents/DataTable.js.map +0 -1
  371. package/dist/labs/DataComponents/DataView.js.map +0 -1
  372. package/dist/labs/DataComponents/DetailPanel.js.map +0 -1
  373. package/dist/labs/DataComponents/LayoutSwitcher.js.map +0 -1
  374. package/dist/labs/DataComponents/RowActions.js.map +0 -1
  375. package/dist/labs/DataComponents/StackCard.js.map +0 -1
  376. package/dist/labs/DataComponents/StackContent.js.map +0 -1
  377. package/dist/labs/DataComponents/TableContent.js.map +0 -1
  378. package/dist/labs/DataComponents/TableSettings.js.map +0 -1
  379. package/dist/labs/DataComponents/componentTypes.js.map +0 -1
  380. package/dist/labs/DataComponents/constants.js.map +0 -1
  381. package/dist/labs/DataComponents/dataTypes.js.map +0 -1
  382. package/dist/labs/DataComponents/fetchData.js.map +0 -1
  383. package/dist/labs/DataComponents/index.js.map +0 -1
  384. package/dist/labs/DataComponents/tableConstants.js.map +0 -1
  385. package/dist/labs/DataComponents/useFilterConversion.js.map +0 -1
  386. package/dist/labs/SideNav.js +0 -478
  387. package/dist/labs/SideNav.js.map +0 -1
  388. package/dist/src/createShadowRootElement.d.ts.map +0 -1
  389. package/dist/src/labs/DataComponents/BulkActionsMenu.d.ts.map +0 -1
  390. package/dist/src/labs/DataComponents/DataStack.d.ts +0 -20
  391. package/dist/src/labs/DataComponents/DataStack.d.ts.map +0 -1
  392. package/dist/src/labs/DataComponents/DataTable.d.ts +0 -16
  393. package/dist/src/labs/DataComponents/DataTable.d.ts.map +0 -1
  394. package/dist/src/labs/DataComponents/DataView.d.ts.map +0 -1
  395. package/dist/src/labs/DataComponents/DetailPanel.d.ts.map +0 -1
  396. package/dist/src/labs/DataComponents/LayoutSwitcher.d.ts.map +0 -1
  397. package/dist/src/labs/DataComponents/RowActions.d.ts.map +0 -1
  398. package/dist/src/labs/DataComponents/StackCard.d.ts.map +0 -1
  399. package/dist/src/labs/DataComponents/StackContent.d.ts.map +0 -1
  400. package/dist/src/labs/DataComponents/TableContent.d.ts.map +0 -1
  401. package/dist/src/labs/DataComponents/TableSettings.d.ts.map +0 -1
  402. package/dist/src/labs/DataComponents/componentTypes.d.ts.map +0 -1
  403. package/dist/src/labs/DataComponents/constants.d.ts.map +0 -1
  404. package/dist/src/labs/DataComponents/dataTypes.d.ts.map +0 -1
  405. package/dist/src/labs/DataComponents/fetchData.d.ts.map +0 -1
  406. package/dist/src/labs/DataComponents/index.d.ts.map +0 -1
  407. package/dist/src/labs/DataComponents/tableConstants.d.ts.map +0 -1
  408. package/dist/src/labs/DataComponents/useFilterConversion.d.ts.map +0 -1
  409. package/dist/src/labs/SideNav.d.ts.map +0 -1
  410. package/src/labs/DataComponents/DataStack.tsx +0 -105
  411. package/src/labs/SideNav.tsx +0 -745
  412. /package/dist/labs/{DataComponents → DataView}/BulkActionsMenu.js +0 -0
  413. /package/dist/labs/{DataComponents → DataView}/DetailPanel.js +0 -0
  414. /package/dist/labs/{DataComponents → DataView}/LayoutSwitcher.js +0 -0
  415. /package/dist/labs/{DataComponents → DataView}/RowActions.js +0 -0
  416. /package/dist/labs/{DataComponents → DataView}/componentTypes.js +0 -0
  417. /package/dist/labs/{DataComponents → DataView}/dataTypes.js +0 -0
  418. /package/dist/labs/{DataComponents → DataView}/fetchData.js +0 -0
  419. /package/dist/labs/{DataComponents → DataView}/tableConstants.js +0 -0
  420. /package/dist/labs/{DataComponents → DataView}/useFilterConversion.js +0 -0
  421. /package/dist/src/labs/{DataComponents → DataView}/BulkActionsMenu.d.ts +0 -0
  422. /package/dist/src/labs/{DataComponents → DataView}/LayoutSwitcher.d.ts +0 -0
  423. /package/dist/src/labs/{DataComponents → DataView}/RowActions.d.ts +0 -0
  424. /package/dist/src/labs/{DataComponents → DataView}/dataTypes.d.ts +0 -0
  425. /package/dist/src/labs/{DataComponents → DataView}/fetchData.d.ts +0 -0
  426. /package/dist/src/labs/{DataComponents → DataView}/tableConstants.d.ts +0 -0
  427. /package/src/labs/{DataComponents → DataView}/BulkActionsMenu.tsx +0 -0
  428. /package/src/labs/{DataComponents → DataView}/LayoutSwitcher.tsx +0 -0
  429. /package/src/labs/{DataComponents → DataView}/RowActions.tsx +0 -0
  430. /package/src/labs/{DataComponents → DataView}/dataTypes.ts +0 -0
  431. /package/src/labs/{DataComponents → DataView}/fetchData.ts +0 -0
  432. /package/src/labs/{DataComponents → DataView}/tableConstants.tsx +0 -0
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 {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f,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 = false,\n isInvalid,\n label: labelProp,\n name,\n testId,\n translate,\n value,\n isReadOnly = false,\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":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA,SAASA,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,mBAAmB,QAAQ,OAAO;AAAC,SAIvEC,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAmCnB,MAAMC,KAAK,GAAGA,CAAC;EACbC,IAAI;EACJC,QAAQ;EACRC,SAAS;EACTC,UAAU,GAAG,KAA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,MAAMG,MAAM,GAAG1B,WAAW,CACvBmC,KAAK,IAAK;IACTR,UAAU,GAAGQ,KAAK,CAAC;EACrB,CAAC,EACD,CAACR,UAAU,CACb,CAAC;EAED,OACErB,IAAA,CAAAkC,iBAAA;IACEJ,OAAO,EAAEtB,SAAU;IACnB2B,SAAS,EAAEzB,SAAS,GAAG,WAAW,GAAG,EAAG;IACxC0B,OAAO,EACLpC,IAAA,CAAAqC,MAAA;MACEC,UAAU,EAAE;QACV,SAAS,EAAExB,MAAM;QACjB,eAAe,EAAEL,UAAU,IAAIQ,UAAU;QACzCsB,QAAQ,EAAEtB,UAAU;QACpBuB,QAAQ,EAAEvB,UAAU,GAAG,CAAC,GAAGwB;MAC7B,CAAE;MACFlC,QAAQ,EAAEgB,aAAc;MACxBL,QAAQ,EAAEA,QAAS;MACnBI,OAAO,EAAEA,OAAO,IAAIU,WAAY;MAChCU,QAAQ,EAAEjC;IAAW,CACtB,CACF;IACDE,KAAK,EAAEA,KAAM;IACbE,IAAI,EAAEA,IAAK;IACXE,SAAS,EAAEA,SAAU;IACrBC,KAAK,EAAEA,KAAM;IACbI,MAAM,EAAEA,MAAO;IACfsB,QAAQ,EAAEjC,UAAW;IACrBkC,EAAE,EAAE;MACF,IAAI1B,UAAU,IAAI;QAChB2B,MAAM,EAAE,SAAS;QACjB,uBAAuB,EAAE;UACvBA,MAAM,EAAE;QACV;MACF,CAAC;IACH;EAAE,CACH,CAAC;AAEN,CAAC;AAED,MAAMC,aAAa,GAAGpD,IAAI,CAACY,KAAK,CAAC;AACjCwC,aAAa,CAACC,WAAW,GAAG,OAAO;AAEnC,SAASD,aAAa,IAAIxC,KAAK"}
@@ -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,EAAa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AEoB,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":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA,OAAOA,KAAK,IAAIC,IAAI,EAAaC,WAAW,EAAEC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAAC,SAEpEC,KAAK;AAAA,SAMLC,eAAe,EAAEC,cAAc;AAAA,SAC/BC,KAAK;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAyCd,MAAMC,UAAU,GAAGA,CAAC;EAClBC,eAAe;EACfC,QAAQ;EACRC,YAAY;EACZC,YAAY;EACZC,gBAAgB;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B;IAClC,qBAAmBmC,qBAAsB;IACzC,mBAAiBC,cAAe;IAChC,WAASpB,MAAO;IAChBT,EAAE,EAAEA,EAAG;IACPK,IAAI,EAAEC,YAAY,IAAIN,EAAG;IACzBO,QAAQ,EAAEA,QAAS;IACnBG,SAAS,EAAEA,SAAU;IAAAhB,QAAA,EAEpB0B;EAAgB,CACJ,CAChB,EACD,CAACL,WAAW,EAAET,YAAY,EAAEC,QAAQ,EAAEa,gBAAgB,EAAEX,MAAM,EAAEC,SAAS,CAC3E,CAAC;EAED,OACEnB,IAAA,CAACL,KAAK;IACJO,eAAe,EAAEA,eAAgB;IACjCG,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCkC,SAAS,EAAC,OAAO;IACjBC,eAAe,EAAE,KAAM;IACvBlC,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfC,UAAU,EAAEA,UAAW;IACvBC,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbuB,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMM,kBAAkB,GAAGnD,IAAI,CAACU,UAAU,CAAC;AAC3CyC,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIzC,UAAU"}
package/dist/Select.js CHANGED
@@ -69,7 +69,7 @@ const NonInteractiveIcon = styled(CloseCircleFilledIcon, {
69
69
  margin-block-end: -1px;
70
70
  `;
71
71
  const ChipsInnerContainer = styled(_Box, {
72
- shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isInteractive"
72
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isInteractive" && prop !== "isReadOnly"
73
73
  })`
74
74
  display: flex;
75
75
  flex-wrap: wrap;
@@ -78,8 +78,9 @@ const ChipsInnerContainer = styled(_Box, {
78
78
  }) => odysseyDesignTokens.Spacing1};
79
79
  pointer-events: none;
80
80
  opacity: ${({
81
- isInteractive
82
- }) => isInteractive ? 1 : 0};
81
+ isInteractive,
82
+ isReadOnly
83
+ }) => isInteractive || isReadOnly ? 1 : 0};
83
84
  min-height: ${({
84
85
  odysseyDesignTokens
85
86
  }) => odysseyDesignTokens.Spacing6};
@@ -101,6 +102,7 @@ const Select = ({
101
102
  isFullWidth = false,
102
103
  isMultiSelect,
103
104
  isOptional = false,
105
+ isReadOnly = false,
104
106
  label,
105
107
  name: nameOverride,
106
108
  onBlur,
@@ -111,6 +113,7 @@ const Select = ({
111
113
  translate,
112
114
  value
113
115
  }) => {
116
+ const selectRef = useRef(null);
114
117
  const hasMultipleChoices = useMemo(() => hasMultipleChoicesProp === undefined ? isMultiSelect : hasMultipleChoicesProp, [hasMultipleChoicesProp, isMultiSelect]);
115
118
  const controlledStateRef = useRef(getControlState({
116
119
  controlledValue: value,
@@ -137,31 +140,39 @@ const Select = ({
137
140
  controlState: controlledStateRef.current
138
141
  });
139
142
  const onChange = useCallback((event, child) => {
140
- const {
141
- target: {
142
- value
143
+ if (isReadOnly) {
144
+ event.preventDefault();
145
+ } else {
146
+ const {
147
+ target: {
148
+ value
149
+ }
150
+ } = event;
151
+ if (controlledStateRef.current !== CONTROLLED) {
152
+ setInternalSelectedValues(typeof value === "string" && hasMultipleChoices ? value.split(",") : value);
143
153
  }
144
- } = event;
145
- if (controlledStateRef.current !== CONTROLLED) {
146
- setInternalSelectedValues(typeof value === "string" && hasMultipleChoices ? value.split(",") : value);
154
+ onChangeProp?.(event, child);
147
155
  }
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;
156
+ }, [hasMultipleChoices, onChangeProp, isReadOnly]);
157
+ const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {
158
+ const normalizedOptions = options.map(option => {
159
+ if (typeof option === "object") {
160
+ const value = option?.value === "" ? option.value : option.value || option.text;
161
+ return {
162
+ text: option.text,
163
+ value,
164
+ type: option.type === "heading" ? "heading" : "option"
165
+ };
166
+ }
153
167
  return {
154
- text: option.text,
155
- value,
156
- type: option.type === "heading" ? "heading" : "option"
168
+ text: option,
169
+ value: option,
170
+ type: "option"
157
171
  };
158
- }
159
- return {
160
- text: option,
161
- value: option,
162
- type: "option"
163
- };
164
- }), [options]);
172
+ });
173
+ const normalizedOptionsMap = new Map(normalizedOptions.map(option => [option.value, option]));
174
+ return [normalizedOptions, normalizedOptionsMap];
175
+ }, [options]);
165
176
  const removeSelectedValue = useCallback(selectedValue => {
166
177
  if (Array.isArray(internalSelectedValues)) {
167
178
  const newValue = internalSelectedValues.filter(internalSelectedValue => internalSelectedValue !== selectedValue);
@@ -174,16 +185,18 @@ const Select = ({
174
185
  }
175
186
  }, [internalSelectedValues, onChange]);
176
187
  const Chips = useCallback(({
177
- isInteractive
188
+ isInteractive,
189
+ isReadOnly
178
190
  }) => {
179
191
  const stopPropagation = event => event.stopPropagation();
180
192
  const hasNonInteractiveIcon = !isInteractive && controlledStateRef.current === CONTROLLED && hasMultipleChoices;
181
193
  return Array.isArray(internalSelectedValues) && _jsx(ChipsInnerContainer, {
182
194
  isInteractive: isInteractive,
195
+ isReadOnly: isReadOnly,
183
196
  odysseyDesignTokens: odysseyDesignTokens,
184
197
  children: internalSelectedValues.map(item => item?.length > 0 && _jsx(_Chip, {
185
198
  label: _jsxs(_Fragment, {
186
- children: [item, hasNonInteractiveIcon && _jsx(NonInteractiveIcon, {
199
+ children: [normalizedOptionsMap.get(item)?.text, hasNonInteractiveIcon && _jsx(NonInteractiveIcon, {
187
200
  odysseyDesignTokens: odysseyDesignTokens
188
201
  })]
189
202
  }),
@@ -197,7 +210,7 @@ const Select = ({
197
210
  })
198
211
  }, item))
199
212
  });
200
- }, [controlledStateRef, hasMultipleChoices, internalSelectedValues, odysseyDesignTokens, removeSelectedValue]);
213
+ }, [controlledStateRef, hasMultipleChoices, internalSelectedValues, odysseyDesignTokens, removeSelectedValue, normalizedOptionsMap]);
201
214
  const renderedOptions = useMemo(() => normalizedOptions.map((option, index) => {
202
215
  if (option.type === "heading") {
203
216
  return _jsxs(_ListSubheader, {
@@ -206,6 +219,7 @@ const Select = ({
206
219
  }
207
220
  const isSelected = hasMultipleChoices ? internalSelectedValues?.includes(option.value) : internalSelectedValues === option.value;
208
221
  return _jsxs(_MenuItem, {
222
+ "data-empty": !option.text,
209
223
  value: option.value,
210
224
  selected: isSelected,
211
225
  children: [hasMultipleChoices && _jsx(_Checkbox, {
@@ -231,9 +245,16 @@ const Select = ({
231
245
  displayEmpty: true,
232
246
  id: id,
233
247
  inputProps: {
234
- "data-se": testId
248
+ "data-se": testId,
249
+ "aria-disabled": isDisabled || isReadOnly,
250
+ readOnly: isReadOnly
251
+ },
252
+ inputRef: el => {
253
+ if (localInputRef.current !== el) {
254
+ localInputRef.current = el;
255
+ }
256
+ selectRef.current = el;
235
257
  },
236
- inputRef: localInputRef,
237
258
  labelId: labelElementId,
238
259
  multiple: hasMultipleChoices,
239
260
  name: nameOverride ?? id,
@@ -247,11 +268,12 @@ const Select = ({
247
268
  children: _jsx(ChipsPositioningContainer, {
248
269
  odysseyDesignTokens: odysseyDesignTokens,
249
270
  children: _jsx(Chips, {
250
- isInteractive: true
271
+ isInteractive: !isReadOnly,
272
+ isReadOnly: isReadOnly
251
273
  })
252
274
  })
253
275
  })]
254
- }), [Chips, inputValues, hasMultipleChoices, nameOverride, odysseyDesignTokens, onBlur, onChange, onFocus, renderedOptions, renderValue, testId, translate]);
276
+ }), [Chips, inputValues, hasMultipleChoices, isDisabled, isReadOnly, nameOverride, odysseyDesignTokens, onBlur, onChange, onFocus, renderedOptions, renderValue, testId, translate]);
255
277
  return _jsx(Field, {
256
278
  ariaDescribedBy: ariaDescribedBy,
257
279
  errorMessage: errorMessage,
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","names":["memo","useCallback","useEffect","useMemo","useRef","useState","useImperativeHandle","Field","CheckIcon","CloseCircleFilledIcon","ComponentControlledState","useInputValues","getControlState","normalizedKey","styled","useOdysseyDesignTokens","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SelectContainer","div","ChipsPositioningContainer","shouldForwardProp","prop","odysseyDesignTokens","Spacing0","Spacing5","Spacing1","BorderWidthMain","NonInteractiveIcon","Spacing2","ChipsInnerContainer","_Box","isInteractive","Spacing6","CONTROLLED","Select","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","hint","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","options","testId","translate","value","undefined","controlledStateRef","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","current","localInputRef","focus","inputValues","controlState","event","child","target","split","normalizedOptions","map","option","text","type","removeSelectedValue","selectedValue","Array","isArray","newValue","filter","internalSelectedValue","syntheticEvent","Chips","stopPropagation","hasNonInteractiveIcon","children","item","length","_Chip","tabIndex","onDelete","deleteIcon","sx","pointerEvents","onMouseDown","renderedOptions","index","_ListSubheader","isSelected","includes","_MenuItem","selected","_Checkbox","checked","_ListItemSecondaryAction","toString","renderValue","renderFieldComponent","errorMessageElementId","labelElementId","_Select","displayEmpty","inputProps","labelId","multiple","fieldType","hasVisibleLabel","MemoizedSelect","displayName"],"sources":["../src/Select.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 memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n MouseEvent,\n} from \"react\";\nimport {\n Box as MuiBox,\n Checkbox as MuiCheckbox,\n Chip as MuiChip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem as MuiMenuItem,\n Select as MuiSelect,\n SelectChangeEvent,\n} from \"@mui/material\";\nimport { SelectProps as MuiSelectProps } from \"@mui/material\";\n\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport { CheckIcon, CloseCircleFilledIcon } from \"./icons.generated\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n FocusHandle,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\nimport { normalizedKey } from \"./useNormalizedKey\";\nimport styled from \"@emotion/styled\";\n\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext\";\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n};\n\nconst SelectContainer = styled.div`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nconst ChipsPositioningContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n align-items: center;\n position: absolute;\n top: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n right: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing5};\n bottom: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n left: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.BorderWidthMain};\n opacity: 1;\n pointer-events: none;\n`;\n\nconst NonInteractiveIcon = styled(CloseCircleFilledIcon, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n font-size: 1em;\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.Spacing2};\n margin-inline-end: -${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-block-end: -1px;\n`;\n\nconst ChipsInnerContainer = styled(MuiBox, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"isInteractive\",\n})<{\n isInteractive?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n pointer-events: none;\n opacity: ${({ isInteractive }) => (isInteractive ? 1 : 0)};\n min-height: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing6};\n`;\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype SelectRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect],\n );\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue,\n );\n\n const localInputRef = useRef<HTMLSelectElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" && hasMultipleChoices\n ? value.split(\",\")\n : value) as Value,\n );\n }\n onChangeProp?.(event, child);\n },\n [hasMultipleChoices, onChangeProp],\n );\n\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const normalizedOptions = useMemo(\n () =>\n options.map((option) => {\n if (typeof option === \"object\") {\n /**\n * If the value of `option?.value is an empty string, we need to make sure that we\n * set an empty string to `value` in the normalized option so that the select component\n * can potentially set it as the selected one in the text input\n */\n const value =\n option?.value === \"\" ? option.value : option.value || option.text;\n return {\n text: option.text,\n value,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n };\n }\n return { text: option, value: option, type: \"option\" };\n }),\n [options],\n );\n\n const removeSelectedValue = useCallback(\n (selectedValue: string) => {\n if (Array.isArray(internalSelectedValues)) {\n const newValue = internalSelectedValues.filter(\n (internalSelectedValue) => internalSelectedValue !== selectedValue,\n );\n\n const syntheticEvent = {\n target: { value: newValue },\n } as SelectChangeEvent<Value>;\n\n onChange(syntheticEvent, null);\n }\n },\n [internalSelectedValues, onChange],\n );\n\n const Chips = useCallback(\n ({ isInteractive }: { isInteractive: boolean }) => {\n const stopPropagation = (event: MouseEvent<SVGSVGElement>) =>\n event.stopPropagation();\n\n const hasNonInteractiveIcon =\n !isInteractive &&\n controlledStateRef.current === CONTROLLED &&\n hasMultipleChoices;\n\n return (\n Array.isArray(internalSelectedValues) && (\n <ChipsInnerContainer\n isInteractive={isInteractive}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {internalSelectedValues.map(\n (item) =>\n item?.length > 0 && (\n <MuiChip\n key={item}\n label={\n <>\n {item}\n {hasNonInteractiveIcon && (\n <NonInteractiveIcon\n odysseyDesignTokens={odysseyDesignTokens}\n />\n )}\n </>\n }\n tabIndex={-1}\n onDelete={\n isInteractive && controlledStateRef.current === CONTROLLED\n ? () => removeSelectedValue(item)\n : undefined\n }\n deleteIcon={\n <CloseCircleFilledIcon\n sx={{ pointerEvents: \"auto\" }}\n // We need to stop event propagation on mouse down to prevent the deletion\n // from being blocked by the Select list opening, and also ensure that\n // the pointerEvent is registered even when the parent's are not\n onMouseDown={stopPropagation}\n />\n }\n />\n ),\n )}\n </ChipsInnerContainer>\n )\n );\n },\n [\n controlledStateRef,\n hasMultipleChoices,\n internalSelectedValues,\n odysseyDesignTokens,\n removeSelectedValue,\n ],\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const renderedOptions = useMemo(\n () =>\n normalizedOptions.map((option, index) => {\n if (option.type === \"heading\") {\n return (\n <ListSubheader key={option.text}> {option.text} </ListSubheader>\n );\n }\n\n const isSelected = hasMultipleChoices\n ? internalSelectedValues?.includes(option.value)\n : internalSelectedValues === option.value;\n\n return (\n <MuiMenuItem\n key={normalizedKey(option.text, index.toString())}\n value={option.value}\n selected={isSelected}\n >\n {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}\n {option.text}\n {!hasMultipleChoices && internalSelectedValues === option.value && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MuiMenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues],\n );\n const renderValue = useCallback(\n (value: Value) => Array.isArray(value) && <Chips isInteractive={false} />,\n [Chips],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: SelectRenderProps) => (\n <SelectContainer>\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n displayEmpty\n id={id}\n inputProps={{ \"data-se\": testId }}\n inputRef={localInputRef}\n labelId={labelElementId}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n >\n {renderedOptions}\n </MuiSelect>\n {hasMultipleChoices && (\n <>\n <ChipsPositioningContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Chips isInteractive={true} />\n </ChipsPositioningContainer>\n </>\n )}\n </SelectContainer>\n ),\n [\n Chips,\n inputValues,\n hasMultipleChoices,\n nameOverride,\n odysseyDesignTokens,\n onBlur,\n onChange,\n onFocus,\n renderedOptions,\n renderValue,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,mBAAmB,QAEd,OAAO;AAAC,SAaNC,KAAK;AAAA,SAKLC,SAAS,EAAEC,qBAAqB;AAAA,SAGvCC,wBAAwB,EAExBC,cAAc,EACdC,eAAe;AAAA,SAERC,aAAa;AACtB,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAGnCC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAUxB,MAAMC,eAAe,GAAG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ClBa,YAAY,EACZ9B,mBAAmB,EACnB+B,MAAM,EACNC,QAAQ,EACRE,OAAO,EACP8C,eAAe,EACfW,WAAW,EACXvD,MAAM,EACNC,SAAS,CAEb,CAAC;EAED,OACE/C,IAAA,CAACV,KAAK;IACJiC,eAAe,EAAEA,eAAgB;IACjCE,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnCoF,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACflF,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbgE,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMU,cAAc,GAAGjI,IAAI,CAACuC,MAAM,CAAC;AACnC0F,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAI1F,MAAM"}
1
+ {"version":3,"file":"Select.js","names":["memo","useCallback","useEffect","useMemo","useRef","useState","useImperativeHandle","Field","CheckIcon","CloseCircleFilledIcon","ComponentControlledState","useInputValues","getControlState","normalizedKey","styled","useOdysseyDesignTokens","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","SelectContainer","div","ChipsPositioningContainer","shouldForwardProp","prop","odysseyDesignTokens","Spacing0","Spacing5","Spacing1","BorderWidthMain","NonInteractiveIcon","Spacing2","ChipsInnerContainer","_Box","isInteractive","isReadOnly","Spacing6","CONTROLLED","Select","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","hasMultipleChoicesProp","hint","HintLinkComponent","id","idOverride","inputRef","isDisabled","isFullWidth","isMultiSelect","isOptional","label","name","nameOverride","onBlur","onChange","onChangeProp","onFocus","options","testId","translate","value","selectRef","undefined","controlledStateRef","controlledValue","uncontrolledValue","internalSelectedValues","setInternalSelectedValues","current","localInputRef","focus","inputValues","controlState","event","child","preventDefault","target","split","normalizedOptions","normalizedOptionsMap","map","option","text","type","Map","removeSelectedValue","selectedValue","Array","isArray","newValue","filter","internalSelectedValue","syntheticEvent","Chips","stopPropagation","hasNonInteractiveIcon","children","item","length","_Chip","get","tabIndex","onDelete","deleteIcon","sx","pointerEvents","onMouseDown","renderedOptions","index","_ListSubheader","isSelected","includes","_MenuItem","selected","_Checkbox","checked","_ListItemSecondaryAction","toString","renderValue","renderFieldComponent","errorMessageElementId","labelElementId","_Select","displayEmpty","inputProps","readOnly","el","labelId","multiple","fieldType","hasVisibleLabel","MemoizedSelect","displayName"],"sources":["../src/Select.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 memo,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n useImperativeHandle,\n} from \"react\";\nimport {\n Box as MuiBox,\n Checkbox as MuiCheckbox,\n Chip as MuiChip,\n ListItemSecondaryAction,\n ListSubheader,\n MenuItem as MuiMenuItem,\n Select as MuiSelect,\n SelectChangeEvent,\n} from \"@mui/material\";\nimport { SelectProps as MuiSelectProps } from \"@mui/material\";\nimport { Field } from \"./Field\";\nimport {\n FieldComponentProps,\n FieldComponentRenderProps,\n} from \"./FieldComponentProps\";\nimport { CheckIcon, CloseCircleFilledIcon } from \"./icons.generated\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n FocusHandle,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\nimport { normalizedKey } from \"./useNormalizedKey\";\nimport styled from \"@emotion/styled\";\nimport {\n useOdysseyDesignTokens,\n DesignTokens,\n} from \"./OdysseyDesignTokensContext\";\n\nexport type SelectOption = {\n text: string;\n type?: \"heading\" | \"option\";\n value?: string;\n};\n\nconst SelectContainer = styled.div`\n position: relative;\n width: 100%;\n display: flex;\n`;\n\nconst ChipsPositioningContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n align-items: center;\n position: absolute;\n top: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n right: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing5};\n bottom: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing0};\n left: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.BorderWidthMain};\n opacity: 1;\n pointer-events: none;\n`;\n\nconst NonInteractiveIcon = styled(CloseCircleFilledIcon, {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{\n odysseyDesignTokens: DesignTokens;\n}>`\n font-size: 1em;\n margin-inline-start: ${({ odysseyDesignTokens }) =>\n odysseyDesignTokens.Spacing2};\n margin-inline-end: -${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n margin-block-end: -1px;\n`;\n\nconst ChipsInnerContainer = styled(MuiBox, {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isInteractive\" &&\n prop !== \"isReadOnly\",\n})<{\n isInteractive?: boolean;\n isReadOnly?: boolean;\n odysseyDesignTokens: DesignTokens;\n}>`\n display: flex;\n flex-wrap: wrap;\n gap: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing1};\n pointer-events: none;\n opacity: ${({ isInteractive, isReadOnly }) =>\n isInteractive || isReadOnly ? 1 : 0};\n min-height: ${({ odysseyDesignTokens }) => odysseyDesignTokens.Spacing6};\n`;\n\nexport type SelectValueType<HasMultipleChoices> =\n HasMultipleChoices extends true ? string[] : string;\n\nexport type SelectProps<\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: MuiSelectProps<Value>[\"defaultValue\"];\n /**\n * If `true`, the Select allows multiple selections\n */\n hasMultipleChoices?: HasMultipleChoices;\n /**\n * The ref forwarded to the Select\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * @deprecated Use `hasMultipleChoices` instead.\n */\n /** **Deprecated:** use `hasMultipleChoices` */\n isMultiSelect?: HasMultipleChoices;\n /**\n * The label text for the Select\n */\n label: string;\n /**\n * Callback fired when the Select loses focus\n */\n onBlur?: MuiSelectProps<Value>[\"onBlur\"];\n /**\n * Callback fired when the value of the Select changes\n */\n onChange?: MuiSelectProps<Value>[\"onChange\"];\n /**\n * Callback fired when the Select gains focus\n */\n onFocus?: MuiSelectProps<Value>[\"onFocus\"];\n /**\n * The options for the Select\n */\n options: (string | SelectOption)[];\n /**\n * The value or values selected in the Select\n */\n value?: Value;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isDisabled\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"isReadOnly\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\ntype SelectRenderProps = Partial<\n Pick<FieldComponentRenderProps, \"ariaDescribedBy\" | \"errorMessageElementId\">\n> &\n Pick<FieldComponentRenderProps, \"id\" | \"labelElementId\">;\n\n/**\n * Options in Odyssey <Select> are passed as an array, which can contain any combination\n * of the following:\n * - string — A simple string. The string will be both the text and the value of the resulting option.\n * <option value=\"string\">string</option>\n *\n * - { text: string } — Same as above, but the string is contained within an object.\n * <option value=\"text\">text</option>\n *\n * - { text: string, value: string } — The option text will be text, and the option value will be value.\n * <option value=\"value\">text</option>\n *\n * - { text: string, type: \"heading\" } — Used to display a group heading with the text\n */\n\nconst { CONTROLLED } = ComponentControlledState;\nconst Select = <\n Value extends SelectValueType<HasMultipleChoices>,\n HasMultipleChoices extends boolean,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices: hasMultipleChoicesProp,\n hint,\n HintLinkComponent,\n id: idOverride,\n inputRef,\n isDisabled = false,\n isFullWidth = false,\n isMultiSelect,\n isOptional = false,\n isReadOnly = false,\n label,\n name: nameOverride,\n onBlur,\n onChange: onChangeProp,\n onFocus,\n options,\n testId,\n translate,\n value,\n}: SelectProps<Value, HasMultipleChoices>) => {\n const selectRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n\n const hasMultipleChoices = useMemo(\n () =>\n hasMultipleChoicesProp === undefined\n ? isMultiSelect\n : hasMultipleChoicesProp,\n [hasMultipleChoicesProp, isMultiSelect],\n );\n\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n const [internalSelectedValues, setInternalSelectedValues] = useState(\n controlledStateRef.current === CONTROLLED ? value : defaultValue,\n );\n\n const localInputRef = useRef<HTMLSelectElement>(null);\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n useImperativeHandle(\n inputRef,\n () => {\n return {\n focus: () => {\n localInputRef.current?.focus();\n },\n };\n },\n [],\n );\n\n useEffect(() => {\n if (controlledStateRef.current === CONTROLLED) {\n setInternalSelectedValues(value);\n }\n }, [value]);\n\n const inputValues = useInputValues({\n defaultValue,\n value,\n controlState: controlledStateRef.current,\n });\n\n const onChange = useCallback<NonNullable<MuiSelectProps<Value>[\"onChange\"]>>(\n (event, child) => {\n if (isReadOnly) {\n event.preventDefault();\n } else {\n const {\n target: { value },\n } = event;\n if (controlledStateRef.current !== CONTROLLED) {\n setInternalSelectedValues(\n (typeof value === \"string\" && hasMultipleChoices\n ? value.split(\",\")\n : value) as Value,\n );\n }\n onChangeProp?.(event, child);\n }\n },\n [hasMultipleChoices, onChangeProp, isReadOnly],\n );\n // Normalize the options array to accommodate the various\n // data types that might be passed\n const [normalizedOptions, normalizedOptionsMap] = useMemo(() => {\n const normalizedOptions = options.map((option) => {\n if (typeof option === \"object\") {\n /**\n * If the value of `option?.value is an empty string, we need to make sure that we\n * set an empty string to `value` in the normalized option so that the select component\n * can potentially set it as the selected one in the text input\n */\n const value =\n option?.value === \"\" ? option.value : option.value || option.text;\n return {\n text: option.text,\n value,\n type: option.type === \"heading\" ? \"heading\" : \"option\",\n };\n }\n\n return { text: option, value: option, type: \"option\" };\n });\n\n const normalizedOptionsMap = new Map(\n normalizedOptions.map((option) => [option.value, option]),\n );\n return [normalizedOptions, normalizedOptionsMap];\n }, [options]);\n\n const removeSelectedValue = useCallback(\n (selectedValue: string) => {\n if (Array.isArray(internalSelectedValues)) {\n const newValue = internalSelectedValues.filter(\n (internalSelectedValue) => internalSelectedValue !== selectedValue,\n );\n\n const syntheticEvent = {\n target: { value: newValue },\n } as SelectChangeEvent<Value>;\n\n onChange(syntheticEvent, null);\n }\n },\n [internalSelectedValues, onChange],\n );\n\n const Chips = useCallback(\n ({\n isInteractive,\n isReadOnly,\n }: {\n isInteractive: boolean;\n isReadOnly?: boolean;\n }) => {\n const stopPropagation = (event: React.MouseEvent<SVGSVGElement>) =>\n event.stopPropagation();\n\n const hasNonInteractiveIcon =\n !isInteractive &&\n controlledStateRef.current === CONTROLLED &&\n hasMultipleChoices;\n return (\n Array.isArray(internalSelectedValues) && (\n <ChipsInnerContainer\n isInteractive={isInteractive}\n isReadOnly={isReadOnly}\n odysseyDesignTokens={odysseyDesignTokens}\n >\n {internalSelectedValues.map(\n (item) =>\n item?.length > 0 && (\n <MuiChip\n key={item}\n label={\n <>\n {normalizedOptionsMap.get(item)?.text}\n {hasNonInteractiveIcon && (\n <NonInteractiveIcon\n odysseyDesignTokens={odysseyDesignTokens}\n />\n )}\n </>\n }\n tabIndex={-1}\n onDelete={\n isInteractive && controlledStateRef.current === CONTROLLED\n ? () => removeSelectedValue(item)\n : undefined\n }\n deleteIcon={\n <CloseCircleFilledIcon\n sx={{ pointerEvents: \"auto\" }}\n // We need to stop event propagation on mouse down to prevent the deletion\n // from being blocked by the Select list opening, and also ensure that\n // the pointerEvent is registered even when the parent's are not\n onMouseDown={stopPropagation}\n />\n }\n />\n ),\n )}\n </ChipsInnerContainer>\n )\n );\n },\n [\n controlledStateRef,\n hasMultipleChoices,\n internalSelectedValues,\n odysseyDesignTokens,\n removeSelectedValue,\n normalizedOptionsMap,\n ],\n );\n\n // Convert the options into the ReactNode children\n // that will populate the <Select>\n const renderedOptions = useMemo(\n () =>\n normalizedOptions.map((option, index) => {\n if (option.type === \"heading\") {\n return (\n <ListSubheader key={option.text}> {option.text} </ListSubheader>\n );\n }\n\n const isSelected = hasMultipleChoices\n ? internalSelectedValues?.includes(option.value)\n : internalSelectedValues === option.value;\n\n return (\n <MuiMenuItem\n data-empty={!option.text}\n key={normalizedKey(option.text, index.toString())}\n value={option.value}\n selected={isSelected}\n >\n {hasMultipleChoices && <MuiCheckbox checked={isSelected} />}\n {option.text}\n {!hasMultipleChoices && internalSelectedValues === option.value && (\n <ListItemSecondaryAction>\n <CheckIcon />\n </ListItemSecondaryAction>\n )}\n </MuiMenuItem>\n );\n }),\n [hasMultipleChoices, normalizedOptions, internalSelectedValues],\n );\n\n const renderValue = useCallback(\n (value: Value) => Array.isArray(value) && <Chips isInteractive={false} />,\n [Chips],\n );\n\n const renderFieldComponent = useCallback(\n ({\n ariaDescribedBy,\n errorMessageElementId,\n id,\n labelElementId,\n }: SelectRenderProps) => (\n <SelectContainer>\n <MuiSelect\n {...inputValues}\n aria-describedby={ariaDescribedBy}\n aria-errormessage={errorMessageElementId}\n displayEmpty\n id={id}\n inputProps={{\n \"data-se\": testId,\n \"aria-disabled\": isDisabled || isReadOnly,\n readOnly: isReadOnly,\n }}\n inputRef={(el: HTMLInputElement | HTMLTextAreaElement | null) => {\n if (localInputRef.current !== el) {\n (localInputRef as React.MutableRefObject<typeof el>).current = el;\n }\n selectRef.current = el;\n }}\n labelId={labelElementId}\n multiple={hasMultipleChoices}\n name={nameOverride ?? id}\n onBlur={onBlur}\n onChange={onChange}\n onFocus={onFocus}\n renderValue={hasMultipleChoices ? renderValue : undefined}\n translate={translate}\n >\n {renderedOptions}\n </MuiSelect>\n {hasMultipleChoices && (\n <>\n <ChipsPositioningContainer\n odysseyDesignTokens={odysseyDesignTokens}\n >\n <Chips isInteractive={!isReadOnly} isReadOnly={isReadOnly} />\n </ChipsPositioningContainer>\n </>\n )}\n </SelectContainer>\n ),\n [\n Chips,\n inputValues,\n hasMultipleChoices,\n isDisabled,\n isReadOnly,\n nameOverride,\n odysseyDesignTokens,\n onBlur,\n onChange,\n onFocus,\n renderedOptions,\n renderValue,\n testId,\n translate,\n ],\n );\n\n return (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n id={idOverride}\n isDisabled={isDisabled}\n isFullWidth={isFullWidth}\n isOptional={isOptional}\n label={label}\n renderFieldComponent={renderFieldComponent}\n />\n );\n};\n\nconst MemoizedSelect = memo(Select);\nMemoizedSelect.displayName = \"Select\";\n\nexport { MemoizedSelect as Select };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,IAAI,EACJC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,EACRC,mBAAmB,QACd,OAAO;AAAC,SAYNC,KAAK;AAAA,SAKLC,SAAS,EAAEC,qBAAqB;AAAA,SAGvCC,wBAAwB,EAExBC,cAAc,EACdC,eAAe;AAAA,SAERC,aAAa;AACtB,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAEnCC,sBAAsB;AAAA,SAAAC,GA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E,YAAY,EAAEA,YAAa;IAC3BC,gBAAgB,EAAEA,gBAAiB;IACnC2F,SAAS,EAAC,QAAQ;IAClBC,eAAe;IACfzF,IAAI,EAAEA,IAAK;IACXC,iBAAiB,EAAEA,iBAAkB;IACrCC,EAAE,EAAEC,UAAW;IACfE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA,WAAY;IACzBE,UAAU,EAAEA,UAAW;IACvBC,KAAK,EAAEA,KAAM;IACbqE,oBAAoB,EAAEA;EAAqB,CAC5C,CAAC;AAEN,CAAC;AAED,MAAMY,cAAc,GAAGzI,IAAI,CAACwC,MAAM,CAAC;AACnCiG,cAAc,CAACC,WAAW,GAAG,QAAQ;AAErC,SAASD,cAAc,IAAIjG,MAAM"}
@@ -1 +1 @@
1
- {"version":3,"file":"ToastStack.js","names":["memo","jsx","_jsx","ToastStack","children","_Snackbar","open","_Box","sx","display","flexDirection","gap","MemoizedToastStack","displayName"],"sources":["../src/ToastStack.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, ReactElement } from \"react\";\nimport { Box, Snackbar } from \"@mui/material\";\nimport { Toast } from \"./Toast\";\n\nexport type ToastStackProps = {\n /**\n * The Toast or array of Toasts within the ToastStack\n */\n children: ReactElement<typeof Toast> | Array<ReactElement<typeof Toast>>;\n};\n\nconst ToastStack = ({ children }: ToastStackProps) => {\n return (\n <Snackbar open={true}>\n <Box\n sx={{\n display: \"flex\",\n flexDirection: \"column-reverse\",\n gap: 2,\n }}\n >\n {children}\n </Box>\n </Snackbar>\n );\n};\n\nconst MemoizedToastStack = memo(ToastStack);\nMemoizedToastStack.displayName = \"ToastStack\";\n\nexport { MemoizedToastStack as ToastStack };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAsB,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAW3C,MAAMC,UAAU,GAAGA,CAAC;EAAEC;AAA0B,CAAC,KAAK;EACpD,OACEF,IAAA,CAAAG,SAAA;IAAUC,IAAI,EAAE,IAAK;IAAAF,QAAA,EACnBF,IAAA,CAAAK,IAAA;MACEC,EAAE,EAAE;QACFC,OAAO,EAAE,MAAM;QACfC,aAAa,EAAE,gBAAgB;QAC/BC,GAAG,EAAE;MACP,CAAE;MAAAP,QAAA,EAEDA;IAAQ,CACN;EAAC,CACE,CAAC;AAEf,CAAC;AAED,MAAMQ,kBAAkB,GAAGZ,IAAI,CAACG,UAAU,CAAC;AAC3CS,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIT,UAAU"}
1
+ {"version":3,"file":"ToastStack.js","names":["memo","jsx","_jsx","ToastStack","children","_Snackbar","open","_Box","sx","display","flexDirection","gap","MemoizedToastStack","displayName"],"sources":["../src/ToastStack.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, ReactElement } from \"react\";\nimport { Box, Snackbar } from \"@mui/material\";\nimport { Toast } from \"./Toast\";\n\nexport type ToastListProps = {\n /**\n * The Toast or array of Toasts within the ToastStack\n */\n children: ReactElement<typeof Toast> | Array<ReactElement<typeof Toast>>;\n};\n\nconst ToastStack = ({ children }: ToastListProps) => {\n return (\n <Snackbar open={true}>\n <Box\n sx={{\n display: \"flex\",\n flexDirection: \"column-reverse\",\n gap: 2,\n }}\n >\n {children}\n </Box>\n </Snackbar>\n );\n};\n\nconst MemoizedToastStack = memo(ToastStack);\nMemoizedToastStack.displayName = \"ToastStack\";\n\nexport { MemoizedToastStack as ToastStack };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAsB,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAW3C,MAAMC,UAAU,GAAGA,CAAC;EAAEC;AAAyB,CAAC,KAAK;EACnD,OACEF,IAAA,CAAAG,SAAA;IAAUC,IAAI,EAAE,IAAK;IAAAF,QAAA,EACnBF,IAAA,CAAAK,IAAA;MACEC,EAAE,EAAE;QACFC,OAAO,EAAE,MAAM;QACfC,aAAa,EAAE,gBAAgB;QAC/BC,GAAG,EAAE;MACP,CAAE;MAAAP,QAAA,EAEDA;IAAQ,CACN;EAAC,CACE,CAAC;AAEf,CAAC;AAED,MAAMQ,kBAAkB,GAAGZ,IAAI,CAACG,UAAU,CAAC;AAC3CS,kBAAkB,CAACC,WAAW,GAAG,YAAY;AAE7C,SAASD,kBAAkB,IAAIT,UAAU"}
@@ -10,17 +10,33 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
+ export const createShadowDomElements = containerElement => {
14
+ const shadowRoot = containerElement.attachShadow({
15
+ mode: "open"
16
+ });
17
+ const emotionRootElement = document.createElement("div");
18
+ emotionRootElement.setAttribute("id", "style-root");
19
+ emotionRootElement.setAttribute("nonce", window.cspNonce);
20
+ const shadowRootElement = document.createElement("div");
21
+ shadowRootElement.setAttribute("id", "shadow-root");
22
+ shadowRoot.appendChild(emotionRootElement);
23
+ shadowRoot.appendChild(shadowRootElement);
24
+ return {
25
+ emotionRootElement,
26
+ shadowRootElement
27
+ };
28
+ };
13
29
  export const createShadowRootElement = containerElement => {
14
30
  const shadowRoot = containerElement.attachShadow({
15
31
  mode: "open"
16
32
  });
17
- const emotionRoot = document.createElement("style");
18
- emotionRoot.setAttribute("id", "style-root");
19
- emotionRoot.setAttribute("nonce", window.cspNonce);
33
+ const emotionRootElement = document.createElement("style");
34
+ emotionRootElement.setAttribute("id", "style-root");
35
+ emotionRootElement.setAttribute("nonce", window.cspNonce);
20
36
  const shadowRootElement = document.createElement("div");
21
37
  shadowRootElement.setAttribute("id", "shadow-root");
22
- shadowRoot.appendChild(emotionRoot);
38
+ shadowRoot.appendChild(emotionRootElement);
23
39
  shadowRoot.appendChild(shadowRootElement);
24
- return [emotionRoot, shadowRootElement];
40
+ return [emotionRootElement, shadowRootElement];
25
41
  };
26
- //# sourceMappingURL=createShadowRootElement.js.map
42
+ //# sourceMappingURL=createShadowDomElements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createShadowDomElements.js","names":["createShadowDomElements","containerElement","shadowRoot","attachShadow","mode","emotionRootElement","document","createElement","setAttribute","window","cspNonce","shadowRootElement","appendChild","createShadowRootElement"],"sources":["../src/createShadowDomElements.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport const createShadowDomElements = (containerElement: HTMLElement) => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // Container for Emotion `<style>` elements.\n const emotionRootElement = document.createElement(\"div\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // React app root component.\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRootElement);\n shadowRoot.appendChild(shadowRootElement);\n\n return { emotionRootElement, shadowRootElement };\n};\n\n/** @deprecated Use `createShadowDomElements` instead. */\nexport const createShadowRootElement = (\n containerElement: HTMLElement,\n): [HTMLStyleElement, HTMLDivElement] => {\n const shadowRoot = containerElement.attachShadow({ mode: \"open\" });\n\n // the element that styles will be cached into\n const emotionRootElement = document.createElement(\"style\");\n emotionRootElement.setAttribute(\"id\", \"style-root\");\n emotionRootElement.setAttribute(\"nonce\", window.cspNonce);\n\n // the element that emotion renders html into\n const shadowRootElement = document.createElement(\"div\");\n shadowRootElement.setAttribute(\"id\", \"shadow-root\");\n\n shadowRoot.appendChild(emotionRootElement);\n shadowRoot.appendChild(shadowRootElement);\n\n return [emotionRootElement, shadowRootElement];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMA,uBAAuB,GAAIC,gBAA6B,IAAK;EACxE,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAMC,kBAAkB,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACxDF,kBAAkB,CAACG,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EACnDH,kBAAkB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAGzD,MAAMC,iBAAiB,GAAGL,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACvDI,iBAAiB,CAACH,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;EAEnDN,UAAU,CAACU,WAAW,CAACP,kBAAkB,CAAC;EAC1CH,UAAU,CAACU,WAAW,CAACD,iBAAiB,CAAC;EAEzC,OAAO;IAAEN,kBAAkB;IAAEM;EAAkB,CAAC;AAClD,CAAC;AAGD,OAAO,MAAME,uBAAuB,GAClCZ,gBAA6B,IACU;EACvC,MAAMC,UAAU,GAAGD,gBAAgB,CAACE,YAAY,CAAC;IAAEC,IAAI,EAAE;EAAO,CAAC,CAAC;EAGlE,MAAMC,kBAAkB,GAAGC,QAAQ,CAACC,aAAa,CAAC,OAAO,CAAC;EAC1DF,kBAAkB,CAACG,YAAY,CAAC,IAAI,EAAE,YAAY,CAAC;EACnDH,kBAAkB,CAACG,YAAY,CAAC,OAAO,EAAEC,MAAM,CAACC,QAAQ,CAAC;EAGzD,MAAMC,iBAAiB,GAAGL,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EACvDI,iBAAiB,CAACH,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;EAEnDN,UAAU,CAACU,WAAW,CAACP,kBAAkB,CAAC;EAC1CH,UAAU,CAACU,WAAW,CAACD,iBAAiB,CAAC;EAEzC,OAAO,CAACN,kBAAkB,EAAEM,iBAAiB,CAAC;AAChD,CAAC"}
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ export * from "./Checkbox.js";
27
27
  export * from "./CheckboxGroup.js";
28
28
  export * from "./CircularProgress.js";
29
29
  export * from "./CssBaseline.js";
30
- export * from "./createShadowRootElement.js";
30
+ export * from "./createShadowDomElements.js";
31
31
  export * from "./createUniqueId.js";
32
32
  export * from "./DataTable/index.js";
33
33
  export * from "./Dialog.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["deepmerge","visuallyHidden","createTheme","DialogContentText","Divider","InputAdornment","InputBase","ListItemIcon","ListItemText","ListSubheader","MenuList","Paper","ScopedCssBaseline","ThemeProvider","odysseyTranslate","useOdysseyDesignTokens","badgeContentMaxValues"],"sources":["../src/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 { deepmerge, visuallyHidden } from \"@mui/utils\";\n\nexport {\n createTheme,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n DialogContentText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Divider,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputAdornment,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputBase,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemIcon,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListSubheader,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n MenuList,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Paper,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ScopedCssBaseline,\n ThemeProvider,\n} from \"@mui/material\";\n\nexport type {\n CssBaselineProps,\n DialogContentTextProps,\n DividerProps,\n InputAdornmentProps,\n InputBaseProps,\n ListItemIconProps,\n ListItemTextProps,\n ListSubheaderProps,\n MenuListProps,\n PaperProps,\n ScopedCssBaselineProps,\n ThemeOptions,\n} from \"@mui/material\";\n\nexport { odysseyTranslate } from \"./i18n\";\nexport type { FocusHandle } from \"./inputUtils\";\nexport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport * from \"./Accordion\";\nexport * from \"./Autocomplete\";\nexport { badgeContentMaxValues } from \"./Badge\";\nexport * from \"./Banner\";\nexport * from \"./Box\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./Button\";\nexport * from \"./Card\";\nexport * from \"./Callout\";\nexport * from \"./Checkbox\";\nexport * from \"./CheckboxGroup\";\nexport * from \"./CircularProgress\";\nexport * from \"./CssBaseline\";\nexport * from \"./createShadowRootElement\";\nexport * from \"./createUniqueId\";\nexport * from \"./DataTable\";\nexport * from \"./Dialog\";\nexport * from \"./Drawer\";\nexport * from \"./EmptyState\";\nexport * from \"./Fieldset\";\nexport * from \"./FieldComponentProps\";\nexport * from \"./Form\";\nexport * from \"./HintLink\";\nexport * from \"./IconWithTooltip\";\nexport * from \"./Link\";\nexport * from \"./MenuButton\";\nexport * from \"./MenuItem\";\nexport * from \"./NativeSelect\";\nexport * from \"./NullElement\";\nexport * from \"./OdysseyCacheProvider\";\nexport * from \"./OdysseyProvider\";\nexport * from \"./OdysseyThemeProvider\";\nexport * from \"./OdysseyTranslationProvider\";\nexport * from \"./PasswordField\";\nexport * from \"./Radio\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScreenReaderText\";\nexport * from \"./SearchField\";\nexport * from \"./Select\";\nexport * from \"./Status\";\nexport * from \"./Surface\";\nexport * from \"./Tabs\";\nexport * from \"./Tag\";\nexport * from \"./TagList\";\nexport * from \"./TextField\";\nexport * from \"./theme\";\nexport * from \"./Toast\";\nexport * from \"./ToastStack\";\nexport * from \"./labs/Switch\";\nexport * from \"./Tooltip\";\nexport * from \"./Typography\";\nexport * from \"./useUniqueId\";\nexport * from \"./Pagination\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,cAAc,QAAQ,YAAY;AAEtD,SACEC,WAAW,EAEXC,iBAAiB,EAEjBC,OAAO,EAEPC,cAAc,EAEdC,SAAS,EAETC,YAAY,EAEZC,YAAY,EAEZC,aAAa,EAEbC,QAAQ,EAERC,KAAK,EAELC,iBAAiB,EACjBC,aAAa,QACR,eAAe;AAAC,SAiBdC,gBAAgB;AAAA,SAEhBC,sBAAsB;AAAA;AAAA;AAAA,SAItBC,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":["deepmerge","visuallyHidden","createTheme","DialogContentText","Divider","InputAdornment","InputBase","ListItemIcon","ListItemText","ListSubheader","MenuList","Paper","ScopedCssBaseline","ThemeProvider","odysseyTranslate","useOdysseyDesignTokens","badgeContentMaxValues"],"sources":["../src/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 { deepmerge, visuallyHidden } from \"@mui/utils\";\n\nexport {\n createTheme,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n DialogContentText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Divider,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputAdornment,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n InputBase,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemIcon,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListItemText,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ListSubheader,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n MenuList,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n Paper,\n /** @deprecated Will be removed in a future Odyssey version in lieu of a wrapped version. */\n ScopedCssBaseline,\n ThemeProvider,\n} from \"@mui/material\";\n\nexport type {\n CssBaselineProps,\n DialogContentTextProps,\n DividerProps,\n InputAdornmentProps,\n InputBaseProps,\n ListItemIconProps,\n ListItemTextProps,\n ListSubheaderProps,\n MenuListProps,\n PaperProps,\n ScopedCssBaselineProps,\n ThemeOptions,\n} from \"@mui/material\";\n\nexport { odysseyTranslate } from \"./i18n\";\nexport type { FocusHandle } from \"./inputUtils\";\nexport { useOdysseyDesignTokens } from \"./OdysseyDesignTokensContext\";\n\nexport * from \"./Accordion\";\nexport * from \"./Autocomplete\";\nexport { badgeContentMaxValues } from \"./Badge\";\nexport * from \"./Banner\";\nexport * from \"./Box\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./Button\";\nexport * from \"./Card\";\nexport * from \"./Callout\";\nexport * from \"./Checkbox\";\nexport * from \"./CheckboxGroup\";\nexport * from \"./CircularProgress\";\nexport * from \"./CssBaseline\";\nexport * from \"./createShadowDomElements\";\nexport * from \"./createUniqueId\";\nexport * from \"./DataTable\";\nexport * from \"./Dialog\";\nexport * from \"./Drawer\";\nexport * from \"./EmptyState\";\nexport * from \"./Fieldset\";\nexport * from \"./FieldComponentProps\";\nexport * from \"./Form\";\nexport * from \"./HintLink\";\nexport * from \"./IconWithTooltip\";\nexport * from \"./Link\";\nexport * from \"./MenuButton\";\nexport * from \"./MenuItem\";\nexport * from \"./NativeSelect\";\nexport * from \"./NullElement\";\nexport * from \"./OdysseyCacheProvider\";\nexport * from \"./OdysseyProvider\";\nexport * from \"./OdysseyThemeProvider\";\nexport * from \"./OdysseyTranslationProvider\";\nexport * from \"./PasswordField\";\nexport * from \"./Radio\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScreenReaderText\";\nexport * from \"./SearchField\";\nexport * from \"./Select\";\nexport * from \"./Status\";\nexport * from \"./Surface\";\nexport * from \"./Tabs\";\nexport * from \"./Tag\";\nexport * from \"./TagList\";\nexport * from \"./TextField\";\nexport * from \"./theme\";\nexport * from \"./Toast\";\nexport * from \"./ToastStack\";\nexport * from \"./labs/Switch\";\nexport * from \"./Tooltip\";\nexport * from \"./Typography\";\nexport * from \"./useUniqueId\";\nexport * from \"./Pagination\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,SAAS,EAAEC,cAAc,QAAQ,YAAY;AAEtD,SACEC,WAAW,EAEXC,iBAAiB,EAEjBC,OAAO,EAEPC,cAAc,EAEdC,SAAS,EAETC,YAAY,EAEZC,YAAY,EAEZC,aAAa,EAEbC,QAAQ,EAERC,KAAK,EAELC,iBAAiB,EACjBC,aAAa,QACR,eAAe;AAAC,SAiBdC,gBAAgB;AAAA,SAEhBC,sBAAsB;AAAA;AAAA;AAAA,SAItBC,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA"}
package/dist/index.scss CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  /**
3
3
  * Do not edit directly
4
- * Generated on Fri, 09 Aug 2024 19:25:30 GMT
4
+ * Generated on Thu, 05 Sep 2024 19:54:26 GMT
5
5
  */
6
6
 
7
7
  $border-color-control: #8d8d8d !default;
@@ -70,8 +70,8 @@ $hue-red-600: #d92300 !default;
70
70
  $hue-red-700: #951800 !default;
71
71
  $hue-red-800: #711200 !default;
72
72
  $hue-red-900: #500d00 !default;
73
- $hue-yellow-50: #fcf6ac !default;
74
- $hue-yellow-100: #fce101 !default;
73
+ $hue-yellow-50: #fdfad9 !default;
74
+ $hue-yellow-100: #ffe01a !default;
75
75
  $hue-yellow-200: #f9c503 !default;
76
76
  $hue-yellow-300: #eb9e05 !default;
77
77
  $hue-yellow-400: #bf8004 !default;
@@ -96,14 +96,14 @@ $palette-danger-darker: #711200 !default;
96
96
  $palette-danger-text: #d92300 !default;
97
97
  $palette-danger-heading: #500d00 !default;
98
98
  $palette-danger-highlight: #ffd8d1 !default;
99
- $palette-warning-lighter: #fcf6ac !default;
99
+ $palette-warning-lighter: #fdfad9 !default;
100
100
  $palette-warning-light: #eb9e05 !default;
101
101
  $palette-warning-main: #a16c03 !default;
102
102
  $palette-warning-dark: #664402 !default;
103
103
  $palette-warning-darker: #4c3302 !default;
104
104
  $palette-warning-text: #966603 !default;
105
105
  $palette-warning-heading: #352401 !default;
106
- $palette-warning-highlight: #fce101 !default;
106
+ $palette-warning-highlight: #ffe01a !default;
107
107
  $palette-success-lighter: #defae7 !default;
108
108
  $palette-success-light: #59c282 !default;
109
109
  $palette-success-main: #16884a !default;