@okta/odyssey-react-mui 1.25.0 → 1.27.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 (512) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/Autocomplete.js +30 -191
  3. package/dist/Autocomplete.js.map +1 -1
  4. package/dist/Box.js +2 -0
  5. package/dist/Box.js.map +1 -1
  6. package/dist/Card.js +1 -0
  7. package/dist/Card.js.map +1 -1
  8. package/dist/OdysseyDesignTokensContext.js +3 -2
  9. package/dist/OdysseyDesignTokensContext.js.map +1 -1
  10. package/dist/OdysseyProvider.js +9 -7
  11. package/dist/OdysseyProvider.js.map +1 -1
  12. package/dist/OdysseyThemeProvider.js +33 -13
  13. package/dist/OdysseyThemeProvider.js.map +1 -1
  14. package/dist/Pagination/Pagination.js +46 -14
  15. package/dist/Pagination/Pagination.js.map +1 -1
  16. package/dist/Surface.js +14 -3
  17. package/dist/Surface.js.map +1 -1
  18. package/dist/Tag.js +42 -27
  19. package/dist/Tag.js.map +1 -1
  20. package/dist/index.js +6 -7
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.scss +1 -1
  23. package/dist/labs/AppTile.js +137 -39
  24. package/dist/labs/AppTile.js.map +1 -1
  25. package/dist/labs/DataView/CardLayoutContent.js +7 -8
  26. package/dist/labs/DataView/CardLayoutContent.js.map +1 -1
  27. package/dist/labs/DataView/DataCard.js +96 -43
  28. package/dist/labs/DataView/DataCard.js.map +1 -1
  29. package/dist/labs/DataView/DataView.js +6 -0
  30. package/dist/labs/DataView/DataView.js.map +1 -1
  31. package/dist/labs/DataView/TableLayoutContent.js +3 -2
  32. package/dist/labs/DataView/TableLayoutContent.js.map +1 -1
  33. package/dist/labs/DataView/componentTypes.js.map +1 -1
  34. package/dist/labs/DataView/index.js.map +1 -1
  35. package/dist/labs/OdysseyPickers/ComposablePicker.js +113 -0
  36. package/dist/labs/OdysseyPickers/ComposablePicker.js.map +1 -0
  37. package/dist/labs/OdysseyPickers/Picker.js +261 -0
  38. package/dist/labs/OdysseyPickers/Picker.js.map +1 -0
  39. package/dist/labs/OdysseyPickers/PickerVirtualizationListBox.js +132 -0
  40. package/dist/labs/OdysseyPickers/PickerVirtualizationListBox.js.map +1 -0
  41. package/dist/labs/OdysseyPickers/PickerWithOptionAdornment.js +291 -0
  42. package/dist/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -0
  43. package/dist/{src/createShadowDomElements.d.ts → labs/OdysseyPickers/index.js} +4 -7
  44. package/dist/labs/OdysseyPickers/index.js.map +1 -0
  45. package/dist/labs/PageTemplate.js +14 -10
  46. package/dist/labs/PageTemplate.js.map +1 -1
  47. package/dist/labs/SideNav/CollapseIcon.js +11 -25
  48. package/dist/labs/SideNav/CollapseIcon.js.map +1 -1
  49. package/dist/labs/SideNav/HandleIcon.js +32 -0
  50. package/dist/labs/SideNav/HandleIcon.js.map +1 -0
  51. package/dist/labs/{NavAccordion.js → SideNav/NavAccordion.js} +36 -8
  52. package/dist/labs/SideNav/NavAccordion.js.map +1 -0
  53. package/dist/labs/SideNav/OktaAura.js +32 -0
  54. package/dist/labs/SideNav/OktaAura.js.map +1 -0
  55. package/dist/labs/SideNav/OktaLogo.js +6 -9
  56. package/dist/labs/SideNav/OktaLogo.js.map +1 -1
  57. package/dist/labs/SideNav/SideNav.js +316 -172
  58. package/dist/labs/SideNav/SideNav.js.map +1 -1
  59. package/dist/labs/SideNav/SideNavFooterContent.js +32 -18
  60. package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -1
  61. package/dist/labs/SideNav/SideNavHeader.js +48 -37
  62. package/dist/labs/SideNav/SideNavHeader.js.map +1 -1
  63. package/dist/labs/SideNav/SideNavItemContent.js +150 -68
  64. package/dist/labs/SideNav/SideNavItemContent.js.map +1 -1
  65. package/dist/labs/SideNav/SideNavItemContentContext.js +20 -0
  66. package/dist/labs/SideNav/SideNavItemContentContext.js.map +1 -0
  67. package/dist/labs/SideNav/SideNavItemLinkContent.js +15 -14
  68. package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -1
  69. package/dist/labs/SideNav/SideNavLogo.js +42 -0
  70. package/dist/labs/SideNav/SideNavLogo.js.map +1 -0
  71. package/dist/labs/SideNav/SideNavToggleButton.js +170 -0
  72. package/dist/labs/SideNav/SideNavToggleButton.js.map +1 -0
  73. package/dist/labs/SideNav/SortableList/SortableItem.js +162 -0
  74. package/dist/labs/SideNav/SortableList/SortableItem.js.map +1 -0
  75. package/dist/labs/SideNav/SortableList/SortableList.js +118 -0
  76. package/dist/labs/SideNav/SortableList/SortableList.js.map +1 -0
  77. package/dist/labs/SideNav/SortableList/SortableOverlay.js +30 -0
  78. package/dist/labs/SideNav/SortableList/SortableOverlay.js.map +1 -0
  79. package/dist/labs/SideNav/types.js.map +1 -1
  80. package/dist/labs/TopNav/TopNav.js +65 -0
  81. package/dist/labs/TopNav/TopNav.js.map +1 -0
  82. package/dist/labs/TopNav/TopNavLinksList.js +38 -0
  83. package/dist/labs/TopNav/TopNavLinksList.js.map +1 -0
  84. package/dist/labs/TopNav/TopNavListItem.js +132 -0
  85. package/dist/labs/TopNav/TopNavListItem.js.map +1 -0
  86. package/dist/labs/TopNav/UserProfile.js +65 -0
  87. package/dist/labs/TopNav/UserProfile.js.map +1 -0
  88. package/dist/labs/TopNav/index.js +14 -0
  89. package/dist/labs/TopNav/index.js.map +1 -0
  90. package/dist/labs/UiShell/UiShell.js +68 -0
  91. package/dist/labs/UiShell/UiShell.js.map +1 -0
  92. package/dist/labs/UiShell/UiShellContent.js +114 -0
  93. package/dist/labs/UiShell/UiShellContent.js.map +1 -0
  94. package/dist/labs/UiShell/bufferLatest.js +37 -0
  95. package/dist/labs/UiShell/bufferLatest.js.map +1 -0
  96. package/dist/labs/UiShell/createMessageBus.js +30 -0
  97. package/dist/labs/UiShell/createMessageBus.js.map +1 -0
  98. package/dist/labs/UiShell/createStore.js +24 -0
  99. package/dist/labs/UiShell/createStore.js.map +1 -0
  100. package/dist/labs/UiShell/index.js +15 -0
  101. package/dist/labs/UiShell/index.js.map +1 -0
  102. package/dist/labs/UiShell/renderUiShell.js +78 -0
  103. package/dist/labs/UiShell/renderUiShell.js.map +1 -0
  104. package/dist/labs/UiShell/useHasUiShell.js +22 -0
  105. package/dist/labs/UiShell/useHasUiShell.js.map +1 -0
  106. package/dist/labs/UiShell/useScrollState.js +41 -0
  107. package/dist/labs/UiShell/useScrollState.js.map +1 -0
  108. package/dist/labs/index.js +5 -3
  109. package/dist/labs/index.js.map +1 -1
  110. package/dist/properties/ts/odyssey-react-mui.js +14 -1
  111. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  112. package/dist/properties/ts/odyssey-react-mui_cs.js +3 -1
  113. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  114. package/dist/properties/ts/odyssey-react-mui_da.js +3 -1
  115. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  116. package/dist/properties/ts/odyssey-react-mui_de.js +3 -1
  117. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  118. package/dist/properties/ts/odyssey-react-mui_el.js +3 -1
  119. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  120. package/dist/properties/ts/odyssey-react-mui_es.js +3 -1
  121. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  122. package/dist/properties/ts/odyssey-react-mui_fi.js +3 -1
  123. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  124. package/dist/properties/ts/odyssey-react-mui_fr.js +5 -3
  125. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  126. package/dist/properties/ts/odyssey-react-mui_ht.js +3 -1
  127. package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  128. package/dist/properties/ts/odyssey-react-mui_hu.js +3 -1
  129. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  130. package/dist/properties/ts/odyssey-react-mui_id.js +3 -1
  131. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  132. package/dist/properties/ts/odyssey-react-mui_it.js +4 -2
  133. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  134. package/dist/properties/ts/odyssey-react-mui_ja.js +9 -7
  135. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  136. package/dist/properties/ts/odyssey-react-mui_ko.js +3 -1
  137. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  138. package/dist/properties/ts/odyssey-react-mui_ms.js +3 -1
  139. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  140. package/dist/properties/ts/odyssey-react-mui_nb.js +3 -1
  141. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  142. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +3 -1
  143. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  144. package/dist/properties/ts/odyssey-react-mui_pl.js +3 -1
  145. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  146. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +3 -1
  147. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  148. package/dist/properties/ts/odyssey-react-mui_ro.js +3 -1
  149. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  150. package/dist/properties/ts/odyssey-react-mui_ru.js +3 -1
  151. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  152. package/dist/properties/ts/odyssey-react-mui_sv.js +3 -1
  153. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  154. package/dist/properties/ts/odyssey-react-mui_th.js +3 -1
  155. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  156. package/dist/properties/ts/odyssey-react-mui_tr.js +4 -2
  157. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  158. package/dist/properties/ts/odyssey-react-mui_uk.js +3 -1
  159. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  160. package/dist/properties/ts/odyssey-react-mui_vi.js +3 -1
  161. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  162. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +3 -1
  163. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  164. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +3 -1
  165. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  166. package/dist/src/Autocomplete.d.ts +21 -22
  167. package/dist/src/Autocomplete.d.ts.map +1 -1
  168. package/dist/src/Box.d.ts +3 -1
  169. package/dist/src/Box.d.ts.map +1 -1
  170. package/dist/src/Card.d.ts.map +1 -1
  171. package/dist/src/OdysseyDesignTokensContext.d.ts +5 -4
  172. package/dist/src/OdysseyDesignTokensContext.d.ts.map +1 -1
  173. package/dist/src/OdysseyProvider.d.ts +3 -3
  174. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  175. package/dist/src/OdysseyThemeProvider.d.ts +10 -12
  176. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  177. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  178. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  179. package/dist/src/Pagination/Pagination.d.ts +21 -7
  180. package/dist/src/Pagination/Pagination.d.ts.map +1 -1
  181. package/dist/src/Surface.d.ts.map +1 -1
  182. package/dist/src/Tag.d.ts +5 -2
  183. package/dist/src/Tag.d.ts.map +1 -1
  184. package/dist/src/index.d.ts +6 -7
  185. package/dist/src/index.d.ts.map +1 -1
  186. package/dist/src/labs/AppTile.d.ts +3 -1
  187. package/dist/src/labs/AppTile.d.ts.map +1 -1
  188. package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -1
  189. package/dist/src/labs/DataView/DataCard.d.ts +9 -3
  190. package/dist/src/labs/DataView/DataCard.d.ts.map +1 -1
  191. package/dist/src/labs/DataView/DataView.d.ts +1 -1
  192. package/dist/src/labs/DataView/DataView.d.ts.map +1 -1
  193. package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -1
  194. package/dist/src/labs/DataView/componentTypes.d.ts +4 -3
  195. package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -1
  196. package/dist/src/labs/DataView/index.d.ts +1 -0
  197. package/dist/src/labs/DataView/index.d.ts.map +1 -1
  198. package/dist/src/labs/OdysseyPickers/ComposablePicker.d.ts +33 -0
  199. package/dist/src/labs/OdysseyPickers/ComposablePicker.d.ts.map +1 -0
  200. package/dist/src/labs/OdysseyPickers/Picker.d.ts +98 -0
  201. package/dist/src/labs/OdysseyPickers/Picker.d.ts.map +1 -0
  202. package/dist/src/labs/OdysseyPickers/PickerVirtualizationListBox.d.ts +17 -0
  203. package/dist/src/labs/OdysseyPickers/PickerVirtualizationListBox.d.ts.map +1 -0
  204. package/dist/src/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts +26 -0
  205. package/dist/src/labs/OdysseyPickers/PickerWithOptionAdornment.d.ts.map +1 -0
  206. package/dist/src/labs/OdysseyPickers/index.d.ts +15 -0
  207. package/dist/src/labs/OdysseyPickers/index.d.ts.map +1 -0
  208. package/dist/src/labs/PageTemplate.d.ts +1 -1
  209. package/dist/src/labs/PageTemplate.d.ts.map +1 -1
  210. package/dist/src/labs/SideNav/CollapseIcon.d.ts +1 -4
  211. package/dist/src/labs/SideNav/CollapseIcon.d.ts.map +1 -1
  212. package/dist/src/labs/SideNav/HandleIcon.d.ts +14 -0
  213. package/dist/src/labs/SideNav/HandleIcon.d.ts.map +1 -0
  214. package/dist/src/labs/{NavAccordion.d.ts → SideNav/NavAccordion.d.ts} +7 -7
  215. package/dist/src/labs/SideNav/NavAccordion.d.ts.map +1 -0
  216. package/dist/src/labs/SideNav/OktaAura.d.ts +14 -0
  217. package/dist/src/labs/SideNav/OktaAura.d.ts.map +1 -0
  218. package/dist/src/labs/SideNav/OktaLogo.d.ts.map +1 -1
  219. package/dist/src/labs/SideNav/SideNav.d.ts +2 -1
  220. package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -1
  221. package/dist/src/labs/SideNav/SideNavFooterContent.d.ts +1 -1
  222. package/dist/src/labs/SideNav/SideNavFooterContent.d.ts.map +1 -1
  223. package/dist/src/labs/SideNav/SideNavHeader.d.ts +12 -3
  224. package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -1
  225. package/dist/src/labs/SideNav/SideNavItemContent.d.ts +38 -3
  226. package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -1
  227. package/dist/src/labs/SideNav/SideNavItemContentContext.d.ts +19 -0
  228. package/dist/src/labs/SideNav/SideNavItemContentContext.d.ts.map +1 -0
  229. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts +1 -1
  230. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts.map +1 -1
  231. package/dist/src/labs/SideNav/SideNavLogo.d.ts +15 -0
  232. package/dist/src/labs/SideNav/SideNavLogo.d.ts.map +1 -0
  233. package/dist/src/labs/SideNav/SideNavToggleButton.d.ts +38 -0
  234. package/dist/src/labs/SideNav/SideNavToggleButton.d.ts.map +1 -0
  235. package/dist/src/labs/SideNav/SortableList/SortableItem.d.ts +26 -0
  236. package/dist/src/labs/SideNav/SortableList/SortableItem.d.ts.map +1 -0
  237. package/dist/src/labs/SideNav/SortableList/SortableList.d.ts +36 -0
  238. package/dist/src/labs/SideNav/SortableList/SortableList.d.ts.map +1 -0
  239. package/dist/src/labs/SideNav/SortableList/SortableOverlay.d.ts +17 -0
  240. package/dist/src/labs/SideNav/SortableList/SortableOverlay.d.ts.map +1 -0
  241. package/dist/src/labs/SideNav/types.d.ts +79 -35
  242. package/dist/src/labs/SideNav/types.d.ts.map +1 -1
  243. package/dist/src/labs/TopNav/TopNav.d.ts +31 -0
  244. package/dist/src/labs/TopNav/TopNav.d.ts.map +1 -0
  245. package/dist/src/labs/TopNav/TopNavLinksList.d.ts +44 -0
  246. package/dist/src/labs/TopNav/TopNavLinksList.d.ts.map +1 -0
  247. package/dist/src/labs/TopNav/TopNavListItem.d.ts +42 -0
  248. package/dist/src/labs/TopNav/TopNavListItem.d.ts.map +1 -0
  249. package/dist/src/labs/TopNav/UserProfile.d.ts +29 -0
  250. package/dist/src/labs/TopNav/UserProfile.d.ts.map +1 -0
  251. package/dist/src/labs/TopNav/index.d.ts +14 -0
  252. package/dist/src/labs/TopNav/index.d.ts.map +1 -0
  253. package/dist/src/labs/UiShell/UiShell.d.ts +33 -0
  254. package/dist/src/labs/UiShell/UiShell.d.ts.map +1 -0
  255. package/dist/src/labs/UiShell/UiShellContent.d.ts +47 -0
  256. package/dist/src/labs/UiShell/UiShellContent.d.ts.map +1 -0
  257. package/dist/src/labs/UiShell/bufferLatest.d.ts +31 -0
  258. package/dist/src/labs/UiShell/bufferLatest.d.ts.map +1 -0
  259. package/dist/src/labs/UiShell/createMessageBus.d.ts +24 -0
  260. package/dist/src/labs/UiShell/createMessageBus.d.ts.map +1 -0
  261. package/dist/src/labs/UiShell/createStore.d.ts +22 -0
  262. package/dist/src/labs/UiShell/createStore.d.ts.map +1 -0
  263. package/dist/src/labs/UiShell/index.d.ts +16 -0
  264. package/dist/src/labs/UiShell/index.d.ts.map +1 -0
  265. package/dist/src/labs/UiShell/renderUiShell.d.ts +45 -0
  266. package/dist/src/labs/UiShell/renderUiShell.d.ts.map +1 -0
  267. package/dist/src/labs/UiShell/useHasUiShell.d.ts +13 -0
  268. package/dist/src/labs/UiShell/useHasUiShell.d.ts.map +1 -0
  269. package/dist/src/labs/UiShell/useScrollState.d.ts +16 -0
  270. package/dist/src/labs/UiShell/useScrollState.d.ts.map +1 -0
  271. package/dist/src/labs/index.d.ts +6 -2
  272. package/dist/src/labs/index.d.ts.map +1 -1
  273. package/dist/src/properties/ts/odyssey-react-mui.d.ts +13 -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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  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 +2 -0
  328. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  329. package/dist/src/test-selectors/querySelector.d.ts +2 -2
  330. package/dist/src/theme/components.d.ts +3 -1
  331. package/dist/src/theme/components.d.ts.map +1 -1
  332. package/dist/src/theme/createOdysseyMuiTheme.d.ts +2 -1
  333. package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
  334. package/dist/src/useAutocomplete.d.ts +29 -0
  335. package/dist/src/useAutocomplete.d.ts.map +1 -0
  336. package/dist/src/useContrastMode.d.ts +46 -0
  337. package/dist/src/useContrastMode.d.ts.map +1 -0
  338. package/dist/src/web-component/index.d.ts +14 -0
  339. package/dist/src/web-component/index.d.ts.map +1 -0
  340. package/dist/src/web-component/renderReactInWebComponent.d.ts +76 -0
  341. package/dist/src/web-component/renderReactInWebComponent.d.ts.map +1 -0
  342. package/dist/src/web-component/shadow-dom.d.ts +23 -0
  343. package/dist/src/web-component/shadow-dom.d.ts.map +1 -0
  344. package/dist/test-selectors/querySelector.js.map +1 -1
  345. package/dist/theme/components.js +36 -32
  346. package/dist/theme/components.js.map +1 -1
  347. package/dist/theme/createOdysseyMuiTheme.js +3 -2
  348. package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
  349. package/dist/tsconfig.production.tsbuildinfo +1 -1
  350. package/dist/tsconfig.tsbuildinfo +1 -1
  351. package/dist/useAutocomplete.js +105 -0
  352. package/dist/useAutocomplete.js.map +1 -0
  353. package/dist/useContrastMode.js +93 -0
  354. package/dist/useContrastMode.js.map +1 -0
  355. package/dist/web-component/index.js +14 -0
  356. package/dist/web-component/index.js.map +1 -0
  357. package/dist/web-component/renderReactInWebComponent.js +72 -0
  358. package/dist/web-component/renderReactInWebComponent.js.map +1 -0
  359. package/dist/{createShadowDomElements.js → web-component/shadow-dom.js} +10 -12
  360. package/dist/web-component/shadow-dom.js.map +1 -0
  361. package/i18n.config.json +2 -1
  362. package/jest.config.cjs +1 -1
  363. package/jest.setup.js +0 -3
  364. package/package.json +7 -3
  365. package/src/Autocomplete.tsx +40 -330
  366. package/src/Box.tsx +4 -2
  367. package/src/Card.tsx +1 -0
  368. package/src/OdysseyDesignTokensContext.tsx +6 -3
  369. package/src/OdysseyProvider.tsx +13 -8
  370. package/src/OdysseyThemeProvider.test.tsx +209 -0
  371. package/src/OdysseyThemeProvider.tsx +42 -26
  372. package/src/Pagination/Pagination.test.tsx +305 -0
  373. package/src/Pagination/Pagination.tsx +86 -38
  374. package/src/Surface.tsx +18 -5
  375. package/src/Tag.tsx +64 -39
  376. package/src/createUniqueAlphabeticalId.test.ts +1 -1
  377. package/src/createUniqueId.test.ts +1 -1
  378. package/src/index.ts +6 -7
  379. package/src/labs/AppTile.tsx +169 -40
  380. package/src/labs/DataView/CardLayoutContent.tsx +12 -14
  381. package/src/labs/DataView/DataCard.tsx +137 -69
  382. package/src/labs/DataView/DataView.test.tsx +6 -4
  383. package/src/labs/DataView/DataView.tsx +6 -0
  384. package/src/labs/DataView/TableLayoutContent.tsx +6 -2
  385. package/src/labs/DataView/componentTypes.ts +7 -3
  386. package/src/labs/DataView/index.tsx +1 -0
  387. package/src/labs/OdysseyPickers/ComposablePicker.test.tsx +29 -0
  388. package/src/labs/OdysseyPickers/ComposablePicker.tsx +188 -0
  389. package/src/labs/OdysseyPickers/Picker.tsx +381 -0
  390. package/src/labs/OdysseyPickers/PickerVirtualizationListBox.tsx +191 -0
  391. package/src/labs/OdysseyPickers/PickerWithOptionAdornment.tsx +429 -0
  392. package/src/labs/OdysseyPickers/index.ts +15 -0
  393. package/src/labs/PageTemplate.tsx +18 -10
  394. package/src/labs/SideNav/CollapseIcon.tsx +14 -28
  395. package/src/labs/SideNav/HandleIcon.tsx +35 -0
  396. package/src/labs/{NavAccordion.tsx → SideNav/NavAccordion.tsx} +51 -16
  397. package/src/labs/SideNav/OktaAura.tsx +35 -0
  398. package/src/labs/SideNav/OktaLogo.tsx +5 -10
  399. package/src/labs/SideNav/SideNav.test.tsx +323 -0
  400. package/src/labs/SideNav/SideNav.tsx +405 -205
  401. package/src/labs/SideNav/SideNavFooterContent.tsx +36 -28
  402. package/src/labs/SideNav/SideNavHeader.tsx +62 -45
  403. package/src/labs/SideNav/SideNavItemContent.tsx +202 -69
  404. package/src/labs/SideNav/SideNavItemContentContext.tsx +29 -0
  405. package/src/labs/SideNav/SideNavItemLinkContent.tsx +18 -15
  406. package/src/labs/SideNav/SideNavLogo.tsx +41 -0
  407. package/src/labs/SideNav/SideNavToggleButton.tsx +245 -0
  408. package/src/labs/SideNav/SortableList/SortableItem.tsx +202 -0
  409. package/src/labs/SideNav/SortableList/SortableList.tsx +122 -0
  410. package/src/labs/SideNav/SortableList/SortableOverlay.tsx +34 -0
  411. package/src/labs/SideNav/types.ts +85 -36
  412. package/src/labs/TopNav/TopNav.tsx +95 -0
  413. package/src/labs/TopNav/TopNavLinksList.tsx +68 -0
  414. package/src/labs/TopNav/TopNavListItem.tsx +209 -0
  415. package/src/labs/TopNav/UserProfile.tsx +79 -0
  416. package/src/labs/TopNav/index.ts +14 -0
  417. package/src/labs/UiShell/UiShell.test.tsx +284 -0
  418. package/src/labs/UiShell/UiShell.tsx +109 -0
  419. package/src/labs/UiShell/UiShellContent.tsx +170 -0
  420. package/src/labs/UiShell/bufferLatest.test.ts +79 -0
  421. package/src/labs/UiShell/bufferLatest.ts +64 -0
  422. package/src/labs/UiShell/createMessageBus.test.ts +115 -0
  423. package/src/labs/UiShell/createMessageBus.ts +53 -0
  424. package/src/labs/UiShell/createStore.test.ts +103 -0
  425. package/src/labs/UiShell/createStore.ts +37 -0
  426. package/src/labs/UiShell/index.ts +17 -0
  427. package/src/labs/UiShell/renderUiShell.test.tsx +197 -0
  428. package/src/labs/UiShell/renderUiShell.tsx +132 -0
  429. package/src/labs/UiShell/useHasUiShell.ts +25 -0
  430. package/src/labs/UiShell/useScrollState.ts +56 -0
  431. package/src/labs/index.ts +10 -3
  432. package/src/properties/odyssey-react-mui.properties +14 -0
  433. package/src/properties/translations/odyssey-react-mui_cs.properties +2 -1
  434. package/src/properties/translations/odyssey-react-mui_da.properties +2 -1
  435. package/src/properties/translations/odyssey-react-mui_de.properties +2 -1
  436. package/src/properties/translations/odyssey-react-mui_el.properties +2 -1
  437. package/src/properties/translations/odyssey-react-mui_es.properties +2 -1
  438. package/src/properties/translations/odyssey-react-mui_fi.properties +2 -1
  439. package/src/properties/translations/odyssey-react-mui_fr.properties +4 -3
  440. package/src/properties/translations/odyssey-react-mui_ht.properties +2 -1
  441. package/src/properties/translations/odyssey-react-mui_hu.properties +2 -1
  442. package/src/properties/translations/odyssey-react-mui_id.properties +2 -1
  443. package/src/properties/translations/odyssey-react-mui_it.properties +3 -2
  444. package/src/properties/translations/odyssey-react-mui_ja.properties +8 -7
  445. package/src/properties/translations/odyssey-react-mui_ko.properties +2 -1
  446. package/src/properties/translations/odyssey-react-mui_ms.properties +2 -1
  447. package/src/properties/translations/odyssey-react-mui_nb.properties +2 -1
  448. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +2 -1
  449. package/src/properties/translations/odyssey-react-mui_pl.properties +2 -1
  450. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +2 -1
  451. package/src/properties/translations/odyssey-react-mui_ro.properties +2 -1
  452. package/src/properties/translations/odyssey-react-mui_ru.properties +2 -1
  453. package/src/properties/translations/odyssey-react-mui_sv.properties +2 -1
  454. package/src/properties/translations/odyssey-react-mui_th.properties +2 -1
  455. package/src/properties/translations/odyssey-react-mui_tr.properties +3 -2
  456. package/src/properties/translations/odyssey-react-mui_uk.properties +2 -1
  457. package/src/properties/translations/odyssey-react-mui_vi.properties +2 -1
  458. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +2 -1
  459. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +2 -1
  460. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  461. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  462. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  463. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  464. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  465. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  466. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  467. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  468. package/src/properties/ts/odyssey-react-mui_ht.ts +1 -1
  469. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  470. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  471. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  472. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  473. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  474. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  475. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  476. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  477. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  478. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  479. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  480. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  481. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  482. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  483. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  484. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  485. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  486. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  487. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  488. package/src/test-selectors/querySelector.ts +1 -1
  489. package/src/theme/components.tsx +50 -33
  490. package/src/theme/createOdysseyMuiTheme.ts +4 -3
  491. package/src/theme/useContrastMode.test.tsx +503 -0
  492. package/src/useAutocomplete.tsx +183 -0
  493. package/src/useContrastMode.tsx +149 -0
  494. package/src/web-component/index.ts +14 -0
  495. package/src/web-component/renderReactInWebComponent.test.tsx +156 -0
  496. package/src/web-component/renderReactInWebComponent.ts +153 -0
  497. package/src/web-component/shadow-dom.test.ts +24 -0
  498. package/src/{createShadowDomElements.ts → web-component/shadow-dom.ts} +15 -14
  499. package/dist/ContrastModeProvider.js +0 -86
  500. package/dist/ContrastModeProvider.js.map +0 -1
  501. package/dist/createShadowDomElements.js.map +0 -1
  502. package/dist/labs/NavAccordion.js.map +0 -1
  503. package/dist/labs/TopNav.js +0 -281
  504. package/dist/labs/TopNav.js.map +0 -1
  505. package/dist/src/ContrastModeProvider.d.ts +0 -34
  506. package/dist/src/ContrastModeProvider.d.ts.map +0 -1
  507. package/dist/src/createShadowDomElements.d.ts.map +0 -1
  508. package/dist/src/labs/NavAccordion.d.ts.map +0 -1
  509. package/dist/src/labs/TopNav.d.ts +0 -78
  510. package/dist/src/labs/TopNav.d.ts.map +0 -1
  511. package/src/ContrastModeProvider.tsx +0 -131
  512. package/src/labs/TopNav.tsx +0 -396
