@brightlocal/ui-components 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AI_USAGE.md +10 -0
- package/README.md +8 -1
- package/component-meta.json +1591 -123
- package/deprecations.json +45 -1
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +73 -102
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +36 -5
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +83 -128
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts +4 -4
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +116 -177
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.js +13 -16
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +30 -45
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +32 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +90 -71
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +130 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +24 -6
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +74 -140
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +136 -176
- package/dist/blocks/progress-state.cjs +1 -1
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/progress-state.js +223 -347
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +28 -6
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +763 -1086
- package/dist/brand-illustration-motif.cjs +1 -1
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/brand-illustration-motif.js +40 -61
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +62 -102
- package/dist/button-group.cjs +1 -1
- package/dist/button-group.js +23 -31
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +4 -2
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +149 -189
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +87 -3
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +116 -173
- package/dist/callout.cjs +1 -1
- package/dist/callout.js +73 -96
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +92 -6
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +240 -234
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +3 -3
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +174 -268
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.js +27 -48
- package/dist/chart-empty.cjs +1 -1
- package/dist/chart-empty.js +18 -27
- package/dist/chart.cjs +7 -7
- package/dist/chart.d.ts +253 -25
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +465 -511
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +37 -69
- package/dist/chip.cjs +1 -1
- package/dist/chip.js +116 -173
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +35 -41
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +14 -4
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +440 -639
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +273 -420
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +5 -5
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +121 -191
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +442 -144
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +708 -835
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +15 -4
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +156 -231
- package/dist/delta.cjs +1 -0
- package/dist/delta.d.ts +79 -0
- package/dist/delta.d.ts.map +1 -0
- package/dist/delta.js +62 -0
- package/dist/description.cjs +1 -1
- package/dist/description.js +11 -20
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +1 -1
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +76 -116
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +11 -11
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +76 -134
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +6 -6
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +179 -300
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +9 -9
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +166 -286
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.js +203 -342
- package/dist/grid.cjs +1 -1
- package/dist/grid.d.ts +24 -1
- package/dist/grid.d.ts.map +1 -1
- package/dist/grid.js +16 -29
- package/dist/header.cjs +1 -1
- package/dist/header.js +21 -38
- package/dist/height-transition.cjs +1 -1
- package/dist/height-transition.js +38 -55
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +10 -9
- package/dist/hooks/use-debounce.cjs +1 -1
- package/dist/hooks/use-debounce.js +12 -11
- package/dist/hooks/use-delayed-pending.cjs +1 -1
- package/dist/hooks/use-delayed-pending.js +8 -9
- package/dist/hooks/use-filter-search-params.cjs +1 -0
- package/dist/hooks/use-filter-search-params.d.ts +93 -0
- package/dist/hooks/use-filter-search-params.d.ts.map +1 -0
- package/dist/hooks/use-filter-search-params.js +122 -0
- package/dist/hooks/use-mobile.cjs +1 -1
- package/dist/hooks/use-mobile.js +6 -6
- package/dist/hooks/use-overlay-pointer-lock.cjs +1 -1
- package/dist/hooks/use-overlay-pointer-lock.js +8 -9
- package/dist/hooks/use-prefers-reduced-motion.cjs +1 -1
- package/dist/hooks/use-prefers-reduced-motion.js +5 -8
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +1 -1
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +30 -62
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +636 -582
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +27 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +32 -3
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +182 -231
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +188 -122
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.d.ts +3 -3
- package/dist/input-otp.d.ts.map +1 -1
- package/dist/input-otp.js +102 -146
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +26 -8
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +139 -171
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +51 -73
- package/dist/label.cjs +1 -1
- package/dist/label.js +20 -38
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +5 -2
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +16 -17
- package/dist/lib/compose-event-handlers.cjs +1 -0
- package/dist/lib/compose-event-handlers.d.ts +9 -0
- package/dist/lib/compose-event-handlers.d.ts.map +1 -0
- package/dist/lib/compose-event-handlers.js +8 -0
- package/dist/lib/download-file.cjs +1 -0
- package/dist/lib/download-file.d.ts +14 -0
- package/dist/lib/download-file.d.ts.map +1 -0
- package/dist/lib/download-file.js +40 -0
- package/dist/lib/empty-canvas.cjs +1 -1
- package/dist/lib/empty-canvas.js +28 -56
- package/dist/lib/empty-chip.cjs +1 -1
- package/dist/lib/empty-chip.d.ts +14 -3
- package/dist/lib/empty-chip.d.ts.map +1 -1
- package/dist/lib/empty-chip.js +15 -11
- package/dist/lib/field-aria.cjs +1 -0
- package/dist/lib/field-aria.d.ts +34 -0
- package/dist/lib/field-aria.d.ts.map +1 -0
- package/dist/lib/field-aria.js +52 -0
- package/dist/lib/image-file-info.cjs +1 -0
- package/dist/lib/image-file-info.d.ts +25 -0
- package/dist/lib/image-file-info.d.ts.map +1 -0
- package/dist/lib/image-file-info.js +67 -0
- package/dist/lib/media-viewer-content.cjs +1 -0
- package/dist/lib/media-viewer-content.d.ts +102 -0
- package/dist/lib/media-viewer-content.d.ts.map +1 -0
- package/dist/lib/media-viewer-content.js +650 -0
- package/dist/lib/media-viewer-internal.cjs +1 -0
- package/dist/lib/media-viewer-internal.d.ts +98 -0
- package/dist/lib/media-viewer-internal.d.ts.map +1 -0
- package/dist/lib/media-viewer-internal.js +61 -0
- package/dist/lib/media-viewer-motion.cjs +1 -0
- package/dist/lib/media-viewer-motion.d.ts +40 -0
- package/dist/lib/media-viewer-motion.d.ts.map +1 -0
- package/dist/lib/media-viewer-motion.js +37 -0
- package/dist/lib/motion.cjs +1 -1
- package/dist/lib/motion.d.ts +8 -0
- package/dist/lib/motion.d.ts.map +1 -1
- package/dist/lib/motion.js +11 -10
- package/dist/lib/optical-center.cjs +1 -1
- package/dist/lib/optical-center.d.ts +1 -1
- package/dist/lib/optical-center.d.ts.map +1 -1
- package/dist/lib/optical-center.js +12 -5
- package/dist/lib/spring-settle.cjs +1 -1
- package/dist/lib/spring-settle.js +1 -1
- package/dist/lib/table-internal.cjs +1 -0
- package/dist/lib/table-internal.d.ts +62 -0
- package/dist/lib/table-internal.d.ts.map +1 -0
- package/dist/lib/table-internal.js +18 -0
- package/dist/lib/use-controllable.cjs +1 -0
- package/dist/lib/use-controllable.d.ts +12 -0
- package/dist/lib/use-controllable.d.ts.map +1 -0
- package/dist/lib/use-controllable.js +15 -0
- package/dist/lib/use-dev-warning.cjs +1 -1
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +29 -35
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.js +78 -124
- package/dist/list.cjs +1 -1
- package/dist/list.d.ts +8 -0
- package/dist/list.d.ts.map +1 -1
- package/dist/list.js +94 -156
- package/dist/loading.cjs +1 -1
- package/dist/loading.js +124 -151
- package/dist/logo-mark.cjs +1 -0
- package/dist/logo-mark.d.ts +79 -0
- package/dist/logo-mark.d.ts.map +1 -0
- package/dist/logo-mark.js +219 -0
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +1 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +51 -87
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +390 -586
- package/dist/media-empty.cjs +1 -1
- package/dist/media-empty.js +27 -42
- package/dist/media-viewer.cjs +1 -0
- package/dist/media-viewer.d.ts +224 -0
- package/dist/media-viewer.d.ts.map +1 -0
- package/dist/media-viewer.js +295 -0
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +14 -14
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +130 -267
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +186 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +374 -0
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +108 -172
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +36 -12
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +208 -281
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +34 -45
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +139 -17
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +116 -148
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +90 -146
- package/dist/rating.cjs +1 -1
- package/dist/rating.d.ts +80 -13
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +70 -65
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +112 -0
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +39 -23
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +42 -44
- package/dist/result-count.cjs +1 -0
- package/dist/result-count.d.ts +110 -0
- package/dist/result-count.d.ts.map +1 -0
- package/dist/result-count.js +49 -0
- package/dist/route-progress.cjs +1 -1
- package/dist/route-progress.js +58 -102
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +9 -1
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +44 -79
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +20 -10
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +132 -236
- package/dist/separator.cjs +1 -1
- package/dist/separator.js +90 -78
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +86 -7
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +275 -235
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +113 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +224 -0
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.js +24 -38
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +51 -81
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +113 -137
- package/dist/spinner.cjs +1 -1
- package/dist/spinner.js +22 -31
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +53 -102
- package/dist/status.cjs +1 -0
- package/dist/status.d.ts +51 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +60 -0
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +184 -316
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +17 -32
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +127 -13
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +170 -192
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +123 -146
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.js +307 -363
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.d.ts.map +1 -1
- package/dist/textarea.js +23 -36
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.js +43 -62
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +34 -46
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +175 -78
- package/dist/typography-heading.cjs +1 -1
- package/dist/typography-heading.js +25 -61
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +1 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +27 -57
- package/dist/typography.cjs +1 -1
- package/dist/typography.d.ts +1 -1
- package/dist/typography.js +132 -340
- package/package.json +45 -46
- package/src/blocks/empty-state.tsx +42 -21
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +111 -32
- package/src/components/accordion.tsx +1 -1
- package/src/components/alert-dialog.tsx +52 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +152 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +8 -6
- package/src/components/calendar.tsx +155 -9
- package/src/components/card.tsx +266 -26
- package/src/components/carousel.tsx +4 -1
- package/src/components/chart.tsx +664 -42
- package/src/components/checkbox.tsx +2 -2
- package/src/components/collapsible.tsx +4 -1
- package/src/components/combobox.tsx +42 -9
- package/src/components/command.tsx +10 -11
- package/src/components/context-menu.tsx +4 -4
- package/src/components/data-table.tsx +1363 -398
- package/src/components/date-picker.tsx +31 -4
- package/src/components/delta.tsx +217 -0
- package/src/components/drawer.tsx +5 -5
- package/src/components/dropdown-menu.tsx +4 -4
- package/src/components/field.tsx +36 -15
- package/src/components/global-layout.tsx +1 -1
- package/src/components/grid.tsx +32 -1
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +52 -8
- package/src/components/input-group.tsx +247 -12
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +29 -11
- package/src/components/input.tsx +11 -2
- package/src/components/list.tsx +15 -3
- package/src/components/logo-mark.tsx +345 -0
- package/src/components/map.tsx +18 -20
- package/src/components/media-viewer.tsx +908 -0
- package/src/components/multi-select-filter.tsx +1046 -0
- package/src/components/navigation-menu.tsx +2 -2
- package/src/components/pagination.tsx +86 -26
- package/src/components/progress.tsx +281 -54
- package/src/components/rating.tsx +200 -74
- package/src/components/relative-date.tsx +238 -0
- package/src/components/resizable.tsx +86 -33
- package/src/components/result-count.tsx +253 -0
- package/src/components/scroll-area.tsx +31 -5
- package/src/components/select.tsx +37 -7
- package/src/components/sheet.tsx +252 -6
- package/src/components/single-select-filter.tsx +538 -0
- package/src/components/slider.tsx +2 -2
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/status.tsx +162 -0
- package/src/components/switch.tsx +1 -1
- package/src/components/table.tsx +305 -73
- package/src/components/tabs.tsx +94 -46
- package/src/components/textarea.tsx +21 -3
- package/src/components/toggle.tsx +2 -2
- package/src/components/tooltip.tsx +431 -68
- package/src/components/typography-text.tsx +1 -2
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/hooks/use-filter-search-params.ts +302 -0
- package/src/index.ts +11 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/compose-event-handlers.ts +14 -0
- package/src/lib/download-file.ts +61 -0
- package/src/lib/empty-chip.tsx +52 -0
- package/src/lib/field-aria.tsx +97 -0
- package/src/lib/image-file-info.ts +102 -0
- package/src/lib/media-viewer-content.tsx +1587 -0
- package/src/lib/media-viewer-internal.tsx +191 -0
- package/src/lib/media-viewer-motion.ts +120 -0
- package/src/lib/motion.ts +9 -0
- package/src/lib/table-internal.ts +74 -0
- package/src/lib/use-controllable.ts +43 -0
- package/src/lib/utils.ts +1 -0
- package/src/lib/empty-chip.ts +0 -24
package/dist/data-table.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Column, ColumnDef, ExpandedState, PaginationState, Row, RowData, RowSelectionState, SortingState, Table as TanStackTable } from '@tanstack/react-table';
|
|
2
2
|
import { InputGroup } from './input-group';
|
|
3
|
+
import { TableFrame, TableSize } from '../lib/table-internal';
|
|
3
4
|
/**
|
|
4
5
|
* DataTable — composable data table primitives built on TanStack Table.
|
|
5
6
|
*
|
|
@@ -26,6 +27,20 @@ declare module "@tanstack/react-table" {
|
|
|
26
27
|
width?: string;
|
|
27
28
|
/** Minimum column width (e.g., "100px", "8rem"). */
|
|
28
29
|
minWidth?: string;
|
|
30
|
+
/**
|
|
31
|
+
* This column starts a column group (DS-1195): its body cells draw a
|
|
32
|
+
* separator on their start edge. The header band stays clean.
|
|
33
|
+
*/
|
|
34
|
+
groupStart?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Pin the column to the left edge while the table scrolls sideways
|
|
37
|
+
* (DS-1205). Pin ONE column — the first, normally; two pinned columns
|
|
38
|
+
* would stack on the same edge. The pinned header and body cells get an
|
|
39
|
+
* opaque background that follows the row state (selected, expanded,
|
|
40
|
+
* sub-row) and a divider on the pinned edge. Only has a visible effect
|
|
41
|
+
* when the table scrolls horizontally (`minWidth`).
|
|
42
|
+
*/
|
|
43
|
+
pinned?: "left";
|
|
29
44
|
}
|
|
30
45
|
}
|
|
31
46
|
/**
|
|
@@ -88,7 +103,11 @@ export interface UseDataTableOptions<TData> {
|
|
|
88
103
|
enableRowSelection?: boolean | ((row: Row<TData>) => boolean);
|
|
89
104
|
/** Enable client-side pagination. @default false */
|
|
90
105
|
enablePagination?: boolean;
|
|
91
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Initial page size when pagination is enabled. The Filtering pattern's
|
|
108
|
+
* 20 rows a page; pass 10 when two tables share a page.
|
|
109
|
+
* @default 20
|
|
110
|
+
*/
|
|
92
111
|
pageSize?: number;
|
|
93
112
|
/**
|
|
94
113
|
* Skip client-side sorting — the server pre-sorts `data`.
|
|
@@ -200,15 +219,6 @@ export interface UseDataTableOptions<TData> {
|
|
|
200
219
|
* return <DataTable table={table} dataHook="locations-table" />;
|
|
201
220
|
*/
|
|
202
221
|
export declare function useDataTable<TData>(options: UseDataTableOptions<TData>): TanStackTable<TData>;
|
|
203
|
-
/**
|
|
204
|
-
* Props for `DataTable`.
|
|
205
|
-
*
|
|
206
|
-
* `DataTable` is the generic rendering layer for a DataTable. It takes an
|
|
207
|
-
* already-constructed TanStack Table instance (typically from
|
|
208
|
-
* `useDataTable`) and renders the primitives. It is purposefully
|
|
209
|
-
* rendering-focused — wire toolbars, pagination, and search components
|
|
210
|
-
* outside of it via composition.
|
|
211
|
-
*/
|
|
212
222
|
export interface DataTableProps<TData> {
|
|
213
223
|
/** TanStack Table instance (usually returned from `useDataTable`). */
|
|
214
224
|
table: TanStackTable<TData>;
|
|
@@ -218,34 +228,148 @@ export interface DataTableProps<TData> {
|
|
|
218
228
|
trackingEl?: string;
|
|
219
229
|
/** Analytics label. */
|
|
220
230
|
trackingLabel?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Row density, passed through to the underlying `Table` (DS-556):
|
|
233
|
+
* `default` rows are `h-12` (48px) under `h-12` (48px) column headers;
|
|
234
|
+
* `sm` rows are `h-10` (40px) under `h-9` (36px) headers. Rows still grow
|
|
235
|
+
* with multi-line content, and a row hosting an expander or icon-only
|
|
236
|
+
* action button (`size-9` + the cell's `p-2`) measures 52px at either size.
|
|
237
|
+
* Use `sm` for dense tables inside cards, dialogs and side panels.
|
|
238
|
+
* @default "default"
|
|
239
|
+
*/
|
|
240
|
+
size?: TableSize;
|
|
241
|
+
/**
|
|
242
|
+
* Where the frame comes from (DS-1103), passed through to the `Table`.
|
|
243
|
+
* - `"own"` — the view draws its own 1px `border-border`, `rounded-md`
|
|
244
|
+
* frame; cells keep `p-2`. The standalone table.
|
|
245
|
+
* - `"container"` — no border, square corners, and the first/last cell of
|
|
246
|
+
* every row — heads, cells, footer, empty row, skeleton rows — pads to the
|
|
247
|
+
* container's gutter, `var(--content-inset)` (24px in a `data` Card).
|
|
248
|
+
* Use inside `CardContent flush`, a Sheet or a dialog body so the page
|
|
249
|
+
* shows one box and the columns line up with the title; no className
|
|
250
|
+
* override needed. The view stays a focusable scroll region either way.
|
|
251
|
+
* @default "own"
|
|
252
|
+
*/
|
|
253
|
+
frame?: TableFrame;
|
|
254
|
+
/**
|
|
255
|
+
* Faint rule under every body row but the last (DS-1195), passed through to
|
|
256
|
+
* the `Table`. For long, dense tables with many numeric or grouped columns;
|
|
257
|
+
* leave off for short or simple tables.
|
|
258
|
+
* @default false
|
|
259
|
+
*/
|
|
260
|
+
rowDividers?: boolean;
|
|
221
261
|
/** Show skeleton rows instead of data while loading async data. */
|
|
222
262
|
isLoading?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Marks a server-side refetch (page, sort, filter or search change) as in
|
|
265
|
+
* flight. Unlike `isLoading` — the initial load, which swaps rows for
|
|
266
|
+
* skeletons — `refetching` never touches the rows: they stay rendered at
|
|
267
|
+
* full contrast (keep the stale data with TanStack Query's
|
|
268
|
+
* `placeholderData: keepPreviousData` or `useTransition`). The table sets
|
|
269
|
+
* `aria-busy` (never the wrapper — the live region must stay outside the
|
|
270
|
+
* busy subtree to be announced), a polite live region announces
|
|
271
|
+
* `refetchingLabel`, and the
|
|
272
|
+
* selection checkboxes (`DataTableSelectAllCheckbox`,
|
|
273
|
+
* `DataTableSelectRowCheckbox`) set `aria-disabled` and ignore toggles —
|
|
274
|
+
* selecting rows that are about to be replaced acts on stale data. The busy *visual* belongs to the
|
|
275
|
+
* control that requested the refetch (the pagination button, the sort
|
|
276
|
+
* header's or search field's `loading`), not to the body.
|
|
277
|
+
*
|
|
278
|
+
* Wrap a raw `isFetching` in `useDelayedPending` before passing it, so a
|
|
279
|
+
* refetch that resolves inside the flash threshold shows nothing at all.
|
|
280
|
+
* @default false
|
|
281
|
+
*/
|
|
282
|
+
refetching?: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* What the polite live region announces to screen readers while
|
|
285
|
+
* `refetching` is set.
|
|
286
|
+
* @default "Loading results…"
|
|
287
|
+
*/
|
|
288
|
+
refetchingLabel?: string;
|
|
289
|
+
/**
|
|
290
|
+
* What the polite live region announces to screen readers while
|
|
291
|
+
* `isLoading` is set and the rows are skeletons.
|
|
292
|
+
* @default "Loading data…"
|
|
293
|
+
*/
|
|
294
|
+
loadingLabel?: string;
|
|
223
295
|
/** Number of skeleton rows when loading. Falls back to the table's page size, then 10. */
|
|
224
296
|
skeletonRowCount?: number;
|
|
225
297
|
/**
|
|
226
|
-
* What the table shows in place of rows when it has none
|
|
298
|
+
* What the table shows in place of rows when it has none — rendered through
|
|
299
|
+
* `TableEmpty`, announced politely either way.
|
|
227
300
|
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
301
|
+
* Left unset, the table renders the designed no-results state (Figma
|
|
302
|
+
* `No results`): an `<EmptyState size="md">` with the `SearchX` icon, the
|
|
303
|
+
* global-filter query echoed in the title and one line of description, no
|
|
304
|
+
* action — the reader wants the outcome of their own query, not a CTA.
|
|
305
|
+
* Translate it with `noResultsTitle` / `noResultsDescription`.
|
|
231
306
|
*
|
|
232
|
-
* Pass
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* a
|
|
238
|
-
* @default
|
|
307
|
+
* Pass your own `<EmptyState size="md">` for an empty collection (Figma
|
|
308
|
+
* `Empty`): a title, one line and the setup CTA. The cell brings the
|
|
309
|
+
* block's breathing room with it — do not wrap it in a padding element.
|
|
310
|
+
* The block sits in the same live region, so keep it to the standard
|
|
311
|
+
* anatomy — its title and one line are worth hearing; a wall of copy is
|
|
312
|
+
* not. A string renders as a one-line message in an ordinary row.
|
|
313
|
+
* @default the no-results EmptyState
|
|
239
314
|
*/
|
|
240
315
|
noResultsMessage?: React.ReactNode;
|
|
241
316
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
317
|
+
* Title of the default no-results state. `{query}` is replaced with the
|
|
318
|
+
* current global-filter value; the plain default is used when there is no
|
|
319
|
+
* query (column filters only).
|
|
320
|
+
* @default "No results for \"{query}\"" with a query, else "No results"
|
|
321
|
+
*/
|
|
322
|
+
noResultsTitle?: string;
|
|
323
|
+
/**
|
|
324
|
+
* The one line under the default no-results title.
|
|
325
|
+
* @default "Try a different search, or clear the filters."
|
|
326
|
+
*/
|
|
327
|
+
noResultsDescription?: string;
|
|
328
|
+
/**
|
|
329
|
+
* Pin the `<thead>` to the top of the component's own scroll container
|
|
330
|
+
* (the outer wrapper) so column headers remain visible while the rows
|
|
331
|
+
* scroll. Bound the height through `className` — a fixed cap
|
|
332
|
+
* (`max-h-96`) or flex sizing inside a height-capped parent
|
|
333
|
+
* (`min-h-0 flex-1`) — and the header sticks while rows scroll beneath
|
|
334
|
+
* it (DS-912). The header keeps its opaque `bg-muted` background to
|
|
335
|
+
* separate it from body rows.
|
|
336
|
+
*
|
|
337
|
+
* Setting this also makes the outer wrapper a focusable scroll region
|
|
338
|
+
* (`role="region"` + `tabIndex`, labelled by `scrollRegionLabel`), so
|
|
339
|
+
* keyboard users can focus and scroll the rows — the height bound lives
|
|
340
|
+
* in `className`, which the component cannot inspect, so the sticky
|
|
341
|
+
* intent is the signal. For the same reason, don't set it on a table
|
|
342
|
+
* with no height bound: the wrapper never scrolls, and the region
|
|
343
|
+
* becomes an inert tab stop.
|
|
344
|
+
*
|
|
345
|
+
* `"page"` pins the headings to the page's scroll instead, with no height
|
|
346
|
+
* bound and no inner scroll box (DS-1215) — for long report tables that
|
|
347
|
+
* scroll with the page. The `<thead>` sticks at `--content-sticky-top`,
|
|
348
|
+
* which a `CardHeader sticky` publishes with its live height, so inside
|
|
349
|
+
* such a card the headings stick directly beneath the card header; with
|
|
350
|
+
* no sticky card header they stick at the top of the scrolling page,
|
|
351
|
+
* Sheet or Dialog. The headings stick while the table fits its container;
|
|
352
|
+
* once it is wider (`minWidth`, column `meta.minWidth`, wide content) the
|
|
353
|
+
* wrapper becomes the horizontal scroll region, labelled by
|
|
354
|
+
* `scrollRegionLabel`, and the headings scroll with the page — a sideways
|
|
355
|
+
* scroll box would otherwise trap them.
|
|
245
356
|
* @default false
|
|
246
357
|
*/
|
|
247
|
-
stickyHeader?: boolean;
|
|
248
|
-
/**
|
|
358
|
+
stickyHeader?: boolean | "page";
|
|
359
|
+
/**
|
|
360
|
+
* Additional class name for the outer wrapper — the component's single
|
|
361
|
+
* scroll container for both axes. Height bounds belong here: `max-h-*`
|
|
362
|
+
* for a fixed cap, or `min-h-0 flex-1` to fill a height-capped parent
|
|
363
|
+
* such as a dialog body.
|
|
364
|
+
*
|
|
365
|
+
* A height bound almost always wants `stickyHeader` with it — that also
|
|
366
|
+
* grants the keyboard-focusable scroll-region semantics. If you cap the
|
|
367
|
+
* height and deliberately let the header scroll away, pass
|
|
368
|
+
* `scrollRegionLabel` instead: it opts the wrapper into the same
|
|
369
|
+
* focusable scroll-region semantics without pinning the header, so the
|
|
370
|
+
* region semantics sit on the element that actually scrolls — keyboard
|
|
371
|
+
* arrow keys only scroll the focused element itself or an ancestor.
|
|
372
|
+
*/
|
|
249
373
|
className?: string;
|
|
250
374
|
/**
|
|
251
375
|
* Table layout algorithm.
|
|
@@ -266,8 +390,23 @@ export interface DataTableProps<TData> {
|
|
|
266
390
|
*/
|
|
267
391
|
minWidth?: string;
|
|
268
392
|
/**
|
|
269
|
-
* Accessible label for the scroll container region.
|
|
270
|
-
*
|
|
393
|
+
* Accessible label for the scroll container region (the outer wrapper).
|
|
394
|
+
* Applied whenever the wrapper is a focusable scroll region: `minWidth`
|
|
395
|
+
* is set (horizontal scrolling), `stickyHeader` is set (vertical
|
|
396
|
+
* scrolling under a pinned header), or always on `VirtualizedDataTable`
|
|
397
|
+
* (its viewport is bounded by definition).
|
|
398
|
+
*
|
|
399
|
+
* Passing it is also itself the opt-in for tables that scroll without
|
|
400
|
+
* either signal — a `className` height cap with the header deliberately
|
|
401
|
+
* left unpinned. The height bound lives in `className`, which the
|
|
402
|
+
* component cannot inspect, so the supplied label tells it the rows
|
|
403
|
+
* scroll and the wrapper becomes a focusable region. Don't pass it on a
|
|
404
|
+
* table that never scrolls: the region would be an inert tab stop.
|
|
405
|
+
*
|
|
406
|
+
* Give each table on a page a distinct label ("Invoices", "Team
|
|
407
|
+
* members") — several region landmarks sharing the default name violate
|
|
408
|
+
* axe's landmark-unique rule and are indistinguishable to screen-reader
|
|
409
|
+
* users.
|
|
271
410
|
* @default "Scrollable table"
|
|
272
411
|
*/
|
|
273
412
|
scrollRegionLabel?: string;
|
|
@@ -301,44 +440,13 @@ export interface DataTableProps<TData> {
|
|
|
301
440
|
renderExpandedContent?: (row: Row<TData>) => React.ReactNode;
|
|
302
441
|
}
|
|
303
442
|
/**
|
|
304
|
-
* Generic DataTable renderer.
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
* rows (search, filters, pagination, counters), `DataTableBulkActions` — form
|
|
312
|
-
* a single unit. When the parent lays out its children with a gap (e.g.
|
|
313
|
-
* `DialogContent` with `gap-8`, a Card body, a page section), wrap the whole
|
|
314
|
-
* unit in one flex-column container so the parent's gap applies around the
|
|
315
|
-
* table block, not between the toolbars and the table. Vertical rhythm inside
|
|
316
|
-
* the block comes from the toolbars' built-in padding — don't add custom
|
|
317
|
-
* margins between the parts.
|
|
318
|
-
*
|
|
319
|
-
* @example
|
|
320
|
-
* const table = useDataTable({ columns, data, enableSorting: true });
|
|
321
|
-
* return <DataTable table={table} dataHook="my-table" />;
|
|
322
|
-
*
|
|
323
|
-
* @example
|
|
324
|
-
* // One slot inside a gapped parent (dialog, card, page section).
|
|
325
|
-
* // min-h-0/flex-1 keep the table scrollable in height-capped parents.
|
|
326
|
-
* <div className="flex min-h-0 flex-1 flex-col">
|
|
327
|
-
* <DataTableToolbar dataHook="toolbar-top">
|
|
328
|
-
* <DataTableToolbarLeft>{heading or search}</DataTableToolbarLeft>
|
|
329
|
-
* <DataTableToolbarRight>{filters}</DataTableToolbarRight>
|
|
330
|
-
* </DataTableToolbar>
|
|
331
|
-
* <DataTable table={table} dataHook="my-table" className="min-h-0 flex-1 overflow-y-auto" />
|
|
332
|
-
* <DataTableToolbar dataHook="toolbar-bottom">
|
|
333
|
-
* <DataTableToolbarLeft>{selection counter}</DataTableToolbarLeft>
|
|
334
|
-
* <DataTableToolbarRight>{pagination}</DataTableToolbarRight>
|
|
335
|
-
* </DataTableToolbar>
|
|
336
|
-
* </div>
|
|
337
|
-
*/
|
|
338
|
-
export declare function DataTable<TData>({ table, dataHook, trackingEl, trackingLabel, isLoading, skeletonRowCount, noResultsMessage, stickyHeader, className, layout, minWidth, scrollRegionLabel, footer, getRowClassName, renderExpandedContent, }: DataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
339
|
-
export declare namespace DataTable {
|
|
340
|
-
var displayName: string;
|
|
341
|
-
}
|
|
443
|
+
* Generic DataTable renderer — see `DataTableInner` for the full contract.
|
|
444
|
+
* `ref` is the view wrapper (`data-slot="data-table-view"`), the component's
|
|
445
|
+
* scroll container: scroll it back to the top after a page change, or
|
|
446
|
+
* `scrollIntoView` it. Cast keeps the `TData` generic through `forwardRef`
|
|
447
|
+
* (the Tabs / CommandVirtualList idiom).
|
|
448
|
+
*/
|
|
449
|
+
declare const DataTable: <TData>(props: DataTableProps<TData> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
342
450
|
/**
|
|
343
451
|
* Props for `VirtualizedDataTable`.
|
|
344
452
|
*
|
|
@@ -352,7 +460,14 @@ export declare namespace DataTable {
|
|
|
352
460
|
* sub-rows are real row-model rows — as do `getRowClassName` and the
|
|
353
461
|
* addressable row attributes.
|
|
354
462
|
*/
|
|
355
|
-
export interface VirtualizedDataTableProps<TData> extends Omit<DataTableProps<TData>, "renderExpandedContent"> {
|
|
463
|
+
export interface VirtualizedDataTableProps<TData> extends Omit<DataTableProps<TData>, "renderExpandedContent" | "stickyHeader"> {
|
|
464
|
+
/**
|
|
465
|
+
* Pin the `<thead>` to the top of the virtualized viewport so column
|
|
466
|
+
* headers stay visible while the rows scroll. The viewport is always
|
|
467
|
+
* bounded, so there is no `"page"` mode here.
|
|
468
|
+
* @default false
|
|
469
|
+
*/
|
|
470
|
+
stickyHeader?: boolean;
|
|
356
471
|
/**
|
|
357
472
|
* Height of the scroll container in pixels. Required — virtualization
|
|
358
473
|
* needs a bounded viewport. Pass a CSS value via `className` instead
|
|
@@ -362,8 +477,10 @@ export interface VirtualizedDataTableProps<TData> extends Omit<DataTableProps<TD
|
|
|
362
477
|
height?: number;
|
|
363
478
|
/**
|
|
364
479
|
* Estimated height of a single row in pixels. The virtualizer uses this
|
|
365
|
-
* for initial layout before measuring real DOM nodes.
|
|
366
|
-
*
|
|
480
|
+
* for initial layout before measuring real DOM nodes. Defaults to the
|
|
481
|
+
* table's row min-height for its `size` — 48 for `default`, 40 for `sm` —
|
|
482
|
+
* so only tables whose rows routinely wrap need to set it.
|
|
483
|
+
* @default 48 (`size="default"`) | 40 (`size="sm"`)
|
|
367
484
|
*/
|
|
368
485
|
estimateSize?: number;
|
|
369
486
|
/**
|
|
@@ -374,33 +491,10 @@ export interface VirtualizedDataTableProps<TData> extends Omit<DataTableProps<TD
|
|
|
374
491
|
overscan?: number;
|
|
375
492
|
}
|
|
376
493
|
/**
|
|
377
|
-
* Virtualized
|
|
378
|
-
*
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
* `@tanstack/react-virtual` internally.
|
|
382
|
-
*
|
|
383
|
-
* @example
|
|
384
|
-
* const table = useDataTable({
|
|
385
|
-
* columns,
|
|
386
|
-
* data: largeDataset, // 10 000+ rows
|
|
387
|
-
* enableSorting: true,
|
|
388
|
-
* manualPagination: true, // skip client pagination
|
|
389
|
-
* });
|
|
390
|
-
*
|
|
391
|
-
* return (
|
|
392
|
-
* <VirtualizedDataTable
|
|
393
|
-
* table={table}
|
|
394
|
-
* dataHook="big-table"
|
|
395
|
-
* height={600}
|
|
396
|
-
* estimateSize={48}
|
|
397
|
-
* />
|
|
398
|
-
* );
|
|
399
|
-
*/
|
|
400
|
-
export declare function VirtualizedDataTable<TData>({ table, dataHook, trackingEl, trackingLabel, isLoading, skeletonRowCount, noResultsMessage, stickyHeader, className, layout, minWidth, scrollRegionLabel, footer, getRowClassName, height, estimateSize, overscan, }: VirtualizedDataTableProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
401
|
-
export declare namespace VirtualizedDataTable {
|
|
402
|
-
var displayName: string;
|
|
403
|
-
}
|
|
494
|
+
* Virtualized renderer — see `VirtualizedDataTableInner` for the contract.
|
|
495
|
+
* `ref` is the view wrapper, the scroll container the virtualizer drives.
|
|
496
|
+
*/
|
|
497
|
+
declare const VirtualizedDataTable: <TData>(props: VirtualizedDataTableProps<TData> & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
404
498
|
/**
|
|
405
499
|
* Props for `DataTableColumnHeader` — a sortable column header with
|
|
406
500
|
* directional sort indicators. Matches the Figma TableHead/Button variant.
|
|
@@ -421,9 +515,35 @@ export interface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAtt
|
|
|
421
515
|
/**
|
|
422
516
|
* Builds the accessible label for the sort button.
|
|
423
517
|
* Receives the column title and current sort direction (`"asc"`, `"desc"`, or `false`).
|
|
518
|
+
* While `loading` is true the direction passed is the settled one — the
|
|
519
|
+
* order the visible rows still reflect, not the one just requested.
|
|
424
520
|
* @default (title, dir) => `Sort by ${title}${dir ? `, currently ${dir === "asc" ? "ascending" : "descending"}` : ""}`
|
|
425
521
|
*/
|
|
426
522
|
getSortLabel?: (title: string, direction: "asc" | "desc" | false) => string;
|
|
523
|
+
/**
|
|
524
|
+
* Marks a server-side sort refetch as in flight. Pass the same fetching
|
|
525
|
+
* flag to every column's header: every sort button sets `aria-busy` and
|
|
526
|
+
* becomes inert — clicks are ignored to prevent a double-fetch — without a
|
|
527
|
+
* disabled look, and the column whose click requested the refetch (the one
|
|
528
|
+
* whose requested order differs from the settled one it still shows) swaps
|
|
529
|
+
* its sort icon for a spinner. Icons, labels and the `<th>`'s `aria-sort`
|
|
530
|
+
* keep describing the settled sort order — the order the visible rows still
|
|
531
|
+
* reflect — until the flag clears.
|
|
532
|
+
*
|
|
533
|
+
* The settled order is captured when the sort change and this flag land in
|
|
534
|
+
* the same render commit: a click handler that sets both, or React Query's
|
|
535
|
+
* `isFetching` in the same batch — the normal wirings. It is tracked at the
|
|
536
|
+
* table level, so it survives the columns array being rebuilt (and every
|
|
537
|
+
* header remounting) when the flag flips. A flag that only flips on a later
|
|
538
|
+
* render (e.g. wrapped in `useDelayedPending`) degrades gracefully to
|
|
539
|
+
* announcing the requested order (the standard behavior of sortable
|
|
540
|
+
* tables), with the spinner on the sorted column or columns — the
|
|
541
|
+
* requesting one can no longer be told apart; button and `<th>` stay
|
|
542
|
+
* consistent with each other either way. Rendered standalone (outside a
|
|
543
|
+
* DataTable), the settled order is held in header-local state instead.
|
|
544
|
+
* @default false
|
|
545
|
+
*/
|
|
546
|
+
loading?: boolean;
|
|
427
547
|
}
|
|
428
548
|
/**
|
|
429
549
|
* Sortable column header with sort indicator icons.
|
|
@@ -446,7 +566,7 @@ export interface DataTableColumnHeaderProps<TData, TValue> extends React.HTMLAtt
|
|
|
446
566
|
* so tables that do not opt in keep first-click-ascending. Once a column is
|
|
447
567
|
* sorted, clicking again reverses the direction as before.
|
|
448
568
|
*/
|
|
449
|
-
export declare function DataTableColumnHeader<TData, TValue>({ column, title, className, dataHook, trackingEl, trackingLabel, align, getSortLabel, }: DataTableColumnHeaderProps<TData, TValue>):
|
|
569
|
+
export declare function DataTableColumnHeader<TData, TValue>({ column, title, className, dataHook, trackingEl, trackingLabel, align, getSortLabel, loading, }: DataTableColumnHeaderProps<TData, TValue>): React.JSX.Element;
|
|
450
570
|
export declare namespace DataTableColumnHeader {
|
|
451
571
|
var displayName: string;
|
|
452
572
|
}
|
|
@@ -466,6 +586,38 @@ export interface DataTableSearchProps<TData> extends Omit<React.ComponentPropsWi
|
|
|
466
586
|
placeholder?: string;
|
|
467
587
|
/** Accessible label for the clear button. @default "Clear search" */
|
|
468
588
|
clearSearchAriaLabel?: string;
|
|
589
|
+
/**
|
|
590
|
+
* Disables the search input. Use during initial data load when there is
|
|
591
|
+
* nothing to search yet — the input cannot be typed in, the clear button
|
|
592
|
+
* hides, and the group dims via `has-[:disabled]:opacity-50`. Any pending
|
|
593
|
+
* debounced push is discarded.
|
|
594
|
+
*
|
|
595
|
+
* This is for *initial load*, not refetch — during a search-triggered
|
|
596
|
+
* refetch, use `loading` instead (the input stays editable).
|
|
597
|
+
* @default false
|
|
598
|
+
*/
|
|
599
|
+
disabled?: boolean;
|
|
600
|
+
/**
|
|
601
|
+
* Search refetch in flight — the leading search icon swaps to a spinner
|
|
602
|
+
* and the group sets `aria-busy`. The input stays fully editable, and the
|
|
603
|
+
* clear button keeps its place in the trailing slot whenever there is a
|
|
604
|
+
* value: the way out of a slow search never disappears.
|
|
605
|
+
* @default false
|
|
606
|
+
*/
|
|
607
|
+
loading?: boolean;
|
|
608
|
+
/**
|
|
609
|
+
* Debounce between keystrokes and the table's global filter, in
|
|
610
|
+
* milliseconds. The input echoes instantly; the filter (and any server
|
|
611
|
+
* refetch keyed off it) only updates after the pause. Clearing via the
|
|
612
|
+
* clear button skips the debounce.
|
|
613
|
+
*
|
|
614
|
+
* The default is derived from the table's filtering mode: `300` when the
|
|
615
|
+
* table uses `manualFiltering` (server-side — one refetch per pause,
|
|
616
|
+
* "debounce the request"), `0` for client-side filtering (rows keep
|
|
617
|
+
* narrowing per keystroke, as before). Pass a value to override either mode.
|
|
618
|
+
* @default table.options.manualFiltering ? 300 : 0
|
|
619
|
+
*/
|
|
620
|
+
debounceMs?: number;
|
|
469
621
|
}
|
|
470
622
|
/**
|
|
471
623
|
* Search input for filtering DataTable rows.
|
|
@@ -475,11 +627,58 @@ export interface DataTableSearchProps<TData> extends Omit<React.ComponentPropsWi
|
|
|
475
627
|
* customize width or shape.
|
|
476
628
|
*
|
|
477
629
|
* Uses the table's global filter (requires `enableGlobalFiltering` on the hook).
|
|
630
|
+
*
|
|
631
|
+
* With `manualFiltering` (server-side search) keystrokes echo in the input
|
|
632
|
+
* instantly while the global filter — and any server refetch keyed off it —
|
|
633
|
+
* only updates after `debounceMs` of inactivity. Client-side filtering stays
|
|
634
|
+
* synchronous: rows narrow per keystroke, exactly as the Filtering pattern
|
|
635
|
+
* promises ("debounce the request, never the input").
|
|
636
|
+
*
|
|
637
|
+
* Accepts a `ref` that resolves to the inner `<input>` element, so consumers
|
|
638
|
+
* can call `.focus()` without querying the component's markup.
|
|
478
639
|
*/
|
|
479
|
-
export declare
|
|
480
|
-
|
|
481
|
-
|
|
640
|
+
export declare const DataTableSearch: <TData>(props: DataTableSearchProps<TData> & React.RefAttributes<HTMLInputElement>) => React.ReactElement;
|
|
641
|
+
/** Pagination info returned by `useDataTablePagination`. */
|
|
642
|
+
interface DataTablePaginationInfo {
|
|
643
|
+
/** Current 0-based page index. */
|
|
644
|
+
pageIndex: number;
|
|
645
|
+
/** Number of rows per page. */
|
|
646
|
+
pageSize: number;
|
|
647
|
+
/** Total rows across all pages. */
|
|
648
|
+
totalRows: number;
|
|
649
|
+
/** Total page count. */
|
|
650
|
+
totalPages: number;
|
|
651
|
+
/** First visible row (1-based, 0 when empty). */
|
|
652
|
+
startRow: number;
|
|
653
|
+
/** Last visible row. */
|
|
654
|
+
endRow: number;
|
|
655
|
+
/** Current page (1-based). */
|
|
656
|
+
currentPage: number;
|
|
657
|
+
/** Whether a previous page exists. */
|
|
658
|
+
canPrev: boolean;
|
|
659
|
+
/** Whether a next page exists. */
|
|
660
|
+
canNext: boolean;
|
|
661
|
+
/** Navigate to a 1-based page number. */
|
|
662
|
+
goToPage: (page: number) => void;
|
|
663
|
+
/** Navigate to the next page. */
|
|
664
|
+
nextPage: () => void;
|
|
665
|
+
/** Navigate to the previous page. */
|
|
666
|
+
previousPage: () => void;
|
|
667
|
+
/** Set page size (resets to page 1). */
|
|
668
|
+
setPageSize: (size: number) => void;
|
|
482
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Derives pagination state from a TanStack Table instance.
|
|
672
|
+
*
|
|
673
|
+
* Use when you need pagination metadata in a custom location (toolbar header,
|
|
674
|
+
* sticky footer) without rendering `DataTablePagination`. The component itself
|
|
675
|
+
* is built on this hook.
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* const { startRow, endRow, totalRows, canNext, nextPage } = useDataTablePagination(table);
|
|
679
|
+
*/
|
|
680
|
+
declare function useDataTablePagination<TData>(table: TanStackTable<TData>): DataTablePaginationInfo;
|
|
681
|
+
/** The English default: compact "start – end of total", nothing when empty. */
|
|
483
682
|
/** Info passed to row-count render functions. */
|
|
484
683
|
export interface RowCountRenderInfo {
|
|
485
684
|
/** First visible row (1-based, 0 when empty). */
|
|
@@ -495,25 +694,51 @@ export interface RowCountRenderInfo {
|
|
|
495
694
|
}
|
|
496
695
|
export interface DataTablePaginationRowCountProps {
|
|
497
696
|
/**
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
697
|
+
* Row-count text. Supports the `{from}`, `{to}` and `{total}`
|
|
698
|
+
* placeholders — name the records in the product's words
|
|
699
|
+
* ("{from} to {to} of {total} locations"). Passed to
|
|
700
|
+
* `ResultCount` as its `rangeLabel`.
|
|
701
|
+
* @default "{from} to {to} of {total} results"
|
|
702
|
+
*/
|
|
703
|
+
label?: string;
|
|
704
|
+
/**
|
|
705
|
+
* `label` for a total of exactly 1 ("1 to 1 of 1 location"). Falls back to
|
|
706
|
+
* `label`. Passed to `ResultCount` as its `rangeLabelOne`.
|
|
707
|
+
* @default "{from} to {to} of {total} result"
|
|
708
|
+
*/
|
|
709
|
+
labelOne?: string;
|
|
710
|
+
/**
|
|
711
|
+
* Screen-reader-only text while the table is empty. The visible count
|
|
712
|
+
* hides at zero — the empty state says it — but the live region stays and
|
|
713
|
+
* announces the result. Passed to `ResultCount` as its `emptyLabel`.
|
|
714
|
+
* @default "No results"
|
|
715
|
+
*/
|
|
716
|
+
emptyLabel?: string;
|
|
717
|
+
/**
|
|
718
|
+
* Render the row-count text yourself. Receives pagination numbers; you
|
|
719
|
+
* control wording, pluralization, and order. Return `null` to hide. The
|
|
720
|
+
* node renders as plain text — prefer `label` so the count stays the
|
|
721
|
+
* `ResultCount` live region.
|
|
501
722
|
*/
|
|
502
723
|
renderText?: (info: RowCountRenderInfo) => React.ReactNode;
|
|
724
|
+
/** Data hook for the count. @default "{paginationDataHook}-row-count" */
|
|
725
|
+
dataHook?: string;
|
|
503
726
|
/** Additional class name. */
|
|
504
727
|
className?: string;
|
|
505
728
|
}
|
|
506
729
|
/**
|
|
507
|
-
* Row-count label for `DataTablePagination
|
|
730
|
+
* Row-count label for `DataTablePagination` — a `ResultCount` in its range
|
|
731
|
+
* form ("1 to 20 of 45 results"), so a paged table and a filtered
|
|
732
|
+
* list share one count component and one wording. At zero rows the visible
|
|
733
|
+
* count hides (the empty state says it) but the live region stays, with the
|
|
734
|
+
* screen-reader-only `emptyLabel`, so the empty result is announced.
|
|
508
735
|
*
|
|
509
|
-
* Renders "start–end of total" by default. Pass `renderText` for i18n-friendly
|
|
510
|
-
* custom text with full control over wording, pluralization, and order.
|
|
511
736
|
* Renders nothing below the `sm` viewport breakpoint — on small screens the
|
|
512
737
|
* label is removed so the page buttons get the full width (DS-998).
|
|
513
738
|
*
|
|
514
739
|
* Must be rendered inside `<DataTablePagination>`.
|
|
515
740
|
*/
|
|
516
|
-
declare function DataTablePaginationRowCount({ renderText, className, }: DataTablePaginationRowCountProps):
|
|
741
|
+
declare function DataTablePaginationRowCount({ label, labelOne, emptyLabel, renderText, dataHook, className, }: DataTablePaginationRowCountProps): React.JSX.Element | null;
|
|
517
742
|
declare namespace DataTablePaginationRowCount {
|
|
518
743
|
var displayName: string;
|
|
519
744
|
}
|
|
@@ -533,7 +758,7 @@ export interface DataTablePaginationNavProps {
|
|
|
533
758
|
* to navigate. Below the `sm` viewport breakpoint the buttons centre in the
|
|
534
759
|
* available width (DS-998). Must be rendered inside `<DataTablePagination>`.
|
|
535
760
|
*/
|
|
536
|
-
declare function DataTablePaginationNav({ ariaLabel, dataHook, className, }: DataTablePaginationNavProps):
|
|
761
|
+
declare function DataTablePaginationNav({ ariaLabel, dataHook, className, }: DataTablePaginationNavProps): React.JSX.Element | null;
|
|
537
762
|
declare namespace DataTablePaginationNav {
|
|
538
763
|
var displayName: string;
|
|
539
764
|
}
|
|
@@ -562,10 +787,36 @@ export interface DataTablePaginationProps<TData> {
|
|
|
562
787
|
*/
|
|
563
788
|
showRowCount?: boolean;
|
|
564
789
|
/**
|
|
565
|
-
*
|
|
566
|
-
*
|
|
790
|
+
* Row-count text in the default layout. Supports the `{from}`, `{to}` and
|
|
791
|
+
* `{total}` placeholders — name the records in the product's words
|
|
792
|
+
* ("{from} to {to} of {total} locations"). i18next's `{{from}}`
|
|
793
|
+
* form is accepted too, so `rowCountLabel={t("pagination.caption")}` works
|
|
794
|
+
* with the untranslated string.
|
|
795
|
+
* Ignored when `children` are provided — use `DataTablePaginationRowCount` instead.
|
|
796
|
+
* @default "{from} to {to} of {total} results"
|
|
797
|
+
*/
|
|
798
|
+
rowCountLabel?: string;
|
|
799
|
+
/**
|
|
800
|
+
* `rowCountLabel` for a total of exactly 1 ("1 to 1 of 1 location"). Falls
|
|
801
|
+
* back to `rowCountLabel`; pair with i18next's `_one` key.
|
|
802
|
+
* Ignored when `children` are provided — use `DataTablePaginationRowCount` instead.
|
|
803
|
+
* @default "{from} to {to} of {total} result"
|
|
804
|
+
*/
|
|
805
|
+
rowCountLabelOne?: string;
|
|
806
|
+
/**
|
|
807
|
+
* Screen-reader-only row count while the table is empty. The visible count
|
|
808
|
+
* hides at zero (the empty state says it) but the live region stays and
|
|
809
|
+
* announces the result; nothing is visible and the bar keeps no height.
|
|
810
|
+
* Ignored when `children` are provided — use `DataTablePaginationRowCount` instead.
|
|
811
|
+
* @default "No results"
|
|
812
|
+
*/
|
|
813
|
+
rowCountEmptyLabel?: string;
|
|
814
|
+
/**
|
|
815
|
+
* Render the row-count text yourself. Receives pagination numbers; you
|
|
816
|
+
* control wording, pluralization, and order. Return `null` to hide. The
|
|
817
|
+
* node renders as plain text — prefer `rowCountLabel` so the count stays
|
|
818
|
+
* the `ResultCount` live region.
|
|
567
819
|
* Ignored when `children` are provided — use `DataTablePaginationRowCount` instead.
|
|
568
|
-
* @default Renders "{startRow}-{endRow} of {totalRows}" or nothing when empty.
|
|
569
820
|
*/
|
|
570
821
|
renderRowCount?: ((info: RowCountRenderInfo) => React.ReactNode) | null;
|
|
571
822
|
/** Analytics element identifier. */
|
|
@@ -587,14 +838,16 @@ export interface DataTablePaginationProps<TData> {
|
|
|
587
838
|
/**
|
|
588
839
|
* Pagination controls for a DataTable.
|
|
589
840
|
*
|
|
590
|
-
* **Default mode** (no children): renders previous/next/page links and
|
|
591
|
-
*
|
|
592
|
-
* i18n-friendly text.
|
|
841
|
+
* **Default mode** (no children): renders previous/next/page links and the
|
|
842
|
+
* row count — a `ResultCount` in its range form, "1 to 20 of 45
|
|
843
|
+
* results". Use `rowCountLabel` for i18n-friendly text.
|
|
593
844
|
*
|
|
594
845
|
* The navigation hides itself when there is at most one page (the row count
|
|
595
|
-
* stays, keeping the bar informative and the layout stable).
|
|
596
|
-
* row count
|
|
597
|
-
*
|
|
846
|
+
* stays, keeping the bar informative and the layout stable). At zero rows the
|
|
847
|
+
* row count keeps its live region mounted with nothing visible, so the empty
|
|
848
|
+
* result is announced; only with the row count off (`showRowCount={false}`,
|
|
849
|
+
* `renderRowCount` null or returning null, or below `sm`) and a single page
|
|
850
|
+
* does the component render nothing — no consumer render gate needed.
|
|
598
851
|
*
|
|
599
852
|
* **Responsive behaviour:** below the `sm` viewport breakpoint the row-count
|
|
600
853
|
* label is removed and the page buttons centre in the available width — the
|
|
@@ -623,9 +876,7 @@ export interface DataTablePaginationProps<TData> {
|
|
|
623
876
|
* <DataTablePagination
|
|
624
877
|
* table={table}
|
|
625
878
|
* dataHook="pagination"
|
|
626
|
-
*
|
|
627
|
-
* t('pagination.caption', { from: startRow, to: endRow, total: totalRows })
|
|
628
|
-
* }
|
|
879
|
+
* rowCountLabel={t('pagination.caption')} // "{from} to {to} of {total} locations"
|
|
629
880
|
* />
|
|
630
881
|
*
|
|
631
882
|
* @example
|
|
@@ -635,7 +886,7 @@ export interface DataTablePaginationProps<TData> {
|
|
|
635
886
|
* <DataTablePaginationNav />
|
|
636
887
|
* </DataTablePagination>
|
|
637
888
|
*/
|
|
638
|
-
export declare function DataTablePagination<TData>({ table, dataHook, showRowCount, renderRowCount, trackingEl, trackingLabel, className, ariaLabel, children, }: DataTablePaginationProps<TData>):
|
|
889
|
+
export declare function DataTablePagination<TData>({ table, dataHook, showRowCount, rowCountLabel, rowCountLabelOne, rowCountEmptyLabel, renderRowCount, trackingEl, trackingLabel, className, ariaLabel, children, }: DataTablePaginationProps<TData>): React.JSX.Element | null;
|
|
639
890
|
export declare namespace DataTablePagination {
|
|
640
891
|
var displayName: string;
|
|
641
892
|
}
|
|
@@ -656,10 +907,17 @@ export interface DataTableSelectAllCheckboxProps<TData> {
|
|
|
656
907
|
selectAllAriaLabel?: string;
|
|
657
908
|
}
|
|
658
909
|
/**
|
|
659
|
-
* Header checkbox for selecting all visible page rows.
|
|
660
|
-
*
|
|
910
|
+
* Header checkbox for selecting all visible page rows. Checked only when
|
|
911
|
+
* every page row is selected; a partial selection shows it unchecked — the
|
|
912
|
+
* DS checkbox has no indeterminate state (Active | Inactive, like the Figma
|
|
913
|
+
* set), and clicking it still selects or clears every page row.
|
|
914
|
+
*
|
|
915
|
+
* While the surrounding `DataTable` is `refetching`, the checkbox is
|
|
916
|
+
* `aria-disabled` and toggles are ignored (visually unchanged, still exposed
|
|
917
|
+
* to screen readers so the select-all `<th>` never reads as empty): the rows
|
|
918
|
+
* it would select are stale and about to be replaced (DS-916).
|
|
661
919
|
*/
|
|
662
|
-
export declare function DataTableSelectAllCheckbox<TData>({ table, dataHook, trackingEl, trackingLabel, selectAllAriaLabel, }: DataTableSelectAllCheckboxProps<TData>):
|
|
920
|
+
export declare function DataTableSelectAllCheckbox<TData>({ table, dataHook, trackingEl, trackingLabel, selectAllAriaLabel, }: DataTableSelectAllCheckboxProps<TData>): React.JSX.Element;
|
|
663
921
|
export declare namespace DataTableSelectAllCheckbox {
|
|
664
922
|
var displayName: string;
|
|
665
923
|
}
|
|
@@ -680,8 +938,13 @@ export interface DataTableSelectRowCheckboxProps<TData> {
|
|
|
680
938
|
}
|
|
681
939
|
/**
|
|
682
940
|
* Row-level selection checkbox. Disabled when the row cannot be selected.
|
|
941
|
+
*
|
|
942
|
+
* While the surrounding `DataTable` is `refetching`, the checkbox is
|
|
943
|
+
* `aria-disabled` and toggles are ignored (visually unchanged, still exposed
|
|
944
|
+
* to screen readers): the row it would select is stale and about to be
|
|
945
|
+
* replaced (DS-916).
|
|
683
946
|
*/
|
|
684
|
-
export declare function DataTableSelectRowCheckbox<TData>({ row, dataHook, trackingEl, trackingLabel, selectRowAriaLabel, }: DataTableSelectRowCheckboxProps<TData>):
|
|
947
|
+
export declare function DataTableSelectRowCheckbox<TData>({ row, dataHook, trackingEl, trackingLabel, selectRowAriaLabel, }: DataTableSelectRowCheckboxProps<TData>): React.JSX.Element;
|
|
685
948
|
export declare namespace DataTableSelectRowCheckbox {
|
|
686
949
|
var displayName: string;
|
|
687
950
|
}
|
|
@@ -730,7 +993,7 @@ export interface DataTableExpandRowButtonProps<TData> {
|
|
|
730
993
|
* `enableExpanding` on `useDataTable` (with `getSubRows` for sub-rows or
|
|
731
994
|
* `getRowCanExpand` for the detail-panel pattern).
|
|
732
995
|
*/
|
|
733
|
-
export declare function DataTableExpandRowButton<TData>({ row, rowName, dataHook, trackingEl, trackingLabel, expandLabel, collapseLabel, className, }: DataTableExpandRowButtonProps<TData>):
|
|
996
|
+
export declare function DataTableExpandRowButton<TData>({ row, rowName, dataHook, trackingEl, trackingLabel, expandLabel, collapseLabel, className, }: DataTableExpandRowButtonProps<TData>): React.JSX.Element;
|
|
734
997
|
export declare namespace DataTableExpandRowButton {
|
|
735
998
|
var displayName: string;
|
|
736
999
|
}
|
|
@@ -769,7 +1032,7 @@ export interface DataTableExpandedSkeletonProps {
|
|
|
769
1032
|
* : <DataTableExpandedSkeleton fields={4} />
|
|
770
1033
|
* }
|
|
771
1034
|
*/
|
|
772
|
-
export declare function DataTableExpandedSkeleton({ fields, loadingLabel, dataHook, className, }: DataTableExpandedSkeletonProps):
|
|
1035
|
+
export declare function DataTableExpandedSkeleton({ fields, loadingLabel, dataHook, className, }: DataTableExpandedSkeletonProps): React.JSX.Element;
|
|
773
1036
|
export declare namespace DataTableExpandedSkeleton {
|
|
774
1037
|
var displayName: string;
|
|
775
1038
|
}
|
|
@@ -788,6 +1051,13 @@ export interface DataTableBulkActionsContextValue {
|
|
|
788
1051
|
* `useDataTable` — the same option `DataTablePagination` relies on.
|
|
789
1052
|
*/
|
|
790
1053
|
totalCount: number;
|
|
1054
|
+
/**
|
|
1055
|
+
* Whether a server-side refetch is in flight (the bar's `refetching` prop).
|
|
1056
|
+
* `DataTableBulkActionsActions` goes inert on it; custom action parts built
|
|
1057
|
+
* on this context should do the same — the selection they would act on is
|
|
1058
|
+
* stale (DS-916).
|
|
1059
|
+
*/
|
|
1060
|
+
refetching: boolean;
|
|
791
1061
|
}
|
|
792
1062
|
/**
|
|
793
1063
|
* Read the selection counts from the surrounding `DataTableBulkActions`.
|
|
@@ -821,6 +1091,16 @@ export interface DataTableBulkActionsProps<TData> {
|
|
|
821
1091
|
* `DataTableBulkActionsActions`, and any custom parts in any order.
|
|
822
1092
|
*/
|
|
823
1093
|
children?: React.ReactNode;
|
|
1094
|
+
/**
|
|
1095
|
+
* Marks a server-side refetch as in flight — pass the same flag given to
|
|
1096
|
+
* the `DataTable`'s `refetching`. The bar sets `aria-busy` and
|
|
1097
|
+
* `DataTableBulkActionsActions` becomes inert (unfocusable and unclickable,
|
|
1098
|
+
* visually unchanged): bulk actions would act on stale rows about to be
|
|
1099
|
+
* replaced. The bar lives outside the table's subtree, so it cannot inherit
|
|
1100
|
+
* the flag from `DataTable` — it must be passed here too (DS-916).
|
|
1101
|
+
* @default false
|
|
1102
|
+
*/
|
|
1103
|
+
refetching?: boolean;
|
|
824
1104
|
}
|
|
825
1105
|
/**
|
|
826
1106
|
* Bulk-actions bar for a DataTable with row selection.
|
|
@@ -838,8 +1118,6 @@ export interface DataTableBulkActionsProps<TData> {
|
|
|
838
1118
|
* <DataTableToolbar dataHook="toolbar">
|
|
839
1119
|
* <DataTableToolbarLeft>
|
|
840
1120
|
* <DataTableSearch table={table} dataHook="search" />
|
|
841
|
-
* </DataTableToolbarLeft>
|
|
842
|
-
* <DataTableToolbarRight>
|
|
843
1121
|
* <DataTableBulkActions table={table} dataHook="bulk-actions">
|
|
844
1122
|
* <DataTableBulkActionsSummary />
|
|
845
1123
|
* <DataTableBulkActionsActions>
|
|
@@ -848,10 +1126,13 @@ export interface DataTableBulkActionsProps<TData> {
|
|
|
848
1126
|
* </Button>
|
|
849
1127
|
* </DataTableBulkActionsActions>
|
|
850
1128
|
* </DataTableBulkActions>
|
|
1129
|
+
* </DataTableToolbarLeft>
|
|
1130
|
+
* <DataTableToolbarRight>
|
|
1131
|
+
* <DataTablePagination table={table} dataHook="pagination" />
|
|
851
1132
|
* </DataTableToolbarRight>
|
|
852
1133
|
* </DataTableToolbar>
|
|
853
1134
|
*/
|
|
854
|
-
export declare function DataTableBulkActions<TData>({ table, dataHook, trackingEl, trackingLabel, className, children, }: DataTableBulkActionsProps<TData>):
|
|
1135
|
+
export declare function DataTableBulkActions<TData>({ table, dataHook, trackingEl, trackingLabel, className, children, refetching, }: DataTableBulkActionsProps<TData>): React.JSX.Element | null;
|
|
855
1136
|
export declare namespace DataTableBulkActions {
|
|
856
1137
|
var displayName: string;
|
|
857
1138
|
}
|
|
@@ -897,7 +1178,7 @@ export interface DataTableBulkActionsSummaryProps {
|
|
|
897
1178
|
* }
|
|
898
1179
|
* </DataTableBulkActionsSummary>
|
|
899
1180
|
*/
|
|
900
|
-
export declare function DataTableBulkActionsSummary({ dataHook, className, children, }: DataTableBulkActionsSummaryProps):
|
|
1181
|
+
export declare function DataTableBulkActionsSummary({ dataHook, className, children, }: DataTableBulkActionsSummaryProps): React.JSX.Element;
|
|
901
1182
|
export declare namespace DataTableBulkActionsSummary {
|
|
902
1183
|
var displayName: string;
|
|
903
1184
|
}
|
|
@@ -922,8 +1203,12 @@ export interface DataTableBulkActionsActionsProps {
|
|
|
922
1203
|
* Optional: a single action can sit directly inside
|
|
923
1204
|
* `DataTableBulkActions`. Use this when you have several, or need them
|
|
924
1205
|
* grouped and protected from shrinking.
|
|
1206
|
+
*
|
|
1207
|
+
* While the bar's `refetching` flag is set, the slot is `inert` — its buttons
|
|
1208
|
+
* cannot be clicked or focused (without a disabled look), because the
|
|
1209
|
+
* selection they would act on is stale (DS-916).
|
|
925
1210
|
*/
|
|
926
|
-
export declare function DataTableBulkActionsActions({ dataHook, className, children, }: DataTableBulkActionsActionsProps):
|
|
1211
|
+
export declare function DataTableBulkActionsActions({ dataHook, className, children, }: DataTableBulkActionsActionsProps): React.JSX.Element;
|
|
927
1212
|
export declare namespace DataTableBulkActionsActions {
|
|
928
1213
|
var displayName: string;
|
|
929
1214
|
}
|
|
@@ -943,14 +1228,24 @@ export interface DataTableToolbarProps {
|
|
|
943
1228
|
* Responsive toolbar container for DataTable companion controls.
|
|
944
1229
|
*
|
|
945
1230
|
* Stacks vertically on mobile (< 640 px) and switches to a horizontal
|
|
946
|
-
* row on `sm:` and up.
|
|
947
|
-
*
|
|
1231
|
+
* row on `sm:` and up. The row **wraps**: the bulk-actions bar joins the
|
|
1232
|
+
* search and filters in the left slot while rows are selected, and when the
|
|
1233
|
+
* right slot (pagination) no longer fits beside them it drops to a second
|
|
1234
|
+
* line, right-aligned.
|
|
1235
|
+
* Nothing is hidden or squeezed, which is what keeps the bulk-actions
|
|
1236
|
+
* contract ("search and filters stay mounted") true at any width.
|
|
1237
|
+
* Layout-only — no dependency on a TanStack Table instance, so it works
|
|
1238
|
+
* for table footers or any search-plus-pagination row.
|
|
948
1239
|
*
|
|
949
1240
|
* Toolbars belong in the same flex-column container as their `DataTable` so
|
|
950
1241
|
* the group reads as one slot inside gapped parents — see the composition
|
|
951
1242
|
* note on `DataTable`. The built-in vertical padding provides the spacing
|
|
952
1243
|
* between a toolbar and its table; don't add custom margins or padding.
|
|
953
1244
|
*
|
|
1245
|
+
* Inside a Card with a header, filters that narrow what the card shows
|
|
1246
|
+
* (`DataTableSearch` included) go in the header's `CardToolbar`; this toolbar
|
|
1247
|
+
* keeps pagination beside the table. A report card uses both.
|
|
1248
|
+
*
|
|
954
1249
|
* @example
|
|
955
1250
|
* <DataTableToolbar dataHook="locations-toolbar">
|
|
956
1251
|
* <DataTableToolbarLeft>
|
|
@@ -961,7 +1256,7 @@ export interface DataTableToolbarProps {
|
|
|
961
1256
|
* </DataTableToolbarRight>
|
|
962
1257
|
* </DataTableToolbar>
|
|
963
1258
|
*/
|
|
964
|
-
export declare function DataTableToolbar({ dataHook, className, children, }: DataTableToolbarProps):
|
|
1259
|
+
export declare function DataTableToolbar({ dataHook, className, children, }: DataTableToolbarProps): React.JSX.Element;
|
|
965
1260
|
export declare namespace DataTableToolbar {
|
|
966
1261
|
var displayName: string;
|
|
967
1262
|
}
|
|
@@ -976,10 +1271,12 @@ export interface DataTableToolbarLeftProps {
|
|
|
976
1271
|
}
|
|
977
1272
|
/**
|
|
978
1273
|
* Left slot of `DataTableToolbar`. Grows to fill remaining space on
|
|
979
|
-
* desktop; full-width on mobile.
|
|
980
|
-
*
|
|
1274
|
+
* desktop; full-width on mobile. Its flex basis is its content
|
|
1275
|
+
* (`flex-auto`, not `flex-1`) so a crowded toolbar wraps the right slot
|
|
1276
|
+
* onto a new line instead of squeezing the search and filters; `min-w-0`
|
|
1277
|
+
* still lets long inputs shrink on narrow viewports.
|
|
981
1278
|
*/
|
|
982
|
-
export declare function DataTableToolbarLeft({ className, children, }: DataTableToolbarLeftProps):
|
|
1279
|
+
export declare function DataTableToolbarLeft({ className, children, }: DataTableToolbarLeftProps): React.JSX.Element;
|
|
983
1280
|
export declare namespace DataTableToolbarLeft {
|
|
984
1281
|
var displayName: string;
|
|
985
1282
|
}
|
|
@@ -989,18 +1286,19 @@ export declare namespace DataTableToolbarLeft {
|
|
|
989
1286
|
export interface DataTableToolbarRightProps {
|
|
990
1287
|
/** Additional class name (merged after defaults via `cn`). */
|
|
991
1288
|
className?: string;
|
|
992
|
-
/** Slot contents —
|
|
1289
|
+
/** Slot contents — action buttons, bulk actions, or a compact top `DataTablePagination` for long-list pages. Pagination default placement is below the table. */
|
|
993
1290
|
children: React.ReactNode;
|
|
994
1291
|
}
|
|
995
1292
|
/**
|
|
996
1293
|
* Right slot of `DataTableToolbar`. Collapses to content width and
|
|
997
|
-
* right-aligns on desktop
|
|
998
|
-
*
|
|
1294
|
+
* right-aligns on desktop (`ml-auto`, so it stays right-aligned when the
|
|
1295
|
+
* toolbar wraps it onto its own line); full-width with `justify-end` on
|
|
1296
|
+
* mobile so pagination controls don't jump when stacking.
|
|
999
1297
|
*/
|
|
1000
|
-
export declare function DataTableToolbarRight({ className, children, }: DataTableToolbarRightProps):
|
|
1298
|
+
export declare function DataTableToolbarRight({ className, children, }: DataTableToolbarRightProps): React.JSX.Element;
|
|
1001
1299
|
export declare namespace DataTableToolbarRight {
|
|
1002
1300
|
var displayName: string;
|
|
1003
1301
|
}
|
|
1004
|
-
export { DataTablePaginationRowCount, DataTablePaginationNav };
|
|
1005
|
-
export type { Column, ColumnDef, ExpandedState, PaginationState, Row, RowSelectionState, SortingState, TanStackTable, };
|
|
1302
|
+
export { DataTable, VirtualizedDataTable, DataTablePaginationRowCount, DataTablePaginationNav, useDataTablePagination, };
|
|
1303
|
+
export type { DataTablePaginationInfo, Column, ColumnDef, ExpandedState, PaginationState, Row, RowSelectionState, SortingState, TanStackTable, };
|
|
1006
1304
|
//# sourceMappingURL=data-table.d.ts.map
|