@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,76 +0,0 @@
1
- import { tv, type VariantProps } from 'tailwind-variants';
2
-
3
- /**
4
- * Tailwind-variants recipe for `<ConfirmDialog>`.
5
- *
6
- * Built on the native HTML `<dialog>` element + `showModal()`, which
7
- * gives us focus-trap, Escape handling, and `::backdrop` pseudo-element
8
- * for free. The styling here is for the dialog body — the backdrop is
9
- * styled via the `::backdrop` selector inside the dialog rule.
10
- *
11
- * Slots:
12
- * - `backdrop` — semi-opaque overlay (`::backdrop` pseudo)
13
- * - `dialog` — the modal box
14
- * - `title` — modal heading
15
- * - `body` — message text
16
- * - `actions` — bottom button row
17
- * - `confirmButton` — primary action
18
- * - `cancelButton` — secondary action
19
- */
20
- export const confirmDialogVariants = tv({
21
- slots: {
22
- backdrop: 'backdrop:bg-black/40 backdrop:backdrop-blur-sm',
23
- dialog: [
24
- 'rounded-lg bg-neutral-50 text-neutral-900 shadow-xl',
25
- 'border border-neutral-200',
26
- 'p-0 max-w-md w-[min(28rem,calc(100vw-2rem))]',
27
- 'open:flex open:flex-col',
28
- // Native <dialog> defaults to centered; reinforce for older browsers.
29
- 'mx-auto my-auto',
30
- 'focus:outline-none',
31
- ],
32
- title:
33
- 'px-5 pt-5 pb-2 text-lg font-semibold text-neutral-900 leading-tight',
34
- body: 'px-5 py-2 text-sm text-neutral-700 leading-relaxed',
35
- actions:
36
- 'px-5 py-4 mt-2 flex justify-end gap-2 border-t border-neutral-200',
37
- confirmButton: [
38
- 'inline-flex items-center justify-center px-4 h-9',
39
- 'rounded-md text-sm font-medium',
40
- 'outline-none focus-visible:ring-2 focus-visible:ring-offset-2',
41
- 'transition-colors',
42
- ],
43
- cancelButton: [
44
- 'inline-flex items-center justify-center px-4 h-9',
45
- 'rounded-md text-sm font-medium',
46
- 'text-neutral-800 bg-neutral-100 hover:bg-neutral-200',
47
- 'outline-none focus-visible:ring-2 focus-visible:ring-primary-500/50',
48
- 'transition-colors',
49
- ],
50
- },
51
- variants: {
52
- severity: {
53
- info: {
54
- confirmButton:
55
- 'bg-primary-600 hover:bg-primary-700 text-white focus-visible:ring-primary-500',
56
- },
57
- warning: {
58
- confirmButton:
59
- 'bg-warning-600 hover:bg-warning-700 text-white focus-visible:ring-warning-500',
60
- },
61
- danger: {
62
- confirmButton:
63
- 'bg-danger-600 hover:bg-danger-700 text-white focus-visible:ring-danger-500',
64
- },
65
- success: {
66
- confirmButton:
67
- 'bg-success-600 hover:bg-success-700 text-white focus-visible:ring-success-500',
68
- },
69
- },
70
- },
71
- defaultVariants: {
72
- severity: 'info',
73
- },
74
- });
75
-
76
- export type ConfirmDialogVariants = VariantProps<typeof confirmDialogVariants>;
@@ -1,209 +0,0 @@
1
- // @vitest-environment jsdom
2
- import { describe, it, expect } from 'vitest';
3
- import { render } from '@testing-library/react';
4
- import { Container } from './Container.js';
5
-
6
- describe('<Container>', () => {
7
- // ─── Default rendering ──────────────────────────────────────────────
8
- describe('default rendering', () => {
9
- it('renders a <div> by default', () => {
10
- const { container } = render(<Container>x</Container>);
11
- expect(container.firstElementChild?.tagName).toBe('DIV');
12
- });
13
-
14
- it('has mx-auto + w-full baseline', () => {
15
- const { container } = render(<Container>x</Container>);
16
- const cls = container.firstElementChild?.className ?? '';
17
- expect(cls).toContain('mx-auto');
18
- expect(cls).toContain('w-full');
19
- });
20
-
21
- it('default size is xl (max-w-screen-xl)', () => {
22
- const { container } = render(<Container>x</Container>);
23
- expect(container.firstElementChild?.className).toContain('max-w-screen-xl');
24
- });
25
-
26
- it('default px is true — responsive padding ramp', () => {
27
- const { container } = render(<Container>x</Container>);
28
- const cls = container.firstElementChild?.className ?? '';
29
- expect(cls).toContain('px-4');
30
- expect(cls).toContain('sm:px-6');
31
- expect(cls).toContain('lg:px-8');
32
- });
33
-
34
- it('default centerContent is false — no flex column', () => {
35
- const { container } = render(<Container>x</Container>);
36
- const cls = container.firstElementChild?.className ?? '';
37
- // baseline doesn't include flex
38
- expect(cls.split(' ')).not.toContain('flex');
39
- });
40
- });
41
-
42
- // ─── Size axis ──────────────────────────────────────────────────────
43
- describe('size', () => {
44
- it('size="sm"', () => {
45
- const { container } = render(<Container size="sm">x</Container>);
46
- expect(container.firstElementChild?.className).toContain('max-w-screen-sm');
47
- });
48
-
49
- it('size="lg"', () => {
50
- const { container } = render(<Container size="lg">x</Container>);
51
- expect(container.firstElementChild?.className).toContain('max-w-screen-lg');
52
- });
53
-
54
- it('size="2xl"', () => {
55
- const { container } = render(<Container size="2xl">x</Container>);
56
- expect(container.firstElementChild?.className).toContain('max-w-screen-2xl');
57
- });
58
-
59
- it('size="fluid" emits no max-w-* class', () => {
60
- const { container } = render(<Container size="fluid">x</Container>);
61
- const cls = container.firstElementChild?.className ?? '';
62
- expect(cls).not.toContain('max-w-screen');
63
- // still mx-auto + w-full baseline
64
- expect(cls).toContain('mx-auto');
65
- });
66
- });
67
-
68
- // ─── Padding axis ───────────────────────────────────────────────────
69
- describe('padding', () => {
70
- it('px={false} skips the responsive padding ramp', () => {
71
- const { container } = render(<Container px={false}>x</Container>);
72
- const cls = container.firstElementChild?.className ?? '';
73
- expect(cls).not.toContain('px-4');
74
- expect(cls).not.toContain('sm:px-6');
75
- });
76
- });
77
-
78
- // ─── Center content ─────────────────────────────────────────────────
79
- describe('centerContent', () => {
80
- it('centerContent turns into flex column items-center', () => {
81
- const { container } = render(<Container centerContent>x</Container>);
82
- const cls = container.firstElementChild?.className ?? '';
83
- expect(cls).toContain('flex');
84
- expect(cls).toContain('flex-col');
85
- expect(cls).toContain('items-center');
86
- });
87
- });
88
-
89
- // ─── Override semantics ─────────────────────────────────────────────
90
- describe('override', () => {
91
- it('sx wins over default size via tailwind-merge', () => {
92
- const { container } = render(
93
- <Container sx="max-w-3xl">x</Container>,
94
- );
95
- const cls = container.firstElementChild?.className ?? '';
96
- expect(cls).toContain('max-w-3xl');
97
- // tailwind-merge collapses the conflicting max-w-screen-xl
98
- expect(cls).not.toContain('max-w-screen-xl');
99
- });
100
-
101
- it('sx can add vertical padding (Container does not expose it)', () => {
102
- const { container } = render(<Container sx="py-12">x</Container>);
103
- expect(container.firstElementChild?.className).toContain('py-12');
104
- });
105
- });
106
-
107
- // ─── Polymorphism ───────────────────────────────────────────────────
108
- describe('polymorphism', () => {
109
- it('as="main" renders <main> with Container chrome', () => {
110
- const { container } = render(<Container as="main">x</Container>);
111
- const el = container.firstElementChild;
112
- expect(el?.tagName).toBe('MAIN');
113
- expect(el?.className).toContain('mx-auto');
114
- });
115
-
116
- it('asChild paints onto the child element', () => {
117
- const { container } = render(
118
- <Container size="lg" asChild>
119
- <article>x</article>
120
- </Container>,
121
- );
122
- const el = container.firstElementChild;
123
- expect(el?.tagName).toBe('ARTICLE');
124
- expect(el?.className).toContain('max-w-screen-lg');
125
- });
126
-
127
- it('asChild wins over as when both are passed', () => {
128
- const { container } = render(
129
- <Container as="main" asChild>
130
- <section>x</section>
131
- </Container>,
132
- );
133
- expect(container.firstElementChild?.tagName).toBe('SECTION');
134
- });
135
- });
136
-
137
- // ─── Pass-through ────────────────────────────────────────────────────
138
- describe('pass-through', () => {
139
- it('forwards data-* + aria-*', () => {
140
- const { container } = render(
141
- <Container data-testid="c" aria-label="page">x</Container>,
142
- );
143
- const el = container.firstElementChild;
144
- expect(el?.getAttribute('data-testid')).toBe('c');
145
- expect(el?.getAttribute('aria-label')).toBe('page');
146
- });
147
- });
148
-
149
- // ─── F11-bis edge cases ─────────────────────────────────────────────
150
- describe('axis coexistence', () => {
151
- it('size + centerContent + px=true (all three combine)', () => {
152
- const { container } = render(
153
- <Container size="md" centerContent px>x</Container>,
154
- );
155
- const cls = container.firstElementChild?.className ?? '';
156
- expect(cls).toContain('max-w-screen-md');
157
- expect(cls).toContain('flex');
158
- expect(cls).toContain('flex-col');
159
- expect(cls).toContain('items-center');
160
- expect(cls).toContain('px-4');
161
- });
162
-
163
- it('fluid + centerContent (full-bleed centered hero pattern)', () => {
164
- const { container } = render(
165
- <Container size="fluid" centerContent>x</Container>,
166
- );
167
- const cls = container.firstElementChild?.className ?? '';
168
- expect(cls).not.toContain('max-w-screen');
169
- expect(cls).toContain('flex-col');
170
- expect(cls).toContain('items-center');
171
- });
172
-
173
- it('fluid + px=false (full-bleed edge-to-edge — hero image pattern)', () => {
174
- const { container } = render(
175
- <Container size="fluid" px={false}>x</Container>,
176
- );
177
- const cls = container.firstElementChild?.className ?? '';
178
- expect(cls).not.toContain('max-w-screen');
179
- expect(cls).not.toContain('px-4');
180
- // still has mx-auto + w-full baseline
181
- expect(cls).toContain('mx-auto');
182
- });
183
- });
184
-
185
- describe('nested fluid-outer + capped-inner pattern', () => {
186
- it('outer fluid colored band + inner capped content renders both', () => {
187
- const { container } = render(
188
- <Container size="fluid" px={false} sx="bg-primary-50 py-16">
189
- <Container size="lg">
190
- <p>inner</p>
191
- </Container>
192
- </Container>,
193
- );
194
- const outer = container.firstElementChild;
195
- const inner = outer?.querySelector('div');
196
- expect(outer?.className).toContain('bg-primary-50');
197
- expect(outer?.className).not.toContain('max-w-screen');
198
- expect(inner?.className).toContain('max-w-screen-lg');
199
- });
200
- });
201
-
202
- describe('every size value', () => {
203
- const SIZES = ['sm', 'md', 'lg', 'xl', '2xl'] as const;
204
- it.each(SIZES)('size="%s" emits max-w-screen-%s', (s) => {
205
- const { container } = render(<Container size={s}>x</Container>);
206
- expect(container.firstElementChild?.className).toContain(`max-w-screen-${s}`);
207
- });
208
- });
209
- });
@@ -1,74 +0,0 @@
1
- import { forwardRef, type ElementType, type ReactElement } from 'react';
2
- import { Slot } from '@radix-ui/react-slot';
3
- import { cn } from '../../utils/cn.js';
4
- import { containerVariants } from './container.variants.js';
5
- import type { ContainerProps } from './container.types.js';
6
-
7
- /**
8
- * `<Container>` — centered max-width wrapper for page-level layouts.
9
- *
10
- * The pattern is universal: every page-root `<div>` in a non-trivial
11
- * web app boils down to "mx-auto + max-w-X + responsive horizontal
12
- * padding". Container collapses that into a typed prop set so the
13
- * decision lives in ONE place per app section (the Container size),
14
- * not scattered as utility chains across every page file.
15
- *
16
- * Default size is `'xl'` (1280px) — comfortable for full app shells
17
- * with a left nav + main + optional right rail. Drop to `'lg'` (1024px)
18
- * for content-heavy docs/marketing, jump to `'2xl'` (1536px) for wide
19
- * dashboards.
20
- *
21
- * Composition pattern — Container at the page root, Stack/Grid inside:
22
- *
23
- * <Container size="lg" as="main">
24
- * <Stack gap={8}>
25
- * <Typography variant="h1">Page title</Typography>
26
- * <Grid container spacing={6}>
27
- * <Grid xs={12} md={6}>...</Grid>
28
- * </Grid>
29
- * </Stack>
30
- * </Container>
31
- *
32
- * Container handles the page chrome (centered, padded, capped width);
33
- * Stack/Grid handle the actual layout of children. Two concerns, two
34
- * primitives.
35
- *
36
- * Polymorphism rule (same as Typography/Box/Stack/Grid): when both
37
- * `as` and `asChild` are passed, `asChild` wins.
38
- */
39
- export const Container = forwardRef<HTMLElement, ContainerProps>(
40
- function Container(props, ref) {
41
- const {
42
- size,
43
- px,
44
- centerContent,
45
- as,
46
- asChild = false,
47
- sx,
48
- children,
49
- ...rest
50
- } = props;
51
-
52
- const classes = cn(
53
- containerVariants({ size, px, centerContent }),
54
- sx,
55
- );
56
-
57
- if (asChild) {
58
- return (
59
- <Slot ref={ref} className={classes} {...rest}>
60
- {children as ReactElement}
61
- </Slot>
62
- );
63
- }
64
-
65
- const Tag = (as ?? 'div') as ElementType;
66
- return (
67
- <Tag ref={ref as never} className={classes} {...rest}>
68
- {children}
69
- </Tag>
70
- );
71
- },
72
- );
73
-
74
- Container.displayName = 'Container';
@@ -1,45 +0,0 @@
1
- import type { ElementType, HTMLAttributes } from 'react';
2
- import type { ContainerVariants } from './container.variants.js';
3
-
4
- /**
5
- * Props for `<Container>` — page-level centered max-width wrapper.
6
- *
7
- * Use at the page-root level (or section-root) to constrain content
8
- * width and apply the canonical responsive horizontal padding ramp.
9
- * Compose Stack/Grid INSIDE Container for the actual layout work.
10
- *
11
- * Native attribute overrides:
12
- * • `className` omitted in favour of `sx` (utility string, merged
13
- * via tailwind-merge — same convention as Box/Stack/Grid/Typography).
14
- */
15
- export interface ContainerProps
16
- extends Omit<HTMLAttributes<HTMLDivElement>, 'className'>,
17
- Pick<ContainerVariants, 'size' | 'px' | 'centerContent'> {
18
- /**
19
- * Override the rendered HTML tag. Defaults to `'div'`. Use
20
- * `as="main"` for the primary content region of a page,
21
- * `as="section"` for a named section, `as="article"` for a
22
- * self-contained article shell.
23
- *
24
- * Ignored when `asChild` is true.
25
- */
26
- as?: ElementType;
27
-
28
- /**
29
- * Render via Radix `Slot` — the Container styles paint onto the
30
- * single React child instead of wrapping it. Useful for letting a
31
- * router `<main>` element receive the Container chrome without
32
- * adding an intermediate `<div>` in the tree.
33
- *
34
- * Mutually exclusive with `as` (when both are passed, `asChild` wins).
35
- */
36
- asChild?: boolean;
37
-
38
- /**
39
- * Utility classes appended to the variant chain. Resolved via
40
- * `tailwind-merge` so the consumer's classes always win over the
41
- * variant defaults — useful for one-off vertical padding (`sx="py-8"`),
42
- * custom max-width (`sx="max-w-3xl"`), etc.
43
- */
44
- sx?: string;
45
- }
@@ -1,81 +0,0 @@
1
- import { tv, type VariantProps } from 'tailwind-variants';
2
-
3
- /**
4
- * `containerVariants` — centered max-width wrapper for page layouts.
5
- *
6
- * Architectural role:
7
- *
8
- * Every web app has the same pattern at the page-root level: a div
9
- * that's `mx-auto`, capped at some `max-w-*`, with responsive
10
- * horizontal padding. Without Container, every page rewrites:
11
- *
12
- * <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
13
- *
14
- * Container collapses that into one typed prop set, with size names
15
- * that mirror Tailwind's breakpoint vocabulary so the muscle memory
16
- * carries over (`size="lg"` ↔ `max-w-screen-lg`).
17
- *
18
- * Size axis — maps to Tailwind's `max-w-screen-*` aliases:
19
- * • sm → max-w-screen-sm (640px)
20
- * • md → max-w-screen-md (768px)
21
- * • lg → max-w-screen-lg (1024px) — most common doc/content cap
22
- * • xl → max-w-screen-xl (1280px) — default; comfortable for full apps
23
- * • 2xl → max-w-screen-2xl (1536px) — wide dashboards
24
- * • fluid → no max-width at all (full bleed, padding still applies)
25
- *
26
- * Padding axis (`px`):
27
- * • true (default) — responsive horizontal padding (px-4 sm:px-6 lg:px-8)
28
- * The canonical Tailwind responsive padding ramp. Designed to keep
29
- * edges from kissing the viewport on mobile and breathing more on
30
- * larger screens.
31
- * • false — no padding. Use when the consumer wants full bleed AND
32
- * handles edge padding inside (e.g. a hero section with its own
33
- * internal spacing scale).
34
- *
35
- * Center content axis (`centerContent`):
36
- * • true — turns the Container into a flex column with items-center
37
- * so the page content stacks centered horizontally. Common for
38
- * marketing pages, sign-in flows, "single artifact" layouts.
39
- * • false (default) — children flow normally (block stacking).
40
- */
41
- export const containerVariants = tv({
42
- base: 'mx-auto w-full',
43
-
44
- variants: {
45
- size: {
46
- sm: 'max-w-screen-sm',
47
- md: 'max-w-screen-md',
48
- lg: 'max-w-screen-lg',
49
- xl: 'max-w-screen-xl',
50
- '2xl': 'max-w-screen-2xl',
51
- fluid: '',
52
- },
53
-
54
- /*
55
- * Responsive padding ramp. `false` skips it entirely so the
56
- * consumer can supply custom padding via `sx` when needed.
57
- */
58
- px: {
59
- true: 'px-4 sm:px-6 lg:px-8',
60
- false: '',
61
- },
62
-
63
- /*
64
- * Stacks children centered. Mutually compatible with all sizes —
65
- * a fluid container with centerContent is the canonical "marketing
66
- * hero" layout.
67
- */
68
- centerContent: {
69
- true: 'flex flex-col items-center',
70
- false: '',
71
- },
72
- },
73
-
74
- defaultVariants: {
75
- size: 'xl',
76
- px: true,
77
- centerContent: false,
78
- },
79
- });
80
-
81
- export type ContainerVariants = VariantProps<typeof containerVariants>;
@@ -1,114 +0,0 @@
1
- // @vitest-environment jsdom
2
- /**
3
- * Performance guardrails for `<DataGrid>` (virtualized).
4
- *
5
- * The whole point of DataGrid is O(window) rendering: mounting 10k or
6
- * 100k rows must cost roughly the same as mounting a few hundred,
7
- * because only the visible window (+ overscan + 2 spacer `<tr>`) is
8
- * ever in the DOM. These tests pin that invariant — a regression that
9
- * accidentally mounts the full dataset (e.g. a broken `renderedRows`
10
- * slice) blows the DOM-node-count assertion immediately.
11
- *
12
- * Budgets are deliberately generous — order-of-magnitude regressions,
13
- * not micro-jitter.
14
- */
15
- import * as React from 'react';
16
- import { describe, it, expect, afterEach, beforeAll } from 'vitest';
17
- import { render, cleanup } from '@testing-library/react';
18
- import { DataGrid } from './DataGrid.js';
19
- import type { TableColumn } from '../Table/table.types.js';
20
-
21
- void React;
22
- afterEach(() => cleanup());
23
-
24
- beforeAll(() => {
25
- // jsdom ships neither ResizeObserver nor IntersectionObserver — the
26
- // virtualizer + Radix popovers need them.
27
- if (typeof globalThis.ResizeObserver === 'undefined') {
28
- (globalThis as unknown as { ResizeObserver: unknown }).ResizeObserver =
29
- class {
30
- observe() {}
31
- unobserve() {}
32
- disconnect() {}
33
- };
34
- }
35
- });
36
-
37
- interface Row {
38
- id: string;
39
- name: string;
40
- email: string;
41
- age: number;
42
- }
43
-
44
- const COLS: TableColumn<Row>[] = [
45
- { field: 'name', header: 'Name', sortable: true },
46
- { field: 'email', header: 'Email' },
47
- { field: 'age', header: 'Age', sortable: true },
48
- ];
49
-
50
- function makeRows(n: number): Row[] {
51
- return Array.from({ length: n }).map((_, i) => ({
52
- id: `r${i}`,
53
- name: `User ${i}`,
54
- email: `user${i}@example.com`,
55
- age: 20 + (i % 50),
56
- }));
57
- }
58
-
59
- describe('<DataGrid> virtualization performance', () => {
60
- it('mounts 10 000 rows under 500ms (render cost is O(window))', () => {
61
- const rows = makeRows(10_000);
62
- const t0 = performance.now();
63
- render(
64
- <DataGrid
65
- rows={rows}
66
- cols={COLS}
67
- getRowId={(r) => r.id}
68
- rowHeight={40}
69
- height="400px"
70
- />,
71
- );
72
- const t1 = performance.now();
73
- expect(t1 - t0).toBeLessThan(500);
74
- });
75
-
76
- it('mounts only the visible window in the DOM, NOT the full dataset', () => {
77
- const rows = makeRows(10_000);
78
- const { container } = render(
79
- <DataGrid
80
- rows={rows}
81
- cols={COLS}
82
- getRowId={(r) => r.id}
83
- rowHeight={40}
84
- height="400px"
85
- />,
86
- );
87
- // Virtualized: visible window + overscan + up to 2 spacer rows —
88
- // a few dozen `<tr>`, far below the 10 000 total.
89
- const trCount = container.querySelectorAll('tbody tr').length;
90
- expect(trCount).toBeGreaterThan(0);
91
- expect(trCount).toBeLessThan(100);
92
- });
93
-
94
- it('mounts 100 000 rows within the same generous budget (virtualized)', () => {
95
- const rows = makeRows(100_000);
96
- const t0 = performance.now();
97
- const { container } = render(
98
- <DataGrid
99
- rows={rows}
100
- cols={COLS}
101
- getRowId={(r) => r.id}
102
- rowHeight={40}
103
- height="400px"
104
- />,
105
- );
106
- const t1 = performance.now();
107
- // 10× the rows — the RENDER stays windowed, so the cost must not
108
- // scale with the dataset. Generous absolute bound (not a ratio,
109
- // to stay non-flaky under CI jitter).
110
- expect(t1 - t0).toBeLessThan(800);
111
- // And the DOM still holds only the window.
112
- expect(container.querySelectorAll('tbody tr').length).toBeLessThan(100);
113
- });
114
- });