@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
@@ -0,0 +1,34 @@
1
+ /*!
2
+ * Copyright (c) 2024-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 type { PropsWithChildren } from "react";
14
+ // eslint-disable-next-line import/no-extraneous-dependencies
15
+ import { DragOverlay, defaultDropAnimationSideEffects } from "@dnd-kit/core";
16
+ import type { DropAnimation } from "@dnd-kit/core";
17
+
18
+ const dropAnimationConfig: DropAnimation = {
19
+ sideEffects: defaultDropAnimationSideEffects({
20
+ styles: {
21
+ active: {
22
+ opacity: "0.4",
23
+ },
24
+ },
25
+ }),
26
+ };
27
+
28
+ interface Props {}
29
+
30
+ export function SortableOverlay({ children }: PropsWithChildren<Props>) {
31
+ return (
32
+ <DragOverlay dropAnimation={dropAnimationConfig}>{children}</DragOverlay>
33
+ );
34
+ }
@@ -14,15 +14,62 @@ import type { ReactElement } from "react";
14
14
  import type { HtmlProps } from "../../HtmlProps";
15
15
  import type { statusSeverityValues } from "../../Status";
16
16
 
17
+ export type SideNavLogoProps = {
18
+ href?: string;
19
+ } & (
20
+ | {
21
+ /**
22
+ * a component to render as the logo
23
+ */
24
+ logoComponent: ReactElement;
25
+ imageAltText?: never;
26
+ imageUrl?: never;
27
+ }
28
+ | {
29
+ /**
30
+ * The src url to render in an `img` tag
31
+ */
32
+ imageUrl: string;
33
+ /**
34
+ * alt text for the img logo
35
+ */
36
+ imageAltText: string;
37
+ logoComponent?: never;
38
+ }
39
+ | {
40
+ /**
41
+ * The src url to render in an `img` tag
42
+ */
43
+ imageUrl?: never;
44
+ /**
45
+ * alt text for the img logo
46
+ */
47
+ imageAltText?: never;
48
+ logoComponent?: never;
49
+ }
50
+ );
51
+
17
52
  export type SideNavProps = {
18
53
  /**
19
54
  * Side Nav header text that is usually reserved to show the App name
20
55
  */
21
- navHeaderText: string;
56
+ appName: string;
22
57
  /**
23
58
  * Determines whether the side nav is collapsible
24
59
  */
25
60
  isCollapsible?: boolean;
61
+ /**
62
+ * Determines whether the side nav items use compact layout
63
+ */
64
+ isCompact?: boolean;
65
+ /**
66
+ * Before the side nav has items, it will be in a loading state.
67
+ */
68
+ isLoading?: boolean;
69
+ /**
70
+ * An optional logo component or src string for an img to display in the header. If not provided, will default to the Okta logo
71
+ */
72
+ logoProps?: SideNavLogoProps;
26
73
  /**
27
74
  * Triggers when the side nav is collapsed
28
75
  */
@@ -32,58 +79,53 @@ export type SideNavProps = {
32
79
  */
33
80
  onExpand?(): void;
34
81
  /**
35
- * Nav items in the side nav
36
- */
37
- sideNavItems: SideNavItem[];
38
- /**
39
- * A CSS length string indicating the customizable expanded width of the SideNav container.
40
- * (it will be smaller if isCollapsible and collapsed)
82
+ * Triggers when the item is reordered
41
83
  */
42
- expandedWidth?: string;
84
+ onSort?(reorderedItems: SideNavItem[]): void;
43
85
  /**
44
- * An optional logo to display in the header. If not provided, will default to the Okta logo
86
+ * Nav items in the side nav
45
87
  */
46
- logo?: ReactElement;
88
+ sideNavItems: SideNavItem[];
47
89
  } & (
48
90
  | {
49
91
  /**
50
- * Footer items in the side nav
51
- */
52
- footerItems?: SideNavFooterItem[];
53
- /**
54
- * footerComponent cannot be used if footerItems are defined
92
+ * The component to display as the footer; if present the `footerItems` are ignored and not rendered.
55
93
  */
56
- footerComponent?: never;
94
+ footerComponent?: ReactElement;
95
+ footerItems?: never;
96
+ hasCustomFooter: true;
57
97
  }
58
98
  | {
99
+ footerComponent?: never;
59
100
  /**
60
- * footerItems cannot be used if footerComponent is defined
61
- */
62
- footerItems?: never;
63
- /**
64
- * The component to display as the footer; if present the `footerItems` are ignored and not rendered.
101
+ * Footer items in the side nav
65
102
  */
66
- footerComponent?: ReactElement;
103
+ footerItems?: SideNavFooterItem[];
104
+ hasCustomFooter?: false;
67
105
  }
68
106
  ) &
69
107
  Pick<HtmlProps, "testId">;
70
108
 
71
109
  export type SideNavItem = {
72
- id: string;
73
- label: string;
110
+ /**
111
+ * The number to display as a count alongside the nav item
112
+ */
113
+ count?: number;
74
114
  /**
75
115
  * The icon element to display at the end of the Nav Item
76
116
  */
77
117
  endIcon?: ReactElement;
118
+ id: string;
78
119
  /**
79
120
  * Whether the item is disabled. When set to true the nav item is set to Disabled color,
80
- * the link/item is not clickable, and item with children is not expandable.
121
+ * the link/item is not clickable, and item with nestedNavItems is not expandable.
81
122
  */
82
123
  isDisabled?: boolean;
83
124
  /**
84
125
  * Whether the item is active/selected
85
126
  */
86
127
  isSelected?: boolean;
128
+ label: string;
87
129
  /**
88
130
  * Event fired when the nav item is clicked
89
131
  */
@@ -106,33 +148,37 @@ export type SideNavItem = {
106
148
  target?: string;
107
149
  } & (
108
150
  | {
151
+ nestedNavItems?: never;
152
+ href?: never;
153
+ isDefaultExpanded?: never;
154
+ isExpanded?: never;
109
155
  /**
110
156
  * Determines if the side nav item is a section header
111
157
  */
112
158
  isSectionHeader: true;
113
- href?: never;
114
- children?: never;
115
- isDefaultExpanded?: never;
116
- isExpanded?: never;
159
+ isSortable?: never;
117
160
  }
118
161
  | {
162
+ nestedNavItems?: never;
119
163
  /**
120
164
  * link added to the nav item. if it is undefined, static text will be displayed.
121
165
  * fires onClick event when it is passed
122
166
  */
123
- href: string;
124
- children?: never;
125
- isSectionHeader?: never;
167
+ href?: string;
126
168
  isDefaultExpanded?: never;
127
169
  isExpanded?: never;
170
+ isSectionHeader?: never;
171
+ isSortable?: never;
128
172
  }
129
173
  | {
130
174
  /**
131
- * An array of side nav items to be displayed as children within Accordion
175
+ * An array of side nav items to be displayed as nestedNavItems within Accordion
132
176
  */
133
- children?: SideNavItem[];
177
+ nestedNavItems?: Array<Omit<SideNavItem, "startIcon" | "nestedNavItems">>;
178
+ endIcon?: never;
179
+ href?: never;
134
180
  /**
135
- * Whether the accordion (nav item with children) is expanded by default
181
+ * Whether the accordion (nav item with nestedNavItems) is expanded by default
136
182
  */
137
183
  isDefaultExpanded?: boolean;
138
184
  /**
@@ -140,8 +186,11 @@ export type SideNavItem = {
140
186
  * Setting this prop enables control over the accordion.
141
187
  */
142
188
  isExpanded?: boolean;
189
+ /**
190
+ * If true, enables sorting for the accordion items
191
+ */
143
192
  isSectionHeader?: never;
144
- href?: never;
193
+ isSortable?: boolean;
145
194
  }
146
195
  );
147
196
 
@@ -0,0 +1,95 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import styled from "@emotion/styled";
14
+ import { memo, type ReactElement } from "react";
15
+
16
+ import type { HtmlProps } from "../../HtmlProps";
17
+ import {
18
+ DesignTokens,
19
+ useOdysseyDesignTokens,
20
+ } from "../../OdysseyDesignTokensContext";
21
+
22
+ export const TOP_NAV_HEIGHT = `${64 / 14}rem`;
23
+
24
+ const StyledLeftSideContainer = styled("div")(() => ({
25
+ flexGrow: 1,
26
+ }));
27
+
28
+ const StyledRightSideContainer = styled("div")(() => ({
29
+ flexShrink: 0,
30
+ }));
31
+
32
+ const StyledTopNavContainer = styled("div", {
33
+ shouldForwardProp: (prop) =>
34
+ prop !== "odysseyDesignTokens" && prop !== "isScrolled",
35
+ })<{
36
+ odysseyDesignTokens: DesignTokens;
37
+ isScrolled?: boolean;
38
+ }>(({ odysseyDesignTokens, isScrolled }) => ({
39
+ alignItems: "center",
40
+ backgroundColor: odysseyDesignTokens.HueNeutral50,
41
+ boxShadow: isScrolled ? odysseyDesignTokens.DepthMedium : undefined,
42
+ clipPath: "inset(0 0 -100vh 0)",
43
+ display: "flex",
44
+ gap: odysseyDesignTokens.Spacing4,
45
+ height: "100%",
46
+ justifyContent: "space-between",
47
+ maxHeight: TOP_NAV_HEIGHT,
48
+ minHeight: TOP_NAV_HEIGHT,
49
+ paddingBlock: odysseyDesignTokens.Spacing2,
50
+ paddingInline: odysseyDesignTokens.Spacing8,
51
+ transition: `box-shadow ${odysseyDesignTokens.TransitionDurationMain} ${odysseyDesignTokens.TransitionTimingMain}`,
52
+ zIndex: 1,
53
+ }));
54
+
55
+ export type TopNavProps = {
56
+ /**
57
+ * Whether or not the underlying content has been scrolled
58
+ */
59
+ isScrolled?: boolean;
60
+ /**
61
+ * React components that render into the left side of the top nav.
62
+ */
63
+ leftSideComponent?: ReactElement;
64
+ /**
65
+ * React components that render into the right side of the top nav.
66
+ */
67
+ rightSideComponent?: ReactElement;
68
+ } & Pick<HtmlProps, "testId">;
69
+
70
+ const TopNav = ({
71
+ isScrolled,
72
+ leftSideComponent,
73
+ rightSideComponent,
74
+ }: TopNavProps) => {
75
+ const odysseyDesignTokens = useOdysseyDesignTokens();
76
+
77
+ return (
78
+ <StyledTopNavContainer
79
+ odysseyDesignTokens={odysseyDesignTokens}
80
+ isScrolled={isScrolled}
81
+ >
82
+ <StyledLeftSideContainer>
83
+ {leftSideComponent ?? <div />}
84
+ </StyledLeftSideContainer>
85
+ <StyledRightSideContainer>
86
+ {rightSideComponent ?? <div />}
87
+ </StyledRightSideContainer>
88
+ </StyledTopNavContainer>
89
+ );
90
+ };
91
+
92
+ const MemoizedTopNav = memo(TopNav);
93
+ MemoizedTopNav.displayName = "TopNav";
94
+
95
+ export { MemoizedTopNav as TopNav };
@@ -0,0 +1,68 @@
1
+ /*!
2
+ * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved.
3
+ * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
4
+ *
5
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
6
+ * Unless required by applicable law or agreed to in writing, software
7
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
8
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9
+ *
10
+ * See the License for the specific language governing permissions and limitations under the License.
11
+ */
12
+
13
+ import styled from "@emotion/styled";
14
+ import { memo, type ReactElement } from "react";
15
+
16
+ import type { HtmlProps } from "../../HtmlProps";
17
+ import { TopNavListItem, TopNavListItemProps } from "./TopNavListItem";
18
+ import { UserProfileProps } from "./UserProfile";
19
+
20
+ export type TopNavLinksListProps = {
21
+ /**
22
+ * Pass in an additional component like `Button` that will be displayed after the nav link items
23
+ */
24
+ additionalNavItem?: ReactElement;
25
+ /**
26
+ * URL to the help page.
27
+ */
28
+ helpPageHref?: string;
29
+ /**
30
+ * Pass in a SearchField component with the variant="filled" prop set
31
+ */
32
+ searchField?: ReactElement;
33
+ /**
34
+ * URL to settings page.
35
+ */
36
+ settingsPageHref?: string;
37
+ /**
38
+ * Nav links in the top nav
39
+ */
40
+ topNavLinkItems: TopNavListItemProps[];
41
+ /**
42
+ * Displays user account info
43
+ */
44
+ userProfile?: UserProfileProps;
45
+ } & Pick<HtmlProps, "testId">;
46
+
47
+ const StyledTopNavList = styled("ul")(() => ({
48
+ alignItems: "center",
49
+ display: "flex",
50
+ listStyle: "none",
51
+ listStyleType: "none",
52
+ padding: 0,
53
+ }));
54
+
55
+ const TopNavLinksList = ({ topNavLinkItems }: TopNavLinksListProps) => (
56
+ <nav>
57
+ <StyledTopNavList>
58
+ {topNavLinkItems.map((item) => (
59
+ <TopNavListItem {...item} key={item.id} />
60
+ ))}
61
+ </StyledTopNavList>
62
+ </nav>
63
+ );
64
+
65
+ const MemoizedTopNavLinksList = memo(TopNavLinksList);
66
+ MemoizedTopNavLinksList.displayName = "TopNavLinksList";
67
+
68
+ export { MemoizedTopNavLinksList as TopNavLinksList };
@@ -0,0 +1,209 @@
1
+ /*!
2
+ * Copyright (c) 2024-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 styled from "@emotion/styled";
14
+ import {
15
+ memo,
16
+ useCallback,
17
+ KeyboardEventHandler,
18
+ MouseEventHandler,
19
+ } from "react";
20
+
21
+ import { Link } from "../../Link";
22
+ import {
23
+ DesignTokens,
24
+ useOdysseyDesignTokens,
25
+ } from "../../OdysseyDesignTokensContext";
26
+
27
+ const StyledTopNavItemLabelContainer = styled("div", {
28
+ shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
29
+ })<{
30
+ odysseyDesignTokens: DesignTokens;
31
+ }>(({ odysseyDesignTokens }) => ({
32
+ alignItems: "center",
33
+ display: "flex",
34
+ flexWrap: "wrap",
35
+ fontSize: odysseyDesignTokens.TypographyScale0,
36
+ fontWeight: odysseyDesignTokens.TypographyWeightHeading,
37
+ }));
38
+
39
+ const StyledTopNavListItem = styled("li", {
40
+ shouldForwardProp: (prop) =>
41
+ prop !== "odysseyDesignTokens" && prop !== "isDisabled",
42
+ })<{
43
+ odysseyDesignTokens: DesignTokens;
44
+ isDisabled?: boolean;
45
+ }>(({ odysseyDesignTokens, isDisabled }) => ({
46
+ alignItems: "center",
47
+ color: `${isDisabled ? odysseyDesignTokens.TypographyColorDisabled : odysseyDesignTokens.TypographyColorHeading} !important`,
48
+ cursor: isDisabled ? "default" : "pointer",
49
+ display: "flex",
50
+ pointerEvents: isDisabled ? "none" : "auto",
51
+
52
+ a: {
53
+ alignItems: "center",
54
+ color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
55
+ display: "flex",
56
+ paddingBlock: odysseyDesignTokens.Spacing2,
57
+ paddingInline: odysseyDesignTokens.Spacing4,
58
+
59
+ "&:hover": {
60
+ backgroundColor: !isDisabled
61
+ ? odysseyDesignTokens.HueNeutral50
62
+ : "inherit",
63
+ textDecoration: "none",
64
+ },
65
+
66
+ "&:focus-visible": {
67
+ backgroundColor: !isDisabled
68
+ ? odysseyDesignTokens.HueNeutral50
69
+ : "inherit",
70
+ borderRadius: 0,
71
+ outlineOffset: 0,
72
+ outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
73
+ },
74
+ },
75
+
76
+ "div[role='button']:hover": {
77
+ backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit",
78
+ },
79
+ }));
80
+
81
+ const StyledNavItemContentClickContainer = styled("div", {
82
+ shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
83
+ })<{
84
+ odysseyDesignTokens: DesignTokens;
85
+ }>(({ odysseyDesignTokens }) => ({
86
+ alignItems: "center",
87
+ display: "flex",
88
+ paddingBlock: odysseyDesignTokens.Spacing2,
89
+ paddingInline: odysseyDesignTokens.Spacing4,
90
+ width: "100%",
91
+
92
+ "&:focus-visible": {
93
+ backgroundColor: odysseyDesignTokens.HueNeutral50,
94
+ borderRadius: 0,
95
+ outlineColor: odysseyDesignTokens.FocusOutlineColorPrimary,
96
+ outlineStyle: odysseyDesignTokens.FocusOutlineStyle,
97
+ outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
98
+ textDecoration: "none",
99
+ },
100
+ }));
101
+
102
+ export type TopNavListItemProps = {
103
+ /**
104
+ * Without a hyperlink reference, `onClick` functionality will not function.
105
+ * If `undefined`, static text will be displayed.
106
+ */
107
+ href?: string;
108
+ /**
109
+ * HTML `id` attribute.
110
+ */
111
+ id: string;
112
+ /**
113
+ * Determines whether the link item is disabled.
114
+ */
115
+ isDisabled?: boolean;
116
+ /**
117
+ * Display text for the link.
118
+ */
119
+ label: string;
120
+ /**
121
+ * Handles both mouse and keyboard interactions.
122
+ */
123
+ onClick?: MouseEventHandler<HTMLAnchorElement> &
124
+ MouseEventHandler<HTMLDivElement> &
125
+ KeyboardEventHandler<HTMLDivElement>;
126
+ /**
127
+ * Where to display the linked URL.
128
+ */
129
+ target?: string;
130
+ };
131
+
132
+ const TopNavListItem = ({
133
+ href,
134
+ id,
135
+ isDisabled,
136
+ label,
137
+ onClick,
138
+ target,
139
+ }: TopNavListItemProps) => {
140
+ const odysseyDesignTokens = useOdysseyDesignTokens();
141
+
142
+ const topNavItemContentKeyHandler = useCallback<
143
+ KeyboardEventHandler<HTMLDivElement>
144
+ >(
145
+ (event) => {
146
+ if (event?.key === "Enter") {
147
+ event.preventDefault();
148
+ event.stopPropagation();
149
+ onClick?.(event);
150
+ }
151
+ },
152
+ [onClick],
153
+ );
154
+
155
+ return (
156
+ <StyledTopNavListItem
157
+ aria-disabled={isDisabled}
158
+ id={id}
159
+ isDisabled={isDisabled}
160
+ odysseyDesignTokens={odysseyDesignTokens}
161
+ >
162
+ {
163
+ // Use Link for nav items with links and div for disabled or non-link items
164
+ isDisabled && (
165
+ <StyledNavItemContentClickContainer
166
+ odysseyDesignTokens={odysseyDesignTokens}
167
+ >
168
+ <StyledTopNavItemLabelContainer
169
+ odysseyDesignTokens={odysseyDesignTokens}
170
+ >
171
+ {label}
172
+ </StyledTopNavItemLabelContainer>
173
+ </StyledNavItemContentClickContainer>
174
+ )
175
+ }
176
+
177
+ {!isDisabled && href && (
178
+ <Link href={href} onClick={onClick} target={target}>
179
+ <StyledTopNavItemLabelContainer
180
+ odysseyDesignTokens={odysseyDesignTokens}
181
+ >
182
+ {label}
183
+ </StyledTopNavItemLabelContainer>
184
+ </Link>
185
+ )}
186
+
187
+ {!isDisabled && !href && (
188
+ <StyledNavItemContentClickContainer
189
+ odysseyDesignTokens={odysseyDesignTokens}
190
+ onClick={onClick}
191
+ onKeyDown={topNavItemContentKeyHandler}
192
+ role="button"
193
+ tabIndex={0}
194
+ >
195
+ <StyledTopNavItemLabelContainer
196
+ odysseyDesignTokens={odysseyDesignTokens}
197
+ >
198
+ {label}
199
+ </StyledTopNavItemLabelContainer>
200
+ </StyledNavItemContentClickContainer>
201
+ )}
202
+ </StyledTopNavListItem>
203
+ );
204
+ };
205
+
206
+ const MemoizedTopNavListItem = memo(TopNavListItem);
207
+ MemoizedTopNavListItem.displayName = "TopNavListItem";
208
+
209
+ export { MemoizedTopNavListItem as TopNavListItem };
@@ -0,0 +1,79 @@
1
+ /*!
2
+ * Copyright (c) 2024-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 styled from "@emotion/styled";
14
+ import { memo, type ReactElement } from "react";
15
+
16
+ import {
17
+ DesignTokens,
18
+ useOdysseyDesignTokens,
19
+ } from "../../OdysseyDesignTokensContext";
20
+ import { Subordinate } from "../../Typography";
21
+
22
+ const UserProfileContainer = styled("div", {
23
+ shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
24
+ })(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
25
+ display: "flex",
26
+ alignItems: "center",
27
+ paddingInlineEnd: odysseyDesignTokens.Spacing4,
28
+ }));
29
+
30
+ const UserProfileIconContainer = styled("div", {
31
+ shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
32
+ })(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
33
+ display: "flex",
34
+ paddingInlineEnd: odysseyDesignTokens.Spacing2,
35
+ }));
36
+
37
+ const UserProfileInfoContainer = styled("div")(() => ({
38
+ display: "flex",
39
+ flexDirection: "column",
40
+ }));
41
+
42
+ export type UserProfileProps = {
43
+ /**
44
+ * Logged in user profile icon to be displayed in the top nav
45
+ */
46
+ profileIcon?: ReactElement;
47
+ /**
48
+ * Logged in user info to be displayed in the top nav
49
+ */
50
+ userName: string;
51
+ /**
52
+ * Org name of the logged in user
53
+ */
54
+ orgName: string;
55
+ };
56
+
57
+ const UserProfile = ({ profileIcon, userName, orgName }: UserProfileProps) => {
58
+ const odysseyDesignTokens = useOdysseyDesignTokens();
59
+
60
+ return (
61
+ <UserProfileContainer odysseyDesignTokens={odysseyDesignTokens}>
62
+ {profileIcon && (
63
+ <UserProfileIconContainer odysseyDesignTokens={odysseyDesignTokens}>
64
+ {profileIcon}
65
+ </UserProfileIconContainer>
66
+ )}
67
+
68
+ <UserProfileInfoContainer>
69
+ <Subordinate color="textPrimary">{userName}</Subordinate>
70
+ <Subordinate color="textSecondary">{orgName}</Subordinate>
71
+ </UserProfileInfoContainer>
72
+ </UserProfileContainer>
73
+ );
74
+ };
75
+
76
+ const MemoizedUserProfile = memo(UserProfile);
77
+ MemoizedUserProfile.displayName = "UserProfile";
78
+
79
+ export { MemoizedUserProfile as UserProfile };