@dashforge/tw 1.1.0 → 1.1.1

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 (390) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/index.esm.js +1 -1
  3. package/dist/src/index.d.ts +1 -1
  4. package/package.json +8 -3
  5. package/.swcrc +0 -29
  6. package/A11Y.md +0 -130
  7. package/CONSUMER-VALIDATION.md +0 -130
  8. package/COVERAGE.md +0 -63
  9. package/PARITY.md +0 -481
  10. package/PERFORMANCE.md +0 -227
  11. package/REFINEMENT-NOTES.md +0 -50
  12. package/THEME-AUDIT.md +0 -174
  13. package/dashforge-tw-1.0.0.tgz +0 -0
  14. package/eslint.config.mjs +0 -62
  15. package/project.json +0 -15
  16. package/rollup.config.cjs +0 -16
  17. package/src/components/Accordion/Accordion.test.tsx +0 -95
  18. package/src/components/Accordion/Accordion.tsx +0 -97
  19. package/src/components/Accordion/accordion.types.ts +0 -66
  20. package/src/components/Accordion/accordion.variants.ts +0 -32
  21. package/src/components/Alert/Alert.test.tsx +0 -302
  22. package/src/components/Alert/Alert.tsx +0 -186
  23. package/src/components/Alert/alert.types.ts +0 -144
  24. package/src/components/Alert/alert.variants.ts +0 -71
  25. package/src/components/AppShell/AppShell.test.tsx +0 -223
  26. package/src/components/AppShell/AppShell.tsx +0 -239
  27. package/src/components/AppShell/appShell.types.ts +0 -49
  28. package/src/components/AppShell/appShell.variants.ts +0 -54
  29. package/src/components/AspectRatio/AspectRatio.test.tsx +0 -173
  30. package/src/components/AspectRatio/AspectRatio.tsx +0 -73
  31. package/src/components/AspectRatio/aspectRatio.types.ts +0 -54
  32. package/src/components/Autocomplete/Autocomplete.perf.test.tsx +0 -225
  33. package/src/components/Autocomplete/Autocomplete.test.tsx +0 -556
  34. package/src/components/Autocomplete/Autocomplete.tsx +0 -1069
  35. package/src/components/Autocomplete/autocomplete.types.ts +0 -198
  36. package/src/components/Autocomplete/autocomplete.variants.ts +0 -141
  37. package/src/components/Avatar/Avatar.test.tsx +0 -287
  38. package/src/components/Avatar/Avatar.tsx +0 -304
  39. package/src/components/Avatar/avatar.types.ts +0 -205
  40. package/src/components/Avatar/avatar.variants.ts +0 -194
  41. package/src/components/Badge/Badge.test.tsx +0 -385
  42. package/src/components/Badge/Badge.tsx +0 -174
  43. package/src/components/Badge/badge.types.ts +0 -154
  44. package/src/components/Badge/badge.variants.ts +0 -161
  45. package/src/components/Box/Box.test.tsx +0 -391
  46. package/src/components/Box/Box.tsx +0 -112
  47. package/src/components/Box/box.types.ts +0 -116
  48. package/src/components/Box/box.variants.ts +0 -230
  49. package/src/components/Breadcrumbs/Breadcrumbs.perf.test.tsx +0 -128
  50. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +0 -231
  51. package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -203
  52. package/src/components/Breadcrumbs/breadcrumbs.types.ts +0 -87
  53. package/src/components/Breadcrumbs/breadcrumbs.variants.ts +0 -54
  54. package/src/components/Button/Button.test.tsx +0 -204
  55. package/src/components/Button/Button.tsx +0 -151
  56. package/src/components/Button/button.types.ts +0 -110
  57. package/src/components/Button/button.variants.ts +0 -159
  58. package/src/components/Calendar/Calendar.test.tsx +0 -75
  59. package/src/components/Calendar/Calendar.tsx +0 -264
  60. package/src/components/Calendar/calendar.types.ts +0 -65
  61. package/src/components/Calendar/calendar.variants.ts +0 -64
  62. package/src/components/Card/Card.test.tsx +0 -291
  63. package/src/components/Card/Card.tsx +0 -241
  64. package/src/components/Card/card.types.ts +0 -132
  65. package/src/components/Checkbox/Checkbox.test.tsx +0 -146
  66. package/src/components/Checkbox/Checkbox.tsx +0 -286
  67. package/src/components/Checkbox/checkbox.types.ts +0 -88
  68. package/src/components/Checkbox/checkbox.variants.ts +0 -68
  69. package/src/components/Chip/Chip.test.tsx +0 -316
  70. package/src/components/Chip/Chip.tsx +0 -224
  71. package/src/components/Chip/chip.types.ts +0 -128
  72. package/src/components/Chip/chip.variants.ts +0 -173
  73. package/src/components/ConfirmDialog/ConfirmDialog.perf.test.tsx +0 -172
  74. package/src/components/ConfirmDialog/ConfirmDialog.test.tsx +0 -311
  75. package/src/components/ConfirmDialog/ConfirmDialog.tsx +0 -252
  76. package/src/components/ConfirmDialog/confirmDialog.types.ts +0 -70
  77. package/src/components/ConfirmDialog/confirmDialog.variants.ts +0 -76
  78. package/src/components/Container/Container.test.tsx +0 -209
  79. package/src/components/Container/Container.tsx +0 -74
  80. package/src/components/Container/container.types.ts +0 -45
  81. package/src/components/Container/container.variants.ts +0 -81
  82. package/src/components/DataGrid/DataGrid.perf.test.tsx +0 -114
  83. package/src/components/DataGrid/DataGrid.test.tsx +0 -1153
  84. package/src/components/DataGrid/DataGrid.tsx +0 -1282
  85. package/src/components/DataGrid/dataGrid.types.ts +0 -238
  86. package/src/components/DataGrid/dataGrid.variants.ts +0 -152
  87. package/src/components/DataGrid/filters/ColumnFilters.test.tsx +0 -330
  88. package/src/components/DataGrid/filters/ColumnFilters.tsx +0 -456
  89. package/src/components/DataGrid/reorder/useColumnReorder.test.ts +0 -130
  90. package/src/components/DataGrid/reorder/useColumnReorder.ts +0 -144
  91. package/src/components/DataGrid/resize/useColumnResize.test.ts +0 -144
  92. package/src/components/DataGrid/resize/useColumnResize.ts +0 -135
  93. package/src/components/DataGrid/visibility/ColumnVisibilityMenu.tsx +0 -186
  94. package/src/components/DatePicker/DatePicker.test.tsx +0 -76
  95. package/src/components/DatePicker/DatePicker.tsx +0 -305
  96. package/src/components/DatePicker/datePicker.types.ts +0 -77
  97. package/src/components/DatePicker/datePicker.variants.ts +0 -50
  98. package/src/components/DateRangePicker/DateRangePicker.test.tsx +0 -92
  99. package/src/components/DateRangePicker/DateRangePicker.tsx +0 -510
  100. package/src/components/DateRangePicker/dateRangePicker.types.ts +0 -74
  101. package/src/components/DateRangePicker/dateRangePicker.variants.ts +0 -101
  102. package/src/components/DateTimePicker/DateTimePicker.test.tsx +0 -78
  103. package/src/components/DateTimePicker/DateTimePicker.tsx +0 -347
  104. package/src/components/DateTimePicker/dateTimePicker.types.ts +0 -79
  105. package/src/components/DateTimePicker/dateTimePicker.variants.ts +0 -55
  106. package/src/components/Dialog/Dialog.test.tsx +0 -96
  107. package/src/components/Dialog/Dialog.tsx +0 -102
  108. package/src/components/Dialog/dialog.types.ts +0 -62
  109. package/src/components/Dialog/dialog.variants.ts +0 -66
  110. package/src/components/Divider/Divider.test.tsx +0 -243
  111. package/src/components/Divider/Divider.tsx +0 -140
  112. package/src/components/Divider/divider.types.ts +0 -52
  113. package/src/components/Divider/divider.variants.ts +0 -116
  114. package/src/components/Grid/Grid.test.tsx +0 -321
  115. package/src/components/Grid/Grid.tsx +0 -148
  116. package/src/components/Grid/grid.types.ts +0 -112
  117. package/src/components/Grid/grid.variants.ts +0 -133
  118. package/src/components/IconButton/IconButton.test.tsx +0 -367
  119. package/src/components/IconButton/IconButton.tsx +0 -159
  120. package/src/components/IconButton/iconButton.types.ts +0 -106
  121. package/src/components/IconButton/iconButton.variants.ts +0 -31
  122. package/src/components/LeftNav/LeftNav.perf.test.tsx +0 -172
  123. package/src/components/LeftNav/LeftNav.test.tsx +0 -302
  124. package/src/components/LeftNav/LeftNav.tsx +0 -330
  125. package/src/components/LeftNav/leftNav.types.ts +0 -120
  126. package/src/components/LeftNav/leftNav.variants.ts +0 -107
  127. package/src/components/Menu/Menu.test.tsx +0 -408
  128. package/src/components/Menu/Menu.tsx +0 -335
  129. package/src/components/Menu/menu.types.ts +0 -221
  130. package/src/components/Menu/menu.variants.ts +0 -132
  131. package/src/components/NumberField/NumberField.test.tsx +0 -83
  132. package/src/components/NumberField/NumberField.tsx +0 -321
  133. package/src/components/NumberField/numberField.types.ts +0 -72
  134. package/src/components/NumberField/numberField.variants.ts +0 -94
  135. package/src/components/OTPField/OTPField.test.tsx +0 -121
  136. package/src/components/OTPField/OTPField.tsx +0 -250
  137. package/src/components/OTPField/otpField.types.ts +0 -58
  138. package/src/components/OTPField/otpField.variants.ts +0 -72
  139. package/src/components/Pagination/Pagination.test.tsx +0 -314
  140. package/src/components/Pagination/Pagination.tsx +0 -277
  141. package/src/components/Pagination/pagination.helpers.ts +0 -102
  142. package/src/components/Pagination/pagination.types.ts +0 -117
  143. package/src/components/Pagination/pagination.variants.ts +0 -117
  144. package/src/components/Popover/Popover.test.tsx +0 -72
  145. package/src/components/Popover/Popover.tsx +0 -55
  146. package/src/components/Popover/popover.types.ts +0 -42
  147. package/src/components/Popover/popover.variants.ts +0 -24
  148. package/src/components/RadioGroup/RadioGroup.test.tsx +0 -140
  149. package/src/components/RadioGroup/RadioGroup.tsx +0 -283
  150. package/src/components/RadioGroup/radioGroup.types.ts +0 -85
  151. package/src/components/RadioGroup/radioGroup.variants.ts +0 -87
  152. package/src/components/Skeleton/Skeleton.test.tsx +0 -127
  153. package/src/components/Skeleton/Skeleton.tsx +0 -49
  154. package/src/components/Skeleton/skeleton.types.ts +0 -59
  155. package/src/components/Skeleton/skeleton.variants.ts +0 -87
  156. package/src/components/Snackbar/Snackbar.perf.test.tsx +0 -144
  157. package/src/components/Snackbar/Snackbar.test.tsx +0 -327
  158. package/src/components/Snackbar/Snackbar.tsx +0 -316
  159. package/src/components/Snackbar/snackbar.types.ts +0 -127
  160. package/src/components/Snackbar/snackbar.variants.ts +0 -81
  161. package/src/components/Spinner/Spinner.test.tsx +0 -199
  162. package/src/components/Spinner/Spinner.tsx +0 -158
  163. package/src/components/Spinner/spinner.types.ts +0 -113
  164. package/src/components/Spinner/spinner.variants.ts +0 -83
  165. package/src/components/Stack/Stack.test.tsx +0 -309
  166. package/src/components/Stack/Stack.tsx +0 -115
  167. package/src/components/Stack/stack.types.ts +0 -68
  168. package/src/components/Stack/stack.variants.ts +0 -80
  169. package/src/components/Switch/Switch.test.tsx +0 -131
  170. package/src/components/Switch/Switch.tsx +0 -158
  171. package/src/components/Switch/switch.types.ts +0 -36
  172. package/src/components/Switch/switch.variants.ts +0 -70
  173. package/src/components/Table/Table.perf.test.tsx +0 -81
  174. package/src/components/Table/Table.test.tsx +0 -674
  175. package/src/components/Table/Table.tsx +0 -863
  176. package/src/components/Table/cells/RenderButton.tsx +0 -23
  177. package/src/components/Table/cells/RenderChip.tsx +0 -37
  178. package/src/components/Table/cells/RenderText.tsx +0 -37
  179. package/src/components/Table/cells/RenderTwoLine.tsx +0 -34
  180. package/src/components/Table/cells/RowActionsMenu.tsx +0 -147
  181. package/src/components/Table/cells/cells.test.tsx +0 -247
  182. package/src/components/Table/cells/index.ts +0 -14
  183. package/src/components/Table/table.types.ts +0 -438
  184. package/src/components/Table/table.variants.ts +0 -207
  185. package/src/components/Tabs/Tabs.test.tsx +0 -145
  186. package/src/components/Tabs/Tabs.tsx +0 -77
  187. package/src/components/Tabs/tabs.types.ts +0 -55
  188. package/src/components/Tabs/tabs.variants.ts +0 -69
  189. package/src/components/Tabs/useTabs.ts +0 -167
  190. package/src/components/TextField/TextField.test.tsx +0 -198
  191. package/src/components/TextField/TextField.tsx +0 -245
  192. package/src/components/TextField/textField.types.ts +0 -90
  193. package/src/components/TextField/textField.variants.ts +0 -105
  194. package/src/components/Textarea/Textarea.test.tsx +0 -75
  195. package/src/components/Textarea/Textarea.tsx +0 -190
  196. package/src/components/Textarea/textarea.types.ts +0 -60
  197. package/src/components/Textarea/textarea.variants.ts +0 -85
  198. package/src/components/TimePicker/TimePicker.test.tsx +0 -65
  199. package/src/components/TimePicker/TimePicker.tsx +0 -274
  200. package/src/components/TimePicker/timePicker.types.ts +0 -69
  201. package/src/components/TimePicker/timePicker.variants.ts +0 -53
  202. package/src/components/Tooltip/Tooltip.test.tsx +0 -73
  203. package/src/components/Tooltip/Tooltip.tsx +0 -70
  204. package/src/components/Tooltip/tooltip.types.ts +0 -44
  205. package/src/components/Tooltip/tooltip.variants.ts +0 -28
  206. package/src/components/TopBar/TopBar.test.tsx +0 -129
  207. package/src/components/TopBar/TopBar.tsx +0 -66
  208. package/src/components/TopBar/topBar.types.ts +0 -42
  209. package/src/components/TopBar/topBar.variants.ts +0 -38
  210. package/src/components/Typography/Typography.test.tsx +0 -247
  211. package/src/components/Typography/Typography.tsx +0 -112
  212. package/src/components/Typography/typography.types.ts +0 -65
  213. package/src/components/Typography/typography.variants.ts +0 -130
  214. package/src/components/VisuallyHidden/VisuallyHidden.test.tsx +0 -86
  215. package/src/components/VisuallyHidden/VisuallyHidden.tsx +0 -59
  216. package/src/components/VisuallyHidden/visuallyHidden.types.ts +0 -45
  217. package/src/components/_shared/data/getNestedValue.test.ts +0 -50
  218. package/src/components/_shared/data/getNestedValue.ts +0 -32
  219. package/src/components/_shared/data/useColumnAutoDetect.test.ts +0 -123
  220. package/src/components/_shared/data/useColumnAutoDetect.ts +0 -100
  221. package/src/components/_shared/data/useControllableState.ts +0 -48
  222. package/src/components/_shared/data/useDebouncedValue.ts +0 -24
  223. package/src/components/_shared/data/useTableFilter.test.ts +0 -166
  224. package/src/components/_shared/data/useTableFilter.ts +0 -118
  225. package/src/components/_shared/data/useTableSearch.test.ts +0 -115
  226. package/src/components/_shared/data/useTableSearch.ts +0 -66
  227. package/src/components/_shared/data/useTableSelection.test.ts +0 -100
  228. package/src/components/_shared/data/useTableSelection.ts +0 -100
  229. package/src/components/_shared/data/useTableSort.test.ts +0 -150
  230. package/src/components/_shared/data/useTableSort.ts +0 -141
  231. package/src/components/_shared/data/useVirtualizer.test.ts +0 -158
  232. package/src/components/_shared/data/useVirtualizer.ts +0 -199
  233. package/src/components/_shared/resolveValidationState.ts +0 -60
  234. package/src/components/_shared/severity/index.ts +0 -33
  235. package/src/components/_shared/severity/severity.types.ts +0 -50
  236. package/src/components/_shared/severity/severityIcons.tsx +0 -104
  237. package/src/components/_shared/severity/severityVariants.test.ts +0 -136
  238. package/src/components/_shared/severity/severityVariants.ts +0 -115
  239. package/src/components/_shared/themeIdentity.test.ts +0 -113
  240. package/src/hooks/useAccessState.spec.tsx +0 -161
  241. package/src/hooks/useAccessState.ts +0 -81
  242. package/src/index.ts +0 -550
  243. package/src/utils/cn.spec.ts +0 -16
  244. package/src/utils/cn.ts +0 -29
  245. package/test-output/vitest/coverage/base.css +0 -224
  246. package/test-output/vitest/coverage/block-navigation.js +0 -87
  247. package/test-output/vitest/coverage/clover.xml +0 -2418
  248. package/test-output/vitest/coverage/coverage-final.json +0 -89
  249. package/test-output/vitest/coverage/favicon.png +0 -0
  250. package/test-output/vitest/coverage/index.html +0 -746
  251. package/test-output/vitest/coverage/prettify.css +0 -1
  252. package/test-output/vitest/coverage/prettify.js +0 -2
  253. package/test-output/vitest/coverage/sort-arrow-sprite.png +0 -0
  254. package/test-output/vitest/coverage/sorter.js +0 -210
  255. package/test-output/vitest/coverage/src/components/Accordion/Accordion.tsx.html +0 -376
  256. package/test-output/vitest/coverage/src/components/Accordion/accordion.variants.ts.html +0 -181
  257. package/test-output/vitest/coverage/src/components/Accordion/index.html +0 -131
  258. package/test-output/vitest/coverage/src/components/AppShell/AppShell.tsx.html +0 -802
  259. package/test-output/vitest/coverage/src/components/AppShell/appShell.variants.ts.html +0 -247
  260. package/test-output/vitest/coverage/src/components/AppShell/index.html +0 -131
  261. package/test-output/vitest/coverage/src/components/AspectRatio/AspectRatio.tsx.html +0 -304
  262. package/test-output/vitest/coverage/src/components/AspectRatio/index.html +0 -116
  263. package/test-output/vitest/coverage/src/components/Autocomplete/Autocomplete.tsx.html +0 -3292
  264. package/test-output/vitest/coverage/src/components/Autocomplete/autocomplete.variants.ts.html +0 -508
  265. package/test-output/vitest/coverage/src/components/Autocomplete/index.html +0 -131
  266. package/test-output/vitest/coverage/src/components/Box/Box.tsx.html +0 -334
  267. package/test-output/vitest/coverage/src/components/Box/box.variants.ts.html +0 -775
  268. package/test-output/vitest/coverage/src/components/Box/index.html +0 -131
  269. package/test-output/vitest/coverage/src/components/Breadcrumbs/Breadcrumbs.tsx.html +0 -694
  270. package/test-output/vitest/coverage/src/components/Breadcrumbs/breadcrumbs.variants.ts.html +0 -247
  271. package/test-output/vitest/coverage/src/components/Breadcrumbs/index.html +0 -131
  272. package/test-output/vitest/coverage/src/components/Button/Button.tsx.html +0 -535
  273. package/test-output/vitest/coverage/src/components/Button/button.variants.ts.html +0 -562
  274. package/test-output/vitest/coverage/src/components/Button/index.html +0 -131
  275. package/test-output/vitest/coverage/src/components/Checkbox/Checkbox.tsx.html +0 -943
  276. package/test-output/vitest/coverage/src/components/Checkbox/checkbox.variants.ts.html +0 -289
  277. package/test-output/vitest/coverage/src/components/Checkbox/index.html +0 -131
  278. package/test-output/vitest/coverage/src/components/ConfirmDialog/ConfirmDialog.tsx.html +0 -841
  279. package/test-output/vitest/coverage/src/components/ConfirmDialog/confirmDialog.variants.ts.html +0 -313
  280. package/test-output/vitest/coverage/src/components/ConfirmDialog/index.html +0 -131
  281. package/test-output/vitest/coverage/src/components/Container/Container.tsx.html +0 -307
  282. package/test-output/vitest/coverage/src/components/Container/container.variants.ts.html +0 -328
  283. package/test-output/vitest/coverage/src/components/Container/index.html +0 -131
  284. package/test-output/vitest/coverage/src/components/DataGrid/DataGrid.tsx.html +0 -3937
  285. package/test-output/vitest/coverage/src/components/DataGrid/dataGrid.variants.ts.html +0 -541
  286. package/test-output/vitest/coverage/src/components/DataGrid/filters/ColumnFilters.tsx.html +0 -1453
  287. package/test-output/vitest/coverage/src/components/DataGrid/filters/index.html +0 -116
  288. package/test-output/vitest/coverage/src/components/DataGrid/index.html +0 -131
  289. package/test-output/vitest/coverage/src/components/DataGrid/reorder/index.html +0 -116
  290. package/test-output/vitest/coverage/src/components/DataGrid/reorder/useColumnReorder.ts.html +0 -517
  291. package/test-output/vitest/coverage/src/components/DataGrid/resize/index.html +0 -116
  292. package/test-output/vitest/coverage/src/components/DataGrid/resize/useColumnResize.ts.html +0 -490
  293. package/test-output/vitest/coverage/src/components/DataGrid/visibility/ColumnVisibilityMenu.tsx.html +0 -592
  294. package/test-output/vitest/coverage/src/components/DataGrid/visibility/index.html +0 -116
  295. package/test-output/vitest/coverage/src/components/DateTimePicker/DateTimePicker.tsx.html +0 -1042
  296. package/test-output/vitest/coverage/src/components/DateTimePicker/dateTimePicker.variants.ts.html +0 -337
  297. package/test-output/vitest/coverage/src/components/DateTimePicker/index.html +0 -131
  298. package/test-output/vitest/coverage/src/components/Dialog/Dialog.tsx.html +0 -391
  299. package/test-output/vitest/coverage/src/components/Dialog/dialog.variants.ts.html +0 -283
  300. package/test-output/vitest/coverage/src/components/Dialog/index.html +0 -131
  301. package/test-output/vitest/coverage/src/components/Divider/Divider.tsx.html +0 -505
  302. package/test-output/vitest/coverage/src/components/Divider/divider.variants.ts.html +0 -433
  303. package/test-output/vitest/coverage/src/components/Divider/index.html +0 -131
  304. package/test-output/vitest/coverage/src/components/Grid/Grid.tsx.html +0 -529
  305. package/test-output/vitest/coverage/src/components/Grid/grid.variants.ts.html +0 -484
  306. package/test-output/vitest/coverage/src/components/Grid/index.html +0 -131
  307. package/test-output/vitest/coverage/src/components/LeftNav/LeftNav.tsx.html +0 -1075
  308. package/test-output/vitest/coverage/src/components/LeftNav/index.html +0 -131
  309. package/test-output/vitest/coverage/src/components/LeftNav/leftNav.variants.ts.html +0 -406
  310. package/test-output/vitest/coverage/src/components/NumberField/NumberField.tsx.html +0 -1048
  311. package/test-output/vitest/coverage/src/components/NumberField/index.html +0 -131
  312. package/test-output/vitest/coverage/src/components/NumberField/numberField.variants.ts.html +0 -367
  313. package/test-output/vitest/coverage/src/components/OTPField/OTPField.tsx.html +0 -835
  314. package/test-output/vitest/coverage/src/components/OTPField/index.html +0 -131
  315. package/test-output/vitest/coverage/src/components/OTPField/otpField.variants.ts.html +0 -301
  316. package/test-output/vitest/coverage/src/components/Pagination/Pagination.tsx.html +0 -916
  317. package/test-output/vitest/coverage/src/components/Pagination/index.html +0 -146
  318. package/test-output/vitest/coverage/src/components/Pagination/pagination.helpers.ts.html +0 -391
  319. package/test-output/vitest/coverage/src/components/Pagination/pagination.variants.ts.html +0 -436
  320. package/test-output/vitest/coverage/src/components/Popover/Popover.tsx.html +0 -250
  321. package/test-output/vitest/coverage/src/components/Popover/index.html +0 -131
  322. package/test-output/vitest/coverage/src/components/Popover/popover.variants.ts.html +0 -157
  323. package/test-output/vitest/coverage/src/components/RadioGroup/RadioGroup.tsx.html +0 -934
  324. package/test-output/vitest/coverage/src/components/RadioGroup/index.html +0 -131
  325. package/test-output/vitest/coverage/src/components/RadioGroup/radioGroup.variants.ts.html +0 -346
  326. package/test-output/vitest/coverage/src/components/Skeleton/Skeleton.tsx.html +0 -232
  327. package/test-output/vitest/coverage/src/components/Skeleton/index.html +0 -131
  328. package/test-output/vitest/coverage/src/components/Skeleton/skeleton.variants.ts.html +0 -346
  329. package/test-output/vitest/coverage/src/components/Snackbar/Snackbar.tsx.html +0 -979
  330. package/test-output/vitest/coverage/src/components/Snackbar/index.html +0 -131
  331. package/test-output/vitest/coverage/src/components/Snackbar/snackbar.variants.ts.html +0 -307
  332. package/test-output/vitest/coverage/src/components/Stack/Stack.tsx.html +0 -430
  333. package/test-output/vitest/coverage/src/components/Stack/index.html +0 -131
  334. package/test-output/vitest/coverage/src/components/Stack/stack.variants.ts.html +0 -325
  335. package/test-output/vitest/coverage/src/components/Switch/Switch.tsx.html +0 -559
  336. package/test-output/vitest/coverage/src/components/Switch/index.html +0 -131
  337. package/test-output/vitest/coverage/src/components/Switch/switch.variants.ts.html +0 -295
  338. package/test-output/vitest/coverage/src/components/Table/Table.tsx.html +0 -2677
  339. package/test-output/vitest/coverage/src/components/Table/cells/RenderButton.tsx.html +0 -154
  340. package/test-output/vitest/coverage/src/components/Table/cells/RenderChip.tsx.html +0 -385
  341. package/test-output/vitest/coverage/src/components/Table/cells/RenderText.tsx.html +0 -196
  342. package/test-output/vitest/coverage/src/components/Table/cells/RenderTwoLine.tsx.html +0 -187
  343. package/test-output/vitest/coverage/src/components/Table/cells/RowActionsMenu.tsx.html +0 -526
  344. package/test-output/vitest/coverage/src/components/Table/cells/index.html +0 -191
  345. package/test-output/vitest/coverage/src/components/Table/cells/index.ts.html +0 -127
  346. package/test-output/vitest/coverage/src/components/Table/index.html +0 -131
  347. package/test-output/vitest/coverage/src/components/Table/table.variants.ts.html +0 -706
  348. package/test-output/vitest/coverage/src/components/Tabs/Tabs.tsx.html +0 -283
  349. package/test-output/vitest/coverage/src/components/Tabs/index.html +0 -131
  350. package/test-output/vitest/coverage/src/components/Tabs/tabs.variants.ts.html +0 -292
  351. package/test-output/vitest/coverage/src/components/TextField/TextField.tsx.html +0 -820
  352. package/test-output/vitest/coverage/src/components/TextField/index.html +0 -131
  353. package/test-output/vitest/coverage/src/components/TextField/textField.variants.ts.html +0 -400
  354. package/test-output/vitest/coverage/src/components/Textarea/Textarea.tsx.html +0 -655
  355. package/test-output/vitest/coverage/src/components/Textarea/index.html +0 -131
  356. package/test-output/vitest/coverage/src/components/Textarea/textarea.variants.ts.html +0 -340
  357. package/test-output/vitest/coverage/src/components/Tooltip/Tooltip.tsx.html +0 -295
  358. package/test-output/vitest/coverage/src/components/Tooltip/index.html +0 -131
  359. package/test-output/vitest/coverage/src/components/Tooltip/tooltip.variants.ts.html +0 -169
  360. package/test-output/vitest/coverage/src/components/TopBar/TopBar.tsx.html +0 -283
  361. package/test-output/vitest/coverage/src/components/TopBar/index.html +0 -131
  362. package/test-output/vitest/coverage/src/components/TopBar/topBar.variants.ts.html +0 -199
  363. package/test-output/vitest/coverage/src/components/Typography/Typography.tsx.html +0 -421
  364. package/test-output/vitest/coverage/src/components/Typography/index.html +0 -131
  365. package/test-output/vitest/coverage/src/components/Typography/typography.variants.ts.html +0 -436
  366. package/test-output/vitest/coverage/src/components/VisuallyHidden/VisuallyHidden.tsx.html +0 -262
  367. package/test-output/vitest/coverage/src/components/VisuallyHidden/index.html +0 -116
  368. package/test-output/vitest/coverage/src/components/_shared/data/getNestedValue.ts.html +0 -181
  369. package/test-output/vitest/coverage/src/components/_shared/data/index.html +0 -236
  370. package/test-output/vitest/coverage/src/components/_shared/data/useColumnAutoDetect.ts.html +0 -385
  371. package/test-output/vitest/coverage/src/components/_shared/data/useControllableState.ts.html +0 -229
  372. package/test-output/vitest/coverage/src/components/_shared/data/useDebouncedValue.ts.html +0 -157
  373. package/test-output/vitest/coverage/src/components/_shared/data/useTableFilter.ts.html +0 -439
  374. package/test-output/vitest/coverage/src/components/_shared/data/useTableSearch.ts.html +0 -283
  375. package/test-output/vitest/coverage/src/components/_shared/data/useTableSelection.ts.html +0 -385
  376. package/test-output/vitest/coverage/src/components/_shared/data/useTableSort.ts.html +0 -508
  377. package/test-output/vitest/coverage/src/components/_shared/data/useVirtualizer.ts.html +0 -682
  378. package/test-output/vitest/coverage/src/components/_shared/index.html +0 -116
  379. package/test-output/vitest/coverage/src/components/_shared/resolveValidationState.ts.html +0 -265
  380. package/test-output/vitest/coverage/src/hooks/index.html +0 -116
  381. package/test-output/vitest/coverage/src/hooks/useAccessState.ts.html +0 -328
  382. package/test-output/vitest/coverage/src/index.html +0 -116
  383. package/test-output/vitest/coverage/src/index.ts.html +0 -1153
  384. package/test-output/vitest/coverage/src/utils/cn.ts.html +0 -172
  385. package/test-output/vitest/coverage/src/utils/index.html +0 -116
  386. package/tsconfig.json +0 -13
  387. package/tsconfig.lib.json +0 -58
  388. package/tsconfig.spec.json +0 -34
  389. package/vite.config.ts +0 -33
  390. package/vitest.config.mts +0 -29