package/CHANGELOG.md CHANGED
@@ -3,6 +3,23 @@
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.27.0](https://github.com/okta/odyssey/compare/v1.26.0...v1.27.0) (2024-11-14)
7
+
8
+ ### Features
9
+
10
+ - adds drag-n-drop feature to the sidenav ([#2405](https://github.com/okta/odyssey/issues/2405)) ([aca8dad](https://github.com/okta/odyssey/commit/aca8dadd7130847112483f49bdc52b065bde3c88))
11
+
12
+ ## [1.26.0](https://github.com/okta/odyssey/compare/v1.25.0...v1.26.0) (2024-11-04)
13
+
14
+ ### Features
15
+
16
+ - adds side-nav collapse handle ([#2385](https://github.com/okta/odyssey/issues/2385)) ([1582be5](https://github.com/okta/odyssey/commit/1582be5669000c6dcec5881ba8178406a457a3b0))
17
+ - adds the ability to render an encapsulated Unified UI Shell ([#2373](https://github.com/okta/odyssey/issues/2373)) ([f964a29](https://github.com/okta/odyssey/commit/f964a29c7eb956fc05cb16fd51963a03c6b08507))
18
+
19
+ ### Bug Fixes
20
+
21
+ - enforce AppTile image heighgt ([#2400](https://github.com/okta/odyssey/issues/2400)) ([7e91875](https://github.com/okta/odyssey/commit/7e9187582cf1c33e6da8297c778549aebbe81d88))
22
+
6
23
  ## [1.25.0](https://github.com/okta/odyssey/compare/v1.24.1...v1.25.0) (2024-10-15)
7
24
 
8
25
  ### Features
@@ -1,5 +1,4 @@
1
1
  import _Autocomplete from "@mui/material/Autocomplete";
2
- import _InputBase from "@mui/material/InputBase";
3
2
  /*!
4
3
  * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
5
4
  * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
@@ -11,14 +10,12 @@ import _InputBase from "@mui/material/InputBase";
11
10
  *
12
11
  * See the License for the specific language governing permissions and limitations under the License.
13
12
  */
14
- import { createContext, forwardRef, memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
15
- import styled from "@emotion/styled";
16
- import { VariableSizeList } from "react-window";
13
+
14
+ import { memo } from "react";
17
15
  import { useTranslation } from "react-i18next";
18
- import { Field } from "./Field.js";
19
- import { ComponentControlledState, useInputValues, getControlState } from "./inputUtils.js";
16
+ import { PickerVirtualizationListBox } from "./labs/OdysseyPickers/PickerVirtualizationListBox.js";
17
+ import { useAutocomplete } from "./useAutocomplete.js";
20
18
  import { jsx as _jsx } from "react/jsx-runtime";
21
- import { createElement as _createElement } from "react";
22
19
  export const AutocompleteTestSelector = {
23
20
  accessibleText: {
24
21
  errorMessage: "errorMessage",
@@ -49,10 +46,6 @@ export const AutocompleteTestSelector = {
49
46
  role: "combobox"
50
47
  }
51
48
  };
52
- const ListboxContainer = styled.div`
53
- width: 100%;
54
- height: 100%;
55
- `;
56
49
  const Autocomplete = ({
57
50
  ariaDescribedBy,
58
51
  defaultValue,
@@ -68,15 +61,15 @@ const Autocomplete = ({
68
61
  isLoading,
69
62
  isOptional = false,
70
63
  isReadOnly,
71
- isVirtualized: isVirtualizedProp = false,
64
+ isVirtualized = false,
72
65
  hint,
73
66
  HintLinkComponent,
74
67
  label,
75
68
  name: nameOverride,
76
69
  noOptionsText,
77
70
  onBlur,
78
- onChange: onChangeProp,
79
- onInputChange: onInputChangeProp,
71
+ onChange,
72
+ onInputChange,
80
73
  onFocus,
81
74
  options,
82
75
  value,
@@ -87,187 +80,33 @@ const Autocomplete = ({
87
80
  const {
88
81
  t
89
82
  } = useTranslation();
90
- const controlledStateRef = useRef(getControlState({
91
- controlledValue: value,
92
- uncontrolledValue: defaultValue
93
- }));
94
- const isVirtualized = useRef(Boolean(isVirtualizedProp));
95
- const defaultValueProp = useMemo(() => {
96
- if (hasMultipleChoices) {
97
- if (value === undefined) {
98
- return defaultValue;
99
- }
100
- return [];
101
- }
102
- return value === undefined ? defaultValue : undefined;
103
- }, [defaultValue, hasMultipleChoices, value]);
104
- const valueProps = useInputValues({
105
- defaultValue: defaultValueProp,
106
- value: value,
107
- controlState: controlledStateRef.current
108
- });
109
- const inputValueProp = useMemo(() => {
110
- if (controlledStateRef.current === ComponentControlledState.CONTROLLED) {
111
- return {
112
- inputValue
113
- };
114
- }
115
- return undefined;
116
- }, [inputValue]);
117
- const renderInput = useCallback(({
118
- InputLabelProps,
119
- InputProps,
120
- ...params
121
- }) => _jsx(Field, {
122
- ariaDescribedBy: ariaDescribedBy,
123
- errorMessage: errorMessage,
124
- errorMessageList: errorMessageList,
125
- fieldType: "single",
126
- hasVisibleLabel: true,
127
- id: InputLabelProps.htmlFor,
128
- isFullWidth: isFullWidth,
129
- hint: hint,
130
- HintLinkComponent: HintLinkComponent,
131
- label: label,
132
- isOptional: isOptional,
133
- renderFieldComponent: ({
134
- ariaDescribedBy,
135
- id,
136
- errorMessageElementId,
137
- labelElementId
138
- }) => _jsx(_InputBase, {
139
- ...params,
140
- ...InputProps,
141
- inputProps: {
142
- ...params.inputProps,
143
- "aria-errormessage": errorMessageElementId,
144
- "aria-labelledby": labelElementId,
145
- "data-se": testId
146
- },
147
- "aria-describedby": ariaDescribedBy,
148
- id: id,
149
- name: nameOverride ?? id,
150
- required: !isOptional
151
- })
152
- }), [ariaDescribedBy, errorMessage, errorMessageList, hint, HintLinkComponent, isFullWidth, isOptional, label, nameOverride, testId]);
153
- const Row = ({
154
- data,
155
- index,
156
- setItemSize,
157
- style
158
- }) => {
159
- const rowRef = useRef(null);
160
- useEffect(() => {
161
- if (rowRef.current) {
162
- const firstChild = rowRef.current.firstElementChild;
163
- const height = firstChild ? firstChild.clientHeight : rowRef.current.clientHeight;
164
- setItemSize(height);
165
- }
166
- }, [index, rowRef, setItemSize]);
167
- const baseOption = data[index];
168
- const {
169
- key,
170
- props
171
- } = baseOption;
172
- const styles = useMemo(() => ({
173
- ...style,
174
- height: "auto"
175
- }), [style]);
176
- return _jsx("div", {
177
- ref: rowRef,
178
- children: _createElement("li", {
179
- ...props,
180
- key: key,
181
- style: styles
182
- })
183
- });
184
- };
185
- const OuterListboxContext = createContext({});
186
- const OuterListboxElementType = forwardRef((props, ref) => {
187
- const outerProps = useContext(OuterListboxContext);
188
- return _jsx("div", {
189
- ref: ref,
190
- ...props,
191
- ...outerProps
192
- });
193
- });
194
- const useResetCache = length => {
195
- const resetCacheRef = useRef(null);
196
- useEffect(() => {
197
- if (resetCacheRef.current) {
198
- resetCacheRef.current.resetAfterIndex(0, true);
199
- }
200
- }, [length]);
201
- return resetCacheRef;
202
- };
203
- const ListboxComponent = forwardRef(function (props, ref) {
204
- const [listHeight, setListHeight] = useState(0);
205
- const {
206
- children,
207
- ...other
208
- } = props;
209
- const itemData = children.flatMap(item => [item].concat(item.children || []));
210
- const sizeMap = useRef([]);
211
- const getListBoxHeight = useCallback(() => {
212
- const COMBINED_LISTBOX_PADDING = 16;
213
- if (itemData.length > OVERSCAN_ROW_COUNT) {
214
- return 99999;
215
- } else {
216
- const itemsHeightCalculated = itemData.map((_, index) => sizeMap.current[index] || 0).reduce((prevItemHeight, nextItemHeight) => prevItemHeight + nextItemHeight, 0);
217
- return COMBINED_LISTBOX_PADDING + itemsHeightCalculated;
218
- }
219
- }, [itemData, sizeMap]);
220
- useEffect(() => {
221
- if (sizeMap.current.length && itemData.length) {
222
- setListHeight(getListBoxHeight());
223
- }
224
- }, [getListBoxHeight, itemData, sizeMap]);
225
- const OVERSCAN_ROW_COUNT = 8;
226
- const gridRef = useResetCache(itemData.length);
227
- const setItemSize = useCallback(size => {
228
- gridRef?.current?.resetAfterIndex(0, true);
229
- sizeMap.current = sizeMap.current.concat(size);
230
- }, [gridRef, sizeMap]);
231
- const getItemSize = useCallback(index => sizeMap.current[index] || 45, [sizeMap]);
232
- return _jsx(ListboxContainer, {
233
- ref: ref,
234
- children: _jsx(OuterListboxContext.Provider, {
235
- value: other,
236
- children: _jsx(VariableSizeList, {
237
- innerElementType: "ul",
238
- itemData: itemData,
239
- itemCount: itemData.length,
240
- itemSize: getItemSize,
241
- height: listHeight,
242
- width: "100%",
243
- ref: gridRef,
244
- outerElementType: OuterListboxElementType,
245
- overscanCount: OVERSCAN_ROW_COUNT,
246
- children: ({
247
- data,
248
- index,
249
- style
250
- }) => _jsx(Row, {
251
- data: data,
252
- index: index,
253
- style: style,
254
- setItemSize: setItemSize
255
- })
256
- })
257
- })
258
- });
83
+ const {
84
+ inputValueProp,
85
+ isVirtualizedRef,
86
+ renderInput,
87
+ valueProps
88
+ } = useAutocomplete({
89
+ ariaDescribedBy,
90
+ defaultValue,
91
+ errorMessage,
92
+ errorMessageList,
93
+ hasMultipleChoices,
94
+ hint,
95
+ HintLinkComponent,
96
+ inputValue,
97
+ isFullWidth,
98
+ isOptional,
99
+ isVirtualized,
100
+ label,
101
+ name: nameOverride,
102
+ testId,
103
+ value
259
104
  });
260
- const onChange = useCallback((event, value, reason, details) => {
261
- onChangeProp?.(event, value, reason, details);
262
- }, [onChangeProp]);
263
- const onInputChange = useCallback((event, value, reason) => {
264
- onInputChangeProp?.(event, value, reason);
265
- }, [onInputChangeProp]);
266
105
  return _jsx(_Autocomplete, {
267
106
  ...valueProps,
268
107
  ...inputValueProp,
269
- ...(isVirtualized.current && {
270
- ListboxComponent
108
+ ...(isVirtualizedRef.current && {
109
+ ListboxComponent: PickerVirtualizationListBox
271
110
  }),
272
111
  "aria-disabled": isDisabled,
273
112
  clearText: t("clear.text"),
@@ -1 +1 @@
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","getOptionLabel","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 * Used to determine the string value for a given option. It's used to fill the input (and the list box options if renderOption is not provided). If used in free solo mode, it must accept both the type of the options and a string.\n *\n * `function(option: Value) => string`\n */\n getOptionLabel?: UseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"getOptionLabel\"];\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 getOptionLabel,\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 getOptionLabel={getOptionLabel}\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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AW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAI1H,YAAY"}
1
+ {"version":3,"file":"Autocomplete.js","names":["memo","useTranslation","PickerVirtualizationListBox","useAutocomplete","jsx","_jsx","AutocompleteTestSelector","accessibleText","errorMessage","hint","label","children","list","listItem","elementSelector","method","options","role","isControlledElement","Autocomplete","ariaDescribedBy","defaultValue","errorMessageList","getOptionLabel","hasMultipleChoices","id","idOverride","inputValue","isCustomValueAllowed","isDisabled","isFullWidth","isLoading","isOptional","isReadOnly","isVirtualized","HintLinkComponent","name","nameOverride","noOptionsText","onBlur","onChange","onInputChange","onFocus","value","getIsOptionEqualToValue","testId","translate","t","inputValueProp","isVirtualizedRef","renderInput","valueProps","_Autocomplete","current","ListboxComponent","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 { memo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport {\n Autocomplete as MuiAutocomplete,\n AutocompleteProps as MuiAutocompleteProps,\n UseAutocompleteProps as MuiUseAutocompleteProps,\n} from \"@mui/material\";\n\nimport { FieldComponentProps } from \"./FieldComponentProps\";\nimport type { HtmlProps } from \"./HtmlProps\";\nimport { PickerVirtualizationListBox } from \"./labs/OdysseyPickers/PickerVirtualizationListBox\";\nimport { useAutocomplete } from \"./useAutocomplete\";\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// type 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?: MuiUseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"defaultValue\"];\n /**\n * Used to determine the string value for a given option. It's used to fill the input (and the list box options if renderOption is not provided). If used in free solo mode, it must accept both the type of the options and a string.\n *\n * `function(option: Value) => string`\n */\n getOptionLabel?: MuiUseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"getOptionLabel\"];\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 * 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?: MuiUseAutocompleteProps<\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 * 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 /**\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?: MuiUseAutocompleteProps<\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?: MuiUseAutocompleteProps<\n OptionType,\n HasMultipleChoices,\n undefined,\n IsCustomValueAllowed\n >[\"value\"];\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 Autocomplete = <\n OptionType,\n HasMultipleChoices extends boolean | undefined,\n IsCustomValueAllowed extends boolean | undefined,\n>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n getOptionLabel,\n hasMultipleChoices,\n id: idOverride,\n inputValue,\n isCustomValueAllowed,\n isDisabled,\n isFullWidth = false,\n isLoading,\n isOptional = false,\n isReadOnly,\n isVirtualized = false,\n hint,\n HintLinkComponent,\n label,\n name: nameOverride,\n noOptionsText,\n onBlur,\n onChange,\n onInputChange,\n onFocus,\n options,\n value,\n getIsOptionEqualToValue,\n testId,\n translate,\n}: AutocompleteProps<OptionType, HasMultipleChoices, IsCustomValueAllowed>) => {\n const { t } = useTranslation();\n const { inputValueProp, isVirtualizedRef, renderInput, valueProps } =\n useAutocomplete<OptionType, HasMultipleChoices, IsCustomValueAllowed>({\n ariaDescribedBy,\n defaultValue,\n errorMessage,\n errorMessageList,\n hasMultipleChoices,\n hint,\n HintLinkComponent,\n inputValue,\n isFullWidth,\n isOptional,\n isVirtualized,\n label,\n name: nameOverride,\n testId,\n value,\n });\n\n return (\n <MuiAutocomplete\n {...valueProps}\n {...inputValueProp}\n // conditionally provide the ListboxComponent if this needs to be virtualized\n {...(isVirtualizedRef.current && {\n ListboxComponent: PickerVirtualizationListBox,\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 getOptionLabel={getOptionLabel}\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;;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,cAAc,QAAQ,eAAe;AAAC,SAStCC,2BAA2B;AAAA,SAC3BC,eAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAGxB,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;AAyKjC,MAAME,YAAY,GAAGA,CAInB;EACAC,eAAe;EACfC,YAAY;EACZb,YAAY;EACZc,gBAAgB;EAChBC,cAAc;EACdC,kBAAkB;EAClBC,EAAE,EAAEC,UAAU;EACdC,UAAU;EACVC,oBAAoB;EACpBC,UAAU;EACVC,WAAW,GAAG,KAAK;EACnBC,SAAS;EACTC,UAAU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IACfC,QAAQ,EAAEA,QAAS;IACnBC,aAAa,EAAEA,aAAc;IAC7BC,OAAO,EAAEA,OAAQ;IACjBsB,QAAQ,EAAEjB,CAAC,CAAC,WAAW,CAAE;IACzB/B,OAAO,EAAEA,OAAQ;IACjBiD,QAAQ,EAAEhC,UAAW;IACrBiB,WAAW,EAAEA,WAAY;IACzBgB,oBAAoB,EAAEtB,uBAAwB;IAC9CE,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN,CAAC;AAGD,MAAMqB,oBAAoB,GAAGnE,IAAI,CAACmB,YAAY,CAAwB;AAEtEgD,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIhD,YAAY"}
package/dist/Box.js CHANGED
@@ -16,6 +16,7 @@ const Box = forwardRef(({
16
16
  children,
17
17
  component,
18
18
  id,
19
+ role,
19
20
  sx,
20
21
  testId,
21
22
  translate
@@ -25,6 +26,7 @@ const Box = forwardRef(({
25
26
  component: component,
26
27
  "data-se": testId,
27
28
  id: id,
29
+ role: role,
28
30
  sx: sx,
29
31
  translate: translate
30
32
  }));
package/dist/Box.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Box.js","names":["forwardRef","memo","jsx","_jsx","Box","children","component","id","sx","testId","translate","ref","_Box","MemoizedBox","displayName"],"sources":["../src/Box.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 { Box as MuiBox, BoxProps as MuiBoxProps } from \"@mui/material\";\nimport { ReactNode, forwardRef, memo } from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type BoxProps = {\n children?: ReactNode;\n component?: MuiBoxProps[\"component\"];\n id?: MuiBoxProps[\"id\"];\n sx?: MuiBoxProps[\"sx\"];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Box = forwardRef<HTMLElement, BoxProps>(\n ({ children, component, id, sx, testId, translate }, ref) => (\n <MuiBox\n ref={ref}\n children={children}\n component={component}\n data-se={testId}\n id={id}\n sx={sx}\n translate={translate}\n />\n ),\n);\n\nconst MemoizedBox = memo(Box);\nMemoizedBox.displayName = \"Box\";\n\nexport { MemoizedBox as Box };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAAoBA,UAAU,EAAEC,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAWpD,MAAMC,GAAG,GAAGJ,UAAU,CACpB,CAAC;EAAEK,QAAQ;EAAEC,SAAS;EAAEC,EAAE;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAU,CAAC,EAAEC,GAAG,KACtDR,IAAA,CAAAS,IAAA;EACED,GAAG,EAAEA,GAAI;EACTN,QAAQ,EAAEA,QAAS;EACnBC,SAAS,EAAEA,SAAU;EACrB,WAASG,MAAO;EAChBF,EAAE,EAAEA,EAAG;EACPC,EAAE,EAAEA,EAAG;EACPE,SAAS,EAAEA;AAAU,CACtB,CAEL,CAAC;AAED,MAAMG,WAAW,GAAGZ,IAAI,CAACG,GAAG,CAAC;AAC7BS,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIT,GAAG"}
1
+ {"version":3,"file":"Box.js","names":["forwardRef","memo","jsx","_jsx","Box","children","component","id","role","sx","testId","translate","ref","_Box","MemoizedBox","displayName"],"sources":["../src/Box.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 { Box as MuiBox, BoxProps as MuiBoxProps } from \"@mui/material\";\nimport { AriaRole, ReactNode, forwardRef, memo } from \"react\";\n\nimport type { HtmlProps } from \"./HtmlProps\";\n\nexport type BoxProps = {\n children?: ReactNode;\n component?: MuiBoxProps[\"component\"];\n id?: MuiBoxProps[\"id\"];\n role?: AriaRole;\n sx?: MuiBoxProps[\"sx\"];\n} & Pick<HtmlProps, \"testId\" | \"translate\">;\n\nconst Box = forwardRef<HTMLElement, BoxProps>(\n ({ children, component, id, role, sx, testId, translate }, ref) => (\n <MuiBox\n ref={ref}\n children={children}\n component={component}\n data-se={testId}\n id={id}\n role={role}\n sx={sx}\n translate={translate}\n />\n ),\n);\n\nconst MemoizedBox = memo(Box);\nMemoizedBox.displayName = \"Box\";\n\nexport { MemoizedBox as Box };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,SAA8BA,UAAU,EAAEC,IAAI,QAAQ,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAY9D,MAAMC,GAAG,GAAGJ,UAAU,CACpB,CAAC;EAAEK,QAAQ;EAAEC,SAAS;EAAEC,EAAE;EAAEC,IAAI;EAAEC,EAAE;EAAEC,MAAM;EAAEC;AAAU,CAAC,EAAEC,GAAG,KAC5DT,IAAA,CAAAU,IAAA;EACED,GAAG,EAAEA,GAAI;EACTP,QAAQ,EAAEA,QAAS;EACnBC,SAAS,EAAEA,SAAU;EACrB,WAASI,MAAO;EAChBH,EAAE,EAAEA,EAAG;EACPC,IAAI,EAAEA,IAAK;EACXC,EAAE,EAAEA,EAAG;EACPE,SAAS,EAAEA;AAAU,CACtB,CAEL,CAAC;AAED,MAAMG,WAAW,GAAGb,IAAI,CAACG,GAAG,CAAC;AAC7BU,WAAW,CAACC,WAAW,GAAG,KAAK;AAE/B,SAASD,WAAW,IAAIV,GAAG"}
package/dist/Card.js CHANGED
@@ -33,6 +33,7 @@ const ImageContainer = styled("div", {
33
33
  display: "flex",
34
34
  alignItems: "flex-start",
35
35
  maxHeight: CARD_IMAGE_HEIGHT,
36
+ height: CARD_IMAGE_HEIGHT,
36
37
  marginBlockEnd: odysseyDesignTokens.Spacing5,
37
38
  paddingRight: hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0
38
39
  }));
package/dist/Card.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Card.js","names":["memo","useMemo","useEffect","styled","ButtonContext","MoreIcon","MenuButton","useOdysseyDesignTokens","Heading5","Paragraph","Support","Box","jsx","_jsx","jsxs","_jsxs","CARD_IMAGE_HEIGHT","ImageContainer","shouldForwardProp","prop","odysseyDesignTokens","hasMenuButtonChildren","display","alignItems","maxHeight","marginBlockEnd","Spacing5","paddingRight","MenuButtonContainer","position","right","Spacing3","top","CardContentContainer","buttonProviderValue","isFullWidth","Card","button","description","image","menuButtonChildren","onClick","overline","title","cardContent","children","Boolean","component","color","_CardActions","Provider","value","_Card","className","_CardActionArea","endIcon","ariaLabel","buttonVariant","menuAlignment","size","tooltipText","MemoizedCard","displayName","Tile","props","console","warn","MemoizedTile"],"sources":["../src/Card.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n MouseEventHandler,\n ReactElement,\n memo,\n useMemo,\n useEffect,\n} from \"react\";\nimport {\n Card as MuiCard,\n CardActions as MuiCardActions,\n CardActionArea as MuiCardActionArea,\n} from \"@mui/material\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"./Button\";\nimport { ButtonContext } from \"./ButtonContext\";\nimport { MoreIcon } from \"./icons.generated\";\nimport { MenuButton, MenuButtonProps } from \"./MenuButton\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { Heading5, Paragraph, Support } from \"./Typography\";\nimport { Box } from \"./Box\";\n\nexport const CARD_IMAGE_HEIGHT = \"64px\";\n\nexport type CardProps = {\n description?: string;\n image?: ReactElement;\n overline?: string;\n title?: string;\n} & (\n | {\n onClick: MouseEventHandler;\n button?: never;\n menuButtonChildren?: never;\n }\n | {\n onClick?: never;\n button?: ReactElement<typeof Button>;\n menuButtonChildren?: MenuButtonProps[\"children\"];\n }\n);\n\nconst ImageContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasMenuButtonChildren\",\n})<{\n odysseyDesignTokens: DesignTokens;\n hasMenuButtonChildren: boolean;\n}>(({ odysseyDesignTokens, hasMenuButtonChildren }) => ({\n display: \"flex\",\n alignItems: \"flex-start\",\n maxHeight: CARD_IMAGE_HEIGHT,\n marginBlockEnd: odysseyDesignTokens.Spacing5,\n paddingRight: hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0,\n}));\n\nconst MenuButtonContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n position: \"absolute\",\n right: odysseyDesignTokens.Spacing3,\n top: odysseyDesignTokens.Spacing3,\n}));\n\nconst CardContentContainer = styled(\"div\")(() => ({\n display: \"flex\",\n}));\n\nconst buttonProviderValue = { isFullWidth: true };\n\nconst Card = ({\n button,\n description,\n image,\n menuButtonChildren,\n onClick,\n overline,\n title,\n}: CardProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const cardContent = useMemo(\n () => (\n <CardContentContainer>\n <Box>\n {image && (\n <ImageContainer\n odysseyDesignTokens={odysseyDesignTokens}\n hasMenuButtonChildren={Boolean(menuButtonChildren)}\n >\n {image}\n </ImageContainer>\n )}\n\n {overline && <Support component=\"div\">{overline}</Support>}\n {title && <Heading5 component=\"div\">{title}</Heading5>}\n {description && (\n <Paragraph color=\"textSecondary\">{description}</Paragraph>\n )}\n\n {button && (\n <MuiCardActions>\n <ButtonContext.Provider value={buttonProviderValue}>\n {button}\n </ButtonContext.Provider>\n </MuiCardActions>\n )}\n </Box>\n </CardContentContainer>\n ),\n [\n button,\n description,\n image,\n menuButtonChildren,\n overline,\n title,\n odysseyDesignTokens,\n ],\n );\n\n return (\n <MuiCard className={onClick ? \"isClickable\" : \"\"}>\n {onClick ? (\n <MuiCardActionArea onClick={onClick}>{cardContent}</MuiCardActionArea>\n ) : (\n cardContent\n )}\n\n {menuButtonChildren && (\n <MenuButtonContainer odysseyDesignTokens={odysseyDesignTokens}>\n <MenuButton\n endIcon={<MoreIcon />}\n ariaLabel=\"Card menu\"\n buttonVariant=\"floating\"\n menuAlignment=\"right\"\n size=\"small\"\n tooltipText=\"Actions\"\n >\n {menuButtonChildren}\n </MenuButton>\n </MenuButtonContainer>\n )}\n </MuiCard>\n );\n};\n\nconst MemoizedCard = memo(Card);\nMemoizedCard.displayName = \"Card\";\n\n/**\n * @deprecated The 'Tile' component is now called 'Card'. Please update your references as 'Tile' will be deprecated soon.\n */\nconst Tile = (props: CardProps) => {\n useEffect(() => {\n console.warn(\n \"Warning: The 'Tile' component is now called 'Card'. Please update your references as 'Tile' will be deprecated soon.\",\n );\n }, []);\n\n return <MemoizedCard {...props} />;\n};\n\nconst MemoizedTile = memo(Tile);\nMemoizedTile.displayName = \"Tile\";\n\nexport { MemoizedCard as Card, Memo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IAAAI,QAAA,GAC9CJ,OAAO,GACN5B,IAAA,CAAAyC,eAAA;MAAmBb,OAAO,EAAEA,OAAQ;MAAAI,QAAA,EAAED;IAAW,CAAoB,CAAC,GAEtEA,WACD,EAEAJ,kBAAkB,IACjB3B,IAAA,CAACe,mBAAmB;MAACR,mBAAmB,EAAEA,mBAAoB;MAAAyB,QAAA,EAC5DhC,IAAA,CAACP,UAAU;QACTiD,OAAO,EAAE1C,IAAA,CAACR,QAAQ,IAAE,CAAE;QACtBmD,SAAS,EAAC,WAAW;QACrBC,aAAa,EAAC,UAAU;QACxBC,aAAa,EAAC,OAAO;QACrBC,IAAI,EAAC,OAAO;QACZC,WAAW,EAAC,SAAS;QAAAf,QAAA,EAEpBL;MAAkB,CACT;IAAC,CACM,CACtB;EAAA,CACM,CAAC;AAEd,CAAC;AAED,MAAMqB,YAAY,GAAG7D,IAAI,CAACoC,IAAI,CAAC;AAC/ByB,YAAY,CAACC,WAAW,GAAG,MAAM;AAKjC,MAAMC,IAAI,GAAIC,KAAgB,IAAK;EACjC9D,SAAS,CAAC,MAAM;IACd+D,OAAO,CAACC,IAAI,CACV,sHACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOrD,IAAA,CAACgD,YAAY;IAAA,GAAKG;EAAK,CAAG,CAAC;AACpC,CAAC;AAED,MAAMG,YAAY,GAAGnE,IAAI,CAAC+D,IAAI,CAAC;AAC/BI,YAAY,CAACL,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIzB,IAAI,EAAE+B,YAAY,IAAIJ,IAAI"}
1
+ {"version":3,"file":"Card.js","names":["memo","useMemo","useEffect","styled","ButtonContext","MoreIcon","MenuButton","useOdysseyDesignTokens","Heading5","Paragraph","Support","Box","jsx","_jsx","jsxs","_jsxs","CARD_IMAGE_HEIGHT","ImageContainer","shouldForwardProp","prop","odysseyDesignTokens","hasMenuButtonChildren","display","alignItems","maxHeight","height","marginBlockEnd","Spacing5","paddingRight","MenuButtonContainer","position","right","Spacing3","top","CardContentContainer","buttonProviderValue","isFullWidth","Card","button","description","image","menuButtonChildren","onClick","overline","title","cardContent","children","Boolean","component","color","_CardActions","Provider","value","_Card","className","_CardActionArea","endIcon","ariaLabel","buttonVariant","menuAlignment","size","tooltipText","MemoizedCard","displayName","Tile","props","console","warn","MemoizedTile"],"sources":["../src/Card.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n MouseEventHandler,\n ReactElement,\n memo,\n useMemo,\n useEffect,\n} from \"react\";\nimport {\n Card as MuiCard,\n CardActions as MuiCardActions,\n CardActionArea as MuiCardActionArea,\n} from \"@mui/material\";\nimport styled from \"@emotion/styled\";\n\nimport { Button } from \"./Button\";\nimport { ButtonContext } from \"./ButtonContext\";\nimport { MoreIcon } from \"./icons.generated\";\nimport { MenuButton, MenuButtonProps } from \"./MenuButton\";\nimport {\n DesignTokens,\n useOdysseyDesignTokens,\n} from \"./OdysseyDesignTokensContext\";\nimport { Heading5, Paragraph, Support } from \"./Typography\";\nimport { Box } from \"./Box\";\n\nexport const CARD_IMAGE_HEIGHT = \"64px\";\n\nexport type CardProps = {\n description?: string;\n image?: ReactElement;\n overline?: string;\n title?: string;\n} & (\n | {\n onClick: MouseEventHandler;\n button?: never;\n menuButtonChildren?: never;\n }\n | {\n onClick?: never;\n button?: ReactElement<typeof Button>;\n menuButtonChildren?: MenuButtonProps[\"children\"];\n }\n);\n\nconst ImageContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" && prop !== \"hasMenuButtonChildren\",\n})<{\n odysseyDesignTokens: DesignTokens;\n hasMenuButtonChildren: boolean;\n}>(({ odysseyDesignTokens, hasMenuButtonChildren }) => ({\n display: \"flex\",\n alignItems: \"flex-start\",\n maxHeight: CARD_IMAGE_HEIGHT,\n height: CARD_IMAGE_HEIGHT,\n marginBlockEnd: odysseyDesignTokens.Spacing5,\n paddingRight: hasMenuButtonChildren ? odysseyDesignTokens.Spacing5 : 0,\n}));\n\nconst MenuButtonContainer = styled(\"div\", {\n shouldForwardProp: (prop) => prop !== \"odysseyDesignTokens\",\n})<{ odysseyDesignTokens: DesignTokens }>(({ odysseyDesignTokens }) => ({\n position: \"absolute\",\n right: odysseyDesignTokens.Spacing3,\n top: odysseyDesignTokens.Spacing3,\n}));\n\nconst CardContentContainer = styled(\"div\")(() => ({\n display: \"flex\",\n}));\n\nconst buttonProviderValue = { isFullWidth: true };\n\nconst Card = ({\n button,\n description,\n image,\n menuButtonChildren,\n onClick,\n overline,\n title,\n}: CardProps) => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const cardContent = useMemo(\n () => (\n <CardContentContainer>\n <Box>\n {image && (\n <ImageContainer\n odysseyDesignTokens={odysseyDesignTokens}\n hasMenuButtonChildren={Boolean(menuButtonChildren)}\n >\n {image}\n </ImageContainer>\n )}\n\n {overline && <Support component=\"div\">{overline}</Support>}\n {title && <Heading5 component=\"div\">{title}</Heading5>}\n {description && (\n <Paragraph color=\"textSecondary\">{description}</Paragraph>\n )}\n\n {button && (\n <MuiCardActions>\n <ButtonContext.Provider value={buttonProviderValue}>\n {button}\n </ButtonContext.Provider>\n </MuiCardActions>\n )}\n </Box>\n </CardContentContainer>\n ),\n [\n button,\n description,\n image,\n menuButtonChildren,\n overline,\n title,\n odysseyDesignTokens,\n ],\n );\n\n return (\n <MuiCard className={onClick ? \"isClickable\" : \"\"}>\n {onClick ? (\n <MuiCardActionArea onClick={onClick}>{cardContent}</MuiCardActionArea>\n ) : (\n cardContent\n )}\n\n {menuButtonChildren && (\n <MenuButtonContainer odysseyDesignTokens={odysseyDesignTokens}>\n <MenuButton\n endIcon={<MoreIcon />}\n ariaLabel=\"Card menu\"\n buttonVariant=\"floating\"\n menuAlignment=\"right\"\n size=\"small\"\n tooltipText=\"Actions\"\n >\n {menuButtonChildren}\n </MenuButton>\n </MenuButtonContainer>\n )}\n </MuiCard>\n );\n};\n\nconst MemoizedCard = memo(Card);\nMemoizedCard.displayName = \"Card\";\n\n/**\n * @deprecated The 'Tile' component is now called 'Card'. Please update your references as 'Tile' will be deprecated soon.\n */\nconst Tile = (props: CardProps) => {\n useEffect(() => {\n console.warn(\n \"Warning: The 'Tile' component is now called 'Card'. Please update your references as 'Tile' will be deprecated soon.\",\n );\n }, []);\n\n return <MemoizedCard {...props} />;\n};\n\nconst MemoizedTile = memo(Tile);\nMemoizedTile.displayName = \"Tile\";\n\nexport { MemoizedCard as Card, MemoizedTile as Tile };\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAGEA,IAAI,EACJC,OAAO,EACPC,SAAS,QACJ,OAAO;AAMd,OAAOC,MAAM,MAAM,iBAAiB;AAAC,SAG5BC,aAAa;AAAA,SACbC,QAAQ;AAAA,SACRC,UAAU;AAAA,SAGjBC,sBAAsB;AAAA,SAEfC,QAAQ,EAAEC,SAAS,EAAEC,OAAO;AAAA,SAC5BC,GAAG;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,IAAAC,KAAA;AAEZ,OAAO,MAAMC,iBAAiB,GAAG,MAAM;AAoBvC,MAAMC,cAAc,GAAGd,MAAM,CAAC,KAAK,EAAE;EACnCe,iBAAiB,EAAGC,IAAI,IACtBA,IAAI,KAAK,qBAAqB,IAAIA,IAAI,KAAK;AAC/C,CAAC,CAAC,CAGC,CAAC;EAAEC,mBAAmB;EAAEC;AAAsB,CAAC,MAAM;EACtDC,OAAO,EAAE,MAAM;EACfC,UAAU,E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AAgB,IAAK;EACjC/D,SAAS,CAAC,MAAM;IACdgE,OAAO,CAACC,IAAI,CACV,sHACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOtD,IAAA,CAACiD,YAAY;IAAA,GAAKG;EAAK,CAAG,CAAC;AACpC,CAAC;AAED,MAAMG,YAAY,GAAGpE,IAAI,CAACgE,IAAI,CAAC;AAC/BI,YAAY,CAACL,WAAW,GAAG,MAAM;AAEjC,SAASD,YAAY,IAAIzB,IAAI,EAAE+B,YAAY,IAAIJ,IAAI"}
@@ -10,8 +10,9 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import * as Tokens from "@okta/odyssey-design-tokens";
13
+ import * as odysseyDesignTokens from "@okta/odyssey-design-tokens";
14
14
  import { createContext, useContext } from "react";
15
- export const OdysseyDesignTokensContext = createContext(Tokens);
15
+ export const defaultOdysseyDesignTokensContextValue = odysseyDesignTokens;
16
+ export const OdysseyDesignTokensContext = createContext(defaultOdysseyDesignTokensContextValue);
16
17
  export const useOdysseyDesignTokens = () => useContext(OdysseyDesignTokensContext);
17
18
  //# sourceMappingURL=OdysseyDesignTokensContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyDesignTokensContext.js","names":["Tokens","createContext","useContext","OdysseyDesignTokensContext","useOdysseyDesignTokens"],"sources":["../src/OdysseyDesignTokensContext.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 * as Tokens from \"@okta/odyssey-design-tokens\";\nimport { createContext, useContext } from \"react\";\n\nexport type DesignTokens = typeof Tokens;\nexport const OdysseyDesignTokensContext = createContext<DesignTokens>(Tokens);\n\nexport const useOdysseyDesignTokens = () =>\n useContext(OdysseyDesignTokensContext);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,MAAM,MAAM,6BAA6B;AACrD,SAASC,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAGjD,OAAO,MAAMC,0BAA0B,GAAGF,aAAa,CAAeD,MAAM,CAAC;AAE7E,OAAO,MAAMI,sBAAsB,GAAGA,CAAA,KACpCF,UAAU,CAACC,0BAA0B,CAAC"}
1
+ {"version":3,"file":"OdysseyDesignTokensContext.js","names":["odysseyDesignTokens","createContext","useContext","defaultOdysseyDesignTokensContextValue","OdysseyDesignTokensContext","useOdysseyDesignTokens"],"sources":["../src/OdysseyDesignTokensContext.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 * as odysseyDesignTokens from \"@okta/odyssey-design-tokens\";\nimport { createContext, useContext } from \"react\";\n\nexport type DesignTokens = typeof odysseyDesignTokens;\nexport const defaultOdysseyDesignTokensContextValue = odysseyDesignTokens;\nexport const OdysseyDesignTokensContext = createContext(\n defaultOdysseyDesignTokensContextValue,\n);\n\nexport const useOdysseyDesignTokens = () =>\n useContext(OdysseyDesignTokensContext);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,mBAAmB,MAAM,6BAA6B;AAClE,SAASC,aAAa,EAAEC,UAAU,QAAQ,OAAO;AAGjD,OAAO,MAAMC,sCAAsC,GAAGH,mBAAmB;AACzE,OAAO,MAAMI,0BAA0B,GAAGH,aAAa,CACrDE,sCACF,CAAC;AAED,OAAO,MAAME,sBAAsB,GAAGA,CAAA,KACpCH,UAAU,CAACE,0BAA0B,CAAC"}
@@ -21,25 +21,27 @@ const scopedCssBaselineStyles = {
21
21
  };
22
22
  const OdysseyProvider = ({
23
23
  children,
24
+ contrastMode,
24
25
  designTokensOverride,
25
26
  emotionRoot,
26
27
  emotionRootElement,
27
- shadowDomElement,
28
- shadowRootElement,
29
28
  languageCode,
30
29
  nonce,
30
+ shadowDomElement,
31
+ shadowRootElement,
31
32
  stylisPlugins,
32
33
  themeOverride,
33
34
  translationOverrides
34
35
  }) => _jsx(OdysseyCacheProvider, {
35
- emotionRoot: emotionRoot,
36
- emotionRootElement: emotionRootElement,
36
+ emotionRootElement: emotionRootElement || emotionRoot,
37
37
  hasShadowDom: Boolean(shadowRootElement || shadowDomElement),
38
38
  nonce: nonce,
39
39
  stylisPlugins: stylisPlugins,
40
40
  children: _jsx(OdysseyThemeProvider, {
41
+ contrastMode: contrastMode,
41
42
  designTokensOverride: designTokensOverride,
42
- shadowRootElement: shadowRootElement || shadowDomElement,
43
+ shadowDomElement: shadowDomElement,
44
+ shadowRootElement: shadowRootElement,
43
45
  themeOverride: themeOverride,
44
46
  children: _jsx(_ScopedCssBaseline, {
45
47
  sx: scopedCssBaselineStyles,
@@ -51,6 +53,6 @@ const OdysseyProvider = ({
51
53
  })
52
54
  })
53
55
  });
54
- const MemoizedThemeProvider = memo(OdysseyProvider);
55
- export { MemoizedThemeProvider as OdysseyProvider };
56
+ const MemoizedOdysseyProvider = memo(OdysseyProvider);
57
+ export { MemoizedOdysseyProvider as OdysseyProvider };
56
58
  //# sourceMappingURL=OdysseyProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","scopedCssBaselineStyles","height","OdysseyProvider","children","designTokensOverride","emotionRoot","emotionRootElement","shadowDomElement","shadowRootElement","languageCode","nonce","stylisPlugins","themeOverride","translationOverrides","hasShadowDom","Boolean","_ScopedCssBaseline","sx","MemoizedThemeProvider"],"sources":["../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { ScopedCssBaseline } from \"@mui/material\";\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider\";\nimport {\n OdysseyTranslationProvider,\n OdysseyTranslationProviderProps,\n} from \"./OdysseyTranslationProvider\";\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\n\nconst scopedCssBaselineStyles = {\n height: \"inherit\",\n};\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n };\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n designTokensOverride,\n emotionRoot,\n emotionRootElement,\n shadowDomElement,\n shadowRootElement,\n languageCode,\n nonce,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n emotionRoot={emotionRoot}\n emotionRootElement={emotionRootElement}\n hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}\n nonce={nonce}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n designTokensOverride={designTokensOverride}\n shadowRootElement={shadowRootElement || shadowDomElement}\n themeOverride={themeOverride}\n >\n {/* This component creates a div; for flexibility of layout of children, make it inherit its parent's height */}\n <ScopedCssBaseline sx={scopedCssBaselineStyles}>\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n </ScopedCssBaseline>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\nconst MemoizedThemeProvider = memo(OdysseyProvider) as typeof OdysseyProvider;\nexport { MemoizedThemeProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAGtCC,oBAAoB;AAAA,SAIpBC,oBAAoB;AAAA,SAIpBC,0BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAK5B,MAAMC,uBAAuB,GAAG;EAC9BC,MAAM,EAAE;AACV,CAAC;AAQD,MAAMC,eAAe,GAAGA,CAAoC;EAC1DC,QAAQ;EACRC,oBAAoB;EACpBC,WAAW;EACXC,kBAAkB;EAClBC,gBAAgB;EAChBC,iBAAiB;EACjBC,YAAY;EACZC,KAAK;EACLC,aAAa;EACbC,aAAa;EACbC;AACwC,CAAC,KACzCd,IAAA,CAACJ,oBAAoB;EACnBU,WAAW,EAAEA,WAAY;EACzBC,kBAAkB,EAAEA,kBAAmB;EACvCQ,YAAY,EAAEC,OAAO,CAACP,iBAAiB,IAAID,gBAAgB,CAAE;EAC7DG,KAAK,EAAEA,KAAM;EACbC,aAAa,EAAEA,aAAc;EAAAR,QAAA,EAE7BJ,IAAA,CAACH,oBAAoB;IACnBQ,oBAAoB,EAAEA,oBAAqB;IAC3CI,iBAAiB,EAAEA,iBAAiB,IAAID,gBAAiB;IACzDK,aAAa,EAAEA,aAAc;IAAAT,QAAA,EAG7BJ,IAAA,CAAAiB,kBAAA;MAAmBC,EAAE,EAAEjB,uBAAwB;MAAAG,QAAA,EAC7CJ,IAAA,CAACF,0BAA0B;QACzBY,YAAY,EAAEA,YAAa;QAC3BI,oBAAoB,EAAEA,oBAAqB;QAAAV,QAAA,EAE1CA;MAAQ,CACiB;IAAC,CACZ;EAAC,CACA;AAAC,CACH,CACvB;AACD,MAAMe,qBAAqB,GAAGxB,IAAI,CAACQ,eAAe,CAA2B;AAC7E,SAASgB,qBAAqB,IAAIhB,eAAe"}
1
+ {"version":3,"file":"OdysseyProvider.js","names":["memo","OdysseyCacheProvider","OdysseyThemeProvider","OdysseyTranslationProvider","jsx","_jsx","scopedCssBaselineStyles","height","OdysseyProvider","children","contrastMode","designTokensOverride","emotionRoot","emotionRootElement","languageCode","nonce","shadowDomElement","shadowRootElement","stylisPlugins","themeOverride","translationOverrides","hasShadowDom","Boolean","_ScopedCssBaseline","sx","MemoizedOdysseyProvider"],"sources":["../src/OdysseyProvider.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, ReactNode } from \"react\";\nimport { ScopedCssBaseline } from \"@mui/material\";\n\nimport {\n OdysseyCacheProvider,\n OdysseyCacheProviderProps,\n} from \"./OdysseyCacheProvider\";\nimport {\n OdysseyThemeProvider,\n OdysseyThemeProviderProps,\n} from \"./OdysseyThemeProvider\";\nimport {\n OdysseyTranslationProvider,\n OdysseyTranslationProviderProps,\n} from \"./OdysseyTranslationProvider\";\nimport { DefaultSupportedLanguages } from \"./OdysseyTranslationProvider.types\";\nconst scopedCssBaselineStyles = {\n height: \"inherit\",\n};\n\nexport type OdysseyProviderProps<\n SupportedLanguages extends string = DefaultSupportedLanguages,\n> = OdysseyCacheProviderProps &\n OdysseyThemeProviderProps &\n OdysseyTranslationProviderProps<SupportedLanguages> & {\n children: ReactNode;\n };\n\nconst OdysseyProvider = <SupportedLanguages extends string>({\n children,\n contrastMode,\n designTokensOverride,\n emotionRoot,\n emotionRootElement,\n languageCode,\n nonce,\n shadowDomElement,\n shadowRootElement,\n stylisPlugins,\n themeOverride,\n translationOverrides,\n}: OdysseyProviderProps<SupportedLanguages>) => (\n <OdysseyCacheProvider\n emotionRootElement={emotionRootElement || emotionRoot}\n hasShadowDom={Boolean(shadowRootElement || shadowDomElement)}\n nonce={nonce}\n stylisPlugins={stylisPlugins}\n >\n <OdysseyThemeProvider\n contrastMode={contrastMode}\n designTokensOverride={designTokensOverride}\n shadowDomElement={shadowDomElement}\n shadowRootElement={shadowRootElement}\n themeOverride={themeOverride}\n >\n {/* This component creates a div; for flexibility of layout of children, make it inherit its parent's height */}\n <ScopedCssBaseline sx={scopedCssBaselineStyles}>\n <OdysseyTranslationProvider<SupportedLanguages>\n languageCode={languageCode}\n translationOverrides={translationOverrides}\n >\n {children}\n </OdysseyTranslationProvider>\n </ScopedCssBaseline>\n </OdysseyThemeProvider>\n </OdysseyCacheProvider>\n);\nconst MemoizedOdysseyProvider = memo(OdysseyProvider) as typeof OdysseyProvider;\n\nexport { MemoizedOdysseyProvider as OdysseyProvider };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,QAAmB,OAAO;AAAC,SAItCC,oBAAoB;AAAA,SAIpBC,oBAAoB;AAAA,SAIpBC,0BAA0B;AAAA,SAAAC,GAAA,I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