@okta/odyssey-react-mui 1.21.2 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (432) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/Autocomplete.js +76 -38
  3. package/dist/Autocomplete.js.map +1 -1
  4. package/dist/Checkbox.js +26 -11
  5. package/dist/Checkbox.js.map +1 -1
  6. package/dist/CheckboxGroup.js +14 -3
  7. package/dist/CheckboxGroup.js.map +1 -1
  8. package/dist/DataTable/DataTable.js +10 -2
  9. package/dist/DataTable/DataTable.js.map +1 -1
  10. package/dist/DataTable/useScrollIndication.js +2 -2
  11. package/dist/DataTable/useScrollIndication.js.map +1 -1
  12. package/dist/Field.js +3 -1
  13. package/dist/Field.js.map +1 -1
  14. package/dist/OdysseyCacheProvider.js +4 -3
  15. package/dist/OdysseyCacheProvider.js.map +1 -1
  16. package/dist/OdysseyProvider.js +6 -3
  17. package/dist/OdysseyProvider.js.map +1 -1
  18. package/dist/OdysseyThemeProvider.js +3 -2
  19. package/dist/OdysseyThemeProvider.js.map +1 -1
  20. package/dist/Radio.js +34 -7
  21. package/dist/Radio.js.map +1 -1
  22. package/dist/RadioGroup.js +17 -5
  23. package/dist/RadioGroup.js.map +1 -1
  24. package/dist/Select.js +53 -31
  25. package/dist/Select.js.map +1 -1
  26. package/dist/ToastStack.js.map +1 -1
  27. package/dist/{createShadowRootElement.js → createShadowDomElements.js} +22 -6
  28. package/dist/createShadowDomElements.js.map +1 -0
  29. package/dist/index.js +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/index.scss +5 -5
  32. package/dist/labs/AppTile.js +124 -0
  33. package/dist/labs/AppTile.js.map +1 -0
  34. package/dist/labs/DataView/BulkActionsMenu.js.map +1 -0
  35. package/dist/labs/{DataComponents/StackContent.js → DataView/CardLayoutContent.js} +14 -14
  36. package/dist/labs/DataView/CardLayoutContent.js.map +1 -0
  37. package/dist/labs/{DataComponents/StackCard.js → DataView/DataCard.js} +6 -6
  38. package/dist/labs/DataView/DataCard.js.map +1 -0
  39. package/dist/labs/{DataComponents → DataView}/DataTable.js +6 -2
  40. package/dist/labs/DataView/DataTable.js.map +1 -0
  41. package/dist/labs/{DataComponents → DataView}/DataView.js +25 -15
  42. package/dist/labs/DataView/DataView.js.map +1 -0
  43. package/dist/labs/DataView/DetailPanel.js.map +1 -0
  44. package/dist/labs/DataView/LayoutSwitcher.js.map +1 -0
  45. package/dist/labs/DataView/RowActions.js.map +1 -0
  46. package/dist/labs/{DataComponents/TableContent.js → DataView/TableLayoutContent.js} +17 -17
  47. package/dist/labs/DataView/TableLayoutContent.js.map +1 -0
  48. package/dist/labs/{DataComponents → DataView}/TableSettings.js +2 -2
  49. package/dist/labs/DataView/TableSettings.js.map +1 -0
  50. package/dist/labs/DataView/componentTypes.js.map +1 -0
  51. package/dist/labs/{DataComponents → DataView}/constants.js +2 -2
  52. package/dist/labs/DataView/constants.js.map +1 -0
  53. package/dist/labs/DataView/dataTypes.js.map +1 -0
  54. package/dist/labs/DataView/fetchData.js.map +1 -0
  55. package/dist/labs/{DataComponents → DataView}/index.js +0 -1
  56. package/dist/labs/DataView/index.js.map +1 -0
  57. package/dist/labs/DataView/tableConstants.js.map +1 -0
  58. package/dist/labs/DataView/useFilterConversion.js.map +1 -0
  59. package/dist/labs/SideNav/CollapseIcon.js +44 -0
  60. package/dist/labs/SideNav/CollapseIcon.js.map +1 -0
  61. package/dist/labs/SideNav/SideNav.js +246 -0
  62. package/dist/labs/SideNav/SideNav.js.map +1 -0
  63. package/dist/labs/SideNav/SideNavFooterContent.js +49 -0
  64. package/dist/labs/SideNav/SideNavFooterContent.js.map +1 -0
  65. package/dist/labs/SideNav/SideNavHeader.js +58 -0
  66. package/dist/labs/SideNav/SideNavHeader.js.map +1 -0
  67. package/dist/labs/SideNav/SideNavItemContent.js +157 -0
  68. package/dist/labs/SideNav/SideNavItemContent.js.map +1 -0
  69. package/dist/labs/SideNav/SideNavItemLinkContent.js +71 -0
  70. package/dist/labs/SideNav/SideNavItemLinkContent.js.map +1 -0
  71. package/dist/labs/SideNav/index.js +14 -0
  72. package/dist/labs/SideNav/index.js.map +1 -0
  73. package/dist/labs/SideNav/types.js +2 -0
  74. package/dist/labs/SideNav/types.js.map +1 -0
  75. package/dist/labs/Switch.js +70 -16
  76. package/dist/labs/Switch.js.map +1 -1
  77. package/dist/labs/index.js +3 -2
  78. package/dist/labs/index.js.map +1 -1
  79. package/dist/properties/ts/odyssey-react-mui_cs.js +17 -3
  80. package/dist/properties/ts/odyssey-react-mui_cs.js.map +1 -1
  81. package/dist/properties/ts/odyssey-react-mui_da.js +17 -3
  82. package/dist/properties/ts/odyssey-react-mui_da.js.map +1 -1
  83. package/dist/properties/ts/odyssey-react-mui_de.js +16 -2
  84. package/dist/properties/ts/odyssey-react-mui_de.js.map +1 -1
  85. package/dist/properties/ts/odyssey-react-mui_el.js +18 -4
  86. package/dist/properties/ts/odyssey-react-mui_el.js.map +1 -1
  87. package/dist/properties/ts/odyssey-react-mui_es.js +17 -3
  88. package/dist/properties/ts/odyssey-react-mui_es.js.map +1 -1
  89. package/dist/properties/ts/odyssey-react-mui_fi.js +17 -3
  90. package/dist/properties/ts/odyssey-react-mui_fi.js.map +1 -1
  91. package/dist/properties/ts/odyssey-react-mui_fr.js +17 -3
  92. package/dist/properties/ts/odyssey-react-mui_fr.js.map +1 -1
  93. package/dist/properties/ts/odyssey-react-mui_ht.js +18 -4
  94. package/dist/properties/ts/odyssey-react-mui_ht.js.map +1 -1
  95. package/dist/properties/ts/odyssey-react-mui_hu.js +17 -3
  96. package/dist/properties/ts/odyssey-react-mui_hu.js.map +1 -1
  97. package/dist/properties/ts/odyssey-react-mui_id.js +17 -3
  98. package/dist/properties/ts/odyssey-react-mui_id.js.map +1 -1
  99. package/dist/properties/ts/odyssey-react-mui_it.js +17 -3
  100. package/dist/properties/ts/odyssey-react-mui_it.js.map +1 -1
  101. package/dist/properties/ts/odyssey-react-mui_ja.js +16 -2
  102. package/dist/properties/ts/odyssey-react-mui_ja.js.map +1 -1
  103. package/dist/properties/ts/odyssey-react-mui_ko.js +16 -2
  104. package/dist/properties/ts/odyssey-react-mui_ko.js.map +1 -1
  105. package/dist/properties/ts/odyssey-react-mui_ms.js +17 -3
  106. package/dist/properties/ts/odyssey-react-mui_ms.js.map +1 -1
  107. package/dist/properties/ts/odyssey-react-mui_nb.js +17 -3
  108. package/dist/properties/ts/odyssey-react-mui_nb.js.map +1 -1
  109. package/dist/properties/ts/odyssey-react-mui_nl_NL.js +17 -3
  110. package/dist/properties/ts/odyssey-react-mui_nl_NL.js.map +1 -1
  111. package/dist/properties/ts/odyssey-react-mui_pl.js +17 -3
  112. package/dist/properties/ts/odyssey-react-mui_pl.js.map +1 -1
  113. package/dist/properties/ts/odyssey-react-mui_pt_BR.js +17 -3
  114. package/dist/properties/ts/odyssey-react-mui_pt_BR.js.map +1 -1
  115. package/dist/properties/ts/odyssey-react-mui_ro.js +17 -3
  116. package/dist/properties/ts/odyssey-react-mui_ro.js.map +1 -1
  117. package/dist/properties/ts/odyssey-react-mui_ru.js +17 -3
  118. package/dist/properties/ts/odyssey-react-mui_ru.js.map +1 -1
  119. package/dist/properties/ts/odyssey-react-mui_sv.js +17 -3
  120. package/dist/properties/ts/odyssey-react-mui_sv.js.map +1 -1
  121. package/dist/properties/ts/odyssey-react-mui_th.js +16 -2
  122. package/dist/properties/ts/odyssey-react-mui_th.js.map +1 -1
  123. package/dist/properties/ts/odyssey-react-mui_tr.js +17 -3
  124. package/dist/properties/ts/odyssey-react-mui_tr.js.map +1 -1
  125. package/dist/properties/ts/odyssey-react-mui_uk.js +17 -3
  126. package/dist/properties/ts/odyssey-react-mui_uk.js.map +1 -1
  127. package/dist/properties/ts/odyssey-react-mui_vi.js +17 -3
  128. package/dist/properties/ts/odyssey-react-mui_vi.js.map +1 -1
  129. package/dist/properties/ts/odyssey-react-mui_zh_CN.js +16 -2
  130. package/dist/properties/ts/odyssey-react-mui_zh_CN.js.map +1 -1
  131. package/dist/properties/ts/odyssey-react-mui_zh_TW.js +16 -2
  132. package/dist/properties/ts/odyssey-react-mui_zh_TW.js.map +1 -1
  133. package/dist/src/Autocomplete.d.ts.map +1 -1
  134. package/dist/src/Checkbox.d.ts +2 -2
  135. package/dist/src/Checkbox.d.ts.map +1 -1
  136. package/dist/src/CheckboxGroup.d.ts +3 -3
  137. package/dist/src/CheckboxGroup.d.ts.map +1 -1
  138. package/dist/src/DataTable/DataTable.d.ts +9 -1
  139. package/dist/src/DataTable/DataTable.d.ts.map +1 -1
  140. package/dist/src/Field.d.ts +3 -2
  141. package/dist/src/Field.d.ts.map +1 -1
  142. package/dist/src/OdysseyCacheProvider.d.ts +7 -3
  143. package/dist/src/OdysseyCacheProvider.d.ts.map +1 -1
  144. package/dist/src/OdysseyProvider.d.ts +1 -1
  145. package/dist/src/OdysseyProvider.d.ts.map +1 -1
  146. package/dist/src/OdysseyThemeProvider.d.ts +3 -1
  147. package/dist/src/OdysseyThemeProvider.d.ts.map +1 -1
  148. package/dist/src/Radio.d.ts +6 -8
  149. package/dist/src/Radio.d.ts.map +1 -1
  150. package/dist/src/RadioGroup.d.ts +4 -5
  151. package/dist/src/RadioGroup.d.ts.map +1 -1
  152. package/dist/src/Select.d.ts +2 -2
  153. package/dist/src/Select.d.ts.map +1 -1
  154. package/dist/src/ToastStack.d.ts +2 -2
  155. package/dist/src/ToastStack.d.ts.map +1 -1
  156. package/dist/src/{createShadowRootElement.d.ts → createShadowDomElements.d.ts} +6 -1
  157. package/dist/src/createShadowDomElements.d.ts.map +1 -0
  158. package/dist/src/index.d.ts +1 -1
  159. package/dist/src/labs/AppTile.d.ts +39 -0
  160. package/dist/src/labs/AppTile.d.ts.map +1 -0
  161. package/dist/src/labs/DataView/BulkActionsMenu.d.ts.map +1 -0
  162. package/dist/src/labs/{DataComponents/StackContent.d.ts → DataView/CardLayoutContent.d.ts} +7 -7
  163. package/dist/src/labs/DataView/CardLayoutContent.d.ts.map +1 -0
  164. package/dist/src/labs/{DataComponents/StackCard.d.ts → DataView/DataCard.d.ts} +4 -4
  165. package/dist/src/labs/DataView/DataCard.d.ts.map +1 -0
  166. package/dist/src/labs/DataView/DataTable.d.ts +16 -0
  167. package/dist/src/labs/DataView/DataTable.d.ts.map +1 -0
  168. package/dist/src/labs/{DataComponents → DataView}/DataView.d.ts +1 -1
  169. package/dist/src/labs/DataView/DataView.d.ts.map +1 -0
  170. package/dist/src/labs/{DataComponents → DataView}/DetailPanel.d.ts +2 -2
  171. package/dist/src/labs/DataView/DetailPanel.d.ts.map +1 -0
  172. package/dist/src/labs/DataView/LayoutSwitcher.d.ts.map +1 -0
  173. package/dist/src/labs/DataView/RowActions.d.ts.map +1 -0
  174. package/dist/src/labs/{DataComponents/TableContent.d.ts → DataView/TableLayoutContent.d.ts} +7 -7
  175. package/dist/src/labs/DataView/TableLayoutContent.d.ts.map +1 -0
  176. package/dist/src/labs/{DataComponents → DataView}/TableSettings.d.ts +3 -3
  177. package/dist/src/labs/DataView/TableSettings.d.ts.map +1 -0
  178. package/dist/src/labs/{DataComponents → DataView}/componentTypes.d.ts +11 -9
  179. package/dist/src/labs/DataView/componentTypes.d.ts.map +1 -0
  180. package/dist/src/labs/{DataComponents → DataView}/constants.d.ts +1 -1
  181. package/dist/src/labs/DataView/constants.d.ts.map +1 -0
  182. package/dist/src/labs/DataView/dataTypes.d.ts.map +1 -0
  183. package/dist/src/labs/DataView/fetchData.d.ts.map +1 -0
  184. package/dist/src/labs/{DataComponents → DataView}/index.d.ts +0 -1
  185. package/dist/src/labs/DataView/index.d.ts.map +1 -0
  186. package/dist/src/labs/DataView/tableConstants.d.ts.map +1 -0
  187. package/dist/src/labs/{DataComponents → DataView}/useFilterConversion.d.ts +2 -2
  188. package/dist/src/labs/DataView/useFilterConversion.d.ts.map +1 -0
  189. package/dist/src/labs/SideNav/CollapseIcon.d.ts +17 -0
  190. package/dist/src/labs/SideNav/CollapseIcon.d.ts.map +1 -0
  191. package/dist/src/labs/SideNav/SideNav.d.ts +15 -0
  192. package/dist/src/labs/SideNav/SideNav.d.ts.map +1 -0
  193. package/dist/src/labs/SideNav/SideNavFooterContent.d.ts +17 -0
  194. package/dist/src/labs/SideNav/SideNavFooterContent.d.ts.map +1 -0
  195. package/dist/src/labs/SideNav/SideNavHeader.d.ts +16 -0
  196. package/dist/src/labs/SideNav/SideNavHeader.d.ts.map +1 -0
  197. package/dist/src/labs/SideNav/SideNavItemContent.d.ts +33 -0
  198. package/dist/src/labs/SideNav/SideNavItemContent.d.ts.map +1 -0
  199. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts +16 -0
  200. package/dist/src/labs/SideNav/SideNavItemLinkContent.d.ts.map +1 -0
  201. package/dist/src/labs/SideNav/index.d.ts +14 -0
  202. package/dist/src/labs/SideNav/index.d.ts.map +1 -0
  203. package/dist/src/labs/{SideNav.d.ts → SideNav/types.d.ts} +31 -33
  204. package/dist/src/labs/SideNav/types.d.ts.map +1 -0
  205. package/dist/src/labs/Switch.d.ts +5 -1
  206. package/dist/src/labs/Switch.d.ts.map +1 -1
  207. package/dist/src/labs/index.d.ts +2 -1
  208. package/dist/src/labs/index.d.ts.map +1 -1
  209. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts +15 -1
  210. package/dist/src/properties/ts/odyssey-react-mui_cs.d.ts.map +1 -1
  211. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts +15 -1
  212. package/dist/src/properties/ts/odyssey-react-mui_da.d.ts.map +1 -1
  213. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts +15 -1
  214. package/dist/src/properties/ts/odyssey-react-mui_de.d.ts.map +1 -1
  215. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts +15 -1
  216. package/dist/src/properties/ts/odyssey-react-mui_el.d.ts.map +1 -1
  217. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts +15 -1
  218. package/dist/src/properties/ts/odyssey-react-mui_es.d.ts.map +1 -1
  219. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts +15 -1
  220. package/dist/src/properties/ts/odyssey-react-mui_fi.d.ts.map +1 -1
  221. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts +15 -1
  222. package/dist/src/properties/ts/odyssey-react-mui_fr.d.ts.map +1 -1
  223. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts +16 -2
  224. package/dist/src/properties/ts/odyssey-react-mui_ht.d.ts.map +1 -1
  225. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts +15 -1
  226. package/dist/src/properties/ts/odyssey-react-mui_hu.d.ts.map +1 -1
  227. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts +15 -1
  228. package/dist/src/properties/ts/odyssey-react-mui_id.d.ts.map +1 -1
  229. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts +15 -1
  230. package/dist/src/properties/ts/odyssey-react-mui_it.d.ts.map +1 -1
  231. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts +15 -1
  232. package/dist/src/properties/ts/odyssey-react-mui_ja.d.ts.map +1 -1
  233. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts +15 -1
  234. package/dist/src/properties/ts/odyssey-react-mui_ko.d.ts.map +1 -1
  235. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts +15 -1
  236. package/dist/src/properties/ts/odyssey-react-mui_ms.d.ts.map +1 -1
  237. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts +15 -1
  238. package/dist/src/properties/ts/odyssey-react-mui_nb.d.ts.map +1 -1
  239. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts +15 -1
  240. package/dist/src/properties/ts/odyssey-react-mui_nl_NL.d.ts.map +1 -1
  241. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts +15 -1
  242. package/dist/src/properties/ts/odyssey-react-mui_pl.d.ts.map +1 -1
  243. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts +15 -1
  244. package/dist/src/properties/ts/odyssey-react-mui_pt_BR.d.ts.map +1 -1
  245. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts +15 -1
  246. package/dist/src/properties/ts/odyssey-react-mui_ro.d.ts.map +1 -1
  247. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts +15 -1
  248. package/dist/src/properties/ts/odyssey-react-mui_ru.d.ts.map +1 -1
  249. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts +15 -1
  250. package/dist/src/properties/ts/odyssey-react-mui_sv.d.ts.map +1 -1
  251. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts +15 -1
  252. package/dist/src/properties/ts/odyssey-react-mui_th.d.ts.map +1 -1
  253. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts +15 -1
  254. package/dist/src/properties/ts/odyssey-react-mui_tr.d.ts.map +1 -1
  255. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts +15 -1
  256. package/dist/src/properties/ts/odyssey-react-mui_uk.d.ts.map +1 -1
  257. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts +15 -1
  258. package/dist/src/properties/ts/odyssey-react-mui_vi.d.ts.map +1 -1
  259. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts +15 -1
  260. package/dist/src/properties/ts/odyssey-react-mui_zh_CN.d.ts.map +1 -1
  261. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts +15 -1
  262. package/dist/src/properties/ts/odyssey-react-mui_zh_TW.d.ts.map +1 -1
  263. package/dist/src/theme/components.d.ts +3 -1
  264. package/dist/src/theme/components.d.ts.map +1 -1
  265. package/dist/src/theme/createOdysseyMuiTheme.d.ts +3 -1
  266. package/dist/src/theme/createOdysseyMuiTheme.d.ts.map +1 -1
  267. package/dist/theme/components.js +232 -146
  268. package/dist/theme/components.js.map +1 -1
  269. package/dist/theme/createOdysseyMuiTheme.js +3 -2
  270. package/dist/theme/createOdysseyMuiTheme.js.map +1 -1
  271. package/dist/tsconfig.production.tsbuildinfo +1 -1
  272. package/package.json +3 -4
  273. package/src/Autocomplete.tsx +108 -45
  274. package/src/Checkbox.tsx +39 -9
  275. package/src/CheckboxGroup.tsx +20 -4
  276. package/src/DataTable/DataTable.tsx +24 -1
  277. package/src/DataTable/useScrollIndication.tsx +2 -2
  278. package/src/Field.tsx +5 -2
  279. package/src/OdysseyCacheProvider.tsx +18 -4
  280. package/src/OdysseyProvider.tsx +6 -3
  281. package/src/OdysseyThemeProvider.tsx +6 -2
  282. package/src/Radio.tsx +42 -13
  283. package/src/RadioGroup.tsx +26 -7
  284. package/src/Select.tsx +78 -45
  285. package/src/ToastStack.tsx +2 -2
  286. package/src/{createShadowRootElement.ts → createShadowDomElements.ts} +24 -5
  287. package/src/index.ts +1 -1
  288. package/src/labs/AppTile.tsx +200 -0
  289. package/src/labs/{DataComponents/StackContent.tsx → DataView/CardLayoutContent.tsx} +24 -19
  290. package/src/labs/{DataComponents/StackCard.tsx → DataView/DataCard.tsx} +7 -7
  291. package/src/labs/{DataComponents → DataView}/DataTable.tsx +8 -4
  292. package/src/labs/{DataComponents → DataView}/DataView.tsx +46 -17
  293. package/src/labs/{DataComponents → DataView}/DetailPanel.tsx +2 -2
  294. package/src/labs/{DataComponents/TableContent.tsx → DataView/TableLayoutContent.tsx} +31 -26
  295. package/src/labs/{DataComponents → DataView}/TableSettings.tsx +5 -4
  296. package/src/labs/{DataComponents → DataView}/componentTypes.ts +11 -9
  297. package/src/labs/{DataComponents → DataView}/constants.tsx +2 -2
  298. package/src/labs/{DataComponents → DataView}/index.tsx +0 -1
  299. package/src/labs/{DataComponents → DataView}/useFilterConversion.ts +2 -2
  300. package/src/labs/SideNav/CollapseIcon.tsx +48 -0
  301. package/src/labs/SideNav/SideNav.tsx +350 -0
  302. package/src/labs/SideNav/SideNavFooterContent.tsx +64 -0
  303. package/src/labs/SideNav/SideNavHeader.tsx +65 -0
  304. package/src/labs/SideNav/SideNavItemContent.tsx +216 -0
  305. package/src/labs/SideNav/SideNavItemLinkContent.tsx +87 -0
  306. package/src/labs/SideNav/index.ts +15 -0
  307. package/src/labs/SideNav/types.ts +125 -0
  308. package/src/labs/Switch.tsx +85 -31
  309. package/src/labs/index.ts +3 -1
  310. package/src/properties/translations/odyssey-react-mui_cs.properties +15 -3
  311. package/src/properties/translations/odyssey-react-mui_da.properties +15 -3
  312. package/src/properties/translations/odyssey-react-mui_de.properties +14 -2
  313. package/src/properties/translations/odyssey-react-mui_el.properties +16 -4
  314. package/src/properties/translations/odyssey-react-mui_es.properties +15 -3
  315. package/src/properties/translations/odyssey-react-mui_fi.properties +15 -3
  316. package/src/properties/translations/odyssey-react-mui_fr.properties +15 -3
  317. package/src/properties/translations/odyssey-react-mui_ht.properties +17 -6
  318. package/src/properties/translations/odyssey-react-mui_hu.properties +15 -3
  319. package/src/properties/translations/odyssey-react-mui_id.properties +15 -3
  320. package/src/properties/translations/odyssey-react-mui_it.properties +15 -3
  321. package/src/properties/translations/odyssey-react-mui_ja.properties +14 -2
  322. package/src/properties/translations/odyssey-react-mui_ko.properties +14 -2
  323. package/src/properties/translations/odyssey-react-mui_ms.properties +15 -3
  324. package/src/properties/translations/odyssey-react-mui_nb.properties +15 -3
  325. package/src/properties/translations/odyssey-react-mui_nl_NL.properties +15 -3
  326. package/src/properties/translations/odyssey-react-mui_pl.properties +15 -3
  327. package/src/properties/translations/odyssey-react-mui_pt_BR.properties +15 -3
  328. package/src/properties/translations/odyssey-react-mui_ro.properties +15 -3
  329. package/src/properties/translations/odyssey-react-mui_ru.properties +15 -3
  330. package/src/properties/translations/odyssey-react-mui_sv.properties +15 -3
  331. package/src/properties/translations/odyssey-react-mui_th.properties +14 -2
  332. package/src/properties/translations/odyssey-react-mui_tr.properties +15 -3
  333. package/src/properties/translations/odyssey-react-mui_uk.properties +15 -3
  334. package/src/properties/translations/odyssey-react-mui_vi.properties +15 -3
  335. package/src/properties/translations/odyssey-react-mui_zh_CN.properties +14 -2
  336. package/src/properties/translations/odyssey-react-mui_zh_TW.properties +14 -2
  337. package/src/properties/ts/odyssey-react-mui_cs.ts +1 -1
  338. package/src/properties/ts/odyssey-react-mui_da.ts +1 -1
  339. package/src/properties/ts/odyssey-react-mui_de.ts +1 -1
  340. package/src/properties/ts/odyssey-react-mui_el.ts +1 -1
  341. package/src/properties/ts/odyssey-react-mui_es.ts +1 -1
  342. package/src/properties/ts/odyssey-react-mui_fi.ts +1 -1
  343. package/src/properties/ts/odyssey-react-mui_fr.ts +1 -1
  344. package/src/properties/ts/odyssey-react-mui_ht.ts +1 -1
  345. package/src/properties/ts/odyssey-react-mui_hu.ts +1 -1
  346. package/src/properties/ts/odyssey-react-mui_id.ts +1 -1
  347. package/src/properties/ts/odyssey-react-mui_it.ts +1 -1
  348. package/src/properties/ts/odyssey-react-mui_ja.ts +1 -1
  349. package/src/properties/ts/odyssey-react-mui_ko.ts +1 -1
  350. package/src/properties/ts/odyssey-react-mui_ms.ts +1 -1
  351. package/src/properties/ts/odyssey-react-mui_nb.ts +1 -1
  352. package/src/properties/ts/odyssey-react-mui_nl_NL.ts +1 -1
  353. package/src/properties/ts/odyssey-react-mui_pl.ts +1 -1
  354. package/src/properties/ts/odyssey-react-mui_pt_BR.ts +1 -1
  355. package/src/properties/ts/odyssey-react-mui_ro.ts +1 -1
  356. package/src/properties/ts/odyssey-react-mui_ru.ts +1 -1
  357. package/src/properties/ts/odyssey-react-mui_sv.ts +1 -1
  358. package/src/properties/ts/odyssey-react-mui_th.ts +1 -1
  359. package/src/properties/ts/odyssey-react-mui_tr.ts +1 -1
  360. package/src/properties/ts/odyssey-react-mui_uk.ts +1 -1
  361. package/src/properties/ts/odyssey-react-mui_vi.ts +1 -1
  362. package/src/properties/ts/odyssey-react-mui_zh_CN.ts +1 -1
  363. package/src/properties/ts/odyssey-react-mui_zh_TW.ts +1 -1
  364. package/src/theme/components.tsx +240 -150
  365. package/src/theme/createOdysseyMuiTheme.ts +4 -1
  366. package/dist/createShadowRootElement.js.map +0 -1
  367. package/dist/labs/DataComponents/BulkActionsMenu.js.map +0 -1
  368. package/dist/labs/DataComponents/DataStack.js +0 -85
  369. package/dist/labs/DataComponents/DataStack.js.map +0 -1
  370. package/dist/labs/DataComponents/DataTable.js.map +0 -1
  371. package/dist/labs/DataComponents/DataView.js.map +0 -1
  372. package/dist/labs/DataComponents/DetailPanel.js.map +0 -1
  373. package/dist/labs/DataComponents/LayoutSwitcher.js.map +0 -1
  374. package/dist/labs/DataComponents/RowActions.js.map +0 -1
  375. package/dist/labs/DataComponents/StackCard.js.map +0 -1
  376. package/dist/labs/DataComponents/StackContent.js.map +0 -1
  377. package/dist/labs/DataComponents/TableContent.js.map +0 -1
  378. package/dist/labs/DataComponents/TableSettings.js.map +0 -1
  379. package/dist/labs/DataComponents/componentTypes.js.map +0 -1
  380. package/dist/labs/DataComponents/constants.js.map +0 -1
  381. package/dist/labs/DataComponents/dataTypes.js.map +0 -1
  382. package/dist/labs/DataComponents/fetchData.js.map +0 -1
  383. package/dist/labs/DataComponents/index.js.map +0 -1
  384. package/dist/labs/DataComponents/tableConstants.js.map +0 -1
  385. package/dist/labs/DataComponents/useFilterConversion.js.map +0 -1
  386. package/dist/labs/SideNav.js +0 -478
  387. package/dist/labs/SideNav.js.map +0 -1
  388. package/dist/src/createShadowRootElement.d.ts.map +0 -1
  389. package/dist/src/labs/DataComponents/BulkActionsMenu.d.ts.map +0 -1
  390. package/dist/src/labs/DataComponents/DataStack.d.ts +0 -20
  391. package/dist/src/labs/DataComponents/DataStack.d.ts.map +0 -1
  392. package/dist/src/labs/DataComponents/DataTable.d.ts +0 -16
  393. package/dist/src/labs/DataComponents/DataTable.d.ts.map +0 -1
  394. package/dist/src/labs/DataComponents/DataView.d.ts.map +0 -1
  395. package/dist/src/labs/DataComponents/DetailPanel.d.ts.map +0 -1
  396. package/dist/src/labs/DataComponents/LayoutSwitcher.d.ts.map +0 -1
  397. package/dist/src/labs/DataComponents/RowActions.d.ts.map +0 -1
  398. package/dist/src/labs/DataComponents/StackCard.d.ts.map +0 -1
  399. package/dist/src/labs/DataComponents/StackContent.d.ts.map +0 -1
  400. package/dist/src/labs/DataComponents/TableContent.d.ts.map +0 -1
  401. package/dist/src/labs/DataComponents/TableSettings.d.ts.map +0 -1
  402. package/dist/src/labs/DataComponents/componentTypes.d.ts.map +0 -1
  403. package/dist/src/labs/DataComponents/constants.d.ts.map +0 -1
  404. package/dist/src/labs/DataComponents/dataTypes.d.ts.map +0 -1
  405. package/dist/src/labs/DataComponents/fetchData.d.ts.map +0 -1
  406. package/dist/src/labs/DataComponents/index.d.ts.map +0 -1
  407. package/dist/src/labs/DataComponents/tableConstants.d.ts.map +0 -1
  408. package/dist/src/labs/DataComponents/useFilterConversion.d.ts.map +0 -1
  409. package/dist/src/labs/SideNav.d.ts.map +0 -1
  410. package/src/labs/DataComponents/DataStack.tsx +0 -105
  411. package/src/labs/SideNav.tsx +0 -745
  412. /package/dist/labs/{DataComponents → DataView}/BulkActionsMenu.js +0 -0
  413. /package/dist/labs/{DataComponents → DataView}/DetailPanel.js +0 -0
  414. /package/dist/labs/{DataComponents → DataView}/LayoutSwitcher.js +0 -0
  415. /package/dist/labs/{DataComponents → DataView}/RowActions.js +0 -0
  416. /package/dist/labs/{DataComponents → DataView}/componentTypes.js +0 -0
  417. /package/dist/labs/{DataComponents → DataView}/dataTypes.js +0 -0
  418. /package/dist/labs/{DataComponents → DataView}/fetchData.js +0 -0
  419. /package/dist/labs/{DataComponents → DataView}/tableConstants.js +0 -0
  420. /package/dist/labs/{DataComponents → DataView}/useFilterConversion.js +0 -0
  421. /package/dist/src/labs/{DataComponents → DataView}/BulkActionsMenu.d.ts +0 -0
  422. /package/dist/src/labs/{DataComponents → DataView}/LayoutSwitcher.d.ts +0 -0
  423. /package/dist/src/labs/{DataComponents → DataView}/RowActions.d.ts +0 -0
  424. /package/dist/src/labs/{DataComponents → DataView}/dataTypes.d.ts +0 -0
  425. /package/dist/src/labs/{DataComponents → DataView}/fetchData.d.ts +0 -0
  426. /package/dist/src/labs/{DataComponents → DataView}/tableConstants.d.ts +0 -0
  427. /package/src/labs/{DataComponents → DataView}/BulkActionsMenu.tsx +0 -0
  428. /package/src/labs/{DataComponents → DataView}/LayoutSwitcher.tsx +0 -0
  429. /package/src/labs/{DataComponents → DataView}/RowActions.tsx +0 -0
  430. /package/src/labs/{DataComponents → DataView}/dataTypes.ts +0 -0
  431. /package/src/labs/{DataComponents → DataView}/fetchData.ts +0 -0
  432. /package/src/labs/{DataComponents → DataView}/tableConstants.tsx +0 -0
