@okta/odyssey-react-mui 1.21.2 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (593) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/@types/i18next.d.js.map +1 -1
  3. package/dist/Autocomplete.js +106 -38
  4. package/dist/Autocomplete.js.map +1 -1
  5. package/dist/Callout.js +12 -24
  6. package/dist/Callout.js.map +1 -1
  7. package/dist/Checkbox.js +26 -11
  8. package/dist/Checkbox.js.map +1 -1
  9. package/dist/CheckboxGroup.js +14 -3
  10. package/dist/CheckboxGroup.js.map +1 -1
  11. package/dist/DataTable/DataTable.js +10 -2
  12. package/dist/DataTable/DataTable.js.map +1 -1
  13. package/dist/DataTable/useScrollIndication.js +9 -5
  14. package/dist/DataTable/useScrollIndication.js.map +1 -1
  15. package/dist/Field.js +3 -1
  16. package/dist/Field.js.map +1 -1
  17. package/dist/FileUploader/FileUploadIllustration.js.map +1 -0
  18. package/dist/FileUploader/FileUploadPreview.js.map +1 -0
  19. package/dist/{labs/FileUpload.js → FileUploader/FileUploader.js} +6 -5
  20. package/dist/FileUploader/FileUploader.js.map +1 -0
  21. package/dist/FileUploader/index.js +13 -0
  22. package/dist/FileUploader/index.js.map +1 -0
  23. package/dist/OdysseyCacheProvider.js +4 -3
  24. package/dist/OdysseyCacheProvider.js.map +1 -1
  25. package/dist/OdysseyProvider.js +10 -3
  26. package/dist/OdysseyProvider.js.map +1 -1
  27. package/dist/OdysseyThemeProvider.js +3 -2
  28. package/dist/OdysseyThemeProvider.js.map +1 -1
  29. package/dist/Radio.js +33 -6
  30. package/dist/Radio.js.map +1 -1
  31. package/dist/RadioGroup.js +17 -5
  32. package/dist/RadioGroup.js.map +1 -1
  33. package/dist/Select.js +89 -31
  34. package/dist/Select.js.map +1 -1
  35. package/dist/{labs/Switch.js → Switch.js} +77 -23
  36. package/dist/Switch.js.map +1 -0
  37. package/dist/Tabs.js +7 -9
  38. package/dist/Tabs.js.map +1 -1
  39. package/dist/Tag.js +102 -4
  40. package/dist/Tag.js.map +1 -1
  41. package/dist/TextField.js +16 -39
  42. package/dist/TextField.js.map +1 -1
  43. package/dist/Toast.js +2 -2
  44. package/dist/Toast.js.map +1 -1
  45. package/dist/ToastStack.js.map +1 -1
  46. package/dist/createShadowDomElements.js +43 -0
  47. package/dist/createShadowDomElements.js.map +1 -0
  48. package/dist/i18n.js +1 -1
  49. package/dist/i18n.js.map +1 -1
  50. package/dist/index.js +3 -2
  51. package/dist/index.js.map +1 -1
  52. package/dist/index.scss +96 -8
  53. package/dist/labs/AppTile.js +124 -0
  54. package/dist/labs/AppTile.js.map +1 -0
  55. package/dist/labs/DataView/BulkActionsMenu.js.map +1 -0
  56. package/dist/labs/{DataComponents/StackContent.js → DataView/CardLayoutContent.js} +14 -14
  57. package/dist/labs/DataView/CardLayoutContent.js.map +1 -0
  58. package/dist/labs/{DataComponents/StackCard.js → DataView/DataCard.js} +6 -6
  59. package/dist/labs/DataView/DataCard.js.map +1 -0
  60. package/dist/labs/{DataComponents → DataView}/DataTable.js +6 -2
  61. package/dist/labs/DataView/DataTable.js.map +1 -0
  62. package/dist/labs/{DataComponents → DataView}/DataView.js +79 -30
  63. package/dist/labs/DataView/DataView.js.map +1 -0
  64. package/dist/labs/DataView/DetailPanel.js.map +1 -0
  65. package/dist/labs/DataView/LayoutSwitcher.js.map +1 -0
  66. package/dist/labs/DataView/RowActions.js.map +1 -0
  67. package/dist/labs/{DataComponents/TableContent.js → DataView/TableLayoutContent.js} +34 -20
  68. package/dist/labs/DataView/TableLayoutContent.js.map +1 -0
  69. package/dist/labs/{DataComponents → DataView}/TableSettings.js +2 -2
  70. package/dist/labs/DataView/TableSettings.js.map +1 -0
  71. package/dist/labs/DataView/componentTypes.js.map +1 -0
  72. package/dist/labs/{DataComponents → DataView}/constants.js +2 -2
  73. package/dist/labs/DataView/constants.js.map +1 -0
  74. package/dist/labs/DataView/dataTypes.js.map +1 -0
  75. package/dist/labs/DataView/fetchData.js.map +1 -0
  76. package/dist/labs/{DataComponents → DataView}/index.js +0 -1
  77. package/dist/labs/DataView/index.js.map +1 -0
  78. package/dist/labs/DataView/tableConstants.js.map +1 -0
  79. package/dist/labs/DataView/useFilterConversion.js.map +1 -0
  80. package/dist/labs/DateField.js +2 -0
  81. package/dist/labs/DateField.js.map +1 -1
  82. package/dist/labs/DatePicker.js +5 -1
  83. package/dist/labs/DatePicker.js.map +1 -1
  84. package/dist/labs/SideNav/CollapseIcon.js +44 -0
  85. package/dist/labs/SideNav/CollapseIcon.js.map +1 -0
  86. package/dist/labs/SideNav/OktaLogo.js +36 -0
  87. package/dist/labs/SideNav/OktaLogo.js.map +1 -0
  88. package/dist/labs/SideNav/SideNav.js +335 -0
  89. package/dist/labs/SideNav/SideNav.js.map +1 -0
  90. package/dist/labs/SideNav/SideNavFooterContent.js +49 -0
  91. package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -0
  92. package/dist/labs/SideNav/SideNavHeader.js +81 -0
  93. package/dist/labs/SideNav/SideNavHeader.js.map +1 -0
  94. package/dist/labs/SideNav/SideNavItemContent.js +157 -0
  95. package/dist/labs/SideNav/SideNavItemContent.js.map +1 -0
  96. package/dist/labs/SideNav/SideNavItemLinkContent.js +71 -0
  97. package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -0
  98. package/dist/labs/SideNav/index.js +14 -0
  99. package/dist/labs/SideNav/index.js.map +1 -0
  100. package/dist/labs/SideNav/types.js +2 -0
  101. package/dist/labs/SideNav/types.js.map +1 -0
  102. package/dist/labs/TopNav.js +2 -1
  103. package/dist/labs/TopNav.js.map +1 -1
  104. package/dist/labs/index.js +3 -4
  105. package/dist/labs/index.js.map +1 -1
  106. package/dist/labs/useDateFieldsTranslations.js +1 -1
  107. package/dist/labs/useDateFieldsTranslations.js.map +1 -1
  108. package/dist/properties/ts/odyssey-react-mui.js +3 -1
  109. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  110. package/dist/properties/ts/odyssey-react-mui_cs.js +17 -3
  111. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  112. package/dist/properties/ts/odyssey-react-mui_da.js +17 -3
  113. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  114. package/dist/properties/ts/odyssey-react-mui_de.js +16 -2
  115. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  116. package/dist/properties/ts/odyssey-react-mui_el.js +18 -4
  117. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  118. package/dist/properties/ts/odyssey-react-mui_es.js +17 -3
  119. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  120. package/dist/properties/ts/odyssey-react-mui_fi.js +17 -3
  121. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  122. package/dist/properties/ts/odyssey-react-mui_fr.js +17 -3
  123. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  124. package/dist/properties/ts/odyssey-react-mui_ht.js +18 -4
  125. package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  126. package/dist/properties/ts/odyssey-react-mui_hu.js +17 -3
  127. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  128. package/dist/properties/ts/odyssey-react-mui_id.js +17 -3
  129. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  130. package/dist/properties/ts/odyssey-react-mui_it.js +17 -3
  131. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  132. package/dist/properties/ts/odyssey-react-mui_ja.js +16 -2
  133. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  134. package/dist/properties/ts/odyssey-react-mui_ko.js +16 -2
  135. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  136. package/dist/properties/ts/odyssey-react-mui_ms.js +17 -3
  137. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  138. package/dist/properties/ts/odyssey-react-mui_nb.js +17 -3
  139. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  140. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +17 -3
  141. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  142. package/dist/properties/ts/odyssey-react-mui_pl.js +17 -3
  143. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  144. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +17 -3
  145. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  146. package/dist/properties/ts/odyssey-react-mui_ro.js +17 -3
  147. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  148. package/dist/properties/ts/odyssey-react-mui_ru.js +17 -3
  149. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  150. package/dist/properties/ts/odyssey-react-mui_sv.js +17 -3
  151. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  152. package/dist/properties/ts/odyssey-react-mui_th.js +16 -2
  153. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  154. package/dist/properties/ts/odyssey-react-mui_tr.js +17 -3
  155. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  156. package/dist/properties/ts/odyssey-react-mui_uk.js +17 -3
  157. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  158. package/dist/properties/ts/odyssey-react-mui_vi.js +17 -3
  159. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  160. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +16 -2
  161. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  162. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +16 -2
  163. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  164. package/dist/src/Autocomplete.d.ts +30 -0
  165. package/dist/src/Autocomplete.d.ts.map +1 -1
  166. package/dist/src/Callout.d.ts +11 -23
  167. package/dist/src/Callout.d.ts.map +1 -1
  168. package/dist/src/Checkbox.d.ts +2 -2
  169. package/dist/src/Checkbox.d.ts.map +1 -1
  170. package/dist/src/CheckboxGroup.d.ts +3 -3
  171. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  172. package/dist/src/DataTable/DataTable.d.ts +9 -1
  173. package/dist/src/DataTable/DataTable.d.ts.map +1 -1
  174. package/dist/src/DataTable/useScrollIndication.d.ts.map +1 -1
  175. package/dist/src/Field.d.ts +3 -2
  176. package/dist/src/Field.d.ts.map +1 -1
  177. package/dist/src/FileUploader/FileUploadIllustration.d.ts.map +1 -0
  178. package/dist/src/{labs → FileUploader}/FileUploadPreview.d.ts +2 -2
  179. package/dist/src/FileUploader/FileUploadPreview.d.ts.map +1 -0
  180. package/dist/src/{labs/FileUpload.d.ts → FileUploader/FileUploader.d.ts} +5 -4
  181. package/dist/src/FileUploader/FileUploader.d.ts.map +1 -0
  182. package/dist/src/FileUploader/index.d.ts +13 -0
  183. package/dist/src/FileUploader/index.d.ts.map +1 -0
  184. package/dist/src/NativeSelect.d.ts +1 -1
  185. package/dist/src/OdysseyCacheProvider.d.ts +7 -3
  186. package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
  187. package/dist/src/OdysseyProvider.d.ts +1 -1
  188. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  189. package/dist/src/OdysseyThemeProvider.d.ts +3 -1
  190. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  191. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  192. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  193. package/dist/src/PasswordField.d.ts +1 -1
  194. package/dist/src/Radio.d.ts +6 -8
  195. package/dist/src/Radio.d.ts.map +1 -1
  196. package/dist/src/RadioGroup.d.ts +4 -5
  197. package/dist/src/RadioGroup.d.ts.map +1 -1
  198. package/dist/src/SearchField.d.ts +1 -1
  199. package/dist/src/Select.d.ts +38 -2
  200. package/dist/src/Select.d.ts.map +1 -1
  201. package/dist/src/{labs/Switch.d.ts → Switch.d.ts} +8 -4
  202. package/dist/src/Switch.d.ts.map +1 -0
  203. package/dist/src/Tabs.d.ts +6 -8
  204. package/dist/src/Tabs.d.ts.map +1 -1
  205. package/dist/src/Tag.d.ts +7 -1
  206. package/dist/src/Tag.d.ts.map +1 -1
  207. package/dist/src/TextField.d.ts +17 -40
  208. package/dist/src/TextField.d.ts.map +1 -1
  209. package/dist/src/ToastStack.d.ts +2 -2
  210. package/dist/src/ToastStack.d.ts.map +1 -1
  211. package/dist/src/{createShadowRootElement.d.ts → createShadowDomElements.d.ts} +6 -1
  212. package/dist/src/createShadowDomElements.d.ts.map +1 -0
  213. package/dist/src/i18n.d.ts +2 -2
  214. package/dist/src/i18n.d.ts.map +1 -1
  215. package/dist/src/index.d.ts +3 -2
  216. package/dist/src/index.d.ts.map +1 -1
  217. package/dist/src/labs/AppTile.d.ts +39 -0
  218. package/dist/src/labs/AppTile.d.ts.map +1 -0
  219. package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -0
  220. package/dist/src/labs/{DataComponents/StackContent.d.ts → DataView/CardLayoutContent.d.ts} +7 -7
  221. package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -0
  222. package/dist/src/labs/{DataComponents/StackCard.d.ts → DataView/DataCard.d.ts} +4 -4
  223. package/dist/src/labs/DataView/DataCard.d.ts.map +1 -0
  224. package/dist/src/labs/DataView/DataTable.d.ts +16 -0
  225. package/dist/src/labs/DataView/DataTable.d.ts.map +1 -0
  226. package/dist/src/labs/{DataComponents → DataView}/DataView.d.ts +1 -1
  227. package/dist/src/labs/DataView/DataView.d.ts.map +1 -0
  228. package/dist/src/labs/{DataComponents → DataView}/DetailPanel.d.ts +2 -2
  229. package/dist/src/labs/DataView/DetailPanel.d.ts.map +1 -0
  230. package/dist/src/labs/DataView/LayoutSwitcher.d.ts.map +1 -0
  231. package/dist/src/labs/DataView/RowActions.d.ts.map +1 -0
  232. package/dist/src/labs/{DataComponents/TableContent.d.ts → DataView/TableLayoutContent.d.ts} +8 -7
  233. package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -0
  234. package/dist/src/labs/{DataComponents → DataView}/TableSettings.d.ts +3 -3
  235. package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -0
  236. package/dist/src/labs/{DataComponents → DataView}/componentTypes.d.ts +21 -9
  237. package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -0
  238. package/dist/src/labs/{DataComponents → DataView}/constants.d.ts +1 -1
  239. package/dist/src/labs/DataView/constants.d.ts.map +1 -0
  240. package/dist/src/labs/DataView/dataTypes.d.ts.map +1 -0
  241. package/dist/src/labs/DataView/fetchData.d.ts.map +1 -0
  242. package/dist/src/labs/{DataComponents → DataView}/index.d.ts +0 -1
  243. package/dist/src/labs/DataView/index.d.ts.map +1 -0
  244. package/dist/src/labs/DataView/tableConstants.d.ts.map +1 -0
  245. package/dist/src/labs/{DataComponents → DataView}/useFilterConversion.d.ts +2 -2
  246. package/dist/src/labs/DataView/useFilterConversion.d.ts.map +1 -0
  247. package/dist/src/labs/DateField.d.ts +2 -2
  248. package/dist/src/labs/DateField.d.ts.map +1 -1
  249. package/dist/src/labs/DatePicker.d.ts +2 -2
  250. package/dist/src/labs/DatePicker.d.ts.map +1 -1
  251. package/dist/src/labs/SideNav/CollapseIcon.d.ts +17 -0
  252. package/dist/src/labs/SideNav/CollapseIcon.d.ts.map +1 -0
  253. package/dist/src/labs/SideNav/OktaLogo.d.ts +14 -0
  254. package/dist/src/labs/SideNav/OktaLogo.d.ts.map +1 -0
  255. package/dist/src/labs/SideNav/SideNav.d.ts +16 -0
  256. package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -0
  257. package/dist/{test-selectors/odysseyTestSelectors.js → src/labs/SideNav/SideNavFooterContent.d.ts} +6 -9
  258. package/dist/src/labs/SideNav/SideNavFooterContent.d.ts.map +1 -0
  259. package/dist/src/labs/SideNav/SideNavHeader.d.ts +16 -0
  260. package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -0
  261. package/dist/src/labs/SideNav/SideNavItemContent.d.ts +33 -0
  262. package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -0
  263. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts +16 -0
  264. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts.map +1 -0
  265. package/dist/src/labs/SideNav/index.d.ts +14 -0
  266. package/dist/src/labs/SideNav/index.d.ts.map +1 -0
  267. package/dist/src/labs/{SideNav.d.ts → SideNav/types.d.ts} +54 -33
  268. package/dist/src/labs/SideNav/types.d.ts.map +1 -0
  269. package/dist/src/labs/TopNav.d.ts +1 -0
  270. package/dist/src/labs/TopNav.d.ts.map +1 -1
  271. package/dist/src/labs/index.d.ts +2 -3
  272. package/dist/src/labs/index.d.ts.map +1 -1
  273. package/dist/src/properties/ts/odyssey-react-mui.d.ts +2 -0
  274. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  275. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +15 -1
  276. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  277. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +15 -1
  278. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  279. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +15 -1
  280. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  281. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +15 -1
  282. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  283. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +15 -1
  284. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  285. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +15 -1
  286. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  287. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +15 -1
  288. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  289. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts +16 -2
  290. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  291. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +15 -1
  292. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  293. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +15 -1
  294. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  295. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +15 -1
  296. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  297. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +15 -1
  298. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  299. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +15 -1
  300. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  301. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +15 -1
  302. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  303. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +15 -1
  304. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  305. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +15 -1
  306. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  307. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +15 -1
  308. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  309. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +15 -1
  310. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  311. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +15 -1
  312. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  313. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +15 -1
  314. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  315. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +15 -1
  316. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  317. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +15 -1
  318. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  319. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +15 -1
  320. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  321. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +15 -1
  322. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  323. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +15 -1
  324. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  325. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +15 -1
  326. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  327. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +15 -1
  328. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  329. package/dist/src/test-selectors/getByQuerySelector.d.ts +148 -0
  330. package/dist/src/test-selectors/getByQuerySelector.d.ts.map +1 -0
  331. package/dist/src/test-selectors/getComputedAccessibleErrorMessageText.d.ts +14 -0
  332. package/dist/src/test-selectors/getComputedAccessibleErrorMessageText.d.ts.map +1 -0
  333. package/dist/src/test-selectors/getComputedAccessibleText.d.ts +23 -0
  334. package/dist/src/test-selectors/getComputedAccessibleText.d.ts.map +1 -0
  335. package/dist/src/test-selectors/index.d.ts +2 -2
  336. package/dist/src/test-selectors/index.d.ts.map +1 -1
  337. package/{src/test-selectors/odysseyTestSelectors.ts → dist/src/test-selectors/interpolateString.d.ts} +4 -11
  338. package/dist/src/test-selectors/interpolateString.d.ts.map +1 -0
  339. package/dist/src/test-selectors/linkedHtmlSelectors.d.ts +24 -0
  340. package/dist/src/test-selectors/linkedHtmlSelectors.d.ts.map +1 -0
  341. package/dist/src/test-selectors/queryOdysseySelector.d.ts +5755 -0
  342. package/dist/src/test-selectors/queryOdysseySelector.d.ts.map +1 -0
  343. package/dist/src/test-selectors/querySelector.d.ts +59 -3613
  344. package/dist/src/test-selectors/querySelector.d.ts.map +1 -1
  345. package/dist/src/test-selectors/sanityChecks.d.ts +18 -0
  346. package/dist/src/test-selectors/sanityChecks.d.ts.map +1 -0
  347. package/dist/src/test-selectors/testSelector.d.ts +46 -0
  348. package/dist/src/test-selectors/testSelector.d.ts.map +1 -0
  349. package/dist/src/theme/components.d.ts +3 -1
  350. package/dist/src/theme/components.d.ts.map +1 -1
  351. package/dist/src/theme/createOdysseyMuiTheme.d.ts +3 -1
  352. package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
  353. package/dist/test-selectors/getByQuerySelector.js +64 -0
  354. package/dist/test-selectors/getByQuerySelector.js.map +1 -0
  355. package/dist/test-selectors/getComputedAccessibleErrorMessageText.js +25 -0
  356. package/dist/test-selectors/getComputedAccessibleErrorMessageText.js.map +1 -0
  357. package/dist/test-selectors/getComputedAccessibleText.js +24 -0
  358. package/dist/test-selectors/getComputedAccessibleText.js.map +1 -0
  359. package/dist/test-selectors/index.js +2 -2
  360. package/dist/test-selectors/index.js.map +1 -1
  361. package/dist/test-selectors/interpolateString.js +25 -0
  362. package/dist/test-selectors/interpolateString.js.map +1 -0
  363. package/dist/test-selectors/linkedHtmlSelectors.js +34 -0
  364. package/dist/test-selectors/linkedHtmlSelectors.js.map +1 -0
  365. package/dist/test-selectors/queryOdysseySelector.js +26 -0
  366. package/dist/test-selectors/queryOdysseySelector.js.map +1 -0
  367. package/dist/test-selectors/querySelector.js +82 -58
  368. package/dist/test-selectors/querySelector.js.map +1 -1
  369. package/dist/test-selectors/sanityChecks.js +33 -0
  370. package/dist/test-selectors/sanityChecks.js.map +1 -0
  371. package/dist/test-selectors/testSelector.js +2 -0
  372. package/dist/test-selectors/testSelector.js.map +1 -0
  373. package/dist/test-selectors/testSelectors.json +1 -1
  374. package/dist/theme/components.js +231 -146
  375. package/dist/theme/components.js.map +1 -1
  376. package/dist/theme/createOdysseyMuiTheme.js +3 -2
  377. package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
  378. package/dist/tsconfig.production.tsbuildinfo +1 -1
  379. package/dist/tsconfig.tsbuildinfo +1 -1
  380. package/jest.setup.js +3 -0
  381. package/package.json +5 -5
  382. package/scripts/generateTestSelectorsJson.ts +1 -1
  383. package/src/@types/i18next.d.ts +1 -1
  384. package/src/Autocomplete.tsx +140 -45
  385. package/src/Callout.tsx +13 -25
  386. package/src/Checkbox.tsx +39 -9
  387. package/src/CheckboxGroup.tsx +20 -4
  388. package/src/DataTable/DataTable.tsx +24 -1
  389. package/src/DataTable/useScrollIndication.tsx +11 -4
  390. package/src/Field.tsx +5 -2
  391. package/src/{labs → FileUploader}/FileUploadPreview.tsx +3 -3
  392. package/src/{labs/FileUpload.tsx → FileUploader/FileUploader.tsx} +7 -6
  393. package/src/FileUploader/index.ts +13 -0
  394. package/src/OdysseyCacheProvider.test.tsx +1 -0
  395. package/src/OdysseyCacheProvider.tsx +18 -4
  396. package/src/OdysseyProvider.tsx +12 -4
  397. package/src/OdysseyThemeProvider.tsx +6 -2
  398. package/src/Radio.tsx +41 -12
  399. package/src/RadioGroup.tsx +26 -7
  400. package/src/Select.tsx +116 -45
  401. package/src/{labs/Switch.tsx → Switch.tsx} +95 -41
  402. package/src/Tabs.tsx +8 -10
  403. package/src/Tag.tsx +134 -3
  404. package/src/TextField.tsx +18 -41
  405. package/src/Toast.tsx +1 -1
  406. package/src/ToastStack.tsx +2 -2
  407. package/src/createShadowDomElements.ts +53 -0
  408. package/src/i18n.ts +3 -3
  409. package/src/index.ts +7 -2
  410. package/src/labs/AppTile.tsx +200 -0
  411. package/src/labs/{DataComponents/StackContent.tsx → DataView/CardLayoutContent.tsx} +24 -19
  412. package/src/labs/{DataComponents/StackCard.tsx → DataView/DataCard.tsx} +7 -7
  413. package/src/labs/{DataComponents → DataView}/DataTable.tsx +8 -4
  414. package/src/labs/DataView/DataView.test.tsx +158 -0
  415. package/src/labs/{DataComponents → DataView}/DataView.tsx +119 -42
  416. package/src/labs/{DataComponents → DataView}/DetailPanel.tsx +2 -2
  417. package/src/labs/{DataComponents/TableContent.tsx → DataView/TableLayoutContent.tsx} +59 -27
  418. package/src/labs/{DataComponents → DataView}/TableSettings.tsx +5 -4
  419. package/src/labs/{DataComponents → DataView}/componentTypes.ts +24 -9
  420. package/src/labs/{DataComponents → DataView}/constants.tsx +2 -2
  421. package/src/labs/{DataComponents → DataView}/index.tsx +0 -1
  422. package/src/labs/{DataComponents → DataView}/useFilterConversion.ts +2 -2
  423. package/src/labs/DateField.tsx +3 -0
  424. package/src/labs/DatePicker.tsx +12 -1
  425. package/src/labs/SideNav/CollapseIcon.tsx +48 -0
  426. package/src/labs/SideNav/OktaLogo.tsx +39 -0
  427. package/src/labs/SideNav/SideNav.tsx +486 -0
  428. package/src/labs/SideNav/SideNavFooterContent.tsx +64 -0
  429. package/src/labs/SideNav/SideNavHeader.tsx +88 -0
  430. package/src/labs/SideNav/SideNavItemContent.tsx +216 -0
  431. package/src/labs/SideNav/SideNavItemLinkContent.tsx +87 -0
  432. package/src/labs/SideNav/index.ts +15 -0
  433. package/src/labs/SideNav/types.ts +152 -0
  434. package/src/labs/TopNav.tsx +3 -1
  435. package/src/labs/index.ts +3 -4
  436. package/src/labs/useDateFieldsTranslations.ts +1 -1
  437. package/src/properties/odyssey-react-mui.properties +2 -1
  438. package/src/properties/translations/odyssey-react-mui_cs.properties +15 -3
  439. package/src/properties/translations/odyssey-react-mui_da.properties +15 -3
  440. package/src/properties/translations/odyssey-react-mui_de.properties +14 -2
  441. package/src/properties/translations/odyssey-react-mui_el.properties +16 -4
  442. package/src/properties/translations/odyssey-react-mui_es.properties +15 -3
  443. package/src/properties/translations/odyssey-react-mui_fi.properties +15 -3
  444. package/src/properties/translations/odyssey-react-mui_fr.properties +15 -3
  445. package/src/properties/translations/odyssey-react-mui_ht.properties +17 -6
  446. package/src/properties/translations/odyssey-react-mui_hu.properties +15 -3
  447. package/src/properties/translations/odyssey-react-mui_id.properties +15 -3
  448. package/src/properties/translations/odyssey-react-mui_it.properties +15 -3
  449. package/src/properties/translations/odyssey-react-mui_ja.properties +14 -2
  450. package/src/properties/translations/odyssey-react-mui_ko.properties +14 -2
  451. package/src/properties/translations/odyssey-react-mui_ms.properties +15 -3
  452. package/src/properties/translations/odyssey-react-mui_nb.properties +15 -3
  453. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +15 -3
  454. package/src/properties/translations/odyssey-react-mui_pl.properties +15 -3
  455. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +15 -3
  456. package/src/properties/translations/odyssey-react-mui_ro.properties +15 -3
  457. package/src/properties/translations/odyssey-react-mui_ru.properties +15 -3
  458. package/src/properties/translations/odyssey-react-mui_sv.properties +15 -3
  459. package/src/properties/translations/odyssey-react-mui_th.properties +14 -2
  460. package/src/properties/translations/odyssey-react-mui_tr.properties +15 -3
  461. package/src/properties/translations/odyssey-react-mui_uk.properties +15 -3
  462. package/src/properties/translations/odyssey-react-mui_vi.properties +15 -3
  463. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +14 -2
  464. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +14 -2
  465. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  466. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  467. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  468. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  469. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  470. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  471. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  472. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  473. package/src/properties/ts/odyssey-react-mui_ht.ts +1 -1
  474. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  475. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  476. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  477. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  478. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  479. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  480. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  481. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  482. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  483. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  484. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  485. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  486. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  487. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  488. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  489. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  490. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  491. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  492. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  493. package/src/test-selectors/getByQuerySelector.ts +176 -0
  494. package/src/test-selectors/getComputedAccessibleErrorMessageText.ts +52 -0
  495. package/src/test-selectors/getComputedAccessibleText.ts +36 -0
  496. package/src/test-selectors/index.ts +2 -2
  497. package/src/test-selectors/interpolateString.ts +41 -0
  498. package/src/test-selectors/linkedHtmlSelectors.ts +73 -0
  499. package/src/test-selectors/queryOdysseySelector.ts +36 -0
  500. package/src/test-selectors/querySelector.ts +221 -170
  501. package/src/test-selectors/sanityChecks.ts +53 -0
  502. package/src/test-selectors/testSelector.ts +143 -0
  503. package/src/theme/components.tsx +238 -150
  504. package/src/theme/createOdysseyMuiTheme.ts +4 -1
  505. package/dist/createShadowRootElement.js +0 -26
  506. package/dist/createShadowRootElement.js.map +0 -1
  507. package/dist/labs/DataComponents/BulkActionsMenu.js.map +0 -1
  508. package/dist/labs/DataComponents/DataStack.js +0 -85
  509. package/dist/labs/DataComponents/DataStack.js.map +0 -1
  510. package/dist/labs/DataComponents/DataTable.js.map +0 -1
  511. package/dist/labs/DataComponents/DataView.js.map +0 -1
  512. package/dist/labs/DataComponents/DetailPanel.js.map +0 -1
  513. package/dist/labs/DataComponents/LayoutSwitcher.js.map +0 -1
  514. package/dist/labs/DataComponents/RowActions.js.map +0 -1
  515. package/dist/labs/DataComponents/StackCard.js.map +0 -1
  516. package/dist/labs/DataComponents/StackContent.js.map +0 -1
  517. package/dist/labs/DataComponents/TableContent.js.map +0 -1
  518. package/dist/labs/DataComponents/TableSettings.js.map +0 -1
  519. package/dist/labs/DataComponents/componentTypes.js.map +0 -1
  520. package/dist/labs/DataComponents/constants.js.map +0 -1
  521. package/dist/labs/DataComponents/dataTypes.js.map +0 -1
  522. package/dist/labs/DataComponents/fetchData.js.map +0 -1
  523. package/dist/labs/DataComponents/index.js.map +0 -1
  524. package/dist/labs/DataComponents/tableConstants.js.map +0 -1
  525. package/dist/labs/DataComponents/useFilterConversion.js.map +0 -1
  526. package/dist/labs/FileUpload.js.map +0 -1
  527. package/dist/labs/FileUploadIllustration.js.map +0 -1
  528. package/dist/labs/FileUploadPreview.js.map +0 -1
  529. package/dist/labs/SideNav.js +0 -478
  530. package/dist/labs/SideNav.js.map +0 -1
  531. package/dist/labs/Switch.js.map +0 -1
  532. package/dist/src/createShadowRootElement.d.ts.map +0 -1
  533. package/dist/src/labs/DataComponents/BulkActionsMenu.d.ts.map +0 -1
  534. package/dist/src/labs/DataComponents/DataStack.d.ts +0 -20
  535. package/dist/src/labs/DataComponents/DataStack.d.ts.map +0 -1
  536. package/dist/src/labs/DataComponents/DataTable.d.ts +0 -16
  537. package/dist/src/labs/DataComponents/DataTable.d.ts.map +0 -1
  538. package/dist/src/labs/DataComponents/DataView.d.ts.map +0 -1
  539. package/dist/src/labs/DataComponents/DetailPanel.d.ts.map +0 -1
  540. package/dist/src/labs/DataComponents/LayoutSwitcher.d.ts.map +0 -1
  541. package/dist/src/labs/DataComponents/RowActions.d.ts.map +0 -1
  542. package/dist/src/labs/DataComponents/StackCard.d.ts.map +0 -1
  543. package/dist/src/labs/DataComponents/StackContent.d.ts.map +0 -1
  544. package/dist/src/labs/DataComponents/TableContent.d.ts.map +0 -1
  545. package/dist/src/labs/DataComponents/TableSettings.d.ts.map +0 -1
  546. package/dist/src/labs/DataComponents/componentTypes.d.ts.map +0 -1
  547. package/dist/src/labs/DataComponents/constants.d.ts.map +0 -1
  548. package/dist/src/labs/DataComponents/dataTypes.d.ts.map +0 -1
  549. package/dist/src/labs/DataComponents/fetchData.d.ts.map +0 -1
  550. package/dist/src/labs/DataComponents/index.d.ts.map +0 -1
  551. package/dist/src/labs/DataComponents/tableConstants.d.ts.map +0 -1
  552. package/dist/src/labs/DataComponents/useFilterConversion.d.ts.map +0 -1
  553. package/dist/src/labs/FileUpload.d.ts.map +0 -1
  554. package/dist/src/labs/FileUploadIllustration.d.ts.map +0 -1
  555. package/dist/src/labs/FileUploadPreview.d.ts.map +0 -1
  556. package/dist/src/labs/SideNav.d.ts.map +0 -1
  557. package/dist/src/labs/Switch.d.ts.map +0 -1
  558. package/dist/src/test-selectors/featureTestSelector.d.ts +0 -31
  559. package/dist/src/test-selectors/featureTestSelector.d.ts.map +0 -1
  560. package/dist/src/test-selectors/odysseyTestSelectors.d.ts +0 -120
  561. package/dist/src/test-selectors/odysseyTestSelectors.d.ts.map +0 -1
  562. package/dist/test-selectors/featureTestSelector.js +0 -2
  563. package/dist/test-selectors/featureTestSelector.js.map +0 -1
  564. package/dist/test-selectors/odysseyTestSelectors.js.map +0 -1
  565. package/src/createShadowRootElement.ts +0 -31
  566. package/src/labs/DataComponents/DataStack.tsx +0 -105
  567. package/src/labs/SideNav.tsx +0 -745
  568. package/src/test-selectors/featureTestSelector.ts +0 -41
  569. /package/dist/{labs → FileUploader}/FileUploadIllustration.js +0 -0
  570. /package/dist/{labs → FileUploader}/FileUploadPreview.js +0 -0
  571. /package/dist/labs/{DataComponents → DataView}/BulkActionsMenu.js +0 -0
  572. /package/dist/labs/{DataComponents → DataView}/DetailPanel.js +0 -0
  573. /package/dist/labs/{DataComponents → DataView}/LayoutSwitcher.js +0 -0
  574. /package/dist/labs/{DataComponents → DataView}/RowActions.js +0 -0
  575. /package/dist/labs/{DataComponents → DataView}/componentTypes.js +0 -0
  576. /package/dist/labs/{DataComponents → DataView}/dataTypes.js +0 -0
  577. /package/dist/labs/{DataComponents → DataView}/fetchData.js +0 -0
  578. /package/dist/labs/{DataComponents → DataView}/tableConstants.js +0 -0
  579. /package/dist/labs/{DataComponents → DataView}/useFilterConversion.js +0 -0
  580. /package/dist/src/{labs → FileUploader}/FileUploadIllustration.d.ts +0 -0
  581. /package/dist/src/labs/{DataComponents → DataView}/BulkActionsMenu.d.ts +0 -0
  582. /package/dist/src/labs/{DataComponents → DataView}/LayoutSwitcher.d.ts +0 -0
  583. /package/dist/src/labs/{DataComponents → DataView}/RowActions.d.ts +0 -0
  584. /package/dist/src/labs/{DataComponents → DataView}/dataTypes.d.ts +0 -0
  585. /package/dist/src/labs/{DataComponents → DataView}/fetchData.d.ts +0 -0
  586. /package/dist/src/labs/{DataComponents → DataView}/tableConstants.d.ts +0 -0
  587. /package/src/{labs → FileUploader}/FileUploadIllustration.tsx +0 -0
  588. /package/src/labs/{DataComponents → DataView}/BulkActionsMenu.tsx +0 -0
  589. /package/src/labs/{DataComponents → DataView}/LayoutSwitcher.tsx +0 -0
  590. /package/src/labs/{DataComponents → DataView}/RowActions.tsx +0 -0
  591. /package/src/labs/{DataComponents → DataView}/dataTypes.ts +0 -0
  592. /package/src/labs/{DataComponents → DataView}/fetchData.ts +0 -0
  593. /package/src/labs/{DataComponents → DataView}/tableConstants.tsx +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,40 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.23.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.23.0) (2024-09-19)
