@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
@@ -33,7 +33,7 @@ const TextWrapper = styled("div")(() => ({
33
33
  const RowActionsContainer = styled("div")(() => ({
34
34
  display: "flex"
35
35
  }));
36
- const TableContent = ({
36
+ const TableLayoutContent = ({
37
37
  columns,
38
38
  data,
39
39
  draggingRow,
@@ -51,7 +51,7 @@ const TableContent = ({
51
51
  rowSelection,
52
52
  setRowSelection,
53
53
  setTableState,
54
- tableOptions,
54
+ tableLayoutOptions,
55
55
  tableState,
56
56
  totalRows
57
57
  }) => {
@@ -103,7 +103,7 @@ const TableContent = ({
103
103
  }) => {
104
104
  const currentIndex = row.index + (pagination.pageIndex - 1) * pagination.pageSize;
105
105
  return _jsxs(RowActionsContainer, {
106
- children: [tableOptions.rowActionButtons?.(row), (tableOptions.rowActionMenuItems || hasRowReordering) && _jsx(MenuButton, {
106
+ children: [tableLayoutOptions.rowActionButtons?.(row), (tableLayoutOptions.rowActionMenuItems || hasRowReordering) && _jsx(MenuButton, {
107
107
  ariaLabel: t("table.moreactions.arialabel"),
108
108
  buttonVariant: "floating",
109
109
  endIcon: _jsx(MoreIcon, {}),
@@ -112,14 +112,14 @@ const TableContent = ({
112
112
  children: _jsx(RowActions, {
113
113
  isRowReorderingDisabled: isRowReorderingDisabled,
114
114
  row: row,
115
- rowActionMenuItems: tableOptions.rowActionMenuItems,
115
+ rowActionMenuItems: tableLayoutOptions.rowActionMenuItems,
116
116
  rowIndex: currentIndex,
117
117
  totalRows: totalRows,
118
118
  updateRowOrder: hasRowReordering && onReorderRows ? updateRowOrder : undefined
119
119
  })
120
120
  })]
121
121
  });
122
- }, [hasRowReordering, isRowReorderingDisabled, onReorderRows, pagination.pageIndex, pagination.pageSize, t, tableOptions, totalRows, updateRowOrder]);
122
+ }, [hasRowReordering, isRowReorderingDisabled, onReorderRows, pagination.pageIndex, pagination.pageSize, t, tableLayoutOptions, totalRows, updateRowOrder]);
123
123
  const innerWidthStyle = useMemo(() => ({
124
124
  width: tableInnerContainerWidth
125
125
  }), [tableInnerContainerWidth]);
@@ -127,7 +127,7 @@ const TableContent = ({
127
127
  sx: innerWidthStyle,
128
128
  children: emptyState
129
129
  }), [innerWidthStyle, emptyState]);
130
- const shouldDisplayRowActions = useMemo(() => hasRowReordering === true && onReorderRows || tableOptions.rowActionButtons || tableOptions.rowActionMenuItems ? true : false, [hasRowReordering, onReorderRows, tableOptions.rowActionButtons, tableOptions.rowActionMenuItems]);
130
+ const shouldDisplayRowActions = useMemo(() => hasRowReordering === true && onReorderRows || tableLayoutOptions.rowActionButtons || tableLayoutOptions.rowActionMenuItems ? true : false, [hasRowReordering, onReorderRows, tableLayoutOptions.rowActionButtons, tableLayoutOptions.rowActionMenuItems]);
131
131
  const dataTable = useMaterialReactTable({
132
132
  data: !isEmpty && !isNoResults ? data : [],
133
133
  columns,
@@ -170,9 +170,9 @@ const TableContent = ({
170
170
  display: "flex",
171
171
  visibility: "hidden"
172
172
  },
173
- children: [tableOptions.rowActionButtons && tableOptions.rowActionButtons({
173
+ children: [tableLayoutOptions.rowActionButtons && tableLayoutOptions.rowActionButtons({
174
174
  id: null
175
- }), (hasRowReordering === true && onReorderRows || tableOptions.rowActionMenuItems) && _jsx(Box, {
175
+ }), (hasRowReordering === true && onReorderRows || tableLayoutOptions.rowActionMenuItems) && _jsx(Box, {
176
176
  children: _jsx(Button, {
177
177
  endIcon: _jsx(MoreIcon, {}),
178
178
  size: "small",
@@ -187,7 +187,7 @@ const TableContent = ({
187
187
  },
188
188
  muiTableProps: {
189
189
  ref: tableContentRef,
190
- className: !shouldDisplayRowActions && tableOptions.hasColumnResizing ? "ods-hide-spacer-column" : ""
190
+ className: !shouldDisplayRowActions && tableLayoutOptions.hasColumnResizing ? "ods-hide-spacer-column" : ""
191
191
  },
192
192
  muiTableContainerProps: {
193
193
  ref: tableInnerContainerRef
@@ -195,11 +195,11 @@ const TableContent = ({
195
195
  muiTableBodyProps: () => ({
196
196
  className: rowDensityClassName
197
197
  }),
198
- enableColumnResizing: tableOptions.hasColumnResizing,
198
+ enableColumnResizing: tableLayoutOptions.hasColumnResizing,
199
199
  defaultColumn: {
200
200
  Cell: defaultCell
201
201
  },
202
- enableRowActions: shouldDisplayRowActions,
202
+ enableRowActions: hasRowReordering === true && onReorderRows || tableLayoutOptions.rowActionButtons || tableLayoutOptions.rowActionMenuItems ? true : false,
203
203
  renderRowActions: ({
204
204
  row
205
205
  }) => renderRowActions({
@@ -248,7 +248,7 @@ const TableContent = ({
248
248
  sx: dragHandleStyles,
249
249
  ...dragHandleText
250
250
  }),
251
- renderDetailPanel: tableOptions.renderDetailPanel,
251
+ renderDetailPanel: tableLayoutOptions.renderDetailPanel,
252
252
  enableRowVirtualization: data.length >= 50,
253
253
  muiTableHeadCellProps: ({
254
254
  column: currentColumn
@@ -260,7 +260,7 @@ const TableContent = ({
260
260
  }) => ({
261
261
  className: column.getIsResizing() ? "isResizing" : ""
262
262
  }),
263
- enableSorting: tableOptions.hasSorting === true,
263
+ enableSorting: tableLayoutOptions.hasSorting === true,
264
264
  onSortingChange: sortingUpdater => {
265
265
  const newSortVal = typeof sortingUpdater === "function" ? sortingUpdater(tableState.columnSorting) : tableState.columnSorting;
266
266
  setTableState(prevState => ({
@@ -288,7 +288,7 @@ const TableContent = ({
288
288
  })
289
289
  });
290
290
  };
291
- const MemoizedTableContent = memo(TableContent);
292
- MemoizedTableContent.displayName = "TableContent";
293
- export { MemoizedTableContent as TableContent };
294
- //# sourceMappingURL=TableContent.js.map
291
+ const MemoizedTableLayoutContent = memo(TableLayoutContent);
292
+ MemoizedTableLayoutContent.displayName = "TableLayoutContent";
293
+ export { MemoizedTableLayoutContent as TableLayoutContent };
294
+ //# sourceMappingURL=TableLayoutContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableLayoutContent.js","names":["memo","useCallback","useMemo","useRef","useState","styled","MRT_TableContainer","useMaterialReactTable","useTranslation","ArrowDownIcon","ArrowUnsortedIcon","ChevronDownIcon","DragIndicatorIcon","Box","Button","dataTableImmutableSettings","displayColumnDefOptions","ScrollableTableContainer","MenuButton","MoreIcon","RowActions","useOdysseyDesignTokens","useScrollIndication","jsx","_jsx","jsxs","_jsxs","TextWrapper","whiteSpace","textOverflow","overflow","RowActionsContainer","display","TableLayoutContent","columns","data","draggingRow","emptyState","getRowId","hasRowReordering","hasRowSelection","isEmpty","isLoading","isNoResults","isRowReorderingDisabled","onReorderRows","pagination","rowReorderingUtilities","rowSelection","setRowSelection","setTableState","tableLayoutOptions","tableState","totalRows","isTableContainerScrolledToStart","setIsTableContainerScrolledToStart","isTableContainerScrolledToEnd","setIsTableContainerScrolledToEnd","tableInnerContainerWidth","setTableInnerContainerWidth","tableOuterContainerRef","tableInnerContainerRef","tableContentRef","tableInnerContainer","current","tableOuterContainer","odysseyDesignTokens","t","columnIds","map","column","accessorKey","columnOrder","filter","id","rowDensityClassName","rowDensity","defaultCell","cell","value","getValue","hasTextWrapping","columnDef","enableWrapping","children","draggableTableBodyRowClassName","dragHandleStyles","dragHandleText","handleDragHandleKeyDown","handleDragHandleOnDragCapture","handleDragHandleOnDragEnd","resetDraggingAndHoveredRow","updateRowOrder","renderRowActions","row","currentIndex","index","pageIndex","pageSize","rowActionButtons","rowActionMenuItems","ariaLabel","buttonVariant","endIcon","menuAlignment","size","rowIndex","undefined","innerWidthStyle","width","emptyStateContainer","sx","shouldDisplayRowActions","dataTable","state","sorting","columnSorting","columnVisibility","icons","ArrowDownwardIcon","DragHandleIcon","SyncAltIcon","ExpandMoreIcon","header","grow","muiTableBodyCellProps","align","className","muiTableHeadCellProps","visibility","variant","isDisabled","muiTableProps","ref","hasColumnResizing","muiTableContainerProps","muiTableBodyProps","enableColumnResizing","defaultColumn","Cell","enableRowActions","enableRowOrdering","Boolean","enableRowDragging","muiDetailPanelProps","paddingBlock","getIsExpanded","Spacing3","muiTableBodyRowProps","table","isDetailPanel","currentRowId","draggingRowId","hoveredRowId","getState","hoveredRow","border","backgroundColor","HueNeutralWhite","muiRowDragHandleProps","onKeyDown","event","onBlur","onDragEnd","onDragCapture","disabled","renderDetailPanel","enableRowVirtualization","length","currentColumn","find","sortedColumn","getIsResizing","enableSorting","hasSorting","onSortingChange","sortingUpdater","newSortVal","prevState","enableRowSelection","onRowSelectionChange","renderEmptyRowsFallback","localization","collapse","collapseAll","expand","expandAll","isScrollableEnd","isScrollableStart","MemoizedTableLayoutContent","displayName"],"sources":["../../../src/labs/DataView/TableLayoutContent.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n SetStateAction,\n memo,\n useCallback,\n useMemo,\n useRef,\n useState,\n ReactNode,\n Dispatch,\n ReactElement,\n} from \"react\";\nimport styled, { CSSObject } from \"@emotion/styled\";\nimport {\n MRT_Row,\n MRT_RowData,\n MRT_RowSelectionState,\n MRT_TableContainer,\n MRT_TableInstance,\n MRT_TableOptions,\n useMaterialReactTable,\n} from \"material-react-table\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n ArrowDownIcon,\n ArrowUnsortedIcon,\n ChevronDownIcon,\n DragIndicatorIcon,\n} from \"../../icons.generated\";\nimport { Box } from \"../../Box\";\nimport { Button } from \"../../Button\";\nimport { TableLayoutProps, TableState, UniversalProps } from \"./componentTypes\";\nimport { DataTableCell } from \"./dataTypes\";\nimport {\n dataTableImmutableSettings,\n displayColumnDefOptions,\n ScrollableTableContainer,\n} from \"./tableConstants\";\nimport { MenuButton } from \"../../MenuButton\";\nimport { MoreIcon } from \"../../icons.generated\";\nimport { RowActions } from \"./RowActions\";\nimport { useOdysseyDesignTokens } from \"../../OdysseyDesignTokensContext\";\nimport { useScrollIndication } from \"../../DataTable/useScrollIndication\";\n\nconst TextWrapper = styled(\"div\")(() => ({\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n overflow: \"hidden\",\n}));\n\nconst RowActionsContainer = styled(\"div\")(() => ({\n display: \"flex\",\n}));\n\nexport type TableLayoutContentProps = {\n columns: TableLayoutProps[\"columns\"];\n data: MRT_RowData[];\n draggingRow?: MRT_Row<MRT_RowData> | null;\n emptyState: ReactNode;\n getRowId: UniversalProps[\"getRowId\"];\n hasRowReordering: UniversalProps[\"hasRowReordering\"];\n hasRowSelection: UniversalProps[\"hasRowSelection\"];\n isEmpty?: boolean;\n isLoading: boolean;\n isNoResults?: boolean;\n isRowReorderingDisabled?: boolean;\n onReorderRows: UniversalProps[\"onReorderRows\"];\n pagination: {\n pageIndex: number;\n pageSize: number;\n };\n rowReorderingUtilities: {\n dragHandleStyles: CSSObject;\n dragHandleText: {\n title: string;\n \"aria-label\": string;\n };\n draggableTableBodyRowClassName: ({\n currentRowId,\n draggingRowId,\n hoveredRowId,\n }: {\n currentRowId: string;\n draggingRowId?: string;\n hoveredRowId?: string;\n }) => string | undefined;\n handleDragHandleKeyDown: ({\n table,\n row,\n event,\n }: {\n table: MRT_TableInstance<MRT_RowData>;\n row: MRT_Row<MRT_RowData>;\n event: React.KeyboardEvent<HTMLButtonElement>;\n }) => void;\n handleDragHandleOnDragCapture: (\n table: MRT_TableInstance<MRT_RowData>,\n ) => void;\n handleDragHandleOnDragEnd: (table: MRT_TableInstance<MRT_RowData>) => void;\n resetDraggingAndHoveredRow: (table: MRT_TableInstance<MRT_RowData>) => void;\n updateRowOrder: ({\n rowId,\n newRowIndex,\n }: {\n rowId: string;\n newRowIndex: number;\n }) => void;\n };\n rowSelection: MRT_RowSelectionState;\n setRowSelection: Dispatch<SetStateAction<MRT_RowSelectionState>>;\n setTableState: Dispatch<SetStateAction<TableState>>;\n tableLayoutOptions: TableLayoutProps;\n tableState: TableState;\n totalRows: UniversalProps[\"totalRows\"];\n};\n\nconst TableLayoutContent = ({\n columns,\n data,\n draggingRow,\n emptyState,\n getRowId,\n hasRowReordering,\n hasRowSelection,\n isEmpty,\n isLoading,\n isNoResults,\n isRowReorderingDisabled,\n onReorderRows,\n pagination,\n rowReorderingUtilities,\n rowSelection,\n setRowSelection,\n setTableState,\n tableLayoutOptions,\n tableState,\n totalRows,\n}: TableLayoutContentProps) => {\n const [isTableContainerScrolledToStart, setIsTableContainerScrolledToStart] =\n useState(true);\n const [isTableContainerScrolledToEnd, setIsTableContainerScrolledToEnd] =\n useState(true);\n const [tableInnerContainerWidth, setTableInnerContainerWidth] =\n useState<string>(\"100%\");\n const tableOuterContainerRef = useRef<HTMLDivElement>(null);\n const tableInnerContainerRef = useRef<HTMLDivElement>(null);\n const tableContentRef = useRef<HTMLTableElement>(null);\n\n useScrollIndication({\n setIsTableContainerScrolledToEnd: setIsTableContainerScrolledToEnd,\n setIsTableContainerScrolledToStart: setIsTableContainerScrolledToStart,\n setTableInnerContainerWidth: setTableInnerContainerWidth,\n tableInnerContainer: tableInnerContainerRef.current,\n tableOuterContainer: tableOuterContainerRef.current,\n });\n\n const odysseyDesignTokens = useOdysseyDesignTokens();\n const { t } = useTranslation();\n\n const columnIds = useMemo(() => {\n return columns.map((column) => column.accessorKey) ?? [];\n }, [columns]);\n\n const columnOrder = useMemo(\n () => [\n \"mrt-row-drag\",\n \"mrt-row-select\",\n \"mrt-row-expand\",\n ...(columnIds?.filter((id): id is string => typeof id === \"string\") ||\n []),\n \"mrt-row-actions\",\n ],\n [columnIds],\n );\n\n const rowDensityClassName = useMemo(() => {\n return tableState.rowDensity === \"spacious\"\n ? \"MuiTableBody-spacious\"\n : tableState.rowDensity === \"compact\"\n ? \"MuiTableBody-compact\"\n : \"MuiTableBody-default\";\n }, [tableState]);\n\n const defaultCell = useCallback<\n ({ cell }: { cell: DataTableCell<MRT_RowData> }) => ReactElement | string\n >(({ cell }) => {\n const value = cell.getValue<string>();\n const hasTextWrapping =\n cell.column.columnDef.hasTextWrapping ||\n cell.column.columnDef.enableWrapping;\n return hasTextWrapping ? value : <TextWrapper>{value}</TextWrapper>;\n }, []);\n\n const {\n draggableTableBodyRowClassName,\n dragHandleStyles,\n dragHandleText,\n handleDragHandleKeyDown,\n handleDragHandleOnDragCapture,\n handleDragHandleOnDragEnd,\n resetDraggingAndHoveredRow,\n updateRowOrder,\n } = rowReorderingUtilities;\n\n const renderRowActions = useCallback(\n ({ row }: { row: MRT_Row<MRT_RowData> }) => {\n const currentIndex =\n row.index + (pagination.pageIndex - 1) * pagination.pageSize;\n return (\n <RowActionsContainer>\n {tableLayoutOptions.rowActionButtons?.(row)}\n {(tableLayoutOptions.rowActionMenuItems || hasRowReordering) && (\n <MenuButton\n ariaLabel={t(\"table.moreactions.arialabel\")}\n buttonVariant=\"floating\"\n endIcon={<MoreIcon />}\n menuAlignment=\"right\"\n size=\"small\"\n >\n <RowActions\n isRowReorderingDisabled={isRowReorderingDisabled}\n row={row}\n rowActionMenuItems={tableLayoutOptions.rowActionMenuItems}\n rowIndex={currentIndex}\n totalRows={totalRows}\n updateRowOrder={\n hasRowReordering && onReorderRows ? updateRowOrder : undefined\n }\n />\n </MenuButton>\n )}\n </RowActionsContainer>\n );\n },\n [\n hasRowReordering,\n isRowReorderingDisabled,\n onReorderRows,\n pagination.pageIndex,\n pagination.pageSize,\n t,\n tableLayoutOptions,\n totalRows,\n updateRowOrder,\n ],\n );\n\n const innerWidthStyle = useMemo(\n () => ({ width: tableInnerContainerWidth }),\n [tableInnerContainerWidth],\n );\n\n const emptyStateContainer = useCallback(\n () => <Box sx={innerWidthStyle}>{emptyState}</Box>,\n [innerWidthStyle, emptyState],\n );\n\n const shouldDisplayRowActions = useMemo(\n () =>\n (hasRowReordering === true && onReorderRows) ||\n tableLayoutOptions.rowActionButtons ||\n tableLayoutOptions.rowActionMenuItems\n ? true\n : false,\n [\n hasRowReordering,\n onReorderRows,\n tableLayoutOptions.rowActionButtons,\n tableLayoutOptions.rowActionMenuItems,\n ],\n );\n\n const dataTable = useMaterialReactTable({\n data: !isEmpty && !isNoResults ? data : [],\n columns,\n getRowId,\n state: {\n sorting: tableState.columnSorting,\n columnVisibility: tableState.columnVisibility,\n isLoading: isLoading,\n rowSelection: rowSelection,\n columnOrder: columnOrder,\n },\n icons: {\n ArrowDownwardIcon: ArrowDownIcon,\n DragHandleIcon: DragIndicatorIcon,\n SyncAltIcon: ArrowUnsortedIcon,\n ExpandMoreIcon: ChevronDownIcon,\n },\n ...dataTableImmutableSettings,\n displayColumnDefOptions: {\n ...(displayColumnDefOptions satisfies Partial<\n MRT_TableOptions<MRT_RowData>[\"displayColumnDefOptions\"]\n >),\n \"mrt-row-actions\": {\n header: \"\",\n grow: true,\n muiTableBodyCellProps: {\n align: \"right\" as const,\n sx: {\n overflow: \"visible\",\n width: \"unset\",\n },\n className: \"ods-actions-cell\",\n },\n muiTableHeadCellProps: {\n align: \"right\" as const,\n sx: {\n width: \"unset\",\n },\n className: \"ods-actions-cell\",\n children: (\n <Box sx={{ display: \"flex\", visibility: \"hidden\" }}>\n {tableLayoutOptions.rowActionButtons &&\n tableLayoutOptions.rowActionButtons({ id: null })}\n {((hasRowReordering === true && onReorderRows) ||\n tableLayoutOptions.rowActionMenuItems) && (\n <Box>\n <Button\n endIcon={<MoreIcon />}\n size=\"small\"\n variant=\"floating\"\n ariaLabel={t(\"table.moreactions.arialabel\")}\n isDisabled\n />\n </Box>\n )}\n </Box>\n ),\n },\n },\n },\n muiTableProps: {\n ref: tableContentRef,\n className:\n !shouldDisplayRowActions && tableLayoutOptions.hasColumnResizing\n ? \"ods-hide-spacer-column\"\n : \"\",\n },\n muiTableContainerProps: {\n ref: tableInnerContainerRef,\n },\n muiTableBodyProps: () => ({\n className: rowDensityClassName,\n }),\n enableColumnResizing: tableLayoutOptions.hasColumnResizing,\n defaultColumn: {\n Cell: defaultCell,\n },\n enableRowActions:\n (hasRowReordering === true && onReorderRows) ||\n tableLayoutOptions.rowActionButtons ||\n tableLayoutOptions.rowActionMenuItems\n ? true\n : false,\n renderRowActions: ({ row }) => renderRowActions({ row }),\n enableRowOrdering: hasRowReordering && Boolean(onReorderRows),\n enableRowDragging: hasRowReordering && Boolean(onReorderRows),\n muiDetailPanelProps: ({ row }) => ({\n sx: {\n paddingBlock: row.getIsExpanded()\n ? `${odysseyDesignTokens.Spacing3} !important`\n : undefined,\n },\n }),\n muiTableBodyRowProps: ({ table, row, isDetailPanel }) => ({\n className: draggableTableBodyRowClassName({\n currentRowId: row.id,\n draggingRowId: draggingRow?.id,\n hoveredRowId: table.getState().hoveredRow?.id,\n }),\n sx: isDetailPanel\n ? {\n paddingBlock: \"0 !important\",\n border: 0,\n [\"&:hover\"]: {\n backgroundColor: `${odysseyDesignTokens.HueNeutralWhite} !important`,\n },\n }\n : {},\n }),\n muiRowDragHandleProps: ({ table, row }) => ({\n onKeyDown: (event) => handleDragHandleKeyDown({ table, row, event }),\n onBlur: () => resetDraggingAndHoveredRow(table),\n onDragEnd: () => handleDragHandleOnDragEnd(table),\n onDragCapture: () => handleDragHandleOnDragCapture(table),\n disabled: isRowReorderingDisabled,\n sx: dragHandleStyles,\n ...dragHandleText,\n }),\n renderDetailPanel: tableLayoutOptions.renderDetailPanel,\n enableRowVirtualization: data.length >= 50,\n muiTableHeadCellProps: ({ column: currentColumn }) => ({\n className: tableState.columnSorting.find(\n (sortedColumn) => sortedColumn.id === currentColumn.id,\n )\n ? \"isSorted\"\n : \"isUnsorted\",\n }),\n muiTableBodyCellProps: ({ column }) => ({\n className: column.getIsResizing() ? \"isResizing\" : \"\",\n }),\n enableSorting: tableLayoutOptions.hasSorting === true, // I don't know why this needs to be true, but it still works if undefined otherwise\n onSortingChange: (sortingUpdater) => {\n const newSortVal =\n typeof sortingUpdater === \"function\"\n ? sortingUpdater(tableState.columnSorting)\n : tableState.columnSorting;\n setTableState((prevState) => ({\n ...prevState,\n columnSorting: newSortVal,\n }));\n },\n enableRowSelection: hasRowSelection,\n onRowSelectionChange: setRowSelection,\n renderEmptyRowsFallback: emptyStateContainer,\n localization: {\n collapse: t(\"table.rowexpansion.collapse\"),\n collapseAll: t(\"table.rowexpansion.collapseall\"),\n expand: t(\"table.rowexpansion.expand\"),\n expandAll: t(\"table.rowexpansion.expandall\"),\n },\n });\n\n return (\n <ScrollableTableContainer\n isScrollableEnd={!isTableContainerScrolledToEnd}\n isScrollableStart={!isTableContainerScrolledToStart}\n odysseyDesignTokens={odysseyDesignTokens}\n ref={tableOuterContainerRef}\n >\n <MRT_TableContainer table={dataTable} />\n </ScrollableTableContainer>\n );\n};\n\nconst MemoizedTableLayoutContent = memo(TableLayoutContent);\nMemoizedTableLayoutContent.displayName = \"TableLayoutContent\";\n\nexport { MemoizedTableLayoutContent as TableLayoutContent };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAEEA,IAAI,EACJC,WAAW,EACXC,OAAO,EACPC,MAAM,EACNC,QAAQ,QAIH,OAAO;AACd,OAAOC,MAAM,MAAqB,iBAAiB;AACnD,SAIEC,kBAAkB,EAGlBC,qBAAqB,QAChB,sBAAsB;AAC7B,SAASC,cAAc,QAAQ,eAAe;AAAC,SAG7CC,aAAa,EACbC,iBAAiB,EACjBC,eAAe,EACfC,iBAAiB;AAAA,SAEVC,GAAG;AAAA,SACHC,MAAM;AAAA,SAIbC,0BAA0B,EAC1BC,uBAAuB,EACvBC,wBAAwB;AAAA,SAEjBC,UAAU;AAAA,SACVC,QAAQ;AAAA,SACRC,UA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,EAAEpH,CAAC,CAAC,6BAA6B,CAAC;MAC1CqH,WAAW,EAAErH,CAAC,CAAC,gCAAgC,CAAC;MAChDsH,MAAM,EAAEtH,CAAC,CAAC,2BAA2B,CAAC;MACtCuH,SAAS,EAAEvH,CAAC,CAAC,8BAA8B;IAC7C;EACF,CAAC,CAAC;EAEF,OACE3C,IAAA,CAACP,wBAAwB;IACvB0K,eAAe,EAAE,CAACnI,6BAA8B;IAChDoI,iBAAiB,EAAE,CAACtI,+BAAgC;IACpDY,mBAAmB,EAAEA,mBAAoB;IACzCmE,GAAG,EAAEzE,sBAAuB;IAAAwB,QAAA,EAE5B5D,IAAA,CAAClB,kBAAkB;MAAC+I,KAAK,EAAEpC;IAAU,CAAE;EAAC,CAChB,CAAC;AAE/B,CAAC;AAED,MAAM4E,0BAA0B,GAAG7L,IAAI,CAACiC,kBAAkB,CAAC;AAC3D4J,0BAA0B,CAACC,WAAW,GAAG,oBAAoB;AAE7D,SAASD,0BAA0B,IAAI5J,kBAAkB"}
@@ -22,7 +22,7 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
22
22
  import { Fragment as _Fragment } from "react/jsx-runtime";
23
23
  const TableSettings = ({
24
24
  setTableState,
25
- tableOptions,
25
+ tableLayoutOptions,
26
26
  tableState
27
27
  }) => {
28
28
  const {
@@ -32,7 +32,7 @@ const TableSettings = ({
32
32
  hasChangeableDensity,
33
33
  hasColumnVisibility,
34
34
  columns
35
- } = tableOptions;
35
+ } = tableLayoutOptions;
36
36
  const {
37
37
  rowDensity,
38
38
  columnVisibility
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableSettings.js","names":["memo","useCallback","useMemo","useTranslation","densityValues","ListIcon","ShowIcon","MenuButton","MenuItem","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","TableSettings","setTableState","tableLayoutOptions","tableState","t","hasChangeableDensity","hasColumnVisibility","columns","rowDensity","columnVisibility","changeRowDensity","value","prevState","changeColumnVisibility","columnId","visibleColumns","Set","filter","column","accessorKey","map","memoizedDensityMenu","ariaLabel","endIcon","menuAlignment","shouldCloseOnSelect","children","isSelected","onClick","charAt","toUpperCase","slice","memoizedColumnVisibilityMenu","Boolean","enableHiding","id","_Checkbox","checked","has","header","MemoizedTableSettings","displayName"],"sources":["../../../src/labs/DataView/TableSettings.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Dispatch, SetStateAction, memo, useCallback, useMemo } from \"react\";\nimport { Checkbox as MuiCheckbox } from \"@mui/material\";\nimport { MRT_DensityState } from \"material-react-table\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { densityValues } from \"./constants\";\nimport { ListIcon, ShowIcon } from \"../../icons.generated\";\nimport { MenuButton } from \"../../MenuButton\";\nimport { MenuItem } from \"../../MenuItem\";\nimport { TableLayoutProps, TableState } from \"./componentTypes\";\n\nexport type TableSettingsProps = {\n setTableState: Dispatch<SetStateAction<TableState>>;\n tableLayoutOptions: TableLayoutProps;\n tableState: TableState;\n};\n\nconst TableSettings = ({\n setTableState,\n tableLayoutOptions,\n tableState,\n}: TableSettingsProps) => {\n const { t } = useTranslation();\n\n const { hasChangeableDensity, hasColumnVisibility, columns } =\n tableLayoutOptions;\n const { rowDensity, columnVisibility } = tableState;\n\n const changeRowDensity = useCallback<(value: MRT_DensityState) => void>(\n (value) => {\n setTableState((prevState) => ({\n ...prevState,\n rowDensity: value,\n }));\n },\n [setTableState],\n );\n\n const changeColumnVisibility = useCallback<(columnId: string) => void>(\n (columnId) => {\n setTableState((prevState) => ({\n ...prevState,\n columnVisibility: {\n ...prevState.columnVisibility,\n [columnId]: prevState.columnVisibility\n ? prevState.columnVisibility[columnId] === false\n : false,\n },\n }));\n },\n [setTableState],\n );\n\n const visibleColumns = useMemo(\n () =>\n new Set(\n columns\n .filter((column) =>\n columnVisibility\n ? columnVisibility[column.accessorKey!] !== false\n : true,\n )\n .map((column) => column.accessorKey!),\n ),\n [columns, columnVisibility],\n );\n\n const memoizedDensityMenu = useMemo(\n () =>\n hasChangeableDensity && (\n <MenuButton\n ariaLabel={t(\"table.density.arialabel\")}\n endIcon={<ListIcon />}\n menuAlignment=\"right\"\n shouldCloseOnSelect={false}\n >\n {densityValues.map((value) => (\n <MenuItem\n key={value}\n isSelected={rowDensity === value}\n onClick={() => changeRowDensity(value)}\n >\n {`${value.charAt(0).toUpperCase()}${value.slice(1)}`}\n </MenuItem>\n ))}\n </MenuButton>\n ),\n [hasChangeableDensity, t, rowDensity, changeRowDensity],\n );\n\n const memoizedColumnVisibilityMenu = useMemo(\n () =>\n hasColumnVisibility && (\n <MenuButton\n ariaLabel={t(\"table.columnvisibility.arialabel\")}\n endIcon={<ShowIcon />}\n menuAlignment=\"right\"\n shouldCloseOnSelect={false}\n >\n {columns\n .filter((column) => Boolean(column.enableHiding !== false))\n .map((column) => (\n <MenuItem\n key={column.accessorKey}\n onClick={() => changeColumnVisibility(column.id!)}\n >\n <MuiCheckbox checked={visibleColumns.has(column.id!)} />\n {column.header}\n </MenuItem>\n ))}\n </MenuButton>\n ),\n [hasColumnVisibility, t, columns, changeColumnVisibility, visibleColumns],\n );\n\n return (\n <>\n {memoizedDensityMenu}\n {memoizedColumnVisibilityMenu}\n </>\n );\n};\n\nconst MemoizedTableSettings = memo(TableSettings);\nMemoizedTableSettings.displayName = \"TableSettings\";\n\nexport { MemoizedTableSettings as TableSettings };\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAmCA,IAAI,EAAEC,WAAW,EAAEC,OAAO,QA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A,KAAMf,sBAAsB,CAACK,MAAM,CAACiB,EAAG,CAAE;MAAAT,QAAA,GAElD/B,IAAA,CAAAyC,SAAA;QAAaC,OAAO,EAAEtB,cAAc,CAACuB,GAAG,CAACpB,MAAM,CAACiB,EAAG;MAAE,CAAE,CAAC,EACvDjB,MAAM,CAACqB,MAAM;IAAA,GAJTrB,MAAM,CAACC,WAKJ,CACX;EAAC,CACM,CACb,EACH,CAACb,mBAAmB,EAAEF,CAAC,EAAEG,OAAO,EAAEM,sBAAsB,EAAEE,cAAc,CAC1E,CAAC;EAED,OACElB,KAAA,CAAAE,SAAA;IAAA2B,QAAA,GACGL,mBAAmB,EACnBW,4BAA4B;EAAA,CAC7B,CAAC;AAEP,CAAC;AAED,MAAMQ,qBAAqB,GAAGvD,IAAI,CAACe,aAAa,CAAC;AACjDwC,qBAAqB,CAACC,WAAW,GAAG,eAAe;AAEnD,SAASD,qBAAqB,IAAIxC,aAAa"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"componentTypes.js","names":[],"sources":["../../../src/labs/DataView/componentTypes.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n MRT_DensityState,\n MRT_RowData,\n MRT_RowSelectionState,\n MRT_SortingState,\n MRT_TableOptions,\n MRT_VisibilityState,\n} from \"material-react-table\";\n\nimport { availableLayouts, availableCardLayouts } from \"./constants\";\nimport { DataFilter } from \"../DataFilters\";\nimport {\n DataGetDataType,\n DataOnReorderRowsType,\n DataRowSelectionState,\n DataTableColumn,\n} from \"./dataTypes\";\nimport { DataTableRowActionsProps } from \"../../DataTable/DataTableRowActions\";\nimport { MenuButtonProps } from \"../..\";\nimport { paginationTypeValues } from \"../DataTablePagination\";\nimport { ReactNode } from \"react\";\nimport { DataCardProps } from \"./DataCard\";\n\nexport type DataLayout = (typeof availableLayouts)[number];\nexport type CardLayout = (typeof availableCardLayouts)[number];\n\nexport type AvailableLayouts = DataLayout[];\nexport type AvailableCardLayouts = CardLayout[];\n\nexport type UniversalProps = {\n additionalActionButton?: ReactNode;\n additionalActionMenuItems?: ReactNode;\n bulkActionMenuItems?: (\n selectedRows: MRT_RowSelectionState,\n ) => MenuButtonProps[\"children\"];\n currentPage?: number;\n emptyPlaceholder?: ReactNode;\n errorMessage?: string;\n filters?: Array<DataFilter | DataTableColumn<MRT_RowData> | string>;\n getData: ({\n page,\n resultsPerPage,\n search,\n filters,\n sort,\n }: DataGetDataType) => MRT_RowData[] | Promise<MRT_RowData[]>;\n getRowId?: MRT_TableOptions<MRT_RowData>[\"getRowId\"];\n hasFilters?: boolean;\n hasPagination?: boolean;\n hasRowReordering?: boolean;\n hasRowSelection?: boolean;\n hasSearch?: boolean;\n hasSearchSubmitButton?: boolean;\n isEmpty?: boolean;\n isLoading?: boolean;\n isNoResults?: boolean;\n isPaginationMoreDisabled?: boolean;\n isRowReorderingDisabled?: boolean;\n maxPages?: number;\n maxResultsPerPage?: number;\n noResultsPlaceholder?: ReactNode;\n onChangeRowSelection?: (rowSelection: DataRowSelectionState) => void;\n onReorderRows?: ({ rowId, newRowIndex }: DataOnReorderRowsType) => void;\n paginationType?: (typeof paginationTypeValues)[number];\n resultsPerPage?: number;\n searchDelayTime?: number;\n totalRows?: number;\n};\n\nexport type TableLayoutProps = {\n columns: DataTableColumn<MRT_RowData>[];\n hasChangeableDensity?: boolean;\n hasColumnResizing?: boolean;\n hasColumnVisibility?: boolean;\n hasSorting?: boolean;\n initialDensity?: MRT_DensityState;\n renderDetailPanel?: MRT_TableOptions<MRT_RowData>[\"renderDetailPanel\"];\n rowActionButtons?: DataTableRowActionsProps[\"rowActionButtons\"];\n rowActionMenuItems?: DataTableRowActionsProps[\"rowActionMenuItems\"];\n};\n\nexport type CardLayoutProps = {\n itemProps: (row: MRT_RowData) => DataCardProps;\n maxGridColumns?: number;\n renderDetailPanel?: (props: { row: MRT_RowData }) => ReactNode;\n rowActionMenuItems?: DataTableRowActionsProps[\"rowActionMenuItems\"];\n};\n\nexport type ViewProps<L extends DataLayout> = {\n availableLayouts?: L[];\n initialLayout?: L;\n cardLayoutOptions?: CardLayoutProps;\n tableLayoutOptions?: TableLayoutProps;\n};\n\nexport type TableState = {\n columnSorting: MRT_SortingState;\n columnVisibility: MRT_VisibilityState;\n rowDensity?: MRT_DensityState;\n};\n"],"mappings":""}
@@ -10,8 +10,8 @@
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- export const availableStackLayouts = ["list", "grid"];
13
+ export const availableCardLayouts = ["list", "grid"];
14
14
  export const availableTableLayouts = ["table"];
15
- export const availableLayouts = [...availableTableLayouts, ...availableStackLayouts];
15
+ export const availableLayouts = [...availableTableLayouts, ...availableCardLayouts];
16
16
  export const densityValues = ["comfortable", "spacious", "compact"];
17
17
  //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","names":["availableCardLayouts","availableTableLayouts","availableLayouts","densityValues"],"sources":["../../../src/labs/DataView/constants.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { MRT_DensityState } from \"material-react-table\";\n\nexport type DataViewLayout = \"list\" | \"grid\" | \"table\";\n\nexport const availableCardLayouts: DataViewLayout[] = [\"list\", \"grid\"];\nexport const availableTableLayouts: DataViewLayout[] = [\"table\"];\nexport const availableLayouts: DataViewLayout[] = [\n ...availableTableLayouts,\n ...availableCardLayouts,\n];\n\nexport const densityValues: MRT_DensityState[] = [\n \"comfortable\",\n \"spacious\",\n \"compact\",\n];\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAMA,OAAO,MAAMA,oBAAsC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;AACtE,OAAO,MAAMC,qBAAuC,GAAG,CAAC,OAAO,CAAC;AAChE,OAAO,MAAMC,gBAAkC,GAAG,CAChD,GAAGD,qBAAqB,EACxB,GAAGD,oBAAoB,CACxB;AAED,OAAO,MAAMG,aAAiC,GAAG,CAC/C,aAAa,EACb,UAAU,EACV,SAAS,CACV"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataTypes.js","names":[],"sources":["../../../src/labs/DataView/dataTypes.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport {\n MRT_Cell,\n MRT_Column,\n MRT_ColumnDef,\n MRT_RowData,\n MRT_RowSelectionState,\n MRT_SortingState,\n} from \"material-react-table\";\n\nimport { DataFilter } from \"../DataFilters\";\n\nexport type DataQueryParamsType = {\n filters?: DataFilter[];\n page?: number;\n resultsPerPage?: number;\n search?: string;\n sort?: MRT_SortingState;\n};\n\nexport type DataTableColumn<T extends MRT_RowData> = MRT_ColumnDef<T> & {\n /**\n * @deprecated use hasTextWrapping instead of enableWrapping\n */\n enableWrapping?: boolean;\n hasTextWrapping?: boolean;\n};\n\nexport type DataTableColumnInstance<T extends MRT_RowData> = Omit<\n MRT_Column<T, unknown>,\n \"columnDef\"\n> & {\n columnDef: DataTableColumn<T>;\n};\n\nexport type DataTableCell<T extends MRT_RowData> = Omit<\n MRT_Cell<T>,\n \"column\"\n> & {\n column: DataTableColumnInstance<T>;\n};\n\nexport type DataColumns = DataTableColumn<MRT_RowData>[];\n\nexport type DataRow = MRT_RowData;\n\nexport type DataGetDataType = {\n filters?: DataFilter[];\n page?: number;\n resultsPerPage?: number;\n search?: string;\n sort?: MRT_SortingState;\n};\n\nexport type DataOnReorderRowsType = {\n newRowIndex: number;\n rowId: string;\n};\n\nexport type DataRowSelectionState = MRT_RowSelectionState;\n\n// Provided for backwards compatibilty with old DataTable types\nexport type DataTableGetDataType = DataGetDataType;\nexport type DataTableOnReorderRowsType = DataOnReorderRowsType;\nexport type DataTableRowSelectionState = DataRowSelectionState;\nexport type DataTableRow = DataRow;\n"],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchData.js","names":["t","fetchData","dataQueryParams","errorMessageProp","getData","setData","setErrorMessage","setIsLoading","incomingData","error"],"sources":["../../../src/labs/DataView/fetchData.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { Dispatch, SetStateAction } from \"react\";\nimport { MRT_RowData } from \"material-react-table\";\nimport { t } from \"i18next\";\n\nimport { DataQueryParamsType } from \"./dataTypes\";\nimport { UniversalProps } from \"./componentTypes\";\n\ntype DataRequestType = {\n dataQueryParams: DataQueryParamsType;\n errorMessageProp: UniversalProps[\"errorMessage\"];\n getData: UniversalProps[\"getData\"];\n setData: Dispatch<SetStateAction<MRT_RowData[]>>;\n setErrorMessage: Dispatch<SetStateAction<UniversalProps[\"errorMessage\"]>>;\n setIsLoading?: Dispatch<SetStateAction<boolean>>;\n};\n\nexport const fetchData = async ({\n dataQueryParams,\n errorMessageProp,\n getData,\n setData,\n setErrorMessage,\n setIsLoading,\n}: DataRequestType) => {\n setIsLoading?.(true);\n setErrorMessage(errorMessageProp);\n try {\n const incomingData = await getData?.(dataQueryParams);\n setData(incomingData);\n } catch (error) {\n setErrorMessage(typeof error === \"string\" ? error : t(\"table.error\"));\n } finally {\n setIsLoading?.(false);\n }\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,CAAC,QAAQ,SAAS;AAc3B,OAAO,MAAMC,SAAS,GAAG,MAAAA,CAAO;EAC9BC,eAAe;EACfC,gBAAgB;EAChBC,OAAO;EACPC,OAAO;EACPC,eAAe;EACfC;AACe,CAAC,KAAK;EACrBA,YAAY,GAAG,IAAI,CAAC;EACpBD,eAAe,CAACH,gBAAgB,CAAC;EACjC,IAAI;IACF,MAAMK,YAAY,GAAG,MAAMJ,OAAO,GAAGF,eAAe,CAAC;IACrDG,OAAO,CAACG,YAAY,CAAC;EACvB,CAAC,CAAC,OAAOC,KAAK,EAAE;IACdH,eAAe,CAAC,OAAOG,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGT,CAAC,CAAC,aAAa,CAAC,CAAC;EACvE,CAAC,SAAS;IACRO,YAAY,GAAG,KAAK,CAAC;EACvB;AACF,CAAC"}
@@ -9,7 +9,6 @@
9
9
  *
10
10
  * See the License for the specific language governing permissions and limitations under the License.
11
11
  */
12
- export { DataStack } from "./DataStack.js";
13
12
  export { DataTable } from "./DataTable.js";
14
13
  export { DataView } from "./DataView.js";
15
14
  export * from "./componentTypes.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["DataTable","DataView"],"sources":["../../../src/labs/DataView/index.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nexport { DataTable, type DataTableProps } from \"./DataTable\";\nexport { DataView, type DataViewProps } from \"./DataView\";\n\nexport * from \"./componentTypes\";\nexport * from \"./constants\";\nexport * from \"./dataTypes\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,SAYSA,SAAS;AAAA,SACTC,QAAQ;AAAA;AAAA;AAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tableConstants.js","names":["styled","Box","DragIndicatorIcon","jsx","_jsx","dataTableImmutableSettings","enableColumnActions","enableDensityToggle","enableExpandAll","enableFilters","enableFullScreenToggle","enableGlobalFilter","enableHiding","enablePagination","layoutMode","manualFiltering","manualSorting","muiTablePaperProps","elevation","sx","overflow","positionActionsColumn","rowVirtualizerOptions","overscan","selectAllMode","displayColumnDefOptions","header","muiTableBodyCellProps","minWidth","width","className","muiTableHeadCellProps","children","marginInline","opacity","padding","ScrollableTableContainer","shouldForwardProp","prop","odysseyDesignTokens","isScrollableStart","isScrollableEnd","marginBlockEnd","Spacing4","position","borderInlineStartColor","HueNeutral200","borderInlineStartStyle","borderInlineStartWidth","BorderWidthMain","background","content","pointerEvents","top","left","bottom","Spacing6","zIndex","transition","TransitionDurationMain","TransitionTimingMain","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","right"],"sources":["../../../src/labs/DataView/tableConstants.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport styled from \"@emotion/styled\";\nimport { MRT_RowData, MRT_TableOptions } from \"material-react-table\";\n\nimport { Box } from \"../../Box\";\nimport { DesignTokens } from \"../../OdysseyDesignTokensContext\";\nimport { DragIndicatorIcon } from \"../../icons.generated\";\n\nexport const dataTableImmutableSettings = {\n enableColumnActions: false,\n enableDensityToggle: false,\n enableExpandAll: false,\n enableFilters: false,\n enableFullScreenToggle: false,\n enableGlobalFilter: false,\n enableHiding: false,\n enablePagination: false,\n layoutMode: \"grid-no-grow\" as MRT_TableOptions<MRT_RowData>[\"layoutMode\"],\n manualFiltering: true,\n manualSorting: true,\n muiTablePaperProps: {\n elevation: 0,\n sx: {\n overflow: \"visible\",\n },\n },\n positionActionsColumn:\n \"last\" as MRT_TableOptions<MRT_RowData>[\"positionActionsColumn\"],\n rowVirtualizerOptions: {\n overscan: 4,\n },\n selectAllMode: \"all\" as MRT_TableOptions<MRT_RowData>[\"selectAllMode\"],\n};\n\nexport const displayColumnDefOptions = {\n \"mrt-row-drag\": {\n header: \"\",\n muiTableBodyCellProps: {\n sx: {\n minWidth: 0,\n width: \"auto\",\n },\n className: \"ods-drag-handle\",\n },\n muiTableHeadCellProps: {\n sx: {\n minWidth: 0,\n width: \"auto\",\n },\n children: (\n // Add a spacer to simulate the width of the drag handle in the column.\n // Without this, the head cells are offset from their body cell counterparts\n <Box sx={{ marginInline: \"-0.1rem\" }}>\n <DragIndicatorIcon sx={{ marginInline: 1, opacity: 0 }} />\n </Box>\n ),\n },\n },\n \"mrt-row-select\": {\n muiTableHeadCellProps: {\n padding: \"checkbox\" as const,\n },\n muiTableBodyCellProps: {\n padding: \"checkbox\" as const,\n },\n },\n \"mrt-row-expand\": {\n header: \"\",\n muiTableBodyCellProps: {\n sx: {\n overflow: \"visible\",\n },\n },\n },\n};\n\nexport const ScrollableTableContainer = styled(\"div\", {\n shouldForwardProp: (prop) =>\n prop !== \"odysseyDesignTokens\" &&\n prop !== \"isScrollableStart\" &&\n prop !== \"isScrollableEnd\",\n})(\n ({\n odysseyDesignTokens,\n isScrollableStart,\n isScrollableEnd,\n }: {\n odysseyDesignTokens: DesignTokens;\n isScrollableStart: boolean;\n isScrollableEnd: boolean;\n }) => ({\n marginBlockEnd: odysseyDesignTokens.Spacing4,\n position: \"relative\",\n borderInlineStartColor: isScrollableStart\n ? odysseyDesignTokens.HueNeutral200\n : \"transparent\",\n borderInlineStartStyle: \"solid\",\n borderInlineStartWidth: odysseyDesignTokens.BorderWidthMain,\n \"::before\": {\n background:\n \"linear-gradient(-90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.33) 50%, rgba(0, 0, 0, 1) 100%)\",\n content: '\"\"',\n opacity: isScrollableStart ? \"0.075\" : \"0\",\n pointerEvents: \"none\",\n position: \"absolute\",\n top: 0,\n left: 0,\n bottom: 0,\n width: odysseyDesignTokens.Spacing6,\n zIndex: 100,\n transition: `opacity ${odysseyDesignTokens.TransitionDurationMain} ${odysseyDesignTokens.TransitionTimingMain}`,\n },\n borderInlineEndColor: isScrollableEnd\n ? odysseyDesignTokens.HueNeutral200\n : \"transparent\",\n borderInlineEndStyle: \"solid\",\n borderInlineEndWidth: odysseyDesignTokens.BorderWidthMain,\n \"::after\": {\n background:\n \"linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.33) 50%, rgba(0, 0, 0, 1) 100%)\",\n content: '\"\"',\n opacity: isScrollableEnd ? \"0.075\" : \"0\",\n pointerEvents: \"none\",\n position: \"absolute\",\n top: 0,\n right: 0,\n bottom: 0,\n width: odysseyDesignTokens.Spacing6,\n transition: `opacity ${odysseyDesignTokens.TransitionDurationMain} ${odysseyDesignTokens.TransitionTimingMain}`,\n },\n }),\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,MAAM,MAAM,iBAAiB;AAAC,SAG5BC,GAAG;AAAA,SAEHC,iBAAiB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE1B,OAAO,MAAMC,0BAA0B,GAAG;EACxCC,mBAAmB,EAAE,KAAK;EAC1BC,mBAAmB,EAAE,KAAK;EAC1BC,eAAe,EAAE,KAAK;EACtBC,aAAa,EAAE,KAAK;EACpBC,sBAAsB,EAAE,KAAK;EAC7BC,kBAAkB,EAAE,KAAK;EACzBC,YAAY,EAAE,KAAK;EACnBC,gBAAgB,EAAE,KAAK;EACvBC,UAAU,EAAE,cAA6D;EACzEC,eAAe,EAAE,IAAI;EACrBC,aAAa,EAAE,IAAI;EACnBC,kBAAkB,EAAE;IAClBC,SAAS,EAAE,CAAC;IACZC,EAAE,EAAE;MACFC,QAAQ,EAAE;IACZ;EACF,CAAC;EACDC,qBAAqB,EACnB,MAAgE;EAClEC,qBAAqB,EAAE;IACrBC,QAAQ,EAAE;EACZ,CAAC;EACDC,aAAa,EAAE;AACjB,CAAC;AAED,OAAO,MAAMC,uBAAuB,GAAG;EACrC,cAAc,EAAE;IACdC,MAAM,EAAE,EAAE;IACVC,qBAAqB,EAAE;MACrBR,EAAE,EAAE;QACFS,QAAQ,EAAE,CAAC;QACXC,KAAK,EAAE;MACT,CAAC;MACDC,SAAS,EAAE;IACb,CAAC;IACDC,qBAAqB,EAAE;MACrBZ,EAAE,EAAE;QACFS,QAAQ,EAAE,CAAC;QACXC,KAAK,EAAE;MACT,CAAC;MACDG,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CAACiB,QAAQ;IACnCC,MAAM,EAAE,GAAG;IACXC,UAAU,EAAG,WAAUnB,mBAAmB,CAACoB,sBAAuB,IAAGpB,mBAAmB,CAACqB,oBAAqB;EAChH,CAAC;EACDC,oBAAoB,EAAEpB,eAAe,GACjCF,mBAAmB,CAACO,aAAa,GACjC,aAAa;EACjBgB,oBAAoB,EAAE,OAAO;EAC7BC,oBAAoB,EAAExB,mBAAmB,CAACU,eAAe;EACzD,SAAS,EAAE;IACTC,UAAU,EACR,6FAA6F;IAC/FC,OAAO,EAAE,IAAI;IACbjB,OAAO,EAAEO,eAAe,GAAG,OAAO,GAAG,GAAG;IACxCW,aAAa,EAAE,MAAM;IACrBR,QAAQ,EAAE,UAAU;IACpBS,GAAG,EAAE,CAAC;IACNW,KAAK,EAAE,CAAC;IACRT,MAAM,EAAE,CAAC;IACT1B,KAAK,EAAEU,mBAAmB,CAACiB,QAAQ;IACnCE,UAAU,EAAG,WAAUnB,mBAAmB,CAACoB,sBAAuB,IAAGpB,mBAAmB,CAACqB,oBAAqB;EAChH;AACF,CAAC,CACH,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFilterConversion.js","names":["useCallback","useMemo","useFilterConversion","columns","filters","convertFilterSelectOptions","options","map","option","label","value","convertColumnToFilter","column","enableColumnFilter","accessorKey","id","header","variant","filterVariant","filterSelectOptions","dataTableFilters","providedFilters","reduce","accumulator","item","foundColumn","find","filter","concat"],"sources":["../../../src/labs/DataView/useFilterConversion.ts"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { useCallback, useMemo } from \"react\";\nimport { MRT_RowData } from \"material-react-table\";\n\nimport { DataFilter } from \"../DataFilters\";\nimport { DataTableColumn } from \"../../DataTable\";\nimport { UniversalProps, TableLayoutProps } from \"./componentTypes\";\n\ntype FilterConversionType = {\n columns?: TableLayoutProps[\"columns\"];\n filters?: UniversalProps[\"filters\"];\n};\n\nexport const useFilterConversion = ({\n columns,\n filters,\n}: FilterConversionType) => {\n const convertFilterSelectOptions = useCallback(\n (options: DataTableColumn<MRT_RowData>[\"filterSelectOptions\"]) =>\n options?.map((option) =>\n typeof option === \"string\"\n ? {\n label: option,\n value: option,\n }\n : {\n // If the option isn't a string, it must have value and/or option defined\n // If either is undefined, use the other\n label: option.label ?? option.value,\n value: option.value ?? option.label,\n },\n ),\n [],\n );\n\n const convertColumnToFilter = useCallback(\n (column: DataTableColumn<MRT_RowData>) =>\n column.enableColumnFilter !== false && column.accessorKey\n ? ({\n id: column.accessorKey,\n label: column.header,\n variant: column.filterVariant,\n options: convertFilterSelectOptions(column.filterSelectOptions),\n } satisfies DataFilter as DataFilter)\n : null,\n [convertFilterSelectOptions],\n );\n\n const dataTableFilters = useMemo(() => {\n // Filters may be manually set via the `filters` variable;\n // If not, they may be inferred from `columns`\n const providedFilters = filters || columns || [];\n\n return providedFilters.reduce<DataFilter[]>((accumulator, item) => {\n if (typeof item === \"string\") {\n const foundColumn = columns?.find(\n (column) => column.accessorKey === item,\n );\n const filter = foundColumn && convertColumnToFilter(foundColumn);\n return filter ? accumulator.concat(filter) : accumulator;\n }\n\n if (\"accessorKey\" in item) {\n const filter = convertColumnToFilter(item);\n return filter ? accumulator.concat(filter) : accumulator;\n }\n\n if (\"label\" in item) {\n return accumulator.concat(item);\n }\n\n return accumulator;\n }, []);\n }, [columns, filters]);\n\n return dataTableFilters;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,OAAO,QAA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,GAAGJ,WAAW;MAC1D;MAEA,IAAI,aAAa,IAAIC,IAAI,EAAE;QACzB,MAAMG,MAAM,GAAGhB,qBAAqB,CAACa,IAAI,CAAC;QAC1C,OAAOG,MAAM,GAAGJ,WAAW,CAACK,MAAM,CAACD,MAAM,CAAC,GAAGJ,WAAW;MAC1D;MAEA,IAAI,OAAO,IAAIC,IAAI,EAAE;QACnB,OAAOD,WAAW,CAACK,MAAM,CAACJ,IAAI,CAAC;MACjC;MAEA,OAAOD,WAAW;IACpB,CAAC,EAAE,EAAE,CAAC;EACR,CAAC,EAAE,CAACpB,OAAO,EAAEC,OAAO,CAAC,CAAC;EAEtB,OAAOgB,gBAAgB;AACzB,CAAC"}
@@ -0,0 +1,44 @@
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 { CollapseLeftIcon } from "../../icons.generated/index.js";
15
+ import { Box } from "../../Box.js";
16
+ import { Button } from "../../Button.js";
17
+ import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext.js";
18
+ import { jsx as _jsx } from "react/jsx-runtime";
19
+ const CollapseIcon = ({
20
+ onClick
21
+ }) => {
22
+ const odysseyDesignTokens = useOdysseyDesignTokens();
23
+ const collapseButtonStyles = useMemo(() => ({
24
+ "& > button": {
25
+ height: odysseyDesignTokens.Spacing6,
26
+ width: odysseyDesignTokens.Spacing6,
27
+ color: odysseyDesignTokens.HueNeutral400
28
+ }
29
+ }), [odysseyDesignTokens]);
30
+ return _jsx(Box, {
31
+ sx: collapseButtonStyles,
32
+ children: _jsx(Button, {
33
+ tabIndex: 0,
34
+ variant: "secondary",
35
+ onClick: onClick,
36
+ startIcon: _jsx(CollapseLeftIcon, {}),
37
+ ariaLabel: "collapse side navigation"
38
+ })
39
+ });
40
+ };
41
+ const MemoizedCollapseIcon = memo(CollapseIcon);
42
+ MemoizedCollapseIcon.displayName = "CollapseIcon";
43
+ export { MemoizedCollapseIcon as CollapseIcon };
44
+ //# sourceMappingURL=CollapseIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CollapseIcon.js","names":["memo","useMemo","CollapseLeftIcon","Box","Button","useOdysseyDesignTokens","jsx","_jsx","CollapseIcon","onClick","odysseyDesignTokens","collapseButtonStyles","height","Spacing6","width","color","HueNeutral400","sx","children","tabIndex","variant","startIcon","ariaLabel","MemoizedCollapseIcon","displayName"],"sources":["../../../src/labs/SideNav/CollapseIcon.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2024-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport { memo, useMemo, ReactElement } from \"react\";\nimport { CollapseLeftIcon } from \"../../icons.generated\";\nimport { Box } from \"../../Box\";\nimport { Button } from \"../../Button\";\nimport { useOdysseyDesignTokens } from \"../../OdysseyDesignTokensContext\";\n\nconst CollapseIcon = ({ onClick }: { onClick?(): void }): ReactElement => {\n const odysseyDesignTokens = useOdysseyDesignTokens();\n\n const collapseButtonStyles = useMemo(\n () => ({\n \"& > button\": {\n height: odysseyDesignTokens.Spacing6,\n width: odysseyDesignTokens.Spacing6,\n color: odysseyDesignTokens.HueNeutral400,\n },\n }),\n [odysseyDesignTokens],\n );\n\n return (\n <Box sx={collapseButtonStyles}>\n <Button\n tabIndex={0}\n variant=\"secondary\"\n onClick={onClick}\n startIcon={<CollapseLeftIcon />}\n ariaLabel=\"collapse side navigation\"\n />\n </Box>\n );\n};\nconst MemoizedCollapseIcon = memo(CollapseIcon);\nMemoizedCollapseIcon.displayName = \"CollapseIcon\";\n\nexport { MemoizedCollapseIcon as CollapseIcon };\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,OAAO,QAAsB,OAAO;AAAC,SAC3CC,gBAAgB;AAAA,SAChBC,GAAG;AAAA,SACHC,MAAM;AAAA,SACNC,sBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAE/B,MAAMC,YAAY,GAAGA,CAAC;EAAEC;AAA8B,CAAC,KAAmB;EACxE,MAAMC,mBAAmB,GAAGL,sBAAsB,CAAC,CAAC;EAEpD,MAAMM,oBAAoB,GAAGV,OAAO,CAClC,OAAO;IACL,YAAY,EAAE;MACZW,MAAM,EAAEF,mBAAmB,CAACG,QAAQ;MACpCC,KAAK,EAAEJ,mBAAmB,CAACG,QAAQ;MACnCE,KAAK,EAAEL,mBAAmB,CAACM;IAC7B;EACF,CAAC,CAAC,EACF,CAACN,mBAAmB,CACtB,CAAC;EAED,OACEH,IAAA,CAACJ,GAAG;IAACc,EAAE,EAAEN,oBAAqB;IAAAO,QAAA,EAC5BX,IAAA,CAACH,MAAM;MACLe,QAAQ,EAAE,CAAE;MACZC,OAAO,EAAC,WAAW;MACnBX,OAAO,EAAEA,OAAQ;MACjBY,SAAS,EAAEd,IAAA,CAACL,gBAAgB,IAAE,CAAE;MAChCoB,SAAS,EAAC;IAA0B,CACrC;EAAC,CACC,CAAC;AAEV,CAAC;AACD,MAAMC,oBAAoB,GAAGvB,IAAI,CAACQ,YAAY,CAAC;AAC/Ce,oBAAoB,CAACC,WAAW,GAAG,cAAc;AAEjD,SAASD,oBAAoB,IAAIf,YAAY"}
@@ -0,0 +1,246 @@
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, useMemo, useState, useCallback, useRef, useEffect } from "react";
15
+ import { Box } from "../../Box.js";
16
+ import { ExpandLeftIcon } from "../../icons.generated/index.js";
17
+ import { NavAccordion } from "../NavAccordion.js";
18
+ import { useOdysseyDesignTokens } from "../../OdysseyDesignTokensContext.js";
19
+ import { SideNavHeader } from "./SideNavHeader.js";
20
+ import { SideNavItemContent, SideNavListItemContainer } from "./SideNavItemContent.js";
21
+ import { SideNavFooterContent } from "./SideNavFooterContent.js";
22
+ import { jsx as _jsx } from "react/jsx-runtime";
23
+ import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ const SideNavCollapsedContainer = styled("div", {
25
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isSideNavCollapsed"
26
+ })(({
27
+ odysseyDesignTokens,
28
+ isSideNavCollapsed
29
+ }) => ({
30
+ backgroundColor: odysseyDesignTokens.HueNeutral300,
31
+ paddingTop: odysseyDesignTokens.Spacing5,
32
+ cursor: "pointer",
33
+ width: isSideNavCollapsed ? "auto" : 0,
34
+ opacity: isSideNavCollapsed ? 1 : 0,
35
+ visibility: isSideNavCollapsed ? "visible" : "hidden",
36
+ transitionProperty: "opacity",
37
+ transitionDuration: odysseyDesignTokens.TransitionDurationMain,
38
+ transitionTimingFunction: odysseyDesignTokens.TransitionTimingMain
39
+ }));
40
+ const SideNavExpandContainer = styled("div", {
41
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens" && prop !== "isSideNavCollapsed"
42
+ })(({
43
+ odysseyDesignTokens,
44
+ isSideNavCollapsed
45
+ }) => ({
46
+ backgroundColor: odysseyDesignTokens.HueNeutralWhite,
47
+ flexDirection: "column",
48
+ display: "flex",
49
+ opacity: isSideNavCollapsed ? 0 : 1,
50
+ visibility: isSideNavCollapsed ? "hidden" : "visible",
51
+ width: isSideNavCollapsed ? "0" : "100%",
52
+ transitionProperty: "opacity, width",
53
+ transitionDuration: odysseyDesignTokens.TransitionDurationMain,
54
+ transitionTimingFunction: odysseyDesignTokens.TransitionTimingMain
55
+ }));
56
+ const SideNavListContainer = styled.ul({
57
+ padding: 0,
58
+ listStyle: "none",
59
+ listStyleType: "none"
60
+ });
61
+ const SectionHeader = styled("li", {
62
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens"
63
+ })(({
64
+ odysseyDesignTokens
65
+ }) => ({
66
+ fontSize: odysseyDesignTokens.TypographySizeOverline,
67
+ fontWeight: odysseyDesignTokens.TypographyWeightHeadingBold,
68
+ color: odysseyDesignTokens.HueNeutral600,
69
+ paddingTop: odysseyDesignTokens.Spacing3,
70
+ paddingBottom: odysseyDesignTokens.Spacing3,
71
+ paddingLeft: odysseyDesignTokens.Spacing4,
72
+ textTransform: "uppercase"
73
+ }));
74
+ const SideNavFooterContainer = styled("div", {
75
+ shouldForwardProp: prop => prop !== "odysseyDesignTokens"
76
+ })(({
77
+ odysseyDesignTokens
78
+ }) => ({
79
+ paddingTop: odysseyDesignTokens.Spacing2,
80
+ paddingBottom: odysseyDesignTokens.Spacing2,
81
+ display: "flex",
82
+ justifyContent: "center",
83
+ flexWrap: "wrap",
84
+ alignItems: "center",
85
+ fontSize: odysseyDesignTokens.TypographySizeOverline,
86
+ "& a": {
87
+ color: `${odysseyDesignTokens.TypographyColorHeading} !important`
88
+ },
89
+ "& a:hover": {
90
+ textDecoration: "none"
91
+ },
92
+ "& a:visited": {
93
+ color: odysseyDesignTokens.TypographyColorHeading
94
+ }
95
+ }));
96
+ const SideNav = ({
97
+ navHeaderText,
98
+ isCollapsible,
99
+ onCollapse,
100
+ onExpand,
101
+ sideNavItems,
102
+ footerItems
103
+ }) => {
104
+ const [isSideNavCollapsed, setSideNavCollapsed] = useState(false);
105
+ const odysseyDesignTokens = useOdysseyDesignTokens();
106
+ const scrollIntoViewRef = useRef(null);
107
+ const firstSideNavItemIdWithIsSelected = useMemo(() => {
108
+ const flattenedItems = sideNavItems.flatMap(sideNavItem => sideNavItem.children ? [sideNavItem, ...sideNavItem.children] : sideNavItem);
109
+ const firstItemWithIsSelected = flattenedItems.find(sideNavItem => sideNavItem.isSelected);
110
+ return firstItemWithIsSelected?.id;
111
+ }, [sideNavItems]);
112
+ useEffect(() => {
113
+ if (firstSideNavItemIdWithIsSelected && scrollIntoViewRef.current) {
114
+ scrollIntoViewRef.current.scrollIntoView();
115
+ }
116
+ }, [firstSideNavItemIdWithIsSelected, scrollIntoViewRef]);
117
+ const getRefIfThisIsFirstNodeWithIsSelected = useCallback(itemId => itemId === firstSideNavItemIdWithIsSelected ? scrollIntoViewRef : undefined, [firstSideNavItemIdWithIsSelected]);
118
+ const processedSideNavItems = useMemo(() => sideNavItems.map(item => ({
119
+ ...item,
120
+ children: item.children?.map(childProps => _jsx(SideNavItemContent, {
121
+ scrollRef: getRefIfThisIsFirstNodeWithIsSelected(childProps.id),
122
+ ...childProps
123
+ }, childProps.id))
124
+ })), [getRefIfThisIsFirstNodeWithIsSelected, sideNavItems]);
125
+ const sideNavCollapseHandler = useCallback(() => {
126
+ setSideNavCollapsed(!isSideNavCollapsed);
127
+ onCollapse?.();
128
+ }, [isSideNavCollapsed, setSideNavCollapsed, onCollapse]);
129
+ const sideNavExpandClickHandler = useCallback(() => {
130
+ setSideNavCollapsed(!isSideNavCollapsed);
131
+ onExpand?.();
132
+ }, [isSideNavCollapsed, setSideNavCollapsed, onExpand]);
133
+ const sideNavExpandKeyHandler = useCallback(event => {
134
+ if (event?.key === "Enter" || event?.code === "Space") {
135
+ event.preventDefault();
136
+ setSideNavCollapsed(!isSideNavCollapsed);
137
+ onExpand?.();
138
+ }
139
+ }, [isSideNavCollapsed, setSideNavCollapsed, onExpand]);
140
+ const sideNavStyles = useMemo(() => ({
141
+ display: "flex",
142
+ height: "100vh"
143
+ }), []);
144
+ const sideNavHeaderContainerStyles = useMemo(() => ({
145
+ position: "sticky",
146
+ top: 0
147
+ }), []);
148
+ const sideNavListContainerStyles = useMemo(() => ({
149
+ flex: 1,
150
+ overflowY: "auto"
151
+ }), []);
152
+ const sideNavFooterContainerStyles = useMemo(() => ({
153
+ position: "sticky",
154
+ bottom: 0,
155
+ paddingTop: odysseyDesignTokens.Spacing2
156
+ }), [odysseyDesignTokens]);
157
+ const expandLeftIconStyles = useMemo(() => ({
158
+ fontSize: "1em",
159
+ margin: `0 ${odysseyDesignTokens.Spacing1}`
160
+ }), [odysseyDesignTokens]);
161
+ return _jsxs(Box, {
162
+ sx: sideNavStyles,
163
+ children: [_jsx(SideNavCollapsedContainer, {
164
+ tabIndex: 0,
165
+ role: "button",
166
+ odysseyDesignTokens: odysseyDesignTokens,
167
+ isSideNavCollapsed: isSideNavCollapsed,
168
+ onClick: sideNavExpandClickHandler,
169
+ onKeyDown: sideNavExpandKeyHandler,
170
+ "data-se": "collapsed-region",
171
+ "data-aria-label": "expand side navigation",
172
+ children: _jsx(ExpandLeftIcon, {
173
+ sx: expandLeftIconStyles
174
+ })
175
+ }), _jsxs(SideNavExpandContainer, {
176
+ odysseyDesignTokens: odysseyDesignTokens,
177
+ isSideNavCollapsed: isSideNavCollapsed,
178
+ "data-se": "expanded-region",
179
+ children: [_jsx(Box, {
180
+ sx: sideNavHeaderContainerStyles,
181
+ children: _jsx(SideNavHeader, {
182
+ navHeaderText: navHeaderText,
183
+ isCollapsible: isCollapsible,
184
+ onCollapse: sideNavCollapseHandler
185
+ })
186
+ }), _jsx(Box, {
187
+ sx: sideNavListContainerStyles,
188
+ testId: "scrollable-region",
189
+ children: _jsx(SideNavListContainer, {
190
+ children: processedSideNavItems?.map(item => {
191
+ const {
192
+ id,
193
+ label,
194
+ isSectionHeader,
195
+ startIcon,
196
+ children,
197
+ isDefaultExpanded,
198
+ isDisabled,
199
+ isExpanded
200
+ } = item;
201
+ if (isSectionHeader) {
202
+ return _jsx(SectionHeader, {
203
+ id: id,
204
+ odysseyDesignTokens: odysseyDesignTokens,
205
+ children: label
206
+ }, id);
207
+ } else if (children) {
208
+ return _jsx(SideNavListItemContainer, {
209
+ id: id,
210
+ odysseyDesignTokens: odysseyDesignTokens,
211
+ children: _jsx(NavAccordion, {
212
+ label: label,
213
+ isDefaultExpanded: isDefaultExpanded,
214
+ isExpanded: isExpanded,
215
+ startIcon: startIcon,
216
+ isDisabled: isDisabled,
217
+ children: _jsx(SideNavListContainer, {
218
+ id: `${id}-list`,
219
+ children: children
220
+ })
221
+ })
222
+ }, id);
223
+ } else {
224
+ return _jsx(SideNavItemContent, {
225
+ scrollRef: getRefIfThisIsFirstNodeWithIsSelected(item.id),
226
+ ...item
227
+ }, item.id);
228
+ }
229
+ })
230
+ })
231
+ }), footerItems && _jsx(Box, {
232
+ sx: sideNavFooterContainerStyles,
233
+ children: _jsx(SideNavFooterContainer, {
234
+ odysseyDesignTokens: odysseyDesignTokens,
235
+ children: _jsx(SideNavFooterContent, {
236
+ footerItems: footerItems
237
+ })
238
+ })
239
+ })]
240
+ })]
241
+ });
242
+ };
243
+ const MemoizedSideNav = memo(SideNav);
244
+ MemoizedSideNav.displayName = "SideNav";
245
+ export { MemoizedSideNav as SideNav };
246
+ //# sourceMappingURL=SideNav.js.map