@@ -0,0 +1,64 @@
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 { memo, useMemo } from "react";
14
+ import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext";
15
+ import type { SideNavFooterItem } from "./types";
16
+ import { Box } from "../../Box";
17
+ import { Link } from "../../Link";
18
+
19
+ const SideNavFooterContent = ({
20
+ footerItems,
21
+ }: {
22
+ footerItems: SideNavFooterItem[];
23
+ }) => {
24
+ const odysseyDesignTokens = useOdysseyDesignTokens();
25
+
26
+ const footerContent = useMemo(() => {
27
+ return footerItems?.map((item, index) => (
28
+ <Box
29
+ key={`${item.id}-wrapper`}
30
+ sx={{
31
+ display: "flex",
32
+ }}
33
+ >
34
+ {item.href ? (
35
+ <Link key={item.id} href={item.href}>
36
+ {item.label}
37
+ </Link>
38
+ ) : (
39
+ <Box component="span" key={item.id}>
40
+ {item.label}
41
+ </Box>
42
+ )}
43
+ {index < footerItems.length - 1 && (
44
+ <Box
45
+ key={`${item.id}-separator`}
46
+ sx={{
47
+ marginLeft: odysseyDesignTokens.Spacing4,
48
+ marginRight: odysseyDesignTokens.Spacing4,
49
+ color: odysseyDesignTokens.HueNeutral300,
50
+ }}
51
+ >
52
+ |
53
+ </Box>
54
+ )}
55
+ </Box>
56
+ ));
57
+ }, [footerItems, odysseyDesignTokens]);
58
+
59
+ return footerContent;
60
+ };
61
+ const MemoizedSideNavFooterContent = memo(SideNavFooterContent);
62
+ MemoizedSideNavFooterContent.displayName = "SideNavFooterContent";
63
+
64
+ export { MemoizedSideNavFooterContent as SideNavFooterContent };
@@ -0,0 +1,65 @@
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, ReactNode, useMemo } from "react";
15
+ import {
16
+ type DesignTokens,
17
+ useOdysseyDesignTokens,
18
+ } from "../../OdysseyDesignTokensContext";
19
+ import { Box } from "../../Box";
20
+ import { Heading6 } from "../../Typography";
21
+ import { CollapseIcon } from "./CollapseIcon";
22
+ import type { SideNavProps } from "./types";
23
+
24
+ const SideNavHeaderContainer = styled("div", {
25
+ shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
26
+ })(({ odysseyDesignTokens }: { odysseyDesignTokens: DesignTokens }) => ({
27
+ display: "flex",
28
+ justifyContent: "space-between",
29
+ alignItems: "center",
30
+ paddingLeft: odysseyDesignTokens.Spacing4,
31
+ paddingRight: odysseyDesignTokens.Spacing4,
32
+ paddingTop: odysseyDesignTokens.Spacing3,
33
+ paddingBottom: odysseyDesignTokens.Spacing3,
34
+ }));
35
+
36
+ const SideNavHeader = ({
37
+ navHeaderText,
38
+ isCollapsible,
39
+ onCollapse,
40
+ }: Pick<
41
+ SideNavProps,
42
+ "navHeaderText" | "isCollapsible" | "onCollapse"
43
+ >): ReactNode => {
44
+ const odysseyDesignTokens = useOdysseyDesignTokens();
45
+
46
+ const sideNavHeaderStyles = useMemo(
47
+ () => ({
48
+ marginTop: odysseyDesignTokens.Spacing2,
49
+ }),
50
+ [odysseyDesignTokens],
51
+ );
52
+
53
+ return (
54
+ <SideNavHeaderContainer odysseyDesignTokens={odysseyDesignTokens}>
55
+ <Box sx={sideNavHeaderStyles}>
56
+ <Heading6>{navHeaderText}</Heading6>
57
+ </Box>
58
+ {isCollapsible && <CollapseIcon onClick={onCollapse} />}
59
+ </SideNavHeaderContainer>
60
+ );
61
+ };
62
+ const MemoizedSideNavHeader = memo(SideNavHeader);
63
+ MemoizedSideNavHeader.displayName = "SideNavHeader";
64
+
65
+ export { MemoizedSideNavHeader as SideNavHeader };
@@ -0,0 +1,216 @@
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
+ useRef,
16
+ useImperativeHandle,
17
+ useCallback,
18
+ memo,
19
+ KeyboardEvent,
20
+ } from "react";
21
+ import { Link } from "../../Link";
22
+ import {
23
+ type DesignTokens,
24
+ useOdysseyDesignTokens,
25
+ } from "../../OdysseyDesignTokensContext";
26
+ import { SideNavItemLinkContent } from "./SideNavItemLinkContent";
27
+ import type { SideNavItem } from "./types";
28
+
29
+ export const SideNavListItemContainer = styled("li", {
30
+ shouldForwardProp: (prop) =>
31
+ prop !== "odysseyDesignTokens" &&
32
+ prop !== "isSelected" &&
33
+ prop !== "isDisabled",
34
+ })<{
35
+ odysseyDesignTokens: DesignTokens;
36
+ isSelected?: boolean;
37
+ disabled?: boolean;
38
+ isDisabled?: boolean;
39
+ }>(({ odysseyDesignTokens, isSelected, isDisabled }) => ({
40
+ display: "flex",
41
+ alignItems: "center",
42
+ cursor: isDisabled ? "default" : "pointer",
43
+ pointerEvents: isDisabled ? "none" : "auto",
44
+ backgroundColor: isSelected ? odysseyDesignTokens.HueNeutral50 : "unset",
45
+ margin: `${odysseyDesignTokens.Spacing1} 0`,
46
+ "&:last-child": {
47
+ marginBottom: odysseyDesignTokens.Spacing2,
48
+ },
49
+ "& a": {
50
+ display: "flex",
51
+ alignItems: "center",
52
+ width: "100%",
53
+ minHeight: "48px",
54
+ padding: `${odysseyDesignTokens.Spacing3} ${odysseyDesignTokens.Spacing4}`,
55
+ color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
56
+ pointerEvents: isDisabled ? "none" : "auto",
57
+ },
58
+ "& a:hover": {
59
+ textDecoration: "none",
60
+ cursor: isDisabled ? "default" : "pointer",
61
+ backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit",
62
+ },
63
+ "& a:focus-visible": {
64
+ outlineOffset: 0,
65
+ borderRadius: 0,
66
+ outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
67
+ backgroundColor: !isDisabled ? odysseyDesignTokens.HueNeutral50 : "inherit",
68
+ },
69
+ }));
70
+
71
+ const scrollToNode = (node: HTMLElement | null) => {
72
+ if (node) {
73
+ node?.scrollIntoView({
74
+ behavior: "instant",
75
+ block: "center",
76
+ inline: "nearest",
77
+ });
78
+ }
79
+ };
80
+
81
+ type ScrollIntoViewHandle = {
82
+ scrollIntoView: () => void;
83
+ };
84
+
85
+ const SideNavItemContent = ({
86
+ id,
87
+ label,
88
+ href,
89
+ target,
90
+ startIcon,
91
+ severity,
92
+ statusLabel,
93
+ endIcon,
94
+ onClick,
95
+ isSelected,
96
+ isDisabled,
97
+ scrollRef,
98
+ }: Pick<
99
+ SideNavItem,
100
+ | "id"
101
+ | "label"
102
+ | "href"
103
+ | "target"
104
+ | "startIcon"
105
+ | "severity"
106
+ | "statusLabel"
107
+ | "endIcon"
108
+ | "onClick"
109
+ | "isSelected"
110
+ | "isDisabled"
111
+ > & {
112
+ /**
113
+ * The ref used to scroll to this item
114
+ */
115
+ scrollRef?: React.RefObject<ScrollIntoViewHandle>;
116
+ }) => {
117
+ const localScrollRef = useRef<HTMLLIElement>(null);
118
+ useImperativeHandle(
119
+ scrollRef,
120
+ () => {
121
+ return {
122
+ scrollIntoView: () => {
123
+ scrollToNode(localScrollRef.current);
124
+ },
125
+ };
126
+ },
127
+ [],
128
+ );
129
+ const odysseyDesignTokens = useOdysseyDesignTokens();
130
+
131
+ const NavItemContentClickContainer = styled("div", {
132
+ shouldForwardProp: (prop) => prop !== "odysseyDesignTokens",
133
+ })(() => ({
134
+ display: "flex",
135
+ alignItems: "center",
136
+ width: "100%",
137
+ minHeight: "48px",
138
+ padding: `${odysseyDesignTokens.Spacing3} ${odysseyDesignTokens.Spacing4}`,
139
+ color: `${isDisabled ? odysseyDesignTokens.TypographyColorDisabled : odysseyDesignTokens.TypographyColorHeading} !important`,
140
+ "&:focus-visible": {
141
+ borderRadius: 0,
142
+ outlineColor: odysseyDesignTokens.FocusOutlineColorPrimary,
143
+ outlineStyle: odysseyDesignTokens.FocusOutlineStyle,
144
+ outlineWidth: odysseyDesignTokens.FocusOutlineWidthMain,
145
+ backgroundColor: odysseyDesignTokens.HueNeutral50,
146
+ textDecoration: "none",
147
+ },
148
+ }));
149
+
150
+ const sideNavItemContentKeyHandler = useCallback(
151
+ (event: KeyboardEvent<HTMLDivElement>) => {
152
+ if (event?.key === "Enter") {
153
+ event.preventDefault();
154
+ onClick?.();
155
+ }
156
+ },
157
+ [onClick],
158
+ );
159
+
160
+ return (
161
+ <SideNavListItemContainer
162
+ ref={localScrollRef}
163
+ id={id}
164
+ key={id}
165
+ disabled={isDisabled}
166
+ aria-disabled={isDisabled}
167
+ isDisabled={isDisabled}
168
+ isSelected={isSelected}
169
+ odysseyDesignTokens={odysseyDesignTokens}
170
+ >
171
+ {
172
+ // Use Link for nav items with links and div for disabled or non-link items
173
+ isDisabled ? (
174
+ <NavItemContentClickContainer>
175
+ <SideNavItemLinkContent
176
+ label={label}
177
+ startIcon={startIcon}
178
+ endIcon={endIcon}
179
+ statusLabel={statusLabel}
180
+ severity={severity}
181
+ />
182
+ </NavItemContentClickContainer>
183
+ ) : !href ? (
184
+ <NavItemContentClickContainer
185
+ role="button"
186
+ tabIndex={0}
187
+ onClick={onClick}
188
+ onKeyDown={sideNavItemContentKeyHandler}
189
+ >
190
+ <SideNavItemLinkContent
191
+ label={label}
192
+ startIcon={startIcon}
193
+ endIcon={endIcon}
194
+ statusLabel={statusLabel}
195
+ severity={severity}
196
+ />
197
+ </NavItemContentClickContainer>
198
+ ) : (
199
+ <Link href={href} target={target} onClick={onClick}>
200
+ <SideNavItemLinkContent
201
+ label={label}
202
+ startIcon={startIcon}
203
+ endIcon={endIcon}
204
+ statusLabel={statusLabel}
205
+ severity={severity}
206
+ />
207
+ </Link>
208
+ )
209
+ }
210
+ </SideNavListItemContainer>
211
+ );
212
+ };
213
+ const MemoizedSideNavItemContent = memo(SideNavItemContent);
214
+ MemoizedSideNavItemContent.displayName = "SideNavItemContent";
215
+
216
+ export { MemoizedSideNavItemContent as SideNavItemContent };
@@ -0,0 +1,87 @@
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, ReactNode, useMemo } from "react";
15
+ import {
16
+ type DesignTokens,
17
+ useOdysseyDesignTokens,
18
+ } from "../../OdysseyDesignTokensContext";
19
+ import { Box } from "../../Box";
20
+ import { Status } from "../../Status";
21
+ import type { SideNavItem } from "./types";
22
+
23
+ const SideNavItemLabelContainer = styled("div", {
24
+ shouldForwardProp: (prop) =>
25
+ prop !== "odysseyDesignTokens" && prop !== "isIconVisible",
26
+ })<{
27
+ odysseyDesignTokens: DesignTokens;
28
+ isIconVisible: boolean;
29
+ }>(({ odysseyDesignTokens, isIconVisible }) => ({
30
+ width: "100%",
31
+ display: "flex",
32
+ flexWrap: "wrap",
33
+ alignItems: "center",
34
+ fontSize: odysseyDesignTokens.TypographyScale0,
35
+ fontWeight: odysseyDesignTokens.TypographyWeightHeading,
36
+ marginLeft: isIconVisible ? odysseyDesignTokens.Spacing2 : 0,
37
+ "& a": {
38
+ color: `${odysseyDesignTokens.TypographyColorHeading} !important`,
39
+ fontSize: odysseyDesignTokens.TypographyScale0,
40
+ },
41
+ "& a:hover": {
42
+ textDecoration: "none",
43
+ cursor: "pointer",
44
+ },
45
+ }));
46
+
47
+ const SideNavItemLinkContent = ({
48
+ label,
49
+ startIcon,
50
+ endIcon,
51
+ severity,
52
+ statusLabel,
53
+ }: Pick<
54
+ SideNavItem,
55
+ "label" | "startIcon" | "endIcon" | "severity" | "statusLabel"
56
+ >): ReactNode => {
57
+ const odysseyDesignTokens = useOdysseyDesignTokens();
58
+
59
+ const sideNavItemContentStyles = useMemo(
60
+ () => ({
61
+ marginLeft: odysseyDesignTokens.Spacing2,
62
+ }),
63
+ [odysseyDesignTokens],
64
+ );
65
+
66
+ return (
67
+ <>
68
+ {startIcon && startIcon}
69
+ <SideNavItemLabelContainer
70
+ odysseyDesignTokens={odysseyDesignTokens}
71
+ isIconVisible={Boolean(startIcon)}
72
+ >
73
+ {label}
74
+ {severity && (
75
+ <Box sx={sideNavItemContentStyles}>
76
+ <Status severity={severity} label={statusLabel || ""} />
77
+ </Box>
78
+ )}
79
+ </SideNavItemLabelContainer>
80
+ {endIcon && endIcon}
81
+ </>
82
+ );
83
+ };
84
+ const MemoizedSideNavItemLinkContent = memo(SideNavItemLinkContent);
85
+ MemoizedSideNavItemLinkContent.displayName = "SideNavItemLinkContent";
86
+
87
+ export { MemoizedSideNavItemLinkContent as SideNavItemLinkContent };
@@ -0,0 +1,15 @@
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
+ export { SideNav } from "./SideNav";
14
+
15
+ export * from "./types";
@@ -0,0 +1,125 @@
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 { ReactElement } from "react";
14
+ import type { HtmlProps } from "../../HtmlProps";
15
+ import type { statusSeverityValues } from "../../Status";
16
+
17
+ export type SideNavProps = {
18
+ /**
19
+ * Side Nav header text that is usually reserved to show the App name
20
+ */
21
+ navHeaderText: string;
22
+ /**
23
+ * Determines whether the side nav is collapsible
24
+ */
25
+ isCollapsible?: boolean;
26
+ /**
27
+ * Footer items in the side nav
28
+ */
29
+ footerItems?: SideNavFooterItem[];
30
+ /**
31
+ * Triggers when the side nav is collapsed
32
+ */
33
+ onCollapse?(): void;
34
+ /**
35
+ * Triggers when the side nav is expanded
36
+ */
37
+ onExpand?(): void;
38
+ /**
39
+ * Nav items in the side nav
40
+ */
41
+ sideNavItems: SideNavItem[];
42
+ } & Pick<HtmlProps, "testId">;
43
+
44
+ export type SideNavItem = {
45
+ id: string;
46
+ label: string;
47
+ /**
48
+ * The icon element to display at the end of the Nav Item
49
+ */
50
+ endIcon?: ReactElement;
51
+ /**
52
+ * Whether the item is disabled. When set to true the nav item is set to Disabled color,
53
+ * the link/item is not clickable, and item with children is not expandable.
54
+ */
55
+ isDisabled?: boolean;
56
+ /**
57
+ * Whether the item is active/selected
58
+ */
59
+ isSelected?: boolean;
60
+ /**
61
+ * Event fired when the nav item is clicked
62
+ */
63
+ onClick?(): void;
64
+ /**
65
+ * The status element to display after the label
66
+ */
67
+ severity?: (typeof statusSeverityValues)[number];
68
+ /**
69
+ * The icon element to display at the start of the Nav Item
70
+ */
71
+ startIcon?: ReactElement;
72
+ /**
73
+ * The label to display inside the status
74
+ */
75
+ statusLabel?: string;
76
+ /**
77
+ * The link target prop. e.g., "_blank"
78
+ */
79
+ target?: string;
80
+ } & (
81
+ | {
82
+ /**
83
+ * Determines if the side nav item is a section header
84
+ */
85
+ isSectionHeader: true;
86
+ href?: never;
87
+ children?: never;
88
+ isDefaultExpanded?: never;
89
+ isExpanded?: never;
90
+ }
91
+ | {
92
+ /**
93
+ * link added to the nav item. if it is undefined, static text will be displayed.
94
+ * fires onClick event when it is passed
95
+ */
96
+ href: string;
97
+ children?: never;
98
+ isSectionHeader?: never;
99
+ isDefaultExpanded?: never;
100
+ isExpanded?: never;
101
+ }
102
+ | {
103
+ /**
104
+ * An array of side nav items to be displayed as children within Accordion
105
+ */
106
+ children?: SideNavItem[];
107
+ /**
108
+ * Whether the accordion (nav item with children) is expanded by default
109
+ */
110
+ isDefaultExpanded?: boolean;
111
+ /**
112
+ * If true, expands the accordion, otherwise collapse it.
113
+ * Setting this prop enables control over the accordion.
114
+ */
115
+ isExpanded?: boolean;
116
+ isSectionHeader?: never;
117
+ href?: never;
118
+ }
119
+ );
120
+
121
+ export type SideNavFooterItem = {
122
+ href?: string;
123
+ id: string;
124
+ label: string;
125
+ };