7
+
8
+ ### Features
9
+
10
+ - add additional action button and menu slot to table ([#2334](https://github.com/okta/odyssey/issues/2334)) ([52b3f38](https://github.com/okta/odyssey/commit/52b3f3832adc442e0219be16fe8a4d96cf100a4e))
11
+ - adds a generic top nav component ([#2296](https://github.com/okta/odyssey/issues/2296)) ([6f3165f](https://github.com/okta/odyssey/commit/6f3165f9fd4a1d1743c975b72132d4ec186d09bb))
12
+ - adds new Shadow DOM export with better naming ([#2338](https://github.com/okta/odyssey/issues/2338)) ([0997e36](https://github.com/okta/odyssey/commit/0997e36afd4d241f5b3960528aff2865fb6d6ac3))
13
+ - automatically scroll to the first isSelected SideNavItem ([#2325](https://github.com/okta/odyssey/issues/2325)) ([52ce441](https://github.com/okta/odyssey/commit/52ce44137ffe5601cfa6044782a21afb5449167e))
14
+
15
+ ### Bug Fixes
16
+
17
+ - Add missing props to Storybook ([#2313](https://github.com/okta/odyssey/issues/2313)) ([bbf96a2](https://github.com/okta/odyssey/commit/bbf96a257160b922c0ebc31b1c5dec1fe31c35b4))
18
+ - fixes translations not working with TypeScript ([#2354](https://github.com/okta/odyssey/issues/2354)) ([37653ee](https://github.com/okta/odyssey/commit/37653ee47c2fab8b54dec26efd5115f6633c2977))
19
+ - **odyssey-design-tokens:** using correct weights in SB ([#2363](https://github.com/okta/odyssey/issues/2363)) ([2dfa614](https://github.com/okta/odyssey/commit/2dfa614cd4c09d71d8624be690ae788e134a74ba))
20
+ - **odyssey-react-mui:** Add min-heights to keep correct heights ([#2324](https://github.com/okta/odyssey/issues/2324)) ([40d5a50](https://github.com/okta/odyssey/commit/40d5a5070ebfab1b650066e91b451c0ef4b3f2d8))
21
+ - remove invalid pseudo element from theme overrides ([#2310](https://github.com/okta/odyssey/issues/2310)) ([fea0793](https://github.com/okta/odyssey/commit/fea0793acf0800494270a87e4e5d65129942b99e))
22
+ - select multioption not rendering text when you use an options object ([#2323](https://github.com/okta/odyssey/issues/2323)) ([4bafbb9](https://github.com/okta/odyssey/commit/4bafbb99e03e52ad572fba9049013c058c75da38))
23
+ - Update Test Selector types and improve functionality ([#2333](https://github.com/okta/odyssey/issues/2333)) ([7039009](https://github.com/okta/odyssey/commit/703900947861dfb36b8996414130a8db3414ccfa))
24
+
25
+ ## [1.22.0](https://github.com/okta/odyssey/compare/v1.19.0...v1.22.0) (2024-09-05)
26
+
27
+ ### Features
28
+
29
+ - add additional action button and menu slot to table ([#2334](https://github.com/okta/odyssey/issues/2334)) ([52b3f38](https://github.com/okta/odyssey/commit/52b3f3832adc442e0219be16fe8a4d96cf100a4e))
30
+ - adds a generic top nav component ([#2296](https://github.com/okta/odyssey/issues/2296)) ([6f3165f](https://github.com/okta/odyssey/commit/6f3165f9fd4a1d1743c975b72132d4ec186d09bb))
31
+ - adds new Shadow DOM export with better naming ([#2338](https://github.com/okta/odyssey/issues/2338)) ([0997e36](https://github.com/okta/odyssey/commit/0997e36afd4d241f5b3960528aff2865fb6d6ac3))
32
+ - automatically scroll to the first isSelected SideNavItem ([#2325](https://github.com/okta/odyssey/issues/2325)) ([52ce441](https://github.com/okta/odyssey/commit/52ce44137ffe5601cfa6044782a21afb5449167e))
33
+
34
+ ### Bug Fixes
35
+
36
+ - **odyssey-react-mui:** Add min-heights to keep correct heights ([#2324](https://github.com/okta/odyssey/issues/2324)) ([40d5a50](https://github.com/okta/odyssey/commit/40d5a5070ebfab1b650066e91b451c0ef4b3f2d8))
37
+ - remove invalid pseudo element from theme overrides ([#2310](https://github.com/okta/odyssey/issues/2310)) ([fea0793](https://github.com/okta/odyssey/commit/fea0793acf0800494270a87e4e5d65129942b99e))
38
+ - select multioption not rendering text when you use an options object ([#2323](https://github.com/okta/odyssey/issues/2323)) ([4bafbb9](https://github.com/okta/odyssey/commit/4bafbb99e03e52ad572fba9049013c058c75da38))
39
+
6
40
  ## [1.21.2](https://github.com/okta/odyssey/compare/v1.21.1...v1.21.2) (2024-08-09)
7
41
 
8
42
  **Note:** Version bump only for package @okta/odyssey-react-mui
@@ -1 +1 @@
1
- {"version":3,"file":"i18next.d.js","names":[],"sources":["../../src/@types/i18next.d.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport \"i18next\";\nimport { translation as en } from \"../properties/ts/odyssey-react-mui\";\n\ndeclare module \"i18next\" {\n interface CustomTypeOptions {\n resources: {\n translations: typeof en;\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAAS"}
1
+ {"version":3,"file":"i18next.d.js","names":[],"sources":["../../src/@types/i18next.d.ts"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport \"i18next\";\nimport { translation as en } from \"../properties/ts/odyssey-react-mui\";\n\ndeclare module \"i18next\" {\n interface CustomTypeOptions {\n resources: {\n translation: typeof en;\n };\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAAS"}
@@ -11,15 +11,44 @@ import _InputBase from "@mui/material/InputBase";
11
11
  *
12
12
  * See the License for the specific language governing permissions and limitations under the License.
13
13
  */
14
- import { createContext, forwardRef, memo, useCallback, useContext, useEffect, useMemo, useRef } from "react";
14
+ import { createContext, forwardRef, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
15
15
  import styled from "@emotion/styled";
16
16
  import { VariableSizeList } from "react-window";
17
- import _AutoSizer from "react-virtualized-auto-sizer";
18
17
  import { useTranslation } from "react-i18next";
19
- const AutoSizer = _AutoSizer;
20
18
  import { Field } from "./Field.js";
21
19
  import { ComponentControlledState, useInputValues, getControlState } from "./inputUtils.js";
22
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
+ import { createElement as _createElement } from "react";
22
+ export const AutocompleteTestSelector = {
23
+ accessibleText: {
24
+ errorMessage: "errorMessage",
25
+ hint: "description",
26
+ label: "label"
27
+ },
28
+ children: {
29
+ list: {
30
+ children: {
31
+ listItem: {
32
+ elementSelector: {
33
+ method: "ByRole",
34
+ options: {
35
+ label: "name"
36
+ },
37
+ role: "option"
38
+ }
39
+ }
40
+ },
41
+ isControlledElement: true
42
+ }
43
+ },
44
+ elementSelector: {
45
+ method: "ByRole",
46
+ options: {
47
+ label: "name"
48
+ },
49
+ role: "combobox"
50
+ }
51
+ };
23
52
  const ListboxContainer = styled.div`
24
53
  width: 100%;
25
54
  height: 100%;
@@ -120,20 +149,37 @@ const Autocomplete = ({
120
149
  required: !isOptional
121
150
  })
122
151
  }), [ariaDescribedBy, errorMessage, errorMessageList, hint, HintLinkComponent, isFullWidth, isOptional, label, nameOverride, testId]);
123
- const renderVirtualizedRow = ({
152
+ const Row = ({
124
153
  data,
125
154
  index,
155
+ setItemSize,
126
156
  style
127
157
  }) => {
128
- const baseOption = data[index];
129
- const optionItem = {
130
- ...baseOption,
131
- props: {
132
- ...baseOption.props,
133
- style
158
+ const rowRef = useRef(null);
159
+ useEffect(() => {
160
+ if (rowRef.current) {
161
+ const firstChild = rowRef.current.firstElementChild;
162
+ const height = firstChild ? firstChild.clientHeight : rowRef.current.clientHeight;
163
+ setItemSize(height);
134
164
  }
135
- };
136
- return optionItem;
165
+ }, [index, rowRef, setItemSize]);
166
+ const baseOption = data[index];
167
+ const {
168
+ key,
169
+ props
170
+ } = baseOption;
171
+ const styles = useMemo(() => ({
172
+ ...style,
173
+ height: "auto"
174
+ }), [style]);
175
+ return _jsx("div", {
176
+ ref: rowRef,
177
+ children: _createElement("li", {
178
+ ...props,
179
+ key: key,
180
+ style: styles
181
+ })
182
+ });
137
183
  };
138
184
  const OuterListboxContext = createContext({});
139
185
  const OuterListboxElementType = forwardRef((props, ref) => {
@@ -144,46 +190,68 @@ const Autocomplete = ({
144
190
  ...outerProps
145
191
  });
146
192
  });
147
- function useResetCache(length) {
148
- const ref = useRef(null);
193
+ const useResetCache = length => {
194
+ const resetCacheRef = useRef(null);
149
195
  useEffect(() => {
150
- if (ref.current) {
151
- ref.current.resetAfterIndex(0, true);
196
+ if (resetCacheRef.current) {
197
+ resetCacheRef.current.resetAfterIndex(0, true);
152
198
  }
153
199
  }, [length]);
154
- return ref;
155
- }
200
+ return resetCacheRef;
201
+ };
156
202
  const ListboxComponent = forwardRef(function (props, ref) {
203
+ const [listHeight, setListHeight] = useState(0);
157
204
  const {
158
205
  children,
159
206
  ...other
160
207
  } = props;
161
208
  const itemData = children.flatMap(item => [item].concat(item.children || []));
162
- const optionHeight = 45;
163
- const overscanRowCount = 8;
164
- const itemSize = useCallback(() => optionHeight, []);
209
+ const sizeMap = useRef([]);
210
+ const getListBoxHeight = useCallback(() => {
211
+ const COMBINED_LISTBOX_PADDING = 16;
212
+ if (itemData.length > OVERSCAN_ROW_COUNT) {
213
+ return 99999;
214
+ } else {
215
+ const itemsHeightCalculated = itemData.map((_, index) => sizeMap.current[index] || 0).reduce((prevItemHeight, nextItemHeight) => prevItemHeight + nextItemHeight, 0);
216
+ return COMBINED_LISTBOX_PADDING + itemsHeightCalculated;
217
+ }
218
+ }, [itemData, sizeMap]);
219
+ useEffect(() => {
220
+ if (sizeMap.current.length && itemData.length) {
221
+ setListHeight(getListBoxHeight());
222
+ }
223
+ }, [getListBoxHeight, itemData, sizeMap]);
224
+ const OVERSCAN_ROW_COUNT = 8;
165
225
  const gridRef = useResetCache(itemData.length);
166
- const renderWindow = useCallback(({
167
- height,
168
- width
169
- }) => _jsx(VariableSizeList, {
170
- innerElementType: "ul",
171
- itemData: itemData,
172
- itemCount: itemData.length,
173
- itemSize: itemSize,
174
- height: height,
175
- width: width,
176
- ref: gridRef,
177
- outerElementType: OuterListboxElementType,
178
- overscanCount: overscanRowCount,
179
- children: renderVirtualizedRow
180
- }), [itemData, gridRef, itemSize]);
226
+ const setItemSize = useCallback(size => {
227
+ gridRef?.current?.resetAfterIndex(0, true);
228
+ sizeMap.current = sizeMap.current.concat(size);
229
+ }, [gridRef, sizeMap]);
230
+ const getItemSize = useCallback(index => sizeMap.current[index] || 45, [sizeMap]);
181
231
  return _jsx(ListboxContainer, {
182
232
  ref: ref,
183
233
  children: _jsx(OuterListboxContext.Provider, {
184
234
  value: other,
185
- children: _jsx(AutoSizer, {
186
- children: renderWindow
235
+ children: _jsx(VariableSizeList, {
236
+ innerElementType: "ul",
237
+ itemData: itemData,
238
+ itemCount: itemData.length,
239
+ itemSize: getItemSize,
240
+ height: listHeight,
241
+ width: "100%",
242
+ ref: gridRef,
243
+ outerElementType: OuterListboxElementType,
244
+ overscanCount: OVERSCAN_ROW_COUNT,
245
+ children: ({
246
+ data,
247
+ index,
248
+ style
249
+ }) => _jsx(Row, {
250
+ data: data,
251
+ index: index,
252
+ style: style,
253
+ setItemSize: setItemSize
254
+ })
187
255
  })
188
256
  })
189
257
  });
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.js","names":["createContext","forwardRef","memo","useCallback","useContext","useEffect","useMemo","useRef","styled","VariableSizeList","_AutoSizer","useTranslation","AutoSizer","Field","ComponentControlledState","useInputValues","getControlState","jsx","_jsx","ListboxContainer","div","Autocomplete","ariaDescribedBy","defaultValue","errorMessage","errorMessageList","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","isVirtualizedProp","hint","HintLinkComponent","label","name","nameOverride","noOptionsText","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","options","value","getIsOptionEqualToValue","testId","translate","t","controlledStateRef","controlledValue","uncontrolledValue","Boolean","defaultValueProp","undefined","valueProps","controlState","current","inputValueProp","CONTROLLED","renderInput","InputLabelProps","InputProps","params","fieldType","hasVisibleLabel","htmlFor","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","inputProps","required","renderVirtualizedRow","data","index","style","baseOption","optionItem","props","OuterListboxContext","OuterListboxElementType","ref","outerProps","useResetCache","length","resetAfterIndex","ListboxComponent","children","other","itemData","flatMap","item","concat","optionHeight","overscanRowCount","itemSize","gridRef","renderWindow","height","width","innerElementType","itemCount","outerElementType","overscanCount","Provider","event","reason","details","_Autocomplete","clearText","closeText","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","fullWidth","loading","multiple","openText","readOnly","isOptionEqualToValue","MemoizedAutocomplete","displayName"],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n InputBase,\n UseAutocompleteProps,\n AutocompleteValue,\n AutocompleteRenderInputParams,\n} from \"@mui/material\";\nimport {\n createContext,\n FC,\n forwardRef,\n HTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n} from \"react\";\nimport styled from \"@emotion/styled\";\nimport { VariableSizeList, ListChildComponentProps } from \"react-window\";\nimport _AutoSizer, {\n Props as AutoSizerProps,\n Size as AutoSizerSize,\n} from \"react-virtualized-auto-sizer\";\nimport { useTranslation } from \"react-i18next\";\n\n// This is required to get around a react-types issue for \"AutoSizer is not a valid JSX element.\"\n// @see https://github.com/bvaughn/react-virtualized/issues/1739#issuecomment-1291444246\nconst AutoSizer = _AutoSizer as unknown as FC<AutoSizerProps>;\n\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\n\nexport type AutocompleteProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"defaultValue\"];\n /**\n * Enables multiple choice selection\n */\n hasMultipleChoices?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"multiple\"];\n /**\n * The value for the input\n */\n inputValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"inputValue\"];\n /**\n * Allows the input of custom values\n */\n isCustomValueAllowed?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"freeSolo\"];\n /**\n * Disables the Autocomplete input\n */\n isDisabled?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"disabled\"];\n /**\n * Displays a loading indicator\n */\n isLoading?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"loading\"];\n /**\n * Makes the Autocomplete input read-only\n */\n isReadOnly?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"readOnly\"];\n /**\n * The label text for the autocomplete input\n */\n label: string;\n /**\n * The text to display when no options are available\n *\n * default: \"No Options\"\n */\n noOptionsText?: string;\n /**\n * Callback fired when the autocomplete loses focus.\n */\n onBlur?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onBlur\"];\n /**\n * Callback fired when a selection is made.\n */\n onChange?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"];\n /**\n * Callback fired when the textbox receives typed characters.\n */\n onInputChange?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"];\n /**\n * Callback fired when the autocomplete gains focus.\n */\n onFocus?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onFocus\"];\n /**\n * The options for the Autocomplete input\n */\n options: ReadonlyArray<OptionType>;\n /**\n * The value of the Autocomplete input\n */\n value?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"value\"];\n\n /**\n * Used to determine if the option represents the given value. Uses strict equality by default if none provided.\n * Both arguments need to be handled, an option can only match with one value.\n * option: the option to test\n * value: the value to test against\n *\n * You will need to implement this function if your `option` items are objects.\n */\n getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;\n\n /**\n * If this component is required to display a virtualized list of options,\n * then this value needs to be set to true.\n * It is recommended if you're options are on the order of 10's of hundreds or more.\n */\n isVirtualized?: boolean;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\nconst ListboxContainer = styled.div`\n width: 100%;\n height: 100%;\n`;\n\nconst Autocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized: isVirtualizedProp = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n noOptionsText,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n getIsOptionEqualToValue,\n testId,\n translate,\n}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const { t } = useTranslation();\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n\n const isVirtualized = useRef(Boolean(isVirtualizedProp));\n const defaultValueProp = useMemo<\n | AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >\n | undefined\n >(() => {\n if (hasMultipleChoices) {\n if (value === undefined) {\n return defaultValue;\n }\n return [] as AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >;\n }\n return value === undefined ? defaultValue : undefined;\n }, [defaultValue, hasMultipleChoices, value]);\n\n const valueProps = useInputValues({\n defaultValue: defaultValueProp,\n value: value,\n controlState: controlledStateRef.current,\n });\n\n const inputValueProp = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { inputValue };\n }\n return undefined;\n }, [inputValue]);\n\n const renderInput = useCallback(\n ({\n InputLabelProps,\n InputProps,\n ...params\n }: AutocompleteRenderInputParams) => (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n //@ts-expect-error htmlFor does not exist ont he InputLabelProps for autocomplete\n id={InputLabelProps.htmlFor}\n isFullWidth={isFullWidth}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n label={label}\n isOptional={isOptional}\n renderFieldComponent={({\n ariaDescribedBy,\n id,\n errorMessageElementId,\n labelElementId,\n }) => (\n <InputBase\n {...params}\n {...InputProps}\n inputProps={{\n ...params.inputProps,\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n }}\n aria-describedby={ariaDescribedBy}\n id={id}\n name={nameOverride ?? id}\n required={!isOptional}\n />\n )}\n />\n ),\n [\n ariaDescribedBy,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n isFullWidth,\n isOptional,\n label,\n nameOverride,\n testId,\n ],\n );\n\n const renderVirtualizedRow = ({\n data,\n index,\n style,\n }: ListChildComponentProps) => {\n const baseOption = data[index];\n /**\n * react-window calculates the absolute positions of the list items, via an inline style, so\n * we need to add it to each list item that is being rendered in the viewable list window.\n * See here if you need to know more: https://github.com/bvaughn/react-window?tab=readme-ov-file#why-is-my-list-blank-when-i-scroll\n */\n const optionItem = { ...baseOption, props: { ...baseOption.props, style } };\n return optionItem;\n };\n\n const OuterListboxContext = createContext({});\n\n const OuterListboxElementType = forwardRef<HTMLDivElement>((props, ref) => {\n const outerProps = useContext(OuterListboxContext);\n return <div ref={ref} {...props} {...outerProps} />;\n });\n\n function useResetCache(length: number) {\n const ref = useRef<VariableSizeList>(null);\n useEffect(() => {\n if (ref.current) {\n ref.current.resetAfterIndex(0, true);\n }\n }, [length]);\n return ref;\n }\n\n const ListboxComponent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLElement>\n >(function (props, ref) {\n const { children, ...other } = props;\n const itemData: ReactElement[] = (children as ReactElement[]).flatMap(\n (item: ReactElement & { children?: ReactElement[] }) =>\n [item].concat(item.children || []),\n );\n\n // the height of an Odyssey autocomplete option item that is used to calculate height of window\n const optionHeight = 45; //px\n\n // The number of items (rows or columns) to render outside of the visible area for performance and scrolling reasons\n const overscanRowCount = 8;\n\n const itemSize = useCallback(() => optionHeight, []);\n\n const gridRef = useResetCache(itemData.length);\n\n const renderWindow = useCallback(\n ({ height, width }: AutoSizerSize) => (\n <VariableSizeList\n innerElementType=\"ul\"\n itemData={itemData}\n itemCount={itemData.length}\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n itemSize={itemSize}\n height={height}\n width={width}\n ref={gridRef}\n outerElementType={OuterListboxElementType}\n overscanCount={overscanRowCount}\n >\n {renderVirtualizedRow}\n </VariableSizeList>\n ),\n [itemData, gridRef, itemSize],\n );\n\n return (\n <ListboxContainer ref={ref}>\n <OuterListboxContext.Provider value={other}>\n <AutoSizer>{renderWindow}</AutoSizer>\n </OuterListboxContext.Provider>\n </ListboxContainer>\n );\n });\n\n const onChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"]\n >\n >(\n (event, value, reason, details) => {\n onChangeProp?.(event, value, reason, details);\n },\n [onChangeProp],\n );\n\n const onInputChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"]\n >\n >(\n (event, value, reason) => {\n onInputChangeProp?.(event, value, reason);\n },\n [onInputChangeProp],\n );\n\n return (\n <MuiAutocomplete\n {...valueProps}\n {...inputValueProp}\n // conditionally provide the ListboxComponent if this needs to be virtualized\n {...(isVirtualized.current && { ListboxComponent })}\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n clearText={t(\"clear.text\")}\n closeText={t(\"close.text\")}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n id={idOverride}\n fullWidth={isFullWidth}\n loading={isLoading}\n multiple={hasMultipleChoices}\n noOptionsText={noOptionsText}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n openText={t(\"open.text\")}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n isOptionEqualToValue={getIsOptionEqualToValue}\n translate={translate}\n />\n );\n};\n\n// Need the `typeof Autocomplete` because generics don't get passed through\nconst MemoizedAutocomplete = memo(Autocomplete) as typeof Autocomplete;\n// @ts-expect-error displayName is expected to not be on `typeof Autocomplete`\nMemoizedAutocomplete.displayName = \"Autocomplete\";\n\nexport { MemoizedAutocomplete as Autocomplete };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA,SACEA,aAAa,EAEbC,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,QACD,OAAO;AACd,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,gBAAgB,QAAiC,cAAc;AACxE,OAAOC,UAAU,MAGV,8BAA8B;AACrC,SAASC,cAAc,QAAQ,eAAe;AAI9C,MAAMC,SAAS,GAAGF,UAA2C;AAAC,SAErDG,KAAK;AAAA,SAIZC,wBAAwB,EACxBC,cAAc,EACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAgKjB,MAAMC,gBAAgB,GAAGX,MAAM,CAACY,GAAI;AACpC;AACA;AACA,CAAC;AAED,MAAMC,YAAY,GAAGA,CAInB;EACAC,eAAe;EACfC,YAAY;EACZC,YAAY;EACZC,gBAAgB;EAChBC,kBAAkB;EAClBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,oBAAoB;EACpBC,UAAU;EACVC,WAAW,GAAG,KAAK;EACnBC,SAAS;EACTC,UAAU,GAAG,KAAK;EAClBC,UAAU;EACVC,aAAa,EAAEC,iBAAiB,GAAG,KAAK;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9D,CAAC,CAAC,YAAY,CAAE;IAC3B+D,SAAS,EAAE/D,CAAC,CAAC,YAAY,CAAE;IAC3BgE,oBAAoB,EAAE7F,kBAAmB;IACzC8F,QAAQ,EAAEzF,UAAW;IACrB0F,QAAQ,EAAE3F,oBAAqB;IAC/B4F,qBAAqB,EAAE,IAAK;IAC5B/F,EAAE,EAAEC,UAAW;IACf+F,SAAS,EAAE3F,WAAY;IACvB4F,OAAO,EAAE3F,SAAU;IACnB4F,QAAQ,EAAEnG,kBAAmB;IAC7BiB,aAAa,EAAEA,aAAc;IAC7BC,MAAM,EAAEA,MAAO;IACfC,QAAQ,EAAEA,QAAS;IACnBE,aAAa,EAAEA,aAAc;IAC7BE,OAAO,EAAEA,OAAQ;IACjB6E,QAAQ,EAAEvE,CAAC,CAAC,WAAW,CAAE;IACzBL,OAAO,EAAEA,OAAQ;IACjB6E,QAAQ,EAAE5F,UAAW;IACrBgC,WAAW,EAAEA,WAAY;IACzB6D,oBAAoB,EAAE5E,uBAAwB;IAC9CE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAGD,MAAM2E,oBAAoB,GAAG/H,IAAI,CAACmB,YAAY,CAAwB;AAEtE4G,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAI5G,YAAY"}
1
+ {"version":3,"file":"Autocomplete.js","names":["createContext","forwardRef","memo","useCallback","useContext","useEffect","useMemo","useRef","useState","styled","VariableSizeList","useTranslation","Field","ComponentControlledState","useInputValues","getControlState","jsx","_jsx","createElement","_createElement","AutocompleteTestSelector","accessibleText","errorMessage","hint","label","children","list","listItem","elementSelector","method","options","role","isControlledElement","ListboxContainer","div","Autocomplete","ariaDescribedBy","defaultValue","errorMessageList","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","isVirtualizedProp","HintLinkComponent","name","nameOverride","noOptionsText","onBlur","onChange","onChangeProp","onInputChange","onInputChangeProp","onFocus","value","getIsOptionEqualToValue","testId","translate","t","controlledStateRef","controlledValue","uncontrolledValue","Boolean","defaultValueProp","undefined","valueProps","controlState","current","inputValueProp","CONTROLLED","renderInput","InputLabelProps","InputProps","params","fieldType","hasVisibleLabel","htmlFor","renderFieldComponent","errorMessageElementId","labelElementId","_InputBase","inputProps","required","Row","data","index","setItemSize","style","rowRef","firstChild","firstElementChild","height","clientHeight","baseOption","key","props","styles","ref","OuterListboxContext","OuterListboxElementType","outerProps","useResetCache","length","resetCacheRef","resetAfterIndex","ListboxComponent","listHeight","setListHeight","other","itemData","flatMap","item","concat","sizeMap","getListBoxHeight","COMBINED_LISTBOX_PADDING","OVERSCAN_ROW_COUNT","itemsHeightCalculated","map","_","reduce","prevItemHeight","nextItemHeight","gridRef","size","getItemSize","Provider","innerElementType","itemCount","itemSize","width","outerElementType","overscanCount","event","reason","details","_Autocomplete","clearText","closeText","disableCloseOnSelect","disabled","freeSolo","filterSelectedOptions","fullWidth","loading","multiple","openText","readOnly","isOptionEqualToValue","MemoizedAutocomplete","displayName"],"sources":["../src/Autocomplete.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n InputBase,\n UseAutocompleteProps,\n AutocompleteValue,\n AutocompleteRenderInputParams,\n} from \"@mui/material\";\nimport {\n createContext,\n forwardRef,\n HTMLAttributes,\n memo,\n ReactElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport styled from \"@emotion/styled\";\nimport { VariableSizeList, ListChildComponentProps } from \"react-window\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Field } from \"./Field\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n useInputValues,\n getControlState,\n} from \"./inputUtils\";\nimport { TestSelector } from \"./test-selectors\";\n\nexport const AutocompleteTestSelector = {\n accessibleText: {\n errorMessage: \"errorMessage\",\n hint: \"description\",\n label: \"label\",\n },\n children: {\n list: {\n children: {\n listItem: {\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"option\",\n },\n },\n },\n isControlledElement: true,\n },\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n label: \"name\",\n },\n role: \"combobox\",\n },\n} as const satisfies TestSelector;\n\ntype SetItemSize = (size: number) => void;\n\nexport type AutocompleteProps<\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n> = {\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"defaultValue\"];\n /**\n * Enables multiple choice selection\n */\n hasMultipleChoices?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"multiple\"];\n /**\n * The value for the input\n */\n inputValue?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"inputValue\"];\n /**\n * Allows the input of custom values\n */\n isCustomValueAllowed?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"freeSolo\"];\n /**\n * Disables the Autocomplete input\n */\n isDisabled?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"disabled\"];\n /**\n * Displays a loading indicator\n */\n isLoading?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"loading\"];\n /**\n * Makes the Autocomplete input read-only\n */\n isReadOnly?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"readOnly\"];\n /**\n * The label text for the autocomplete input\n */\n label: string;\n /**\n * The text to display when no options are available\n *\n * default: \"No Options\"\n */\n noOptionsText?: string;\n /**\n * Callback fired when the autocomplete loses focus.\n */\n onBlur?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onBlur\"];\n /**\n * Callback fired when a selection is made.\n */\n onChange?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"];\n /**\n * Callback fired when the textbox receives typed characters.\n */\n onInputChange?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"];\n /**\n * Callback fired when the autocomplete gains focus.\n */\n onFocus?: MuiAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onFocus\"];\n /**\n * The options for the Autocomplete input\n */\n options: ReadonlyArray<OptionType>;\n /**\n * The value of the Autocomplete input\n */\n value?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"value\"];\n\n /**\n * Used to determine if the option represents the given value. Uses strict equality by default if none provided.\n * Both arguments need to be handled, an option can only match with one value.\n * option: the option to test\n * value: the value to test against\n *\n * You will need to implement this function if your `option` items are objects.\n */\n getIsOptionEqualToValue?: (option: OptionType, value: OptionType) => boolean;\n\n /**\n * If this component is required to display a virtualized list of options,\n * then this value needs to be set to true.\n * It is recommended if you're options are on the order of 10's of hundreds or more.\n */\n isVirtualized?: boolean;\n} & Pick<\n FieldComponentProps,\n | \"errorMessage\"\n | \"errorMessageList\"\n | \"hint\"\n | \"HintLinkComponent\"\n | \"id\"\n | \"isFullWidth\"\n | \"isOptional\"\n | \"name\"\n> &\n Pick<HtmlProps, \"ariaDescribedBy\" | \"testId\" | \"translate\">;\n\nconst ListboxContainer = styled.div`\n width: 100%;\n height: 100%;\n`;\n\nconst Autocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized: isVirtualizedProp = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n noOptionsText,\n onBlur,\n onChange: onChangeProp,\n onInputChange: onInputChangeProp,\n onFocus,\n options,\n value,\n getIsOptionEqualToValue,\n testId,\n translate,\n}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const { t } = useTranslation();\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: value,\n uncontrolledValue: defaultValue,\n }),\n );\n\n const isVirtualized = useRef(Boolean(isVirtualizedProp));\n\n const defaultValueProp = useMemo<\n | AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >\n | undefined\n >(() => {\n if (hasMultipleChoices) {\n if (value === undefined) {\n return defaultValue;\n }\n return [] as AutocompleteValue<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >;\n }\n return value === undefined ? defaultValue : undefined;\n }, [defaultValue, hasMultipleChoices, value]);\n\n const valueProps = useInputValues({\n defaultValue: defaultValueProp,\n value: value,\n controlState: controlledStateRef.current,\n });\n\n const inputValueProp = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { inputValue };\n }\n return undefined;\n }, [inputValue]);\n\n const renderInput = useCallback(\n ({\n InputLabelProps,\n InputProps,\n ...params\n }: AutocompleteRenderInputParams) => (\n <Field\n ariaDescribedBy={ariaDescribedBy}\n errorMessage={errorMessage}\n errorMessageList={errorMessageList}\n fieldType=\"single\"\n hasVisibleLabel\n //@ts-expect-error htmlFor does not exist ont he InputLabelProps for autocomplete\n id={InputLabelProps.htmlFor}\n isFullWidth={isFullWidth}\n hint={hint}\n HintLinkComponent={HintLinkComponent}\n label={label}\n isOptional={isOptional}\n renderFieldComponent={({\n ariaDescribedBy,\n id,\n errorMessageElementId,\n labelElementId,\n }) => (\n <InputBase\n {...params}\n {...InputProps}\n inputProps={{\n ...params.inputProps,\n \"aria-errormessage\": errorMessageElementId,\n \"aria-labelledby\": labelElementId,\n \"data-se\": testId,\n }}\n aria-describedby={ariaDescribedBy}\n id={id}\n name={nameOverride ?? id}\n required={!isOptional}\n />\n )}\n />\n ),\n [\n ariaDescribedBy,\n errorMessage,\n errorMessageList,\n hint,\n HintLinkComponent,\n isFullWidth,\n isOptional,\n label,\n nameOverride,\n testId,\n ],\n );\n\n const Row = ({\n data,\n index,\n setItemSize,\n style,\n }: ListChildComponentProps & { setItemSize: SetItemSize }) => {\n const rowRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (rowRef.current) {\n /**\n * Checking for child height to workaround a bug where the clientHeight of the row isn't updated correctly\n * @see here if you need to know more: https://github.com/bvaughn/react-window/issues/582#issuecomment-1883074908\n */\n const firstChild = rowRef.current.firstElementChild;\n const height = firstChild\n ? firstChild.clientHeight\n : rowRef.current.clientHeight;\n\n setItemSize(height);\n }\n }, [index, rowRef, setItemSize]);\n\n const baseOption = data[index];\n const { key, props } = baseOption;\n\n /**\n * react-window calculates the absolute positions of the list items, via an inline style, so\n * we need to add it to each list item that is being rendered in the viewable list window.\n * @see here if you need to know more: https://github.com/bvaughn/react-window?tab=readme-ov-file#why-is-my-list-blank-when-i-scroll\n */\n const styles = useMemo(\n () => ({\n ...style,\n height: \"auto\",\n }),\n [style],\n );\n\n return (\n <div ref={rowRef}>\n <li {...props} key={key} style={styles} />\n </div>\n );\n };\n\n const OuterListboxContext = createContext({});\n\n const OuterListboxElementType = forwardRef<HTMLDivElement>((props, ref) => {\n const outerProps = useContext(OuterListboxContext);\n return <div ref={ref} {...props} {...outerProps} />;\n });\n\n const useResetCache = (length: number) => {\n const resetCacheRef = useRef<VariableSizeList>(null);\n useEffect(() => {\n if (resetCacheRef.current) {\n resetCacheRef.current.resetAfterIndex(0, true);\n }\n }, [length]);\n return resetCacheRef;\n };\n\n const ListboxComponent = forwardRef<\n HTMLDivElement,\n HTMLAttributes<HTMLElement>\n >(function (props, ref) {\n const [listHeight, setListHeight] = useState(0);\n\n const { children, ...other } = props;\n const itemData: ReactElement[] = (children as ReactElement[]).flatMap(\n (item: ReactElement & { children?: ReactElement[] }) =>\n [item].concat(item.children || []),\n );\n\n const sizeMap = useRef<number[]>([]);\n\n const getListBoxHeight = useCallback(() => {\n // 8px of padding top/bottom applied by MUI\n const COMBINED_LISTBOX_PADDING = 16;\n\n if (itemData.length > OVERSCAN_ROW_COUNT) {\n // has a max-height of 40vh set in CSS. This is only set because height needs to be a number\n return 99999;\n } else {\n const itemsHeightCalculated = itemData\n .map((_, index) => sizeMap.current[index] || 0)\n .reduce(\n (prevItemHeight, nextItemHeight) => prevItemHeight + nextItemHeight,\n 0,\n );\n return COMBINED_LISTBOX_PADDING + itemsHeightCalculated;\n }\n }, [itemData, sizeMap]);\n\n useEffect(() => {\n if (sizeMap.current.length && itemData.length) {\n setListHeight(getListBoxHeight());\n }\n }, [getListBoxHeight, itemData, sizeMap]);\n\n // The number of items (rows or columns) to render outside of the visible area for performance and scrolling reasons\n const OVERSCAN_ROW_COUNT = 8;\n\n const gridRef = useResetCache(itemData.length);\n\n const setItemSize = useCallback<SetItemSize>(\n (size) => {\n gridRef?.current?.resetAfterIndex(0, true);\n sizeMap.current = sizeMap.current.concat(size);\n },\n [gridRef, sizeMap],\n );\n const getItemSize = useCallback(\n // using 45px as a sane default here to avoid a lot of content shift on repaint\n (index: number) => sizeMap.current[index] || 45,\n [sizeMap],\n );\n\n return (\n <ListboxContainer ref={ref}>\n <OuterListboxContext.Provider value={other}>\n <VariableSizeList\n innerElementType=\"ul\"\n itemData={itemData}\n itemCount={itemData.length}\n itemSize={getItemSize}\n height={listHeight}\n width=\"100%\"\n ref={gridRef}\n outerElementType={OuterListboxElementType}\n overscanCount={OVERSCAN_ROW_COUNT}\n >\n {({ data, index, style }) => (\n <Row\n data={data}\n index={index}\n style={style}\n setItemSize={setItemSize}\n />\n )}\n </VariableSizeList>\n </OuterListboxContext.Provider>\n </ListboxContainer>\n );\n });\n\n const onChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onChange\"]\n >\n >(\n (event, value, reason, details) => {\n onChangeProp?.(event, value, reason, details);\n },\n [onChangeProp],\n );\n\n const onInputChange = useCallback<\n NonNullable<\n UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"onInputChange\"]\n >\n >(\n (event, value, reason) => {\n onInputChangeProp?.(event, value, reason);\n },\n [onInputChangeProp],\n );\n\n return (\n <MuiAutocomplete\n {...valueProps}\n {...inputValueProp}\n // conditionally provide the ListboxComponent if this needs to be virtualized\n {...(isVirtualized.current && {\n ListboxComponent,\n })}\n // AutoComplete is wrapped in a div within MUI which does not get the disabled attr. So this aria-disabled gets set in the div\n aria-disabled={isDisabled}\n clearText={t(\"clear.text\")}\n closeText={t(\"close.text\")}\n disableCloseOnSelect={hasMultipleChoices}\n disabled={isDisabled}\n freeSolo={isCustomValueAllowed}\n filterSelectedOptions={true}\n id={idOverride}\n fullWidth={isFullWidth}\n loading={isLoading}\n multiple={hasMultipleChoices}\n noOptionsText={noOptionsText}\n onBlur={onBlur}\n onChange={onChange}\n onInputChange={onInputChange}\n onFocus={onFocus}\n openText={t(\"open.text\")}\n options={options}\n readOnly={isReadOnly}\n renderInput={renderInput}\n isOptionEqualToValue={getIsOptionEqualToValue}\n translate={translate}\n />\n );\n};\n\n// Need the `typeof Autocomplete` because generics don't get passed through\nconst MemoizedAutocomplete = memo(Autocomplete) as typeof Autocomplete;\n// @ts-expect-error displayName is expected to not be on `typeof Autocomplete`\nMemoizedAutocomplete.displayName = \"Autocomplete\";\n\nexport { MemoizedAutocomplete as Autocomplete };\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAUA,SACEA,aAAa,EACbC,UAAU,EAEVC,IAAI,EAEJC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,gBAAgB,QAAiC,cAAc;AACxE,SAASC,cAAc,QAAQ,eAAe;AAAC,SAEtCC,KAAK;AAAA,SAIZC,wBAAwB,EACxBC,cAAc,EACdC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,aAAA,IAAAC,cAAA;AAIjB,OAAO,MAAMC,wBAAwB,GAAG;EACtCC,cAAc,EAAE;IACdC,YAAY,EAAE,cAAc;IAC5BC,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAE;EACT,CAAC;EACDC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJD,QAAQ,EAAE;QACRE,QAAQ,EAAE;UACRC,eAAe,EAAE;YACfC,MAAM,EAAE,QAAQ;YAChBC,OAAO,EAAE;cACPN,KAAK,EAAE;YACT,CAAC;YACDO,IAAI,EAAE;UACR;QACF;MACF,CAAC;MACDC,mBAAmB,EAAE;IACvB;EACF,CAAC;EACDJ,eAAe,EAAE;IACfC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE;MACPN,KAAK,EAAE;IACT,CAAC;IACDO,IAAI,EAAE;EACR;AACF,CAAiC;AAiKjC,MAAME,gBAAgB,GAAGxB,MAAM,CAACyB,GAAI;AACpC;AACA;AACA,CAAC;AAED,MAA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EAAEA,QAAS;IACnBE,aAAa,EAAEA,aAAc;IAC7BE,OAAO,EAAEA,OAAQ;IACjB6F,QAAQ,EAAExF,CAAC,CAAC,WAAW,CAAE;IACzBnC,OAAO,EAAEA,OAAQ;IACjB4H,QAAQ,EAAE1G,UAAW;IACrB6B,WAAW,EAAEA,WAAY;IACzB8E,oBAAoB,EAAE7F,uBAAwB;IAC9CE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAGD,MAAM4F,oBAAoB,GAAG1J,IAAI,CAACiC,YAAY,CAAwB;AAEtEyH,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIzH,YAAY"}
package/dist/Callout.js CHANGED
@@ -22,40 +22,28 @@ import { Paragraph } from "./Typography.js";
22
22
  import { useUniqueId } from "./useUniqueId.js";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  import { jsxs as _jsxs } from "react/jsx-runtime";
25
- export const CalloutTestSelectors = {
26
- feature: {
25
+ export const CalloutTestSelector = {
26
+ accessibleText: {
27
+ text: "description",
28
+ title: "label"
29
+ },
30
+ children: {
27
31
  link: {
28
- selector: {
32
+ elementSelector: {
29
33
  method: "ByRole",
30
34
  options: {
31
- name: "${linkText}"
35
+ linkText: "name"
32
36
  },
33
- role: "link",
34
- templateVariableNames: ["linkText"]
35
- }
36
- },
37
- text: {
38
- selector: {
39
- method: "ByText",
40
- templateVariableNames: ["text"],
41
- text: "${text}"
42
- }
43
- },
44
- title: {
45
- selector: {
46
- method: "ByText",
47
- templateVariableNames: ["title"],
48
- text: "${title}"
37
+ role: "link"
49
38
  }
50
39
  }
51
40
  },
52
- selector: {
41
+ elementSelector: {
53
42
  method: "ByRole",
54
43
  options: {
55
- name: "${title}"
44
+ title: "name"
56
45
  },
57
- role: "${role}",
58
- templateVariableNames: ["role", "title"]
46
+ role: ["alert", "status"]
59
47
  }
60
48
  };
61
49
  export const calloutRoleValues = ["status", "alert"];
@@ -1 +1 @@
1
- {"version":3,"file":"Callout.js","names":["styled","memo","useTranslation","useOdysseyDesignTokens","Paragraph","useUniqueId","jsx","_jsx","jsxs","_jsxs","CalloutTestSelectors","feature","link","selector","method","options","name","role","templateVariableNames","text","title","calloutRoleValues","calloutSeverityValues","ContentContainer","shouldForwardProp","prop","odysseyDesignTokens","marginBlockStart","Spacing4","Callout","children","linkText","linkUrl","severity","testId","translate","t","titleId","_Alert","variant","_AlertTitle","id","_Box","component","_Link","href","MemoizedCallout","displayName"],"sources":["../src/Callout.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { Alert, AlertTitle, Box, Link as MuiLink } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { type FeatureTestSelector } from \"./test-selectors\";\nimport { Paragraph } from \"./Typography\";\nimport { useUniqueId } from \"./useUniqueId\";\n\nexport const CalloutTestSelectors = {\n feature: {\n link: {\n selector: {\n method: \"ByRole\",\n options: {\n name: \"${linkText}\",\n },\n role: \"link\",\n templateVariableNames: [\"linkText\"],\n },\n },\n text: {\n selector: {\n method: \"ByText\",\n templateVariableNames: [\"text\"],\n text: \"${text}\",\n },\n },\n title: {\n selector: {\n method: \"ByText\",\n templateVariableNames: [\"title\"],\n text: \"${title}\",\n },\n },\n },\n selector: {\n method: \"ByRole\",\n options: {\n name: \"${title}\",\n },\n role: \"${role}\",\n templateVariableNames: [\"role\", \"title\"],\n },\n} as const satisfies FeatureTestSelector;\n\nexport const calloutRoleValues = [\"status\", \"alert\"] as const;\nexport const calloutSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type CalloutProps = {\n /**\n * Used to optionally pass a text list to the component\n */\n children?: ReactNode;\n /**\n * Sets the ARIA role of the Callout\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof calloutRoleValues)[number];\n /**\n * Determine the color and icon of the Callout\n */\n severity: (typeof calloutSeverityValues)[number];\n /**\n * The text content of the Callout\n */\n text?: string;\n /**\n * The title of the Callout\n */\n title?: string;\n} & (\n | {\n children?: never;\n text: string;\n }\n | {\n children: ReactNode;\n text?: never;\n }\n) &\n (\n | {\n /**\n * If linkUrl is not undefined, this is the text of the link.\n * If left blank, it defaults to \"Learn more\".\n * Note that linkText does nothing if linkUrl is not defined\n */\n linkUrl: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkText: string;\n }\n | {\n linkUrl?: never;\n linkText?: never;\n }\n ) &\n Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst ContentContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({\n \"& > * + *\": {\n marginBlockStart: odysseyDesignTokens.Spacing4,\n },\n}));\n\nconst Callout = ({\n children,\n linkText,\n linkUrl,\n role,\n severity,\n testId,\n text,\n title,\n translate,\n}: CalloutProps) => {\n const { t } = useTranslation();\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const titleId = useUniqueId();\n\n return (\n <Alert\n aria-label={t(`severity.${severity}`)}\n aria-labelledby={titleId}\n data-se={testId}\n role={role}\n severity={severity}\n variant=\"callout\"\n >\n {title && (\n <AlertTitle aria-hidden id={titleId} translate={translate}>\n {title}\n </AlertTitle>\n )}\n\n <ContentContainer odysseyDesignTokens={odysseyDesignTokens}>\n {children && <Box component=\"div\">{children}</Box>}\n {text && <Paragraph>{text}</Paragraph>}\n {linkUrl && (\n <Box>\n <MuiLink href={linkUrl} variant=\"monochrome\">\n {linkText}\n </MuiLink>\n </Box>\n )}\n </ContentContainer>\n </Alert>\n );\n};\n\nconst MemoizedCallout = memo(Callout);\nMemoizedCallout.displayName = \"Callout\";\n\nexport { MemoizedCallout as Callout };\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SAASC,IAAI,QAAmB,OAAO;AACvC,SAASC,cAAc,QAAQ,eAAe;AAAC,SAK7CC,sBAAsB;AAAA,SAGfC,SAAS;AAAA,SACTC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEpB,OAAO,MAAMC,oBAAoB,GAAG;EAClCC,OAAO,EAAE;IACPC,IAAI,EAAE;MACJC,QAAQ,EAAE;QACRC,MAAM,EAAE,QAAQ;QAChBC,OAAO,EAAE;UACPC,IAAI,EAAE;QACR,CAAC;QACDC,IAAI,EAAE,MAAM;QACZC,qBAAqB,EAAE,CAAC,UAAU;MACpC;IACF,CAAC;IACDC,IAAI,EAAE;MACJN,QAAQ,EAAE;QACRC,MAAM,EAAE,QAAQ;QAChBI,qBAAqB,EAAE,CAAC,MAAM,CAAC;QAC/BC,IAAI,EAAE;MACR;IACF,CAAC;IACDC,KAAK,EAAE;MACLP,QAAQ,EAAE;QACRC,MAAM,EAAE,QAAQ;QAChBI,qBAAqB,EAAE,CAAC,OAAO,CAAC;QAChCC,IAAI,EAAE;MACR;IACF;EACF,CAAC;EACDN,QAAQ,EAAE;IACRC,MAAM,EAAE,QAAQ;IAChBC,OAAO,EAAE;MACPC,IAAI,EAAE;IACR,CAAC;IACDC,IAAI,EAAE,SAAS;IACfC,qBAAqB,EAAE,CAAC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EAAC,KAAK;QAAAb,QAAA,EAAEA;MAAQ,CAAM,CAAC,EACjDX,IAAI,IAAIZ,IAAA,CAACH,SAAS;QAAA0B,QAAA,EAAEX;MAAI,CAAY,CAAC,EACrCa,OAAO,IACNzB,IAAA,CAAAmC,IAAA;QAAAZ,QAAA,EACEvB,IAAA,CAAAqC,KAAA;UAASC,IAAI,EAAEb,OAAQ;UAACO,OAAO,EAAC,YAAY;UAAAT,QAAA,EACzCC;QAAQ,CACF;MAAC,CACP,CACN;IAAA,CACe,CAAC;EAAA,CACd,CAAC;AAEZ,CAAC;AAED,MAAMe,eAAe,GAAG7C,IAAI,CAAC4B,OAAO,CAAC;AACrCiB,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIjB,OAAO"}
1
+ {"version":3,"file":"Callout.js","names":["styled","memo","useTranslation","useOdysseyDesignTokens","Paragraph","useUniqueId","jsx","_jsx","jsxs","_jsxs","CalloutTestSelector","accessibleText","text","title","children","link","elementSelector","method","options","linkText","role","calloutRoleValues","calloutSeverityValues","ContentContainer","shouldForwardProp","prop","odysseyDesignTokens","marginBlockStart","Spacing4","Callout","linkUrl","severity","testId","translate","t","titleId","_Alert","variant","_AlertTitle","id","_Box","component","_Link","href","MemoizedCallout","displayName"],"sources":["../src/Callout.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { Alert, AlertTitle, Box, Link as MuiLink } from \"@mui/material\";\nimport { memo, ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { type TestSelector } from \"./test-selectors\";\nimport { Paragraph } from \"./Typography\";\nimport { useUniqueId } from \"./useUniqueId\";\n\nexport const CalloutTestSelector = {\n accessibleText: {\n text: \"description\",\n title: \"label\",\n },\n children: {\n link: {\n elementSelector: {\n method: \"ByRole\",\n options: {\n linkText: \"name\",\n },\n role: \"link\",\n },\n },\n },\n elementSelector: {\n method: \"ByRole\",\n options: {\n title: \"name\",\n },\n role: [\"alert\", \"status\"],\n },\n} as const satisfies TestSelector;\n\nexport const calloutRoleValues = [\"status\", \"alert\"] as const;\nexport const calloutSeverityValues = [\n \"success\",\n \"info\",\n \"warning\",\n \"error\",\n] as const;\n\nexport type CalloutProps = {\n /**\n * Used to optionally pass a text list to the component\n */\n children?: ReactNode;\n /**\n * Sets the ARIA role of the Callout\n * (\"status\" for something that dynamically updates, \"alert\" for errors, null for something\n * unchanging)\n */\n role?: (typeof calloutRoleValues)[number];\n /**\n * Determine the color and icon of the Callout\n */\n severity: (typeof calloutSeverityValues)[number];\n /**\n * The text content of the Callout\n */\n text?: string;\n /**\n * The title of the Callout\n */\n title?: string;\n} & (\n | {\n children?: never;\n text: string;\n }\n | {\n children: ReactNode;\n text?: never;\n }\n) &\n (\n | {\n /**\n * If linkUrl is not undefined, this is the text of the link.\n * If left blank, it defaults to \"Learn more\".\n * Note that linkText does nothing if linkUrl is not defined\n */\n linkUrl: string;\n /**\n * If defined, the Toast will include a link to the URL\n */\n linkText: string;\n }\n | {\n linkUrl?: never;\n linkText?: never;\n }\n ) &\n Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst ContentContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({\n \"& > * + *\": {\n marginBlockStart: odysseyDesignTokens.Spacing4,\n },\n}));\n\nconst Callout = ({\n children,\n linkText,\n linkUrl,\n role,\n severity,\n testId,\n text,\n title,\n translate,\n}: CalloutProps) => {\n const { t } = useTranslation();\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const titleId = useUniqueId();\n\n return (\n <Alert\n aria-label={t(`severity.${severity}`)}\n aria-labelledby={titleId}\n data-se={testId}\n role={role}\n severity={severity}\n variant=\"callout\"\n >\n {title && (\n <AlertTitle aria-hidden id={titleId} translate={translate}>\n {title}\n </AlertTitle>\n )}\n\n <ContentContainer odysseyDesignTokens={odysseyDesignTokens}>\n {children && <Box component=\"div\">{children}</Box>}\n {text && <Paragraph>{text}</Paragraph>}\n {linkUrl && (\n <Box>\n <MuiLink href={linkUrl} variant=\"monochrome\">\n {linkText}\n </MuiLink>\n </Box>\n )}\n </ContentContainer>\n </Alert>\n );\n};\n\nconst MemoizedCallout = memo(Callout);\nMemoizedCallout.displayName = \"Callout\";\n\nexport { MemoizedCallout as Callout };\n"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAEpC,SAASC,IAAI,QAAmB,OAAO;AACvC,SAASC,cAAc,QAAQ,eAAe;AAAC,SAK7CC,sBAAsB;AAAA,SAGfC,SAAS;AAAA,SACTC,WAAW;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEpB,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,cAAc,EAAE;IACdC,IAAI,EAAE,aAAa;IACnBC,KAAK,EAAE;EACT,CAAC;EACDC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJC,eAAe,EAAE;QACfC,MAAM,EAAE,QAAQ;QAChBC,OAAO,EAAE;UACPC,QAAQ,EAAE;QACZ,CAAC;QACDC,IAAI,EAAE;MACR;IACF;EACF,CAAC;EACDJ,eAAe,EAAE;IACfC,MAAM,EAAE,QAAQ;IACh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oB;MAAAZ,QAAA,GACxDA,QAAQ,IAAIP,IAAA,CAAAiC,IAAA;QAAKC,SAAS,EAAC,KAAK;QAAA3B,QAAA,EAAEA;MAAQ,CAAM,CAAC,EACjDF,IAAI,IAAIL,IAAA,CAACH,SAAS;QAAAU,QAAA,EAAEF;MAAI,CAAY,CAAC,EACrCkB,OAAO,IACNvB,IAAA,CAAAiC,IAAA;QAAA1B,QAAA,EACEP,IAAA,CAAAmC,KAAA;UAASC,IAAI,EAAEb,OAAQ;UAACO,OAAO,EAAC,YAAY;UAAAvB,QAAA,EACzCK;QAAQ,CACF;MAAC,CACP,CACN;IAAA,CACe,CAAC;EAAA,CACd,CAAC;AAEZ,CAAC;AAED,MAAMyB,eAAe,GAAG3C,IAAI,CAAC4B,OAAO,CAAC;AACrCe,eAAe,CAACC,WAAW,GAAG,SAAS;AAEvC,SAASD,eAAe,IAAIf,OAAO"}
package/dist/Checkbox.js CHANGED
@@ -30,6 +30,7 @@ const Checkbox = ({
30
30
  isDefaultChecked,
31
31
  isDisabled,
32
32
  isIndeterminate,
33
+ isReadOnly = false,
33
34
  isRequired,
34
35
  label: labelProp,
35
36
  hint,
@@ -59,13 +60,11 @@ const Checkbox = ({
59
60
  };
60
61
  }, [isDefaultChecked, isChecked]);
61
62
  const localInputRef = useRef(null);
62
- useImperativeHandle(inputRef, () => {
63
- return {
64
- focus: () => {
65
- localInputRef.current?.focus();
66
- }
67
- };
68
- }, []);
63
+ useImperativeHandle(inputRef, () => ({
64
+ focus: () => {
65
+ localInputRef.current?.focus();
66
+ }
67
+ }), []);
69
68
  const label = useMemo(() => {
70
69
  return _jsxs(_Fragment, {
71
70
  children: [_jsx(Typography, {
@@ -86,13 +85,26 @@ const Checkbox = ({
86
85
  const onChange = useCallback((event, checked) => {
87
86
  onChangeProp?.(event, checked);
88
87
  }, [onChangeProp]);
88
+ const onClick = useCallback(event => {
89
+ if (isReadOnly) {
90
+ event.stopPropagation();
91
+ event.preventDefault();
92
+ }
93
+ }, [isReadOnly]);
89
94
  const onBlur = useCallback(event => {
90
95
  onBlurProp?.(event);
91
96
  }, [onBlurProp]);
97
+ const checkboxStyles = useMemo(() => ({
98
+ alignItems: "flex-start",
99
+ ...(isReadOnly && {
100
+ cursor: "default",
101
+ "& .MuiTypography-root": {
102
+ cursor: "default"
103
+ }
104
+ })
105
+ }), [isReadOnly]);
92
106
  return _jsx(_FormControlLabel, {
93
- sx: {
94
- alignItems: "flex-start"
95
- },
107
+ sx: checkboxStyles,
96
108
  "aria-label": ariaLabel,
97
109
  "aria-labelledby": ariaLabelledBy,
98
110
  className: validity === "invalid" ? "Mui-error" : validity === "valid" ? "Mui-valid" : "",
@@ -100,9 +112,12 @@ const Checkbox = ({
100
112
  ...inputValues,
101
113
  indeterminate: isIndeterminate,
102
114
  onChange: onChange,
115
+ onClick: onClick,
103
116
  required: isRequired,
104
117
  inputProps: {
105
- "data-se": testId
118
+ "data-se": testId,
119
+ "aria-readonly": isReadOnly,
120
+ readOnly: isReadOnly
106
121
  },
107
122
  disabled: isDisabled,
108
123
  inputRef: localInputRef,
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","names":["useTranslation","memo","useCallback","useMemo","useRef","useImperativeHandle","ComponentControlledState","getControlState","Typography","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","checkboxValidityValues","Checkbox","ariaLabel","ariaLabelledBy","id","idOverride","inputRef","isChecked","isDefaultChecked","isDisabled","isIndeterminate","isRequired","label","labelProp","hint","name","nameOverride","onChange","onChangeProp","onBlur","onBlurProp","testId","translate","validity","value","t","controlledStateRef","controlledValue","uncontrolledValue","inputValues","current","CONTROLLED","checked","defaultChecked","localInputRef","focus","children","component","color","_FormHelperText","event","_FormControlLabel","sx","alignItems","className","control","_Checkbox","indeterminate","required","inputProps","disabled","marginBlockStart","MemoizedCheckbox","displayName"],"sources":["../src/Checkbox.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useTranslation } from \"react-i18next\";\nimport { memo, useCallback, useMemo, useRef, useImperativeHandle } from \"react\";\nimport {\n Checkbox as MuiCheckbox,\n CheckboxProps as MuiCheckboxProps,\n FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n FormHelperText,\n} from \"@mui/material\";\n\nimport { CheckedFieldProps } from \"./FormCheckedProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n FocusHandle,\n getControlState,\n} from \"./inputUtils\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Typography } from \"./Typography\";\n\nexport const checkboxValidityValues = [\"valid\", \"invalid\", \"inherit\"] as const;\n\nexport type CheckboxProps = {\n /**\n * The ref forwarded to the Checkbox\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Determines whether the Checkbox is in an indeterminate state\n */\n isIndeterminate?: boolean;\n /**\n * Determines whether the Checkbox is required\n */\n isRequired?: boolean;\n /**\n * The label text for the Checkbox\n */\n label?: string;\n /**\n * The checkbox validity, if different from its enclosing group. Defaults to \"inherit\".\n */\n validity?: (typeof checkboxValidityValues)[number];\n /**\n * The value attribute of the Checkbox\n */\n value?: string;\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 CheckedFieldProps<MuiCheckboxProps> &\n Pick<HtmlProps, \"ariaLabel\" | \"ariaLabelledBy\" | \"testId\" | \"translate\">;\n\nconst Checkbox = ({\n ariaLabel,\n ariaLabelledBy,\n id: idOverride,\n inputRef,\n isChecked,\n isDefaultChecked,\n isDisabled,\n isIndeterminate,\n isRequired,\n label: labelProp,\n hint,\n name: nameOverride,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n testId,\n translate,\n validity = \"inherit\",\n value,\n}: CheckboxProps) => {\n const { t } = useTranslation();\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: isChecked,\n uncontrolledValue: isDefaultChecked,\n }),\n );\n const inputValues = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { checked: isChecked };\n }\n return { defaultChecked: isDefaultChecked };\n }, [isDefaultChecked, isChecked]);\n\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 return (\n <>\n <Typography component=\"span\">{labelProp}</Typography>\n {isRequired && (\n <>\n {\" \"}\n <Typography component=\"span\" color=\"textSecondary\">\n ({t(\"fieldlabel.required.text\")})\n </Typography>\n </>\n )}\n {hint && <FormHelperText translate={translate}>{hint}</FormHelperText>}\n </>\n );\n }, [isRequired, labelProp, hint, t, translate]);\n\n const onChange = useCallback<NonNullable<MuiCheckboxProps[\"onChange\"]>>(\n (event, checked) => {\n onChangeProp?.(event, checked);\n },\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 sx={{ alignItems: \"flex-start\" }}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={\n validity === \"invalid\"\n ? \"Mui-error\"\n : validity === \"valid\"\n ? \"Mui-valid\"\n : \"\"\n }\n control={\n <MuiCheckbox\n {...inputValues}\n indeterminate={isIndeterminate}\n onChange={onChange}\n required={isRequired}\n inputProps={{\n \"data-se\": testId,\n }}\n disabled={isDisabled}\n inputRef={localInputRef}\n sx={{\n marginBlockStart: \"2px\",\n }}\n />\n }\n disabled={isDisabled}\n id={idOverride}\n label={label}\n name={nameOverride ?? idOverride}\n value={value}\n required={isRequired}\n onBlur={onBlur}\n translate={translate}\n />\n );\n};\n\nconst MemoizedCheckbox = memo(Checkbox);\nMemoizedCheckbox.displayName = \"Checkbox\";\n\nexport { MemoizedCheckbox as Checkbox };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,eAAe;AAC9C,SAASC,IAAI,EAAEC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,mBAAmB,QAAQ,OAAO;AAAC,SAY9EC,wBAAwB,EAExBC,eAAe;AAAA,SAGRC,UAAU;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAAA,SAAAC,QAAA,IAAAC,SAAA;AAEnB,OAAO,MAAMC,sBAAsB,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAU;AAmC9E,MAAMC,QAAQ,GAAGA,CAAC;EAChBC,SAAS;EACTC,cAAc;EACdC,EAAE,EAAEC,UAAU;EACdC,QAAQ;EACRC,SAAS;EACTC,gBAAgB;EAChBC,UAAU;EACVC,eAAe;EACfC,UAAU;EACVC,KAAK,EAAEC,SAAS;EAChBC,IAAI;EACJC,IAAI,EAAEC,YAAY;EAClBC,QAAQ,EAAEC,YAAY;EACtBC,MAAM,EAAEC,UAAU;EAClBC,MAAM;EACNC,SAAS;EACTC,QAAQ,GAAG,SAAS;EACpBC;AACa,CAAC,KAAK;EACnB,MAAM;IAAEC;EAAE,CAAC,GAAGxC,cAAc,CAAC,CAAC;EAC9B,MAAMyC,kBAAkB,GAAGrC,MAAM,CAC/BG,eAAe,CAAC;IACdmC,eAAe,EAAEpB,SAAS;IAC1BqB,iBAAiB,EAAEpB;EACrB,CAAC,CACH,CAAC;EACD,MAAMqB,WAAW,GAA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KAAK,EAAER,OAAO,CAAC;EAChC,CAAC,EACD,CAACd,YAAY,CACf,CAAC;EAED,MAAMC,MAAM,GAAGhC,WAAW,CACvBqD,KAAK,IAAK;IACTpB,UAAU,GAAGoB,KAAK,CAAC;EACrB,CAAC,EACD,CAACpB,UAAU,CACb,CAAC;EAED,OACEzB,IAAA,CAAA8C,iBAAA;IACEC,EAAE,EAAE;MAAEC,UAAU,EAAE;IAAa,CAAE;IACjC,cAAYzC,SAAU;IACtB,mBAAiBC,cAAe;IAChCyC,SAAS,EACPrB,QAAQ,KAAK,SAAS,GAClB,WAAW,GACXA,QAAQ,KAAK,OAAO,GAClB,WAAW,GACX,EACP;IACDsB,OAAO,EACLlD,IAAA,CAAAmD,SAAA;MAAA,GACMjB,WAAW;MACfkB,aAAa,EAAErC,eAAgB;MAC/BO,QAAQ,EAAEA,QAAS;MACnB+B,QAAQ,EAAErC,UAAW;MACrBsC,UAAU,EAAE;QACV,SAAS,EAAE5B;MACb,CAAE;MACF6B,QAAQ,EAAEzC,UAAW;MACrBH,QAAQ,EAAE4B,aAAc;MACxBQ,EAAE,EAAE;QACFS,gBAAgB,EAAE;MACpB;IAAE,CACH,CACF;IACDD,QAAQ,EAAEzC,UAAW;IACrBL,EAAE,EAAEC,UAAW;IACfO,KAAK,EAAEA,KAAM;IACbG,IAAI,EAAEC,YAAY,IAAIX,UAAW;IACjCmB,KAAK,EAAEA,KAAM;IACbwB,QAAQ,EAAErC,UAAW;IACrBQ,MAAM,EAAEA,MAAO;IACfG,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAED,MAAM8B,gBAAgB,GAAGlE,IAAI,CAACe,QAAQ,CAAC;AACvCmD,gBAAgB,CAACC,WAAW,GAAG,UAAU;AAEzC,SAASD,gBAAgB,IAAInD,QAAQ"}
1
+ {"version":3,"file":"Checkbox.js","names":["useTranslation","memo","useCallback","useMemo","useRef","useImperativeHandle","ComponentControlledState","getControlState","Typography","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","checkboxValidityValues","Checkbox","ariaLabel","ariaLabelledBy","id","idOverride","inputRef","isChecked","isDefaultChecked","isDisabled","isIndeterminate","isReadOnly","isRequired","label","labelProp","hint","name","nameOverride","onChange","onChangeProp","onBlur","onBlurProp","testId","translate","validity","value","t","controlledStateRef","controlledValue","uncontrolledValue","inputValues","current","CONTROLLED","checked","defaultChecked","localInputRef","focus","children","component","color","_FormHelperText","event","onClick","stopPropagation","preventDefault","checkboxStyles","alignItems","cursor","_FormControlLabel","sx","className","control","_Checkbox","indeterminate","required","inputProps","readOnly","disabled","marginBlockStart","MemoizedCheckbox","displayName"],"sources":["../src/Checkbox.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useTranslation } from \"react-i18next\";\nimport { memo, useCallback, useMemo, useRef, useImperativeHandle } from \"react\";\nimport {\n Checkbox as MuiCheckbox,\n CheckboxProps as MuiCheckboxProps,\n FormControlLabel,\n FormControlLabelProps as MuiFormControlLabelProps,\n FormHelperText,\n} from \"@mui/material\";\n\nimport { CheckedFieldProps } from \"./FormCheckedProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport {\n ComponentControlledState,\n FocusHandle,\n getControlState,\n} from \"./inputUtils\";\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport { Typography } from \"./Typography\";\n\nexport const checkboxValidityValues = [\"valid\", \"invalid\", \"inherit\"] as const;\n\nexport type CheckboxProps = {\n /**\n * The ref forwarded to the Checkbox\n */\n inputRef?: React.RefObject<FocusHandle>;\n /**\n * Determines whether the Checkbox is in an indeterminate state\n */\n isIndeterminate?: boolean;\n /**\n * Determines whether the Checkbox is required\n */\n isRequired?: boolean;\n /**\n * The label text for the Checkbox\n */\n label?: string;\n /**\n * The checkbox validity, if different from its enclosing group. Defaults to \"inherit\".\n */\n validity?: (typeof checkboxValidityValues)[number];\n /**\n * The value attribute of the Checkbox\n */\n value?: string;\n /**\n * Callback fired when the blur event happens. Provides event value.\n */\n onBlur?: MuiFormControlLabelProps[\"onBlur\"];\n} & Pick<\n FieldComponentProps,\n \"hint\" | \"id\" | \"isDisabled\" | \"isReadOnly\" | \"name\"\n> &\n CheckedFieldProps<MuiCheckboxProps> &\n Pick<HtmlProps, \"ariaLabel\" | \"ariaLabelledBy\" | \"testId\" | \"translate\">;\n\nconst Checkbox = ({\n ariaLabel,\n ariaLabelledBy,\n id: idOverride,\n inputRef,\n isChecked,\n isDefaultChecked,\n isDisabled,\n isIndeterminate,\n isReadOnly = false,\n isRequired,\n label: labelProp,\n hint,\n name: nameOverride,\n onChange: onChangeProp,\n onBlur: onBlurProp,\n testId,\n translate,\n validity = \"inherit\",\n value,\n}: CheckboxProps) => {\n const { t } = useTranslation();\n const controlledStateRef = useRef(\n getControlState({\n controlledValue: isChecked,\n uncontrolledValue: isDefaultChecked,\n }),\n );\n const inputValues = useMemo(() => {\n if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {\n return { checked: isChecked };\n }\n return { defaultChecked: isDefaultChecked };\n }, [isDefaultChecked, isChecked]);\n\n const localInputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(\n inputRef,\n () => ({\n focus: () => {\n localInputRef.current?.focus();\n },\n }),\n [],\n );\n\n const label = useMemo(() => {\n return (\n <>\n <Typography component=\"span\">{labelProp}</Typography>\n {isRequired && (\n <>\n {\" \"}\n <Typography component=\"span\" color=\"textSecondary\">\n ({t(\"fieldlabel.required.text\")})\n </Typography>\n </>\n )}\n {hint && <FormHelperText translate={translate}>{hint}</FormHelperText>}\n </>\n );\n }, [isRequired, labelProp, hint, t, translate]);\n\n const onChange = useCallback<NonNullable<MuiCheckboxProps[\"onChange\"]>>(\n (event, checked) => {\n onChangeProp?.(event, checked);\n },\n [onChangeProp],\n );\n\n const onClick = useCallback<NonNullable<MuiCheckboxProps[\"onClick\"]>>(\n (event) => {\n if (isReadOnly) {\n event.stopPropagation();\n event.preventDefault();\n }\n },\n [isReadOnly],\n );\n\n const onBlur = useCallback<NonNullable<MuiFormControlLabelProps[\"onBlur\"]>>(\n (event) => {\n onBlurProp?.(event);\n },\n [onBlurProp],\n );\n\n const checkboxStyles = useMemo(\n () => ({\n alignItems: \"flex-start\",\n ...(isReadOnly && {\n cursor: \"default\",\n \"& .MuiTypography-root\": {\n cursor: \"default\",\n },\n }),\n }),\n [isReadOnly],\n );\n\n return (\n <FormControlLabel\n sx={checkboxStyles}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n className={\n validity === \"invalid\"\n ? \"Mui-error\"\n : validity === \"valid\"\n ? \"Mui-valid\"\n : \"\"\n }\n control={\n <MuiCheckbox\n {...inputValues}\n indeterminate={isIndeterminate}\n onChange={onChange}\n onClick={\n onClick as unknown as React.MouseEventHandler<HTMLButtonElement>\n }\n required={isRequired}\n inputProps={{\n \"data-se\": testId,\n \"aria-readonly\": isReadOnly,\n readOnly: isReadOnly,\n }}\n disabled={isDisabled}\n inputRef={localInputRef}\n sx={{\n marginBlockStart: \"2px\",\n }}\n />\n }\n disabled={isDisabled}\n id={idOverride}\n label={label}\n name={nameOverride ?? idOverride}\n value={value}\n required={isRequired}\n onBlur={onBlur}\n translate={translate}\n />\n );\n};\n\nconst MemoizedCheckbox = memo(Checkbox);\nMemoizedCheckbox.displayName = \"Checkbox\";\n\nexport { MemoizedCheckbox as Checkbox };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,eAAe;AAC9C,SAASC,IAAI,EAAEC,WAAW,EAAEC,O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@@ -10,7 +10,8 @@ import _FormGroup from "@mui/material/FormGroup";
10
10
  *
11
11
  * See the License for the specific language governing permissions and limitations under the License.
12
12
  */
13
- import { memo, useCallback } from "react";
13
+
14
+ import React, { memo, useCallback, useMemo } from "react";
14
15
  import { Field } from "./Field.js";
15
16
  import { jsx as _jsx } from "react/jsx-runtime";
16
17
  const CheckboxGroup = ({
@@ -22,11 +23,21 @@ const CheckboxGroup = ({
22
23
  HintLinkComponent,
23
24
  id: idOverride,
24
25
  isDisabled,
26
+ isReadOnly = false,
25
27
  isRequired = false,
26
28
  label,
27
29
  testId,
28
30
  translate
29
31
  }) => {
32
+ const memoizedChildren = useMemo(() => React.Children.map(children, child => {
33
+ if (React.isValidElement(child)) {
34
+ return React.cloneElement(child, {
35
+ isReadOnly,
36
+ isDisabled: isDisabled || child.props.isDisabled
37
+ });
38
+ }
39
+ return child;
40
+ }), [children, isReadOnly, isDisabled]);
30
41
  const renderFieldComponent = useCallback(({
31
42
  ariaDescribedBy,
32
43
  errorMessageElementId,
@@ -39,8 +50,8 @@ const CheckboxGroup = ({
39
50
  "data-se": testId,
40
51
  id: id,
41
52
  translate: translate,
42
- children: children
43
- }), [children, testId, translate]);
53
+ children: memoizedChildren
54
+ }), [memoizedChildren, testId, translate]);
44
55
  return _jsx(Field, {
45
56
  ariaDescribedBy: ariaDescribedBy,
46
57
  errorMessage: errorMessage,