@@ -1,335 +0,0 @@
1
- import {
2
- createContext,
3
- forwardRef,
4
- memo,
5
- useContext,
6
- type ReactNode,
7
- } from 'react';
8
- import * as RadixMenu from '@radix-ui/react-dropdown-menu';
9
- import { DashFormContext, useEngineVisibility } from '@dashforge/ui-core';
10
- import { cn } from '../../utils/cn.js';
11
- import { useAccessState } from '../../hooks/useAccessState.js';
12
- import { menuVariants, placementToRadix } from './menu.variants.js';
13
- import type {
14
- MenuContentProps,
15
- MenuItemProps,
16
- MenuLabelProps,
17
- MenuProps,
18
- MenuSeparatorProps,
19
- MenuSkeletonProps,
20
- MenuTriggerProps,
21
- } from './menu.types.js';
22
-
23
- // ─── Context ─────────────────────────────────────────────────────
24
-
25
- /**
26
- * Internal Menu context — propagates the `closeOnItemClick` flag
27
- * down to `<MenuItem>` so each item knows whether to suppress the
28
- * default Radix close-on-select behaviour.
29
- *
30
- * @internal
31
- */
32
- interface MenuCtx {
33
- closeOnItemClick: boolean;
34
- }
35
-
36
- const MenuContext = createContext<MenuCtx>({ closeOnItemClick: true });
37
-
38
- // ─── Menu (Root provider) ────────────────────────────────────────
39
-
40
- /**
41
- * `<Menu>` — top-level provider that wraps Radix `DropdownMenu.Root`.
42
- *
43
- * Compound API:
44
- * ```tsx
45
- * <Menu>
46
- * <MenuTrigger>
47
- * <IconButton aria-label="Actions"><MoreIcon /></IconButton>
48
- * </MenuTrigger>
49
- * <MenuContent>
50
- * <MenuLabel>Actions</MenuLabel>
51
- * <MenuItem onClick={onEdit}>Edit</MenuItem>
52
- * <MenuSeparator />
53
- * <MenuItem color="danger" onClick={onDelete}>Delete</MenuItem>
54
- * </MenuContent>
55
- * </Menu>
56
- * ```
57
- *
58
- * Built on `@radix-ui/react-dropdown-menu` (purpose-built menu
59
- * primitive with full WAI-ARIA menu pattern + keyboard nav
60
- * + type-ahead + portal mount).
61
- *
62
- * Sub-menus and controlled selection mode are deliberately out of
63
- * scope for v1 (Sprint 4.4) — composable via Radix primitives if
64
- * needed via explicit sub-component opt-in (future).
65
- */
66
- export function Menu({
67
- children,
68
- open,
69
- defaultOpen,
70
- onOpenChange,
71
- closeOnItemClick = true,
72
- modal = false,
73
- }: MenuProps) {
74
- return (
75
- <MenuContext.Provider value={{ closeOnItemClick }}>
76
- <RadixMenu.Root
77
- open={open}
78
- defaultOpen={defaultOpen}
79
- onOpenChange={onOpenChange}
80
- modal={modal}
81
- >
82
- {children}
83
- </RadixMenu.Root>
84
- </MenuContext.Provider>
85
- );
86
- }
87
-
88
- // ─── MenuTrigger ─────────────────────────────────────────────────
89
-
90
- /**
91
- * `<MenuTrigger>` — the element that opens the menu.
92
- *
93
- * Always renders the immediate child via Radix Slot (`asChild`) — the
94
- * child receives the click handler + `aria-haspopup="menu"` +
95
- * `aria-expanded` reactive to open state. Pass any interactive
96
- * component as the child (`<IconButton>`, `<Button>`, `<Avatar>`,
97
- * custom).
98
- */
99
- export function MenuTrigger({ children }: MenuTriggerProps) {
100
- return <RadixMenu.Trigger asChild>{children}</RadixMenu.Trigger>;
101
- }
102
-
103
- // ─── MenuContent ─────────────────────────────────────────────────
104
-
105
- /**
106
- * `<MenuContent>` — the floating panel.
107
- *
108
- * Lazy-mounted via Radix Portal — zero DOM cost when the menu is
109
- * closed (one of the perf properties we inherit from Radix +
110
- * Atlaskit-style menus).
111
- *
112
- * Placement / sideOffset are read from the parent `<Menu>` via
113
- * Radix context — we re-pull the `<Menu>` props via the
114
- * `MenuContext` here.
115
- *
116
- * NB: placement is read from PARENT MENU PROPS, not from
117
- * `<MenuContent>` directly — keeps the floating-positioning API on
118
- * the provider where it belongs.
119
- */
120
- export const MenuContent = forwardRef<HTMLDivElement, MenuContentProps>(
121
- function MenuContent(props, ref) {
122
- const { children, minWidth, className, sx } = props;
123
- const v = menuVariants();
124
-
125
- // NB: we don't read `placement` from MenuContext (Radix Root
126
- // doesn't surface those props to descendants). Instead, the
127
- // consumer passes them on `<Menu>` and they're forwarded into
128
- // `<MenuContent>` via context-style props — to keep the API
129
- // simple, we DON'T expose placement on MenuContent itself; the
130
- // user sets it on Menu. We achieve this by reading the MenuProps
131
- // off the Radix-internal context… actually, simpler: we just
132
- // accept the default `bottom-start` from Radix and let the
133
- // consumer pass `side`/`align` via MenuContent if they want fine
134
- // control. For now, hardcode the most common defaults; Sprint
135
- // 4.4-bis can lift this if real demand emerges.
136
- const { side, align } = placementToRadix('bottom-start');
137
-
138
- return (
139
- <RadixMenu.Portal>
140
- <RadixMenu.Content
141
- ref={ref}
142
- side={side}
143
- align={align}
144
- sideOffset={6}
145
- style={
146
- minWidth !== undefined
147
- ? { minWidth: typeof minWidth === 'number' ? `${minWidth}px` : minWidth }
148
- : undefined
149
- }
150
- className={cn(v.content(), sx, className)}
151
- >
152
- {children}
153
- </RadixMenu.Content>
154
- </RadixMenu.Portal>
155
- );
156
- }
157
- );
158
-
159
- MenuContent.displayName = 'MenuContent';
160
-
161
- // ─── MenuItem ────────────────────────────────────────────────────
162
-
163
- /**
164
- * `<MenuItem>` — clickable row inside the menu.
165
- *
166
- * Memoized via `React.memo` for performance — re-renders only when
167
- * its own props change, not when sibling items mutate. Pattern
168
- * inspired by Atlaskit's `ButtonItem` optimization (one of the
169
- * reasons Atlaskit menus stay responsive on large item lists).
170
- *
171
- * Bridge integration:
172
- * - `access` — hides / disables the item per RBAC
173
- * - `visibleWhen` — engine-reactive predicate
174
- *
175
- * Both gates fold into the visible/disabled state; when the
176
- * predicate returns `false` OR `access` denies visibility, the
177
- * item renders `null` (does NOT occupy a row in the menu, vs
178
- * disabled which renders dimmed-but-present).
179
- */
180
- function MenuItemImpl(props: MenuItemProps) {
181
- const {
182
- children,
183
- onClick,
184
- icon,
185
- endIcon,
186
- disabled: disabledProp,
187
- selected,
188
- color = 'default',
189
- access,
190
- visibleWhen,
191
- className,
192
- sx,
193
- } = props;
194
-
195
- const { closeOnItemClick } = useContext(MenuContext);
196
-
197
- // Bridge hooks — always called (rules-of-hooks).
198
- const bridge = useContext(DashFormContext);
199
- const isBridgeVisible = useEngineVisibility(bridge?.engine, visibleWhen);
200
- const accessState = useAccessState(access);
201
-
202
- if (!isBridgeVisible || !accessState.visible) return null;
203
-
204
- const isDisabled =
205
- Boolean(disabledProp) || accessState.disabled || accessState.readonly;
206
-
207
- const v = menuVariants({ color, selected });
208
-
209
- return (
210
- <RadixMenu.Item
211
- disabled={isDisabled}
212
- onSelect={(e) => {
213
- if (isDisabled) return;
214
- // Suppress default close behaviour when the parent <Menu>
215
- // explicitly opted out (filter / multi-select pattern).
216
- if (!closeOnItemClick) e.preventDefault();
217
- onClick?.();
218
- }}
219
- className={cn(v.item(), sx, className)}
220
- >
221
- {icon != null && (
222
- <span className={v.itemIcon()}>{icon}</span>
223
- )}
224
- <span className={v.itemLabel()}>{children}</span>
225
- {endIcon != null && (
226
- <span className={v.itemEnd()}>{endIcon}</span>
227
- )}
228
- </RadixMenu.Item>
229
- );
230
- }
231
-
232
- export const MenuItem = memo(MenuItemImpl);
233
- MenuItem.displayName = 'MenuItem';
234
-
235
- // ─── MenuLabel ───────────────────────────────────────────────────
236
-
237
- /**
238
- * `<MenuLabel>` — non-interactive group heading.
239
- *
240
- * Renders via Radix `DropdownMenu.Label` which carries the right
241
- * ARIA semantics (`role="presentation"` — not announced as a
242
- * `menuitem` by screen readers).
243
- */
244
- export function MenuLabel({ children, className }: MenuLabelProps) {
245
- const v = menuVariants();
246
- return (
247
- <RadixMenu.Label className={cn(v.label(), className)}>
248
- {children}
249
- </RadixMenu.Label>
250
- );
251
- }
252
-
253
- // ─── MenuSeparator ───────────────────────────────────────────────
254
-
255
- /**
256
- * `<MenuSeparator>` — horizontal divider between items.
257
- *
258
- * Renders via Radix `DropdownMenu.Separator` — semantically correct
259
- * `role="separator"` for screen readers navigating the menu.
260
- */
261
- export function MenuSeparator({ className }: MenuSeparatorProps) {
262
- const v = menuVariants();
263
- return <RadixMenu.Separator className={cn(v.separator(), className)} />;
264
- }
265
-
266
- // ─── MenuSkeleton ────────────────────────────────────────────────
267
-
268
- /**
269
- * `<MenuSkeleton>` — Atlaskit-style loading state.
270
- *
271
- * Renders `count` placeholder rows (default 3) inside the menu while
272
- * real items are being fetched. Each row matches the geometry of a
273
- * real `<MenuItem>` (height, padding, icon slot) so the layout
274
- * doesn't jump when the real data arrives.
275
- *
276
- * `withHeading=true` adds a skeleton heading at the top, mimicking a
277
- * `<MenuLabel>` — useful when the real menu starts with a section
278
- * label.
279
- *
280
- * Pure visual — no animation overhead beyond Tailwind's
281
- * `animate-pulse` (motion-reduce-safe).
282
- *
283
- * @example
284
- * ```tsx
285
- * <MenuContent>
286
- * {isLoading ? (
287
- * <MenuSkeleton count={5} withHeading />
288
- * ) : (
289
- * items.map((it) => <MenuItem key={it.id}>{it.label}</MenuItem>)
290
- * )}
291
- * </MenuContent>
292
- * ```
293
- */
294
- export function MenuSkeleton({
295
- count = 3,
296
- withHeading = false,
297
- className,
298
- }: MenuSkeletonProps) {
299
- const v = menuVariants();
300
- return (
301
- <div
302
- role="presentation"
303
- aria-hidden="true"
304
- className={cn('animate-pulse motion-reduce:animate-none', className)}
305
- >
306
- {withHeading && (
307
- <div className={cn(v.label(), 'pointer-events-none')}>
308
- <span className="inline-block h-2.5 w-16 rounded-sm bg-neutral-200" />
309
- </div>
310
- )}
311
- {Array.from({ length: count }).map((_, i) => (
312
- <SkeletonRow key={i} />
313
- ))}
314
- </div>
315
- );
316
- }
317
-
318
- /**
319
- * One skeleton row — matches the dimensions of a real `<MenuItem>`
320
- * (icon slot + label slot). Internal — not exported.
321
- *
322
- * @internal
323
- */
324
- function SkeletonRow() {
325
- return (
326
- <div className="flex items-center gap-2 px-3 py-1.5 mx-1 my-0.5">
327
- <span className="inline-block h-4 w-4 shrink-0 rounded-sm bg-neutral-200" />
328
- <span className="inline-block h-3 flex-1 rounded-sm bg-neutral-200" />
329
- </div>
330
- );
331
- }
332
-
333
- // Re-export ReactNode type for downstream consumers — keeps the
334
- // import surface for the Menu module self-contained.
335
- export type { ReactNode };
@@ -1,221 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { ClassValue } from 'tailwind-variants';
3
- import type { Engine } from '@dashforge/ui-core';
4
- import type { AccessRequirement } from '@dashforge/rbac';
5
-
6
- /**
7
- * Placement of the menu content relative to the trigger. Maps 1:1 to
8
- * Radix DropdownMenu's `side` + `align` pair via the internal
9
- * helpers in Menu.tsx.
10
- */
11
- export type MenuPlacement =
12
- | 'top'
13
- | 'top-start'
14
- | 'top-end'
15
- | 'bottom'
16
- | 'bottom-start'
17
- | 'bottom-end'
18
- | 'left'
19
- | 'left-start'
20
- | 'left-end'
21
- | 'right'
22
- | 'right-start'
23
- | 'right-end';
24
-
25
- /**
26
- * Props for the top-level `<Menu>` provider.
27
- *
28
- * Wraps Radix `DropdownMenu.Root`. Provides open-state coordination
29
- * + closeOnItemClick context for descendant `<MenuItem>`s.
30
- */
31
- export interface MenuProps {
32
- /** Compound children: `<MenuTrigger>` + `<MenuContent>`. */
33
- children: ReactNode;
34
-
35
- /** Controlled open state. */
36
- open?: boolean;
37
-
38
- /** Default open state for uncontrolled mode. @default false */
39
- defaultOpen?: boolean;
40
-
41
- /** Open/close callback (controlled). */
42
- onOpenChange?: (open: boolean) => void;
43
-
44
- /**
45
- * Close the menu when an item is clicked. Set to `false` for
46
- * filter-style menus where item clicks should NOT dismiss (e.g.,
47
- * multi-select checkbox menus, sticky filter pills).
48
- * @default true
49
- */
50
- closeOnItemClick?: boolean;
51
-
52
- /**
53
- * Placement of the content relative to the trigger.
54
- * @default 'bottom-start'
55
- */
56
- placement?: MenuPlacement;
57
-
58
- /**
59
- * Pixel offset between trigger and content along the perpendicular
60
- * axis (e.g., for `placement='bottom-*'`, the vertical gap).
61
- * @default 6
62
- */
63
- sideOffset?: number;
64
-
65
- /**
66
- * Modal mode (Radix). When `true`, the menu blocks interaction with
67
- * the rest of the page (focus trap + outside scroll lock). When
68
- * `false`, dismissal is automatic on outside-click but the page
69
- * remains interactive. Default false matches the "lightweight
70
- * action menu" pattern.
71
- * @default false
72
- */
73
- modal?: boolean;
74
- }
75
-
76
- /**
77
- * Props for `<MenuTrigger>` — the element that opens the menu.
78
- *
79
- * Always renders via Radix Slot — the immediate child element
80
- * (typically `<IconButton>`, `<Button>`, or a custom interactive
81
- * component) receives the click handler, `aria-haspopup="menu"`,
82
- * and `aria-expanded` reactive to open state.
83
- */
84
- export interface MenuTriggerProps {
85
- /** The trigger element. */
86
- children: ReactNode;
87
- }
88
-
89
- /**
90
- * Props for `<MenuContent>` — the floating panel.
91
- *
92
- * Rendered through Radix `DropdownMenu.Portal`, lazily mounted only
93
- * when the menu is open (cost zero in DOM when closed).
94
- */
95
- export interface MenuContentProps {
96
- /** Items + labels + separators + skeletons. */
97
- children: ReactNode;
98
-
99
- /** CSS min-width for the menu panel. */
100
- minWidth?: number | string;
101
-
102
- /** Standard className — appended to the root via `cn()`. */
103
- className?: string;
104
-
105
- /** Root-element class shortcut. */
106
- sx?: ClassValue;
107
- }
108
-
109
- /**
110
- * Visual / semantic color of a `<MenuItem>`. `'danger'` highlights
111
- * destructive actions with a red hover state.
112
- */
113
- export type MenuItemColor = 'default' | 'danger';
114
-
115
- /**
116
- * Props for `<MenuItem>` — a clickable row inside the menu.
117
- *
118
- * Memoized (`React.memo`) for perf — re-renders only on prop change.
119
- * Pattern inspired by Atlaskit's ButtonItem optimization.
120
- */
121
- export interface MenuItemProps {
122
- /** Item label / content. */
123
- children: ReactNode;
124
-
125
- /**
126
- * Click handler. After firing, the menu closes (unless the parent
127
- * `<Menu closeOnItemClick={false}>` opts out).
128
- */
129
- onClick?: () => void;
130
-
131
- /** Leading icon slot. */
132
- icon?: ReactNode;
133
-
134
- /**
135
- * Trailing slot — typically a keyboard shortcut (`"⌘K"`), a
136
- * status hint, or a sub-menu chevron (when sub-menus arrive).
137
- */
138
- endIcon?: ReactNode;
139
-
140
- /** Disabled state — suppresses click + dims the item. */
141
- disabled?: boolean;
142
-
143
- /**
144
- * Visual hint of "active option" — for menus that show current
145
- * selection (e.g., theme picker). No controlled selection state
146
- * by design (v1) — purely visual.
147
- */
148
- selected?: boolean;
149
-
150
- /**
151
- * Color intent. `'danger'` highlights destructive actions
152
- * (Delete, Remove, Sign out) with a red hover tint.
153
- * @default 'default'
154
- */
155
- color?: MenuItemColor;
156
-
157
- /**
158
- * RBAC requirement. When the current subject doesn't satisfy it,
159
- * the item is hidden (or disabled per `onUnauthorized`).
160
- */
161
- access?: AccessRequirement;
162
-
163
- /**
164
- * Reactive visibility predicate. When `false`, the item renders
165
- * `null`. Use for state-driven menu items (e.g., "Restore" only
166
- * when an item was just deleted).
167
- */
168
- visibleWhen?: (engine: Engine) => boolean;
169
-
170
- /** Standard className. */
171
- className?: string;
172
-
173
- /** Root-element class shortcut. */
174
- sx?: ClassValue;
175
- }
176
-
177
- /**
178
- * Props for `<MenuLabel>` — non-interactive group heading.
179
- *
180
- * Rendered as `role="presentation"` so screen readers don't
181
- * announce it as a menuitem. Typical use: section dividers inside
182
- * a menu ("Workspace", "Account", "Help").
183
- */
184
- export interface MenuLabelProps {
185
- children: ReactNode;
186
- className?: string;
187
- }
188
-
189
- /**
190
- * Props for `<MenuSeparator>` — horizontal divider between items.
191
- */
192
- export interface MenuSeparatorProps {
193
- className?: string;
194
- }
195
-
196
- /**
197
- * Props for `<MenuSkeleton>` — Atlaskit-style loading state.
198
- *
199
- * Renders N placeholder rows that mimic the menu's item geometry,
200
- * giving the user immediate visual feedback while the real items
201
- * are being fetched (e.g., "Recent files" pulled from an API).
202
- * Strictly perceived-performance UX: no animation overhead beyond
203
- * Tailwind's `animate-pulse`.
204
- */
205
- export interface MenuSkeletonProps {
206
- /**
207
- * Number of skeleton item rows to render.
208
- * @default 3
209
- */
210
- count?: number;
211
-
212
- /**
213
- * Show a skeleton heading at the top of the list (matches the
214
- * height + indent of a real `<MenuLabel>`).
215
- * @default false
216
- */
217
- withHeading?: boolean;
218
-
219
- /** Standard className. */
220
- className?: string;
221
- }
@@ -1,132 +0,0 @@
1
- import { tv, type VariantProps } from 'tailwind-variants';
2
- import type { MenuPlacement } from './menu.types.js';
3
-
4
- /**
5
- * Tailwind-variants recipe for the Menu family.
6
- *
7
- * The whole menu family is styled here in one TV instance so the
8
- * compound rules (item color × selected × danger, etc.) live in
9
- * one source of truth.
10
- *
11
- * Slots:
12
- * - `content` — floating panel (DropdownMenu.Content)
13
- * - `item` — clickable row (DropdownMenu.Item)
14
- * - `itemIcon` — leading icon container
15
- * - `itemLabel` — text content slot
16
- * - `itemEnd` — trailing slot (shortcut hint, chevron, …)
17
- * - `label` — non-interactive heading (DropdownMenu.Label)
18
- * - `separator` — divider (DropdownMenu.Separator)
19
- * - `skeleton` — placeholder item (visual only, no Radix slot)
20
- */
21
- export const menuVariants = tv({
22
- slots: {
23
- content: [
24
- 'z-50 min-w-[180px] py-1.5',
25
- // Surface elevation: `bg-white` is hardcoded (does NOT
26
- // auto-invert via the dashforgePreset CSS-var swap), so we
27
- // pair it with `dark:bg-neutral-100` (target #171717 — one
28
- // elevation tier above page surface in dark mode). This is
29
- // Category B of THEME-AUDIT.md — must stay on the same
30
- // string literal so the whitelist regex matches.
31
- 'rounded-md border border-neutral-200 bg-white dark:bg-neutral-100 shadow-lg',
32
- // Smooth fade-in via Radix's data-state attributes. Motion-
33
- // reduce gated.
34
- 'data-[state=open]:animate-in data-[state=closed]:animate-out',
35
- 'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
36
- 'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',
37
- 'motion-reduce:animate-none motion-reduce:transition-none',
38
- // List reset (defensive — same defensive pattern as
39
- // Autocomplete listbox after the listbox-bullets fix in 1.0.1).
40
- 'list-none pl-0 m-0',
41
- ],
42
- item: [
43
- 'group relative flex cursor-pointer select-none items-center gap-2',
44
- 'px-3 py-1.5 mx-1 my-0.5',
45
- 'rounded-md text-sm text-neutral-900',
46
- 'outline-none',
47
- // Radix sets data-highlighted when the item is keyboard-focused
48
- // OR hovered. We anchor the active visual state to that single
49
- // attribute so keyboard + mouse interactions look identical.
50
- 'data-[highlighted]:bg-neutral-100',
51
- // Disabled (Radix sets data-disabled).
52
- 'data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none',
53
- 'transition-colors duration-100',
54
- 'motion-reduce:transition-none',
55
- ],
56
- itemIcon: 'shrink-0 inline-flex items-center justify-center w-4 h-4',
57
- itemLabel: 'flex-1 truncate',
58
- itemEnd: 'shrink-0 ml-3 inline-flex items-center text-xs text-neutral-500',
59
- label: [
60
- 'px-3 py-1 mx-1 mt-1 text-xs font-medium uppercase tracking-wide',
61
- 'text-neutral-500',
62
- ],
63
- separator: 'h-px my-1 mx-1 bg-neutral-200',
64
- skeleton: [
65
- 'flex items-center gap-2 px-3 py-1.5 mx-1 my-0.5',
66
- 'animate-pulse motion-reduce:animate-none',
67
- ],
68
- },
69
- variants: {
70
- /**
71
- * Item color intent. `'danger'` highlights destructive actions
72
- * (Delete, Sign out) with red bg on hover. Both bg and text
73
- * shift to the danger palette when the item is highlighted.
74
- */
75
- color: {
76
- default: {},
77
- danger: {
78
- item: [
79
- 'text-danger-700',
80
- // Hover + keyboard focus → red soft bg + saturated text.
81
- 'data-[highlighted]:bg-danger-50 data-[highlighted]:text-danger-800',
82
- // Dark mode: bg-danger-50 doesn't auto-invert (color
83
- // palettes don't), so we add the explicit dark variant.
84
- // The `text-danger-700` base also gets a dark counterpart
85
- // for readability on the dark surface.
86
- 'dark:text-danger-300',
87
- 'dark:data-[highlighted]:bg-danger-950 dark:data-[highlighted]:text-danger-200',
88
- ],
89
- itemIcon: 'text-danger-600 dark:text-danger-400',
90
- },
91
- },
92
- /**
93
- * Visual `selected` hint — adds a faint primary bg + the
94
- * leading edge gets a primary accent. Pure visual; v1 has no
95
- * controlled selection state machine.
96
- */
97
- selected: {
98
- true: {
99
- item: [
100
- 'bg-primary-50 text-primary-900',
101
- 'dark:bg-primary-950 dark:text-primary-100',
102
- ],
103
- itemIcon: 'text-primary-600 dark:text-primary-400',
104
- },
105
- },
106
- },
107
- defaultVariants: {
108
- color: 'default',
109
- },
110
- });
111
-
112
- export type MenuVariants = VariantProps<typeof menuVariants>;
113
-
114
- /**
115
- * Resolve a `MenuPlacement` enum to Radix `side` + `align` props.
116
- * Single source of truth so Menu.tsx doesn't need a switch statement.
117
- */
118
- export function placementToRadix(placement: MenuPlacement): {
119
- side: 'top' | 'right' | 'bottom' | 'left';
120
- align: 'start' | 'center' | 'end';
121
- } {
122
- // The format is `<side>` or `<side>-<align>`. Center is the default
123
- // when no `-start` / `-end` suffix is present.
124
- const [side, alignSuffix] = placement.split('-') as [
125
- 'top' | 'right' | 'bottom' | 'left',
126
- 'start' | 'end' | undefined,
127
- ];
128
- return {
129
- side,
130
- align: alignSuffix ?? 'center',
131
- };
132
- }