@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,277 +0,0 @@
1
- import { useState, useCallback, type ChangeEvent, type KeyboardEvent } from 'react';
2
- import { cn } from '../../utils/cn.js';
3
- import { paginationVariants } from './pagination.variants.js';
4
- import { computePageRange } from './pagination.helpers.js';
5
- import type { PaginationProps, PaginationLabels } from './pagination.types.js';
6
-
7
- const DEFAULT_LABELS: Required<PaginationLabels> = {
8
- first: 'First',
9
- prev: 'Previous',
10
- next: 'Next',
11
- last: 'Last',
12
- page: 'Page',
13
- of: 'of',
14
- showing: 'Showing',
15
- perPage: 'per page',
16
- goToPage: 'Go to page',
17
- };
18
-
19
- const DEFAULT_PAGE_SIZE_OPTIONS = [10, 20, 50, 100];
20
-
21
- /**
22
- * Dashforge TW `<Pagination>` — controlled pagination primitive.
23
- *
24
- * Three variants:
25
- * - `default` — page-size selector + summary + page numbers + nav buttons + jump input
26
- * - `compact` — page numbers + nav buttons only (no summary, no selector, no jump)
27
- * - `minimal` — "Page X of Y" + prev/next only
28
- *
29
- * Always controlled (no internal state besides the jump-input draft).
30
- *
31
- * A11Y:
32
- * - `<nav aria-label="Pagination">` root
33
- * - `aria-current="page"` on the active page button
34
- * - `aria-label` on every interactive element
35
- *
36
- * @example
37
- * ```tsx
38
- * const [page, setPage] = useState(1);
39
- * const [pageSize, setPageSize] = useState(20);
40
- *
41
- * <Pagination
42
- * page={page}
43
- * pageSize={pageSize}
44
- * totalCount={1437}
45
- * onPageChange={setPage}
46
- * onPageSizeChange={setPageSize}
47
- * />
48
- * ```
49
- */
50
- export function Pagination(props: PaginationProps) {
51
- const {
52
- page,
53
- pageSize,
54
- totalCount,
55
- onPageChange,
56
- onPageSizeChange,
57
- pageSizeOptions = DEFAULT_PAGE_SIZE_OPTIONS,
58
- siblingCount = 1,
59
- boundaryCount = 1,
60
- showFirstLast = true,
61
- showJumpInput = true,
62
- disabled = false,
63
- labels: labelsProp,
64
- variant = 'default',
65
- size = 'md',
66
- sx,
67
- slotProps,
68
- } = props;
69
-
70
- const labels = { ...DEFAULT_LABELS, ...labelsProp };
71
- const v = paginationVariants({ variant, size });
72
-
73
- const totalPages = Math.max(1, Math.ceil(totalCount / pageSize));
74
- const safePage = Math.min(Math.max(1, page), totalPages);
75
-
76
- const pages = computePageRange(safePage, totalPages, siblingCount, boundaryCount);
77
-
78
- // Summary range
79
- const firstItem = totalCount === 0 ? 0 : (safePage - 1) * pageSize + 1;
80
- const lastItem = Math.min(safePage * pageSize, totalCount);
81
-
82
- // Jump input local state (commit on Enter or blur)
83
- const [jumpDraft, setJumpDraft] = useState('');
84
-
85
- const goTo = useCallback(
86
- (nextPage: number) => {
87
- if (disabled) return;
88
- const clamped = Math.min(Math.max(1, nextPage), totalPages);
89
- if (clamped !== safePage) onPageChange(clamped);
90
- },
91
- [disabled, totalPages, safePage, onPageChange],
92
- );
93
-
94
- const commitJump = useCallback(() => {
95
- const parsed = Number(jumpDraft);
96
- if (!Number.isFinite(parsed) || parsed < 1) {
97
- setJumpDraft('');
98
- return;
99
- }
100
- goTo(Math.floor(parsed));
101
- setJumpDraft('');
102
- }, [jumpDraft, goTo]);
103
-
104
- const onJumpKeyDown = useCallback(
105
- (e: KeyboardEvent<HTMLInputElement>) => {
106
- if (e.key === 'Enter') {
107
- e.preventDefault();
108
- commitJump();
109
- }
110
- },
111
- [commitJump],
112
- );
113
-
114
- const handlePageSize = useCallback(
115
- (e: ChangeEvent<HTMLSelectElement>) => {
116
- if (!onPageSizeChange) return;
117
- const next = Number(e.target.value);
118
- if (Number.isFinite(next) && next > 0) onPageSizeChange(next);
119
- },
120
- [onPageSizeChange],
121
- );
122
-
123
- const isMinimal = variant === 'minimal';
124
-
125
- return (
126
- <nav
127
- aria-label="Pagination"
128
- className={cn(v.root(), sx, slotProps?.root?.className)}
129
- >
130
- {/* Summary — only in `default` variant. `compact` skips it entirely.
131
- `minimal` renders a different "Page X of Y" summary below. */}
132
- {variant === 'default' && (
133
- <span className={cn(v.summary(), slotProps?.summary?.className)}>
134
- {labels.showing} {firstItem}-{lastItem} {labels.of} {totalCount}
135
- </span>
136
- )}
137
-
138
- {/* Minimal-mode summary (text-only "Page X of Y") */}
139
- {isMinimal && (
140
- <span className={cn(v.summary(), 'text-sm', slotProps?.summary?.className)}>
141
- {labels.page} {safePage} {labels.of} {totalPages}
142
- </span>
143
- )}
144
-
145
- {/* Nav buttons + page list */}
146
- <ul className={cn(v.list(), slotProps?.list?.className)}>
147
- {showFirstLast && !isMinimal && (
148
- <li>
149
- <button
150
- type="button"
151
- aria-label={labels.first}
152
- disabled={disabled || safePage === 1}
153
- onClick={() => goTo(1)}
154
- className={cn(v.navButton(), slotProps?.navButton?.className)}
155
- >
156
- «
157
- </button>
158
- </li>
159
- )}
160
- <li>
161
- <button
162
- type="button"
163
- aria-label={labels.prev}
164
- disabled={disabled || safePage === 1}
165
- onClick={() => goTo(safePage - 1)}
166
- className={cn(v.navButton(), slotProps?.navButton?.className)}
167
- >
168
- ‹
169
- </button>
170
- </li>
171
- {/* Page-number buttons hidden in minimal mode */}
172
- {!isMinimal &&
173
- pages.map((entry, idx) =>
174
- entry === 'ellipsis' ? (
175
- <li key={`e-${idx}`}>
176
- <span
177
- aria-hidden="true"
178
- className={cn(v.ellipsis(), slotProps?.ellipsis?.className)}
179
- >
180
- …
181
- </span>
182
- </li>
183
- ) : (
184
- <li key={entry}>
185
- <button
186
- type="button"
187
- aria-label={`${labels.page} ${entry}`}
188
- aria-current={entry === safePage ? 'page' : undefined}
189
- disabled={disabled}
190
- onClick={() => goTo(entry)}
191
- className={cn(
192
- v.pageButton(),
193
- entry === safePage && v.activeButton(),
194
- slotProps?.pageButton?.className,
195
- entry === safePage && slotProps?.activeButton?.className,
196
- )}
197
- >
198
- {entry}
199
- </button>
200
- </li>
201
- ),
202
- )}
203
- <li>
204
- <button
205
- type="button"
206
- aria-label={labels.next}
207
- disabled={disabled || safePage === totalPages}
208
- onClick={() => goTo(safePage + 1)}
209
- className={cn(v.navButton(), slotProps?.navButton?.className)}
210
- >
211
- ›
212
- </button>
213
- </li>
214
- {showFirstLast && !isMinimal && (
215
- <li>
216
- <button
217
- type="button"
218
- aria-label={labels.last}
219
- disabled={disabled || safePage === totalPages}
220
- onClick={() => goTo(totalPages)}
221
- className={cn(v.navButton(), slotProps?.navButton?.className)}
222
- >
223
- »
224
- </button>
225
- </li>
226
- )}
227
- </ul>
228
-
229
- {/* Page-size selector + jump input — only in default variant */}
230
- {variant === 'default' && onPageSizeChange && (
231
- <label
232
- className={cn(v.pageSizeSelector(), slotProps?.pageSizeSelector?.className)}
233
- >
234
- <span className="sr-only">{labels.perPage}</span>
235
- <select
236
- value={pageSize}
237
- onChange={handlePageSize}
238
- disabled={disabled}
239
- aria-label={labels.perPage}
240
- className={cn(
241
- // Auto-invert via CSS-var swap — no `dark:` variants needed
242
- // on neutral palette.
243
- 'rounded-md border border-neutral-300 bg-neutral-50 px-2 py-1',
244
- 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500',
245
- )}
246
- >
247
- {pageSizeOptions.map((opt) => (
248
- <option key={opt} value={opt}>
249
- {opt}
250
- </option>
251
- ))}
252
- </select>
253
- <span>{labels.perPage}</span>
254
- </label>
255
- )}
256
-
257
- {variant === 'default' && showJumpInput && (
258
- <label className="inline-flex items-center gap-2">
259
- <span className="sr-only">{labels.goToPage}</span>
260
- <input
261
- type="number"
262
- min={1}
263
- max={totalPages}
264
- value={jumpDraft}
265
- placeholder={labels.goToPage}
266
- disabled={disabled}
267
- onChange={(e) => setJumpDraft(e.target.value)}
268
- onKeyDown={onJumpKeyDown}
269
- onBlur={commitJump}
270
- aria-label={labels.goToPage}
271
- className={cn(v.jumpInput(), slotProps?.jumpInput?.className)}
272
- />
273
- </label>
274
- )}
275
- </nav>
276
- );
277
- }
@@ -1,102 +0,0 @@
1
- /**
2
- * Compute the array of page indices (or `'ellipsis'` sentinels) to
3
- * render for a `<Pagination>`.
4
- *
5
- * Algorithm (standard "siblings + boundaries + ellipsis fill"):
6
- * 1. Always show `boundaryCount` pages at the start and `boundaryCount`
7
- * at the end.
8
- * 2. Show `siblingCount` pages on each side of the current page.
9
- * 3. Fill gaps wider than 1 with `'ellipsis'`.
10
- * 4. If a gap is exactly 1 page wide, include that page directly
11
- * (no ellipsis for a single hidden number).
12
- *
13
- * Output is 1-indexed page numbers OR the literal string `'ellipsis'`.
14
- *
15
- * @example
16
- * ```ts
17
- * range(1, 10, 1, 1) // [1, 'ellipsis', 5, 'ellipsis', 10] when current=5
18
- * range(1, 5, 1, 1) // [1, 2, 3, 4, 5]
19
- * range(1, 100, 1, 1) // edges varying with current
20
- * ```
21
- */
22
- export function computePageRange(
23
- currentPage: number,
24
- totalPages: number,
25
- siblingCount: number,
26
- boundaryCount: number,
27
- ): (number | 'ellipsis')[] {
28
- if (totalPages <= 0) return [];
29
- if (totalPages === 1) return [1];
30
-
31
- // Budget: if `totalPages` fits within boundaries + siblings + current
32
- // (plus the 2 hypothetical ellipsis slots), don't bother with ellipses
33
- // at all — list every page. Avoids the "[1, 2, …, 5]" footgun where
34
- // the user expected to see 3 and 4 explicitly.
35
- const minPagesForEllipsis = 2 * boundaryCount + 2 * siblingCount + 3;
36
- if (totalPages <= minPagesForEllipsis) {
37
- return range(1, totalPages);
38
- }
39
-
40
- const startBoundary = range(1, Math.min(boundaryCount, totalPages));
41
- const endBoundary = range(
42
- Math.max(totalPages - boundaryCount + 1, boundaryCount + 1),
43
- totalPages,
44
- );
45
-
46
- const siblingsStart = Math.max(currentPage - siblingCount, boundaryCount + 2);
47
- const siblingsEnd = Math.min(
48
- currentPage + siblingCount,
49
- totalPages - boundaryCount - 1,
50
- );
51
- const siblings = range(siblingsStart, siblingsEnd);
52
-
53
- const showStartEllipsis = siblingsStart > boundaryCount + 2;
54
- const showEndEllipsis = siblingsEnd < totalPages - boundaryCount - 1;
55
-
56
- const out: (number | 'ellipsis')[] = [...startBoundary];
57
-
58
- if (showStartEllipsis) {
59
- out.push('ellipsis');
60
- } else if (siblingsStart === boundaryCount + 2) {
61
- // Single hidden page → fill it directly instead of an ellipsis.
62
- out.push(boundaryCount + 1);
63
- }
64
-
65
- out.push(...siblings);
66
-
67
- if (showEndEllipsis) {
68
- out.push('ellipsis');
69
- } else if (siblingsEnd === totalPages - boundaryCount - 1) {
70
- out.push(totalPages - boundaryCount);
71
- }
72
-
73
- out.push(...endBoundary);
74
-
75
- // Dedupe while preserving order (overlapping ranges produce duplicates
76
- // when totalPages is small). Two distinct rules:
77
- // 1. Number entries: keep only the first occurrence.
78
- // 2. Ellipsis entries: collapse adjacent ellipses to one.
79
- const seen = new Set<number>();
80
- const deduped: (number | 'ellipsis')[] = [];
81
- let prevWasEllipsis = false;
82
- for (const entry of out) {
83
- if (entry === 'ellipsis') {
84
- if (!prevWasEllipsis) {
85
- deduped.push('ellipsis');
86
- prevWasEllipsis = true;
87
- }
88
- continue;
89
- }
90
- if (!seen.has(entry)) {
91
- seen.add(entry);
92
- deduped.push(entry);
93
- prevWasEllipsis = false;
94
- }
95
- }
96
- return deduped;
97
- }
98
-
99
- function range(start: number, end: number): number[] {
100
- if (end < start) return [];
101
- return Array.from({ length: end - start + 1 }, (_, i) => start + i);
102
- }
@@ -1,117 +0,0 @@
1
- import type { PaginationVariants } from './pagination.variants.js';
2
-
3
- export interface PaginationSlotProps {
4
- root?: { className?: string };
5
- summary?: { className?: string };
6
- list?: { className?: string };
7
- pageButton?: { className?: string };
8
- activeButton?: { className?: string };
9
- navButton?: { className?: string };
10
- ellipsis?: { className?: string };
11
- pageSizeSelector?: { className?: string };
12
- jumpInput?: { className?: string };
13
- }
14
-
15
- /**
16
- * I18n strings for `<Pagination>`. Default = English. Override the
17
- * subset you need to translate; the rest fall back to defaults.
18
- */
19
- export interface PaginationLabels {
20
- first?: string;
21
- prev?: string;
22
- next?: string;
23
- last?: string;
24
- page?: string;
25
- of?: string;
26
- showing?: string;
27
- perPage?: string;
28
- goToPage?: string;
29
- }
30
-
31
- /**
32
- * Props for `<Pagination>`.
33
- *
34
- * Controlled component: the consumer owns `page` + `pageSize`. The
35
- * component emits `onPageChange` / `onPageSizeChange` and recomputes
36
- * the visible page range from `totalCount`.
37
- *
38
- * @example
39
- * ```tsx
40
- * const [page, setPage] = useState(1);
41
- * const [pageSize, setPageSize] = useState(20);
42
- *
43
- * <Pagination
44
- * page={page}
45
- * pageSize={pageSize}
46
- * totalCount={1437}
47
- * onPageChange={setPage}
48
- * onPageSizeChange={setPageSize}
49
- * pageSizeOptions={[10, 20, 50, 100]}
50
- * />
51
- * ```
52
- */
53
- export interface PaginationProps extends Pick<PaginationVariants, 'variant' | 'size'> {
54
- /** Current page, **1-indexed**. */
55
- page: number;
56
-
57
- /** Items per page. */
58
- pageSize: number;
59
-
60
- /** Total items in the underlying data set (NOT total pages — we compute that). */
61
- totalCount: number;
62
-
63
- /** Fired when the user picks a different page. */
64
- onPageChange: (page: number) => void;
65
-
66
- /**
67
- * Fired when the user picks a different page size. Omit (or pass
68
- * undefined) to hide the page-size selector.
69
- */
70
- onPageSizeChange?: (pageSize: number) => void;
71
-
72
- /**
73
- * Options shown in the page-size selector.
74
- * @default [10, 20, 50, 100]
75
- */
76
- pageSizeOptions?: number[];
77
-
78
- /**
79
- * How many page buttons to show on each side of the current page.
80
- * @default 1
81
- */
82
- siblingCount?: number;
83
-
84
- /**
85
- * How many page buttons to always show at the start/end of the
86
- * sequence (acts as "boundary"). @default 1
87
- */
88
- boundaryCount?: number;
89
-
90
- /**
91
- * Show first/last buttons (`«` / `»`). @default true
92
- */
93
- showFirstLast?: boolean;
94
-
95
- /**
96
- * Show the direct page-jump input (variant=`default` only).
97
- * @default true
98
- */
99
- showJumpInput?: boolean;
100
-
101
- /**
102
- * Disable all interactive elements (kept rendered but inert).
103
- */
104
- disabled?: boolean;
105
-
106
- /**
107
- * I18n strings. Defaults are English; pass the subset you need
108
- * to translate.
109
- */
110
- labels?: PaginationLabels;
111
-
112
- /** Root-level Tailwind override. */
113
- sx?: string;
114
-
115
- /** Per-slot overrides. */
116
- slotProps?: PaginationSlotProps;
117
- }
@@ -1,117 +0,0 @@
1
- import { tv, type VariantProps } from 'tailwind-variants';
2
-
3
- /**
4
- * `<Pagination>` variant recipe.
5
- *
6
- * Slots:
7
- * - `root` — outer `<nav>` container
8
- * - `summary` — "Showing X-Y of Z" text
9
- * - `list` — `<ul>` of page buttons
10
- * - `pageButton` — individual page number button
11
- * - `activeButton` — modifier applied to the current page
12
- * - `navButton` — first/prev/next/last buttons
13
- * - `ellipsis` — `…` rendered when range gap
14
- * - `pageSizeSelector` — native `<select>` for page size
15
- * - `jumpInput` — direct page jump `<input>`
16
- *
17
- * Variant axes:
18
- * - `variant` — `default` (full kit) | `compact` (number buttons +
19
- * prev/next only) | `minimal` ("X / Y pages" + prev/next only).
20
- * - `size` — `sm` | `md` (default) | `lg`. Drives padding + text
21
- * size on the buttons.
22
- */
23
- export const paginationVariants = tv({
24
- slots: {
25
- root: 'flex flex-wrap items-center gap-3',
26
- // All neutral classes auto-invert via the dashforgePreset() CSS-var
27
- // swap. `bg-neutral-50` provides the button surface (matches page
28
- // surface; the border gives the separation). `hover:bg-neutral-100`
29
- // is the one-tier elevation that works in both modes.
30
- summary: 'text-neutral-600',
31
- list: 'inline-flex items-center gap-1 list-none pl-0 m-0',
32
- pageButton: [
33
- 'inline-flex items-center justify-center rounded-md',
34
- 'border border-neutral-300',
35
- 'bg-neutral-50',
36
- 'text-neutral-700',
37
- 'hover:bg-neutral-100',
38
- 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500',
39
- 'transition-colors motion-reduce:transition-none',
40
- 'disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none',
41
- ],
42
- activeButton: [
43
- // Primary palette does NOT auto-invert — `dark:` shift is a
44
- // design choice for tone refinement (kept).
45
- 'bg-primary-500 text-white border-primary-500',
46
- 'hover:bg-primary-600 dark:hover:bg-primary-400',
47
- ],
48
- navButton: [
49
- 'inline-flex items-center justify-center rounded-md',
50
- 'border border-neutral-300',
51
- 'bg-neutral-50',
52
- 'text-neutral-700',
53
- 'hover:bg-neutral-100',
54
- 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500',
55
- 'transition-colors motion-reduce:transition-none',
56
- 'disabled:opacity-50 disabled:cursor-not-allowed disabled:pointer-events-none',
57
- ],
58
- ellipsis: 'inline-flex items-center justify-center text-neutral-500 px-1',
59
- pageSizeSelector: [
60
- 'inline-flex items-center gap-2',
61
- 'text-neutral-700',
62
- ],
63
- jumpInput: [
64
- 'rounded-md border border-neutral-300',
65
- 'bg-neutral-50',
66
- 'text-neutral-900',
67
- 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500',
68
- 'transition-colors motion-reduce:transition-none',
69
- ],
70
- },
71
- variants: {
72
- // Note: variant-driven visibility is enforced via conditional JSX
73
- // rendering (in `Pagination.tsx`), NOT via `hidden` Tailwind class.
74
- // Reason: `display: none` keeps the elements in the DOM (and in the
75
- // a11y tree depending on how it's applied), which leaks into
76
- // testing-library `queryByText` and feels semantically wrong for
77
- // "this UI piece doesn't exist in this variant". So compact and
78
- // minimal slots stay empty here.
79
- variant: {
80
- default: {},
81
- compact: {},
82
- minimal: {},
83
- },
84
- size: {
85
- sm: {
86
- summary: 'text-xs',
87
- pageButton: 'h-7 min-w-7 px-2 text-xs',
88
- navButton: 'h-7 min-w-7 px-2 text-xs',
89
- ellipsis: 'h-7 min-w-5 text-xs',
90
- pageSizeSelector: 'text-xs',
91
- jumpInput: 'h-7 px-2 text-xs w-14',
92
- },
93
- md: {
94
- summary: 'text-sm',
95
- pageButton: 'h-9 min-w-9 px-3 text-sm',
96
- navButton: 'h-9 min-w-9 px-3 text-sm',
97
- ellipsis: 'h-9 min-w-6 text-sm',
98
- pageSizeSelector: 'text-sm',
99
- jumpInput: 'h-9 px-2 text-sm w-16',
100
- },
101
- lg: {
102
- summary: 'text-base',
103
- pageButton: 'h-10 min-w-10 px-4 text-base',
104
- navButton: 'h-10 min-w-10 px-4 text-base',
105
- ellipsis: 'h-10 min-w-7 text-base',
106
- pageSizeSelector: 'text-base',
107
- jumpInput: 'h-10 px-3 text-base w-20',
108
- },
109
- },
110
- },
111
- defaultVariants: {
112
- variant: 'default',
113
- size: 'md',
114
- },
115
- });
116
-
117
- export type PaginationVariants = VariantProps<typeof paginationVariants>;
@@ -1,72 +0,0 @@
1
- // @vitest-environment jsdom
2
- import * as React from 'react';
3
- import { describe, it, expect, afterEach, beforeAll } from 'vitest';
4
- import { render, screen, cleanup } from '@testing-library/react';
5
- import { Popover } from './Popover.js';
6
-
7
- void React;
8
- afterEach(() => cleanup());
9
-
10
- // jsdom doesn't implement ResizeObserver — Radix Floating UI requires it.
11
- beforeAll(() => {
12
- if (typeof globalThis.ResizeObserver === 'undefined') {
13
- (globalThis as unknown as { ResizeObserver: unknown }).ResizeObserver = class {
14
- observe() {}
15
- unobserve() {}
16
- disconnect() {}
17
- };
18
- }
19
- });
20
-
21
- describe('Popover — rendering', () => {
22
- it('renders the trigger always', () => {
23
- render(
24
- <Popover content={<p>Panel</p>}>
25
- <button>Open panel</button>
26
- </Popover>
27
- );
28
- expect(screen.queryByRole('button', { name: 'Open panel' })).not.toBeNull();
29
- });
30
-
31
- it('renders content when controlled open=true', () => {
32
- render(
33
- <Popover content={<p>Panel content</p>} open onOpenChange={() => {}}>
34
- <button>Open panel</button>
35
- </Popover>
36
- );
37
- expect(screen.queryByText('Panel content')).not.toBeNull();
38
- });
39
-
40
- it('does not render content when open=false', () => {
41
- render(
42
- <Popover content={<p>Panel content</p>} open={false} onOpenChange={() => {}}>
43
- <button>Open panel</button>
44
- </Popover>
45
- );
46
- expect(screen.queryByText('Panel content')).toBeNull();
47
- });
48
- });
49
-
50
- describe('Popover — placement', () => {
51
- it.each(['top', 'right', 'bottom', 'left'] as const)(
52
- 'renders side=%s without crashing',
53
- (side) => {
54
- render(
55
- <Popover content={<p>Panel</p>} open side={side} onOpenChange={() => {}}>
56
- <button>T</button>
57
- </Popover>
58
- );
59
- expect(screen.queryByText('Panel')).not.toBeNull();
60
- }
61
- );
62
-
63
- it('applies width style', () => {
64
- render(
65
- <Popover content={<p>Panel</p>} open width="300px" onOpenChange={() => {}}>
66
- <button>T</button>
67
- </Popover>
68
- );
69
- const content = screen.getByText('Panel').closest('[role="dialog"]') as HTMLElement | null;
70
- expect(content?.style.width).toBe('300px');
71
- });
72
- });