@okta/odyssey-react-mui 1.24.1 → 1.26.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 (504) hide show
  1. package/CHANGELOG.md +21 -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 +22 -40
  11. package/dist/OdysseyProvider.js.map +1 -1
  12. package/dist/OdysseyThemeProvider.js +33 -12
  13. package/dist/OdysseyThemeProvider.js.map +1 -1
  14. package/dist/OdysseyTranslationProvider.types.js +1 -1
  15. package/dist/OdysseyTranslationProvider.types.js.map +1 -1
  16. package/dist/Pagination/Pagination.js +46 -14
  17. package/dist/Pagination/Pagination.js.map +1 -1
  18. package/dist/Select.js +10 -2
  19. package/dist/Select.js.map +1 -1
  20. package/dist/Surface.js +4 -1
  21. package/dist/Surface.js.map +1 -1
  22. package/dist/Tag.js +97 -47
  23. package/dist/Tag.js.map +1 -1
  24. package/dist/i18n.js +2 -0
  25. package/dist/i18n.js.map +1 -1
  26. package/dist/index.js +6 -7
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.scss +1 -1
  29. package/dist/labs/AppTile.js +137 -39
  30. package/dist/labs/AppTile.js.map +1 -1
  31. package/dist/labs/DataView/CardLayoutContent.js +7 -8
  32. package/dist/labs/DataView/CardLayoutContent.js.map +1 -1
  33. package/dist/labs/DataView/DataCard.js +96 -43
  34. package/dist/labs/DataView/DataCard.js.map +1 -1
  35. package/dist/labs/DataView/TableLayoutContent.js +3 -2
  36. package/dist/labs/DataView/TableLayoutContent.js.map +1 -1
  37. package/dist/labs/DataView/componentTypes.js.map +1 -1
  38. package/dist/labs/DataView/index.js.map +1 -1
  39. package/dist/labs/OdysseyPickers/ComposablePicker.js +113 -0
  40. package/dist/labs/OdysseyPickers/ComposablePicker.js.map +1 -0
  41. package/dist/labs/OdysseyPickers/Picker.js +261 -0
  42. package/dist/labs/OdysseyPickers/Picker.js.map +1 -0
  43. package/dist/labs/OdysseyPickers/PickerVirtualizationListBox.js +132 -0
  44. package/dist/labs/OdysseyPickers/PickerVirtualizationListBox.js.map +1 -0
  45. package/dist/labs/OdysseyPickers/PickerWithOptionAdornment.js +291 -0
  46. package/dist/labs/OdysseyPickers/PickerWithOptionAdornment.js.map +1 -0
  47. package/dist/{src/createShadowDomElements.d.ts → labs/OdysseyPickers/index.js} +4 -7
  48. package/dist/labs/OdysseyPickers/index.js.map +1 -0
  49. package/dist/labs/PageTemplate.js +14 -10
  50. package/dist/labs/PageTemplate.js.map +1 -1
  51. package/dist/labs/SideNav/CollapseIcon.js +11 -25
  52. package/dist/labs/SideNav/CollapseIcon.js.map +1 -1
  53. package/dist/labs/SideNav/HandleIcon.js +32 -0
  54. package/dist/labs/SideNav/HandleIcon.js.map +1 -0
  55. package/dist/labs/{NavAccordion.js → SideNav/NavAccordion.js} +35 -6
  56. package/dist/labs/SideNav/NavAccordion.js.map +1 -0
  57. package/dist/labs/SideNav/OktaAura.js +32 -0
  58. package/dist/labs/SideNav/OktaAura.js.map +1 -0
  59. package/dist/labs/SideNav/OktaLogo.js +6 -9
  60. package/dist/labs/SideNav/OktaLogo.js.map +1 -1
  61. package/dist/labs/SideNav/SideNav.js +239 -169
  62. package/dist/labs/SideNav/SideNav.js.map +1 -1
  63. package/dist/labs/SideNav/SideNavFooterContent.js +32 -18
  64. package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -1
  65. package/dist/labs/SideNav/SideNavHeader.js +48 -37
  66. package/dist/labs/SideNav/SideNavHeader.js.map +1 -1
  67. package/dist/labs/SideNav/SideNavItemContent.js +100 -58
  68. package/dist/labs/SideNav/SideNavItemContent.js.map +1 -1
  69. package/dist/labs/SideNav/SideNavItemContentContext.js +19 -0
  70. package/dist/labs/SideNav/SideNavItemContentContext.js.map +1 -0
  71. package/dist/labs/SideNav/SideNavItemLinkContent.js +14 -13
  72. package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -1
  73. package/dist/labs/SideNav/SideNavLogo.js +42 -0
  74. package/dist/labs/SideNav/SideNavLogo.js.map +1 -0
  75. package/dist/labs/SideNav/SideNavToggleButton.js +170 -0
  76. package/dist/labs/SideNav/SideNavToggleButton.js.map +1 -0
  77. package/dist/labs/SideNav/types.js.map +1 -1
  78. package/dist/labs/TopNav/TopNav.js +65 -0
  79. package/dist/labs/TopNav/TopNav.js.map +1 -0
  80. package/dist/labs/TopNav/TopNavLinksList.js +38 -0
  81. package/dist/labs/TopNav/TopNavLinksList.js.map +1 -0
  82. package/dist/labs/TopNav/TopNavListItem.js +132 -0
  83. package/dist/labs/TopNav/TopNavListItem.js.map +1 -0
  84. package/dist/labs/TopNav/UserProfile.js +65 -0
  85. package/dist/labs/TopNav/UserProfile.js.map +1 -0
  86. package/dist/labs/TopNav/index.js +14 -0
  87. package/dist/labs/TopNav/index.js.map +1 -0
  88. package/dist/labs/UiShell/UiShell.js +68 -0
  89. package/dist/labs/UiShell/UiShell.js.map +1 -0
  90. package/dist/labs/UiShell/UiShellContent.js +114 -0
  91. package/dist/labs/UiShell/UiShellContent.js.map +1 -0
  92. package/dist/labs/UiShell/bufferLatest.js +37 -0
  93. package/dist/labs/UiShell/bufferLatest.js.map +1 -0
  94. package/dist/labs/UiShell/createMessageBus.js +30 -0
  95. package/dist/labs/UiShell/createMessageBus.js.map +1 -0
  96. package/dist/labs/UiShell/createStore.js +24 -0
  97. package/dist/labs/UiShell/createStore.js.map +1 -0
  98. package/dist/labs/UiShell/index.js +15 -0
  99. package/dist/labs/UiShell/index.js.map +1 -0
  100. package/dist/labs/UiShell/renderUiShell.js +78 -0
  101. package/dist/labs/UiShell/renderUiShell.js.map +1 -0
  102. package/dist/labs/UiShell/useHasUiShell.js +22 -0
  103. package/dist/labs/UiShell/useHasUiShell.js.map +1 -0
  104. package/dist/labs/UiShell/useScrollState.js +41 -0
  105. package/dist/labs/UiShell/useScrollState.js.map +1 -0
  106. package/dist/labs/index.js +5 -3
  107. package/dist/labs/index.js.map +1 -1
  108. package/dist/properties/ts/odyssey-react-mui.js +7 -1
  109. package/dist/properties/ts/odyssey-react-mui.js.map +1 -1
  110. package/dist/properties/ts/odyssey-react-mui_cs.js +3 -1
  111. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  112. package/dist/properties/ts/odyssey-react-mui_da.js +3 -1
  113. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  114. package/dist/properties/ts/odyssey-react-mui_de.js +3 -1
  115. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  116. package/dist/properties/ts/odyssey-react-mui_el.js +3 -1
  117. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  118. package/dist/properties/ts/odyssey-react-mui_es.js +3 -1
  119. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  120. package/dist/properties/ts/odyssey-react-mui_fi.js +3 -1
  121. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  122. package/dist/properties/ts/odyssey-react-mui_fr.js +5 -3
  123. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  124. package/dist/properties/ts/odyssey-react-mui_ht.js +3 -1
  125. package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  126. package/dist/properties/ts/odyssey-react-mui_hu.js +3 -1
  127. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  128. package/dist/properties/ts/odyssey-react-mui_id.js +3 -1
  129. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  130. package/dist/properties/ts/odyssey-react-mui_it.js +4 -2
  131. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  132. package/dist/properties/ts/odyssey-react-mui_ja.js +9 -7
  133. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  134. package/dist/properties/ts/odyssey-react-mui_ko.js +3 -1
  135. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  136. package/dist/properties/ts/odyssey-react-mui_ms.js +3 -1
  137. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  138. package/dist/properties/ts/odyssey-react-mui_nb.js +3 -1
  139. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  140. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +3 -1
  141. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  142. package/dist/properties/ts/odyssey-react-mui_pl.js +3 -1
  143. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  144. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +3 -1
  145. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  146. package/dist/properties/ts/odyssey-react-mui_ro.js +3 -1
  147. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  148. package/dist/properties/ts/odyssey-react-mui_ru.js +3 -1
  149. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  150. package/dist/properties/ts/odyssey-react-mui_sv.js +3 -1
  151. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  152. package/dist/properties/ts/odyssey-react-mui_th.js +3 -1
  153. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  154. package/dist/properties/ts/odyssey-react-mui_tr.js +4 -2
  155. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  156. package/dist/properties/ts/odyssey-react-mui_uk.js +3 -1
  157. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  158. package/dist/properties/ts/odyssey-react-mui_vi.js +3 -1
  159. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  160. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +3 -1
  161. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  162. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +3 -1
  163. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  164. package/dist/src/Autocomplete.d.ts +21 -22
  165. package/dist/src/Autocomplete.d.ts.map +1 -1
  166. package/dist/src/Box.d.ts +3 -1
  167. package/dist/src/Box.d.ts.map +1 -1
  168. package/dist/src/Card.d.ts.map +1 -1
  169. package/dist/src/OdysseyDesignTokensContext.d.ts +5 -4
  170. package/dist/src/OdysseyDesignTokensContext.d.ts.map +1 -1
  171. package/dist/src/OdysseyProvider.d.ts +1 -3
  172. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  173. package/dist/src/OdysseyThemeProvider.d.ts +10 -4
  174. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  175. package/dist/src/OdysseyTranslationProvider.d.ts +1 -1
  176. package/dist/src/OdysseyTranslationProvider.d.ts.map +1 -1
  177. package/dist/src/OdysseyTranslationProvider.types.d.ts +1 -1
  178. package/dist/src/OdysseyTranslationProvider.types.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/Select.d.ts.map +1 -1
  182. package/dist/src/Surface.d.ts.map +1 -1
  183. package/dist/src/Tag.d.ts +5 -2
  184. package/dist/src/Tag.d.ts.map +1 -1
  185. package/dist/src/i18n.d.ts.map +1 -1
  186. package/dist/src/index.d.ts +6 -7
  187. package/dist/src/index.d.ts.map +1 -1
  188. package/dist/src/labs/AppTile.d.ts +3 -1
  189. package/dist/src/labs/AppTile.d.ts.map +1 -1
  190. package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -1
  191. package/dist/src/labs/DataView/DataCard.d.ts +9 -3
  192. package/dist/src/labs/DataView/DataCard.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 +1 -1
  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} +6 -2
  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 +2 -3
  226. package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -1
  227. package/dist/src/labs/SideNav/SideNavItemContentContext.d.ts +18 -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/types.d.ts +67 -33
  236. package/dist/src/labs/SideNav/types.d.ts.map +1 -1
  237. package/dist/src/labs/TopNav/TopNav.d.ts +31 -0
  238. package/dist/src/labs/TopNav/TopNav.d.ts.map +1 -0
  239. package/dist/src/labs/TopNav/TopNavLinksList.d.ts +44 -0
  240. package/dist/src/labs/TopNav/TopNavLinksList.d.ts.map +1 -0
  241. package/dist/src/labs/TopNav/TopNavListItem.d.ts +42 -0
  242. package/dist/src/labs/TopNav/TopNavListItem.d.ts.map +1 -0
  243. package/dist/src/labs/TopNav/UserProfile.d.ts +29 -0
  244. package/dist/src/labs/TopNav/UserProfile.d.ts.map +1 -0
  245. package/dist/src/labs/TopNav/index.d.ts +14 -0
  246. package/dist/src/labs/TopNav/index.d.ts.map +1 -0
  247. package/dist/src/labs/UiShell/UiShell.d.ts +33 -0
  248. package/dist/src/labs/UiShell/UiShell.d.ts.map +1 -0
  249. package/dist/src/labs/UiShell/UiShellContent.d.ts +47 -0
  250. package/dist/src/labs/UiShell/UiShellContent.d.ts.map +1 -0
  251. package/dist/src/labs/UiShell/bufferLatest.d.ts +31 -0
  252. package/dist/src/labs/UiShell/bufferLatest.d.ts.map +1 -0
  253. package/dist/src/labs/UiShell/createMessageBus.d.ts +24 -0
  254. package/dist/src/labs/UiShell/createMessageBus.d.ts.map +1 -0
  255. package/dist/src/labs/UiShell/createStore.d.ts +22 -0
  256. package/dist/src/labs/UiShell/createStore.d.ts.map +1 -0
  257. package/dist/src/labs/UiShell/index.d.ts +16 -0
  258. package/dist/src/labs/UiShell/index.d.ts.map +1 -0
  259. package/dist/src/labs/UiShell/renderUiShell.d.ts +45 -0
  260. package/dist/src/labs/UiShell/renderUiShell.d.ts.map +1 -0
  261. package/dist/src/labs/UiShell/useHasUiShell.d.ts +13 -0
  262. package/dist/src/labs/UiShell/useHasUiShell.d.ts.map +1 -0
  263. package/dist/src/labs/UiShell/useScrollState.d.ts +16 -0
  264. package/dist/src/labs/UiShell/useScrollState.d.ts.map +1 -0
  265. package/dist/src/labs/index.d.ts +6 -2
  266. package/dist/src/labs/index.d.ts.map +1 -1
  267. package/dist/src/properties/ts/odyssey-react-mui.d.ts +6 -0
  268. package/dist/src/properties/ts/odyssey-react-mui.d.ts.map +1 -1
  269. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +2 -0
  270. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  271. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +2 -0
  272. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  273. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +2 -0
  274. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  275. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +2 -0
  276. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  277. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +2 -0
  278. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  279. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +2 -0
  280. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  281. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +2 -0
  282. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  283. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts +2 -0
  284. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  285. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +2 -0
  286. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  287. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +2 -0
  288. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  289. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +2 -0
  290. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  291. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +2 -0
  292. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  293. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +2 -0
  294. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  295. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +2 -0
  296. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  297. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +2 -0
  298. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  299. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +2 -0
  300. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  301. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +2 -0
  302. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  303. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +2 -0
  304. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  305. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +2 -0
  306. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  307. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +2 -0
  308. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  309. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +2 -0
  310. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  311. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +2 -0
  312. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  313. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +2 -0
  314. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  315. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +2 -0
  316. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  317. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +2 -0
  318. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  319. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +2 -0
  320. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  321. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +2 -0
  322. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  323. package/dist/src/test-selectors/querySelector.d.ts +2 -2
  324. package/dist/src/theme/components.d.ts +3 -1
  325. package/dist/src/theme/components.d.ts.map +1 -1
  326. package/dist/src/theme/createOdysseyMuiTheme.d.ts +3 -1
  327. package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
  328. package/dist/src/useAutocomplete.d.ts +29 -0
  329. package/dist/src/useAutocomplete.d.ts.map +1 -0
  330. package/dist/src/useContrastMode.d.ts +46 -0
  331. package/dist/src/useContrastMode.d.ts.map +1 -0
  332. package/dist/src/web-component/index.d.ts +14 -0
  333. package/dist/src/web-component/index.d.ts.map +1 -0
  334. package/dist/src/web-component/renderReactInWebComponent.d.ts +76 -0
  335. package/dist/src/web-component/renderReactInWebComponent.d.ts.map +1 -0
  336. package/dist/src/web-component/shadow-dom.d.ts +23 -0
  337. package/dist/src/web-component/shadow-dom.d.ts.map +1 -0
  338. package/dist/test-selectors/querySelector.js.map +1 -1
  339. package/dist/theme/components.js +41 -32
  340. package/dist/theme/components.js.map +1 -1
  341. package/dist/theme/createOdysseyMuiTheme.js +3 -0
  342. package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
  343. package/dist/tsconfig.production.tsbuildinfo +1 -1
  344. package/dist/tsconfig.tsbuildinfo +1 -1
  345. package/dist/useAutocomplete.js +105 -0
  346. package/dist/useAutocomplete.js.map +1 -0
  347. package/dist/useContrastMode.js +93 -0
  348. package/dist/useContrastMode.js.map +1 -0
  349. package/dist/web-component/index.js +14 -0
  350. package/dist/web-component/index.js.map +1 -0
  351. package/dist/web-component/renderReactInWebComponent.js +72 -0
  352. package/dist/web-component/renderReactInWebComponent.js.map +1 -0
  353. package/dist/{createShadowDomElements.js → web-component/shadow-dom.js} +10 -12
  354. package/dist/web-component/shadow-dom.js.map +1 -0
  355. package/jest.config.cjs +21 -2
  356. package/jest.setup.js +0 -3
  357. package/package.json +4 -3
  358. package/src/Autocomplete.tsx +40 -330
  359. package/src/Box.tsx +4 -2
  360. package/src/Card.tsx +1 -0
  361. package/src/OdysseyDesignTokensContext.tsx +6 -3
  362. package/src/OdysseyProvider.tsx +29 -56
  363. package/src/OdysseyThemeProvider.test.tsx +209 -0
  364. package/src/OdysseyThemeProvider.tsx +43 -17
  365. package/src/OdysseyTranslationProvider.types.ts +1 -0
  366. package/src/Pagination/Pagination.test.tsx +305 -0
  367. package/src/Pagination/Pagination.tsx +86 -38
  368. package/src/Select.tsx +12 -3
  369. package/src/Surface.tsx +2 -1
  370. package/src/Tag.tsx +102 -41
  371. package/src/createUniqueAlphabeticalId.test.ts +1 -1
  372. package/src/createUniqueId.test.ts +1 -1
  373. package/src/i18n.ts +2 -0
  374. package/src/index.ts +6 -7
  375. package/src/labs/AppTile.tsx +169 -40
  376. package/src/labs/DataView/CardLayoutContent.tsx +12 -14
  377. package/src/labs/DataView/DataCard.tsx +137 -69
  378. package/src/labs/DataView/DataView.test.tsx +6 -4
  379. package/src/labs/DataView/TableLayoutContent.tsx +6 -2
  380. package/src/labs/DataView/componentTypes.ts +1 -1
  381. package/src/labs/DataView/index.tsx +1 -0
  382. package/src/labs/OdysseyPickers/ComposablePicker.test.tsx +29 -0
  383. package/src/labs/OdysseyPickers/ComposablePicker.tsx +188 -0
  384. package/src/labs/OdysseyPickers/Picker.tsx +381 -0
  385. package/src/labs/OdysseyPickers/PickerVirtualizationListBox.tsx +191 -0
  386. package/src/labs/OdysseyPickers/PickerWithOptionAdornment.tsx +429 -0
  387. package/src/labs/OdysseyPickers/index.ts +15 -0
  388. package/src/labs/PageTemplate.tsx +18 -10
  389. package/src/labs/SideNav/CollapseIcon.tsx +14 -28
  390. package/src/labs/SideNav/HandleIcon.tsx +35 -0
  391. package/src/labs/{NavAccordion.tsx → SideNav/NavAccordion.tsx} +48 -8
  392. package/src/labs/SideNav/OktaAura.tsx +35 -0
  393. package/src/labs/SideNav/OktaLogo.tsx +5 -10
  394. package/src/labs/SideNav/SideNav.test.tsx +323 -0
  395. package/src/labs/SideNav/SideNav.tsx +291 -204
  396. package/src/labs/SideNav/SideNavFooterContent.tsx +36 -28
  397. package/src/labs/SideNav/SideNavHeader.tsx +62 -45
  398. package/src/labs/SideNav/SideNavItemContent.tsx +142 -62
  399. package/src/labs/SideNav/SideNavItemContentContext.tsx +27 -0
  400. package/src/labs/SideNav/SideNavItemLinkContent.tsx +17 -14
  401. package/src/labs/SideNav/SideNavLogo.tsx +41 -0
  402. package/src/labs/SideNav/SideNavToggleButton.tsx +249 -0
  403. package/src/labs/SideNav/types.ts +72 -33
  404. package/src/labs/TopNav/TopNav.tsx +95 -0
  405. package/src/labs/TopNav/TopNavLinksList.tsx +68 -0
  406. package/src/labs/TopNav/TopNavListItem.tsx +209 -0
  407. package/src/labs/TopNav/UserProfile.tsx +79 -0
  408. package/src/labs/TopNav/index.ts +14 -0
  409. package/src/labs/UiShell/UiShell.test.tsx +284 -0
  410. package/src/labs/UiShell/UiShell.tsx +109 -0
  411. package/src/labs/UiShell/UiShellContent.tsx +170 -0
  412. package/src/labs/UiShell/bufferLatest.test.ts +79 -0
  413. package/src/labs/UiShell/bufferLatest.ts +64 -0
  414. package/src/labs/UiShell/createMessageBus.test.ts +115 -0
  415. package/src/labs/UiShell/createMessageBus.ts +53 -0
  416. package/src/labs/UiShell/createStore.test.ts +103 -0
  417. package/src/labs/UiShell/createStore.ts +37 -0
  418. package/src/labs/UiShell/index.ts +17 -0
  419. package/src/labs/UiShell/renderUiShell.test.tsx +197 -0
  420. package/src/labs/UiShell/renderUiShell.tsx +132 -0
  421. package/src/labs/UiShell/useHasUiShell.ts +25 -0
  422. package/src/labs/UiShell/useScrollState.ts +56 -0
  423. package/src/labs/index.ts +10 -3
  424. package/src/properties/odyssey-react-mui.properties +7 -0
  425. package/src/properties/translations/odyssey-react-mui_cs.properties +2 -1
  426. package/src/properties/translations/odyssey-react-mui_da.properties +2 -1
  427. package/src/properties/translations/odyssey-react-mui_de.properties +2 -1
  428. package/src/properties/translations/odyssey-react-mui_el.properties +2 -1
  429. package/src/properties/translations/odyssey-react-mui_es.properties +2 -1
  430. package/src/properties/translations/odyssey-react-mui_fi.properties +2 -1
  431. package/src/properties/translations/odyssey-react-mui_fr.properties +4 -3
  432. package/src/properties/translations/odyssey-react-mui_ht.properties +2 -1
  433. package/src/properties/translations/odyssey-react-mui_hu.properties +2 -1
  434. package/src/properties/translations/odyssey-react-mui_id.properties +2 -1
  435. package/src/properties/translations/odyssey-react-mui_it.properties +3 -2
  436. package/src/properties/translations/odyssey-react-mui_ja.properties +8 -7
  437. package/src/properties/translations/odyssey-react-mui_ko.properties +2 -1
  438. package/src/properties/translations/odyssey-react-mui_ms.properties +2 -1
  439. package/src/properties/translations/odyssey-react-mui_nb.properties +2 -1
  440. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +2 -1
  441. package/src/properties/translations/odyssey-react-mui_pl.properties +2 -1
  442. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +2 -1
  443. package/src/properties/translations/odyssey-react-mui_ro.properties +2 -1
  444. package/src/properties/translations/odyssey-react-mui_ru.properties +2 -1
  445. package/src/properties/translations/odyssey-react-mui_sv.properties +2 -1
  446. package/src/properties/translations/odyssey-react-mui_th.properties +2 -1
  447. package/src/properties/translations/odyssey-react-mui_tr.properties +3 -2
  448. package/src/properties/translations/odyssey-react-mui_uk.properties +2 -1
  449. package/src/properties/translations/odyssey-react-mui_vi.properties +2 -1
  450. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +2 -1
  451. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +2 -1
  452. package/src/properties/ts/odyssey-react-mui.ts +1 -1
  453. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  454. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  455. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  456. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  457. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  458. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  459. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  460. package/src/properties/ts/odyssey-react-mui_ht.ts +1 -1
  461. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  462. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  463. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  464. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  465. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  466. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  467. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  468. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  469. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  470. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  471. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  472. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  473. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  474. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  475. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  476. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  477. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  478. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  479. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  480. package/src/test-selectors/querySelector.ts +1 -1
  481. package/src/theme/components.tsx +55 -31
  482. package/src/theme/createOdysseyMuiTheme.ts +4 -0
  483. package/src/theme/useContrastMode.test.tsx +503 -0
  484. package/src/useAutocomplete.tsx +183 -0
  485. package/src/useContrastMode.tsx +149 -0
  486. package/src/web-component/index.ts +14 -0
  487. package/src/web-component/renderReactInWebComponent.test.tsx +156 -0
  488. package/src/web-component/renderReactInWebComponent.ts +153 -0
  489. package/src/web-component/shadow-dom.test.ts +24 -0
  490. package/src/{createShadowDomElements.ts → web-component/shadow-dom.ts} +15 -14
  491. package/dist/ContrastModeProvider.js +0 -86
  492. package/dist/ContrastModeProvider.js.map +0 -1
  493. package/dist/createShadowDomElements.js.map +0 -1
  494. package/dist/labs/NavAccordion.js.map +0 -1
  495. package/dist/labs/TopNav.js +0 -281
  496. package/dist/labs/TopNav.js.map +0 -1
  497. package/dist/src/ContrastModeProvider.d.ts +0 -34
  498. package/dist/src/ContrastModeProvider.d.ts.map +0 -1
  499. package/dist/src/createShadowDomElements.d.ts.map +0 -1
  500. package/dist/src/labs/NavAccordion.d.ts.map +0 -1
  501. package/dist/src/labs/TopNav.d.ts +0 -78
  502. package/dist/src/labs/TopNav.d.ts.map +0 -1
  503. package/src/ContrastModeProvider.tsx +0 -131
  504. package/src/labs/TopNav.tsx +0 -396
@@ -0,0 +1,191 @@
1
+ /*!
2
+ * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {
14
+ Children,
15
+ createContext,
16
+ forwardRef,
17
+ memo,
18
+ useCallback,
19
+ useContext,
20
+ useEffect,
21
+ useMemo,
22
+ useRef,
23
+ useState,
24
+ } from "react";
25
+ import { VariableSizeList, ListChildComponentProps } from "react-window";
26
+ import styled from "@emotion/styled";
27
+ import { AutocompleteProps } from "@mui/material";
28
+
29
+ type SetItemSize = (size: number) => void;
30
+
31
+ const ListboxContainer = styled.div({
32
+ width: "100%",
33
+ height: "100%",
34
+ });
35
+
36
+ const Row = ({
37
+ data,
38
+ index,
39
+ setItemSize,
40
+ style,
41
+ }: ListChildComponentProps & { setItemSize: SetItemSize }) => {
42
+ const rowRef = useRef<HTMLDivElement>(null);
43
+
44
+ useEffect(() => {
45
+ if (rowRef.current) {
46
+ /**
47
+ * Checking for child height to workaround a bug where the clientHeight of the row isn't updated correctly
48
+ * @see here if you need to know more: https://github.com/bvaughn/react-window/issues/582#issuecomment-1883074908
49
+ */
50
+ const firstChild = rowRef.current.firstElementChild;
51
+ const height = firstChild
52
+ ? firstChild.clientHeight
53
+ : rowRef.current.clientHeight;
54
+
55
+ setItemSize(height);
56
+ }
57
+ }, [index, rowRef, setItemSize]);
58
+
59
+ const baseOption = data[index];
60
+ const { key, props } = baseOption;
61
+
62
+ /**
63
+ * react-window calculates the absolute positions of the list items, via an inline style, so
64
+ * we need to add it to each list item that is being rendered in the viewable list window.
65
+ * @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
66
+ */
67
+ const styles = useMemo(
68
+ () => ({
69
+ ...style,
70
+ height: "auto",
71
+ }),
72
+ [style],
73
+ );
74
+
75
+ return (
76
+ <div ref={rowRef}>
77
+ <li {...props} key={key} style={styles} />
78
+ </div>
79
+ );
80
+ };
81
+
82
+ const OuterListboxContext = createContext({});
83
+
84
+ const OuterListboxElementType = forwardRef<HTMLDivElement>((props, ref) => {
85
+ const outerProps = useContext(OuterListboxContext);
86
+ return <div ref={ref} {...props} {...outerProps} />;
87
+ });
88
+
89
+ const useResetCache = (length: number) => {
90
+ const resetCacheRef = useRef<VariableSizeList>(null);
91
+ useEffect(() => {
92
+ if (resetCacheRef.current) {
93
+ resetCacheRef.current.resetAfterIndex(0, true);
94
+ }
95
+ }, [length]);
96
+ return resetCacheRef;
97
+ };
98
+
99
+ const PickerVirtualizationListBox = forwardRef<
100
+ HTMLDivElement,
101
+ AutocompleteProps<undefined, undefined, undefined, undefined>["ListboxProps"]
102
+ >((props = {}, ref) => {
103
+ const [listHeight, setListHeight] = useState(0);
104
+
105
+ const { children, ...other } = props;
106
+
107
+ const itemData = Children.toArray(children).flatMap<typeof children>(
108
+ (child) =>
109
+ typeof child === "number" || typeof child === "string"
110
+ ? [child]
111
+ : [child].concat("children" in child ? Children.toArray(children) : []),
112
+ );
113
+
114
+ const sizeMapRef = useRef<number[]>([]);
115
+
116
+ const getListBoxHeight = useCallback(() => {
117
+ // 8px of padding top/bottom applied by MUI
118
+ const COMBINED_LISTBOX_PADDING = 16;
119
+
120
+ if (itemData.length > OVERSCAN_ROW_COUNT) {
121
+ // has a max-height of 40vh set in CSS. This is only set because height needs to be a number
122
+ return 9999;
123
+ } else {
124
+ const itemsHeightCalculated = sizeMapRef.current
125
+ .slice(0, itemData.length - 1)
126
+ .map((_, index) => sizeMapRef.current[index] || 0)
127
+ .reduce(
128
+ (prevItemHeight, nextItemHeight) => prevItemHeight + nextItemHeight,
129
+ 0,
130
+ );
131
+ return COMBINED_LISTBOX_PADDING + itemsHeightCalculated;
132
+ }
133
+ }, [itemData, sizeMapRef]);
134
+
135
+ useEffect(() => {
136
+ if (sizeMapRef.current.length && itemData.length) {
137
+ setListHeight(getListBoxHeight());
138
+ }
139
+ }, [getListBoxHeight, itemData, sizeMapRef]);
140
+
141
+ // The number of items (rows or columns) to render outside of the visible area for performance and scrolling reasons
142
+ const OVERSCAN_ROW_COUNT = 8;
143
+
144
+ const gridRef = useResetCache(itemData.length);
145
+
146
+ const setItemSize = useCallback<SetItemSize>(
147
+ (size) => {
148
+ gridRef?.current?.resetAfterIndex(0, true);
149
+ sizeMapRef.current = sizeMapRef.current.concat(size);
150
+ },
151
+ [gridRef, sizeMapRef],
152
+ );
153
+ const getItemSize = useCallback(
154
+ // using 45px as a sane default here to avoid a lot of content shift on repaint
155
+ (index: number) => sizeMapRef.current[index] || 45,
156
+ [sizeMapRef],
157
+ );
158
+
159
+ return (
160
+ <ListboxContainer ref={ref}>
161
+ <OuterListboxContext.Provider value={other}>
162
+ <VariableSizeList
163
+ innerElementType="ul"
164
+ itemData={itemData}
165
+ itemCount={itemData.length}
166
+ itemSize={getItemSize}
167
+ height={listHeight}
168
+ width="100%"
169
+ ref={gridRef}
170
+ outerElementType={OuterListboxElementType}
171
+ overscanCount={OVERSCAN_ROW_COUNT}
172
+ >
173
+ {({ data, index, style }) => (
174
+ <Row
175
+ data={data}
176
+ index={index}
177
+ style={style}
178
+ setItemSize={setItemSize}
179
+ />
180
+ )}
181
+ </VariableSizeList>
182
+ </OuterListboxContext.Provider>
183
+ </ListboxContainer>
184
+ );
185
+ });
186
+
187
+ const MemoizedPickerVirtualizationListBox = memo(PickerVirtualizationListBox);
188
+
189
+ MemoizedPickerVirtualizationListBox.displayName = "PickerVirtualizationListBox";
190
+
191
+ export { MemoizedPickerVirtualizationListBox as PickerVirtualizationListBox };
@@ -0,0 +1,429 @@
1
+ /*!
2
+ * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import {
14
+ HTMLAttributes,
15
+ memo,
16
+ ReactElement,
17
+ ReactNode,
18
+ useCallback,
19
+ } from "react";
20
+ import styled from "@emotion/styled";
21
+
22
+ import { Box } from "../../Box";
23
+ import {
24
+ ComposablePicker,
25
+ ComposablePickerProps,
26
+ type AdornmentSize,
27
+ type BasePickerProps,
28
+ type BasePickerType,
29
+ } from "./ComposablePicker";
30
+ import {
31
+ useOdysseyDesignTokens,
32
+ DesignTokens,
33
+ } from "../../OdysseyDesignTokensContext";
34
+ import {
35
+ type BaseOptionProps,
36
+ type LabelDescription,
37
+ type Metadata,
38
+ Option,
39
+ OptionDescriptionComponent,
40
+ OptionLabelContainer,
41
+ OptionMetadataComponent,
42
+ OptionProps,
43
+ } from "./Picker";
44
+ import { Heading6 } from "../../Typography";
45
+ import { Tag } from "../../Tag";
46
+
47
+ type Adornment = ReactNode | string;
48
+
49
+ type AdornmentLabelDescription = LabelDescription & {
50
+ adornment: Adornment;
51
+ };
52
+
53
+ type AdornmentLabelDescriptionMetadata = AdornmentLabelDescription & Metadata;
54
+
55
+ export type AdornmentOptionType =
56
+ | AdornmentLabelDescription
57
+ | AdornmentLabelDescriptionMetadata;
58
+
59
+ const OptionAdornmentContainer = styled("div", {
60
+ shouldForwardProp: (prop) =>
61
+ prop !== "odysseyDesignTokens" &&
62
+ prop !== "adornmentSize" &&
63
+ prop !== "isTagContainer",
64
+ })<{
65
+ adornmentSize?: AdornmentSize;
66
+ isTagContainer?: boolean;
67
+ odysseyDesignTokens: DesignTokens;
68
+ }>(
69
+ ({
70
+ adornmentSize = "small",
71
+ isTagContainer = false,
72
+ odysseyDesignTokens,
73
+ }) => ({
74
+ position: "relative",
75
+ // push icon up by one px for better visual alignment
76
+ bottom: "1px",
77
+ alignSelf: "flex-start",
78
+ width: odysseyDesignTokens.Spacing5,
79
+ height: odysseyDesignTokens.Spacing5,
80
+ overflow: "hidden",
81
+ marginInlineEnd: odysseyDesignTokens.Spacing3,
82
+
83
+ svg: {
84
+ width: "100%",
85
+ height: "auto",
86
+ },
87
+
88
+ img: {
89
+ position: "absolute",
90
+ top: "50%",
91
+ left: "50%",
92
+ width: "100%",
93
+ transform: "translate(-50%, -50%)",
94
+ },
95
+
96
+ ...(adornmentSize === "large" &&
97
+ !isTagContainer && {
98
+ bottom: 0,
99
+ width: odysseyDesignTokens.Spacing8,
100
+ height: odysseyDesignTokens.Spacing8,
101
+ }),
102
+
103
+ ...(isTagContainer && {
104
+ bottom: 0,
105
+ alignSelf: "center",
106
+ width: odysseyDesignTokens.Spacing4,
107
+ height: "auto",
108
+ maxHeight: odysseyDesignTokens.Spacing4,
109
+ marginInlineEnd: odysseyDesignTokens.Spacing2,
110
+
111
+ svg: {
112
+ display: "flex",
113
+ width: "100%",
114
+ height: "auto",
115
+ },
116
+ }),
117
+ }),
118
+ );
119
+
120
+ type OptionAdornmentProps = {
121
+ adornment: Adornment;
122
+ adornmentSize: AdornmentSize;
123
+ odysseyDesignTokens: DesignTokens;
124
+ };
125
+
126
+ const OptionAdornment = ({
127
+ adornment,
128
+ adornmentSize,
129
+ odysseyDesignTokens,
130
+ }: OptionAdornmentProps) => {
131
+ const isImageAdornment = typeof adornment === "string";
132
+
133
+ if (isImageAdornment) {
134
+ return (
135
+ <OptionAdornmentContainer
136
+ adornmentSize={adornmentSize}
137
+ odysseyDesignTokens={odysseyDesignTokens}
138
+ >
139
+ {/* NOTE: Intentionally leaving alt as an empty string here so screen readers will ignore this image */}
140
+ {/* Image should be suffciently described by the adjacent title and/or description of the option */}
141
+ <img src={adornment} alt="" role="presentation" />
142
+ </OptionAdornmentContainer>
143
+ );
144
+ } else {
145
+ return (
146
+ <OptionAdornmentContainer
147
+ adornmentSize={adornmentSize}
148
+ odysseyDesignTokens={odysseyDesignTokens}
149
+ >
150
+ {adornment}
151
+ </OptionAdornmentContainer>
152
+ );
153
+ }
154
+ };
155
+
156
+ const OptionWithLabelDescriptionOnly = <
157
+ OptionType extends AdornmentLabelDescription,
158
+ >({
159
+ adornmentSize,
160
+ muiProps,
161
+ odysseyDesignTokens,
162
+ option,
163
+ }: BaseOptionProps &
164
+ OptionProps<OptionType> & { adornmentSize: AdornmentSize }) => {
165
+ const { adornment, description, label, value } = option;
166
+ return (
167
+ <Option hasAdornment key={value} muiProps={muiProps}>
168
+ <OptionAdornment
169
+ adornment={adornment}
170
+ adornmentSize={adornmentSize}
171
+ odysseyDesignTokens={odysseyDesignTokens}
172
+ />
173
+ <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>
174
+ <Heading6 component="p">{label}</Heading6>
175
+ <OptionDescriptionComponent
176
+ description={description}
177
+ odysseyDesignTokens={odysseyDesignTokens}
178
+ />
179
+ </OptionLabelContainer>
180
+ </Option>
181
+ );
182
+ };
183
+
184
+ const OptionWithLabelDescriptionMetadata = <
185
+ OptionType extends AdornmentLabelDescriptionMetadata,
186
+ >({
187
+ adornmentSize,
188
+ muiProps,
189
+ odysseyDesignTokens,
190
+ option,
191
+ }: BaseOptionProps &
192
+ OptionProps<OptionType> & {
193
+ adornmentSize: AdornmentSize;
194
+ }) => {
195
+ const { adornment, description, label, metaData, value } = option;
196
+
197
+ return (
198
+ <Option hasAdornment key={value} muiProps={muiProps}>
199
+ <OptionAdornment
200
+ adornment={adornment}
201
+ adornmentSize={adornmentSize}
202
+ odysseyDesignTokens={odysseyDesignTokens}
203
+ />
204
+ <div>
205
+ <OptionLabelContainer odysseyDesignTokens={odysseyDesignTokens}>
206
+ <Heading6 component="p">{label}</Heading6>
207
+ <OptionDescriptionComponent
208
+ description={description}
209
+ odysseyDesignTokens={odysseyDesignTokens}
210
+ />
211
+ </OptionLabelContainer>
212
+ <OptionMetadataComponent
213
+ metaData={metaData}
214
+ odysseyDesignTokens={odysseyDesignTokens}
215
+ />
216
+ </div>
217
+ </Option>
218
+ );
219
+ };
220
+
221
+ type TagAdornmentProps = {
222
+ adornment: Adornment;
223
+ };
224
+
225
+ const TagAdornment = ({ adornment }: TagAdornmentProps) => {
226
+ const odysseyDesignTokens = useOdysseyDesignTokens();
227
+ const isImageAdornment = typeof adornment === "string";
228
+
229
+ if (isImageAdornment) {
230
+ return (
231
+ <OptionAdornmentContainer
232
+ isTagContainer
233
+ odysseyDesignTokens={odysseyDesignTokens}
234
+ >
235
+ <img src={adornment} alt="" role="presentation" />
236
+ </OptionAdornmentContainer>
237
+ );
238
+ }
239
+
240
+ return (
241
+ <OptionAdornmentContainer
242
+ isTagContainer
243
+ odysseyDesignTokens={odysseyDesignTokens}
244
+ >
245
+ {adornment}
246
+ </OptionAdornmentContainer>
247
+ );
248
+ };
249
+
250
+ export type PickerWithOptionAdornmentProps<
251
+ OptionType extends AdornmentOptionType,
252
+ HasMultipleChoices extends boolean | undefined,
253
+ IsCustomValueAllowed extends boolean | undefined,
254
+ > = BasePickerProps<OptionType, HasMultipleChoices, IsCustomValueAllowed> & {
255
+ adornmentSize?: AdornmentSize;
256
+ };
257
+
258
+ type PickerWithOptionAdornmentComponentType = {
259
+ <
260
+ OptionType extends AdornmentLabelDescription,
261
+ HasMultipleChoices extends boolean | undefined,
262
+ IsCustomValueAllowed extends boolean | undefined,
263
+ >(
264
+ props: PickerWithOptionAdornmentProps<
265
+ OptionType,
266
+ HasMultipleChoices,
267
+ IsCustomValueAllowed
268
+ >,
269
+ ): ReactElement;
270
+ <
271
+ OptionType extends AdornmentLabelDescriptionMetadata,
272
+ HasMultipleChoices extends boolean | undefined,
273
+ IsCustomValueAllowed extends boolean | undefined,
274
+ >(
275
+ props: PickerWithOptionAdornmentProps<
276
+ OptionType,
277
+ HasMultipleChoices,
278
+ IsCustomValueAllowed
279
+ >,
280
+ ): ReactElement;
281
+ };
282
+
283
+ const PickerWithOptionAdornment: PickerWithOptionAdornmentComponentType = <
284
+ OptionType extends AdornmentOptionType,
285
+ HasMultipleChoices extends boolean | undefined,
286
+ IsCustomValueAllowed extends boolean | undefined,
287
+ >({
288
+ adornmentSize = "small",
289
+ ariaDescribedBy,
290
+ defaultValue,
291
+ errorMessage,
292
+ errorMessageList,
293
+ getIsOptionEqualToValue,
294
+ groupOptionsBy,
295
+ hasMultipleChoices,
296
+ id: idOverride,
297
+ inputValue,
298
+ isCustomValueAllowed,
299
+ isDisabled,
300
+ isFullWidth = false,
301
+ isLoading,
302
+ isOptional = false,
303
+ isReadOnly,
304
+ isVirtualized: isVirtualizedProp = false,
305
+ hint,
306
+ HintLinkComponent,
307
+ label,
308
+ name: nameOverride,
309
+ onBlur,
310
+ onChange: onChangeProp,
311
+ onInputChange: onInputChangeProp,
312
+ onFocus,
313
+ options,
314
+ value,
315
+ testId,
316
+ translate,
317
+ }: PickerWithOptionAdornmentProps<
318
+ OptionType,
319
+ HasMultipleChoices,
320
+ IsCustomValueAllowed
321
+ >) => {
322
+ const odysseyDesignTokens = useOdysseyDesignTokens();
323
+
324
+ const customTagRender = useCallback<
325
+ NonNullable<
326
+ ComposablePickerProps<
327
+ OptionType,
328
+ HasMultipleChoices,
329
+ IsCustomValueAllowed
330
+ >["renderTags"]
331
+ >
332
+ >(
333
+ (values, getTagProps) =>
334
+ values.map((value, index) => {
335
+ const { key, onDelete } = getTagProps({ index });
336
+ const { adornment, label } = value;
337
+
338
+ return (
339
+ <Box
340
+ key={key}
341
+ sx={{
342
+ margin: odysseyDesignTokens.Spacing1,
343
+ marginInlineEnd: 0,
344
+ }}
345
+ >
346
+ <Tag
347
+ icon={<TagAdornment adornment={adornment} />}
348
+ label={label}
349
+ onRemove={onDelete}
350
+ />
351
+ </Box>
352
+ );
353
+ }),
354
+ [odysseyDesignTokens],
355
+ );
356
+
357
+ const customOptionRender = useCallback<
358
+ (props: HTMLAttributes<HTMLLIElement>, option: OptionType) => ReactNode
359
+ >(
360
+ (muiProps, option) => {
361
+ const hasMetadata = "metaData" in option && option.metaData;
362
+
363
+ if (hasMetadata) {
364
+ return (
365
+ <OptionWithLabelDescriptionMetadata
366
+ adornmentSize={adornmentSize}
367
+ muiProps={muiProps}
368
+ odysseyDesignTokens={odysseyDesignTokens}
369
+ option={option}
370
+ />
371
+ );
372
+ }
373
+
374
+ return (
375
+ <OptionWithLabelDescriptionOnly
376
+ adornmentSize={adornmentSize}
377
+ muiProps={muiProps}
378
+ odysseyDesignTokens={odysseyDesignTokens}
379
+ option={option}
380
+ />
381
+ );
382
+ },
383
+ [adornmentSize, odysseyDesignTokens],
384
+ );
385
+
386
+ return (
387
+ <ComposablePicker<OptionType, HasMultipleChoices, IsCustomValueAllowed>
388
+ ariaDescribedBy={ariaDescribedBy}
389
+ defaultValue={defaultValue}
390
+ errorMessage={errorMessage}
391
+ errorMessageList={errorMessageList}
392
+ getIsOptionEqualToValue={getIsOptionEqualToValue}
393
+ groupOptionsBy={groupOptionsBy}
394
+ hasMultipleChoices={hasMultipleChoices}
395
+ id={idOverride}
396
+ inputValue={inputValue}
397
+ isCustomValueAllowed={isCustomValueAllowed}
398
+ isDisabled={isDisabled}
399
+ isFullWidth={isFullWidth}
400
+ isLoading={isLoading}
401
+ isOptional={isOptional}
402
+ isReadOnly={isReadOnly}
403
+ isVirtualized={isVirtualizedProp}
404
+ hint={hint}
405
+ HintLinkComponent={HintLinkComponent}
406
+ label={label}
407
+ name={nameOverride}
408
+ onBlur={onBlur}
409
+ onChange={onChangeProp}
410
+ onInputChange={onInputChangeProp}
411
+ onFocus={onFocus}
412
+ options={options}
413
+ renderOption={customOptionRender}
414
+ renderTags={customTagRender}
415
+ value={value}
416
+ testId={testId}
417
+ translate={translate}
418
+ />
419
+ );
420
+ };
421
+
422
+ // Need the `as BasePickerType` because generics don't get passed through
423
+ const MemoizedPickerWithOptionAdornment = memo(
424
+ PickerWithOptionAdornment,
425
+ ) as BasePickerType;
426
+
427
+ MemoizedPickerWithOptionAdornment.displayName = "PickerWithOptionAdornment";
428
+
429
+ export { MemoizedPickerWithOptionAdornment as PickerWithOptionAdornment };
@@ -0,0 +1,15 @@
1
+ /*!
2
+ * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ export { adornmentSizeValues } from "./ComposablePicker";
14
+ export * from "./Picker";
15
+ export * from "./PickerWithOptionAdornment";
@@ -20,6 +20,7 @@ import {
20
20
  import { DocumentationIcon } from "../icons.generated";
21
21
  import { Heading4, Subordinate } from "../Typography";
22
22
  import { Link } from "../Link";
23
+ import { useHasUiShell } from "./UiShell";
23
24
 
24
25
  export type PageTemplateProps = {
25
26
  /**
@@ -72,16 +73,20 @@ type TemplateContentProps = {
72
73
 
73
74
  const TemplateContainer = styled("div", {
74
75
  shouldForwardProp: (prop) =>
75
- prop !== "odysseyDesignTokens" && prop !== "isFullWidth",
76
+ prop !== "odysseyDesignTokens" &&
77
+ prop !== "hasUiShell" &&
78
+ prop !== "isFullWidth",
76
79
  })<{
77
- odysseyDesignTokens: DesignTokens;
80
+ hasUiShell: boolean;
78
81
  isFullWidth: boolean;
79
- }>(({ odysseyDesignTokens, isFullWidth }) => ({
82
+ odysseyDesignTokens: DesignTokens;
83
+ }>(({ hasUiShell, isFullWidth, odysseyDesignTokens }) => ({
80
84
  maxWidth: isFullWidth
81
85
  ? "100%"
82
86
  : `calc(1440px + ${odysseyDesignTokens.Spacing6} + ${odysseyDesignTokens.Spacing6})`,
83
- marginInline: isFullWidth ? odysseyDesignTokens.Spacing6 : "auto",
84
- padding: odysseyDesignTokens.Spacing6,
87
+ marginInline:
88
+ isFullWidth && !hasUiShell ? odysseyDesignTokens.Spacing6 : "auto",
89
+ padding: hasUiShell ? 0 : odysseyDesignTokens.Spacing6,
85
90
  }));
86
91
 
87
92
  const TemplateHeader = styled("div")(() => ({
@@ -163,24 +168,27 @@ const TemplateContent = styled("div", {
163
168
  );
164
169
 
165
170
  const PageTemplate = ({
166
- title,
171
+ children,
167
172
  description,
168
173
  documentationLink,
169
174
  documentationText,
175
+ drawer,
176
+ isFullWidth = false,
170
177
  primaryCallToActionComponent,
171
178
  secondaryCallToActionComponent,
172
179
  tertiaryCallToActionComponent,
173
- children,
174
- drawer,
175
- isFullWidth = false,
180
+ title,
176
181
  }: PageTemplateProps) => {
177
182
  const odysseyDesignTokens = useOdysseyDesignTokens();
178
183
  const { isOpen: isDrawerOpen, variant: drawerVariant } = drawer?.props ?? {};
179
184
 
185
+ const hasUiShell = useHasUiShell();
186
+
180
187
  return (
181
188
  <TemplateContainer
182
- odysseyDesignTokens={odysseyDesignTokens}
189
+ hasUiShell={hasUiShell}
183
190
  isFullWidth={isFullWidth}
191
+ odysseyDesignTokens={odysseyDesignTokens}
184
192
  >
185
193
  <TemplateHeader>
186
194
  <TemplateHeaderPrimaryContent>