tembro 2.0.5 → 2.1.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/dist/components/calendar/calendar.cjs +1 -1
- package/dist/components/calendar/calendar.d.ts +2 -1
- package/dist/components/calendar/calendar.js +126 -122
- package/dist/components/calendar/date-range-picker.cjs +1 -1
- package/dist/components/calendar/date-range-picker.d.ts +2 -1
- package/dist/components/calendar/date-range-picker.js +39 -39
- package/dist/components/charts/charts.cjs +1 -1
- package/dist/components/charts/charts.d.ts +13 -4
- package/dist/components/charts/charts.js +76 -46
- package/dist/components/charts/progress-ring.cjs +1 -1
- package/dist/components/charts/progress-ring.d.ts +3 -1
- package/dist/components/charts/progress-ring.js +11 -10
- package/dist/components/data-table/data-table-column-visibility-menu.cjs +1 -1
- package/dist/components/data-table/data-table-column-visibility-menu.d.ts +4 -1
- package/dist/components/data-table/data-table-column-visibility-menu.js +36 -8
- package/dist/components/data-table/data-table-pagination.cjs +1 -1
- package/dist/components/data-table/data-table-pagination.js +4 -4
- package/dist/components/data-table/data-table-toolbar.cjs +1 -1
- package/dist/components/data-table/data-table-toolbar.js +12 -13
- package/dist/components/data-table/data-table.cjs +1 -1
- package/dist/components/data-table/data-table.d.ts +2 -2
- package/dist/components/data-table/data-table.js +2 -1
- package/dist/components/display/carousel.cjs +1 -1
- package/dist/components/display/carousel.d.ts +15 -1
- package/dist/components/display/carousel.js +128 -86
- package/dist/components/display/code-block.cjs +2 -2
- package/dist/components/display/code-block.d.ts +2 -1
- package/dist/components/display/code-block.js +17 -12
- package/dist/components/display/delta-badge.cjs +1 -1
- package/dist/components/display/delta-badge.d.ts +2 -1
- package/dist/components/display/delta-badge.js +11 -7
- package/dist/components/display/kanban.cjs +1 -1
- package/dist/components/display/kanban.d.ts +4 -1
- package/dist/components/display/kanban.js +60 -33
- package/dist/components/display/metric-grid.cjs +1 -1
- package/dist/components/display/metric-grid.d.ts +1 -0
- package/dist/components/display/metric-grid.js +1 -1
- package/dist/components/display/qr-code.cjs +1 -1
- package/dist/components/display/qr-code.d.ts +2 -1
- package/dist/components/display/qr-code.js +19 -16
- package/dist/components/display/smart-card.d.ts +1 -1
- package/dist/components/display/status-legend.d.ts +1 -1
- package/dist/components/display/tag.cjs +1 -1
- package/dist/components/display/tag.d.ts +2 -1
- package/dist/components/display/tag.js +28 -22
- package/dist/components/display/tree-view.cjs +1 -1
- package/dist/components/display/tree-view.d.ts +9 -1
- package/dist/components/display/tree-view.js +104 -40
- package/dist/components/display/trend-card.cjs +1 -1
- package/dist/components/display/trend-card.js +27 -41
- package/dist/components/feedback/alert.cjs +1 -1
- package/dist/components/feedback/alert.d.ts +2 -1
- package/dist/components/feedback/alert.js +6 -6
- package/dist/components/feedback/loading-state.cjs +1 -1
- package/dist/components/feedback/loading-state.d.ts +3 -1
- package/dist/components/feedback/loading-state.js +23 -10
- package/dist/components/feedback/page-state.cjs +1 -1
- package/dist/components/feedback/page-state.d.ts +2 -1
- package/dist/components/feedback/page-state.js +7 -4
- package/dist/components/form/form-field-shell.cjs +1 -1
- package/dist/components/form/form-field-shell.d.ts +4 -2
- package/dist/components/form/form-field-shell.js +57 -41
- package/dist/components/form/form-input.cjs +1 -1
- package/dist/components/form/form-input.d.ts +3 -4
- package/dist/components/form/form-input.js +259 -257
- package/dist/components/form/form-select.cjs +1 -1
- package/dist/components/form/form-select.d.ts +2 -2
- package/dist/components/form/form-select.js +8 -6
- package/dist/components/form/form-switch.cjs +1 -1
- package/dist/components/form/form-switch.d.ts +1 -1
- package/dist/components/form/form-switch.js +58 -54
- package/dist/components/form/form-textarea.cjs +1 -1
- package/dist/components/form/form-textarea.d.ts +1 -1
- package/dist/components/form/form-textarea.js +29 -27
- package/dist/components/inputs/async-select.d.ts +3 -0
- package/dist/components/inputs/search-input.d.ts +3 -0
- package/dist/components/inputs/simple-select.cjs +1 -1
- package/dist/components/inputs/simple-select.d.ts +10 -32
- package/dist/components/inputs/simple-select.js +5 -101
- package/dist/components/layout/app-sidebar.cjs +1 -1
- package/dist/components/layout/app-sidebar.d.ts +1 -0
- package/dist/components/layout/app-sidebar.js +36 -36
- package/dist/components/layout/breadcrumbs.cjs +1 -1
- package/dist/components/layout/breadcrumbs.d.ts +2 -1
- package/dist/components/layout/breadcrumbs.js +7 -7
- package/dist/components/modern/calendar-scheduler.cjs +1 -1
- package/dist/components/modern/calendar-scheduler.d.ts +5 -1
- package/dist/components/modern/calendar-scheduler.js +47 -28
- package/dist/components/modern/dual-list-picker.cjs +1 -1
- package/dist/components/modern/dual-list-picker.d.ts +5 -1
- package/dist/components/modern/dual-list-picker.js +81 -23
- package/dist/components/modern/rich-text-editor.cjs +1 -1
- package/dist/components/modern/rich-text-editor.d.ts +3 -1
- package/dist/components/modern/rich-text-editor.js +12 -9
- package/dist/components/modern/tour.cjs +1 -1
- package/dist/components/modern/tour.d.ts +5 -1
- package/dist/components/modern/tour.js +57 -35
- package/dist/components/navigation/command-bar.cjs +1 -1
- package/dist/components/navigation/command-bar.d.ts +3 -1
- package/dist/components/navigation/command-bar.js +10 -7
- package/dist/components/navigation/demo.cjs +1 -1
- package/dist/components/navigation/demo.js +0 -1
- package/dist/components/navigation/nav-tabs.cjs +1 -1
- package/dist/components/navigation/nav-tabs.js +39 -27
- package/dist/components/navigation/page-tabs.cjs +1 -1
- package/dist/components/navigation/page-tabs.js +41 -30
- package/dist/components/navigation/pagination.cjs +1 -1
- package/dist/components/navigation/pagination.d.ts +7 -1
- package/dist/components/navigation/pagination.js +48 -25
- package/dist/components/notifications/notification-center.cjs +1 -1
- package/dist/components/notifications/notification-center.d.ts +3 -1
- package/dist/components/notifications/notification-center.js +56 -38
- package/dist/components/notifications/toast.cjs +1 -1
- package/dist/components/notifications/toast.d.ts +1 -0
- package/dist/components/notifications/toast.js +4 -0
- package/dist/components/overlay/alert-dialog.cjs +1 -1
- package/dist/components/overlay/alert-dialog.js +1 -1
- package/dist/components/overlay/confirm-dialog.cjs +1 -1
- package/dist/components/overlay/confirm-dialog.d.ts +4 -2
- package/dist/components/overlay/confirm-dialog.js +31 -22
- package/dist/components/overlay/drawer.cjs +1 -1
- package/dist/components/overlay/drawer.d.ts +3 -1
- package/dist/components/overlay/drawer.js +24 -16
- package/dist/components/ui/accordion/index.d.ts +4 -0
- package/dist/components/ui/badge/index.cjs +1 -1
- package/dist/components/ui/badge/index.d.ts +1 -1
- package/dist/components/ui/badge/index.js +2 -1
- package/dist/components/ui/button/index.cjs +1 -1
- package/dist/components/ui/button/index.d.ts +2 -1
- package/dist/components/ui/button/index.js +13 -10
- package/dist/components/ui/card/index.cjs +1 -1
- package/dist/components/ui/card/index.d.ts +13 -2
- package/dist/components/ui/card/index.js +74 -49
- package/dist/components/ui/dialog/index.cjs +1 -1
- package/dist/components/ui/dialog/index.js +2 -1
- package/dist/components/ui/hover-card.cjs +1 -1
- package/dist/components/ui/hover-card.d.ts +11 -3
- package/dist/components/ui/hover-card.js +29 -24
- package/dist/components/ui/input/index.cjs +1 -1
- package/dist/components/ui/input/index.d.ts +9 -1
- package/dist/components/ui/input/index.js +63 -30
- package/dist/components/ui/popover/index.cjs +1 -1
- package/dist/components/ui/popover/index.d.ts +2 -2
- package/dist/components/ui/popover/index.js +6 -5
- package/dist/components/ui/radio-group/index.cjs +1 -1
- package/dist/components/ui/radio-group/index.d.ts +5 -1
- package/dist/components/ui/radio-group/index.js +50 -16
- package/dist/components/ui/right-click-menu/index.cjs +1 -1
- package/dist/components/ui/right-click-menu/index.d.ts +5 -1
- package/dist/components/ui/right-click-menu/index.js +77 -23
- package/dist/components/ui/segmented-control/index.cjs +1 -1
- package/dist/components/ui/segmented-control/index.d.ts +2 -1
- package/dist/components/ui/segmented-control/index.js +23 -11
- package/dist/components/ui/select/index.cjs +1 -1
- package/dist/components/ui/select/index.d.ts +40 -1
- package/dist/components/ui/select/index.js +159 -48
- package/dist/components/ui/switch/index.cjs +1 -1
- package/dist/components/ui/switch/index.d.ts +18 -0
- package/dist/components/ui/switch/index.js +47 -17
- package/dist/components/ui/tabs/index.cjs +1 -1
- package/dist/components/ui/tabs/index.d.ts +14 -4
- package/dist/components/ui/tabs/index.js +11 -8
- package/dist/components/ui/textarea/index.cjs +1 -1
- package/dist/components/ui/textarea/index.d.ts +10 -2
- package/dist/components/ui/textarea/index.js +37 -8
- package/dist/components/ui/textarea.cjs +1 -0
- package/dist/components/ui/textarea.d.ts +1 -0
- package/dist/components/ui/textarea.js +2 -0
- package/dist/components/ui/tooltip/index.cjs +1 -1
- package/dist/components/ui/tooltip/index.d.ts +11 -3
- package/dist/components/ui/tooltip/index.js +41 -20
- package/dist/components/upload/file-upload.cjs +1 -1
- package/dist/components/upload/file-upload.d.ts +8 -1
- package/dist/components/upload/file-upload.js +132 -100
- package/dist/components/upload/image-upload.cjs +1 -1
- package/dist/components/upload/image-upload.d.ts +5 -1
- package/dist/components/upload/image-upload.js +34 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +31 -31
- package/dist/public-component-surface.cjs +1 -1
- package/dist/public-component-surface.js +15 -0
- package/dist/showcase/component-api-schema.cjs +1 -1
- package/dist/showcase/component-api-schema.js +187 -10
- package/dist/showcase/create-demo.cjs +5 -4
- package/dist/showcase/create-demo.js +2 -2
- package/dist/showcase/fallback.cjs +3 -3
- package/dist/showcase/fallback.js +221 -243
- package/dist/showcase/premium/alert/showcase.cjs +1 -1
- package/dist/showcase/premium/alert/showcase.js +1 -0
- package/dist/showcase/premium/app-sidebar/showcase.cjs +1 -1
- package/dist/showcase/premium/app-sidebar/showcase.js +1 -0
- package/dist/showcase/premium/badge/showcase.cjs +1 -1
- package/dist/showcase/premium/badge/showcase.js +7 -0
- package/dist/showcase/premium/badge/types.d.ts +1 -1
- package/dist/showcase/premium/breadcrumbs/showcase.cjs +1 -1
- package/dist/showcase/premium/breadcrumbs/showcase.js +12 -1
- package/dist/showcase/premium/button/mock.cjs +1 -4
- package/dist/showcase/premium/button/mock.js +1 -1
- package/dist/showcase/premium/button/showcase.cjs +1 -1
- package/dist/showcase/premium/button/showcase.js +2 -2
- package/dist/showcase/premium/card/showcase.cjs +1 -1
- package/dist/showcase/premium/card/showcase.js +96 -47
- package/dist/showcase/premium/carousel/showcase.cjs +1 -1
- package/dist/showcase/premium/carousel/showcase.js +76 -49
- package/dist/showcase/premium/command-bar/showcase.cjs +1 -1
- package/dist/showcase/premium/command-bar/showcase.js +2 -0
- package/dist/showcase/premium/data-table/mock.cjs +12 -11
- package/dist/showcase/premium/data-table/mock.js +1 -1
- package/dist/showcase/premium/data-table/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table/showcase.js +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.cjs +1 -1
- package/dist/showcase/premium/data-table-parts/showcase.js +3 -1
- package/dist/showcase/premium/file-upload/showcase.cjs +1 -1
- package/dist/showcase/premium/file-upload/showcase.js +25 -4
- package/dist/showcase/premium/image-upload/showcase.cjs +1 -1
- package/dist/showcase/premium/image-upload/showcase.js +4 -1
- package/dist/showcase/premium/index.cjs +1 -1
- package/dist/showcase/premium/index.js +396 -402
- package/dist/showcase/premium/loading-state/showcase.cjs +1 -1
- package/dist/showcase/premium/loading-state/showcase.js +3 -1
- package/dist/showcase/premium/metric-grid/showcase.cjs +1 -1
- package/dist/showcase/premium/metric-grid/showcase.js +96 -28
- package/dist/showcase/premium/notification-center/showcase.cjs +1 -1
- package/dist/showcase/premium/notification-center/showcase.js +7 -3
- package/dist/showcase/premium/page-state/showcase.cjs +1 -1
- package/dist/showcase/premium/page-state/showcase.js +5 -1
- package/dist/showcase/premium/pagination/showcase.cjs +1 -1
- package/dist/showcase/premium/pagination/showcase.js +15 -2
- package/dist/showcase/premium/popover/showcase.cjs +1 -1
- package/dist/showcase/premium/popover/showcase.js +85 -50
- package/dist/showcase/premium/radio-group/showcase.cjs +1 -1
- package/dist/showcase/premium/radio-group/showcase.js +27 -4
- package/dist/showcase/premium/right-click-menu/showcase.cjs +1 -1
- package/dist/showcase/premium/right-click-menu/showcase.js +56 -43
- package/dist/showcase/premium/segmented-control/showcase.cjs +1 -1
- package/dist/showcase/premium/segmented-control/showcase.js +1 -0
- package/dist/showcase/premium/select/data.cjs +1 -1
- package/dist/showcase/premium/select/data.js +69 -34
- package/dist/showcase/premium/select/mock.cjs +20 -8
- package/dist/showcase/premium/select/mock.js +3 -2
- package/dist/showcase/premium/select/showcase.cjs +1 -1
- package/dist/showcase/premium/select/showcase.js +101 -86
- package/dist/showcase/premium/select/types.d.ts +3 -0
- package/dist/showcase/premium/statistic/showcase.cjs +1 -1
- package/dist/showcase/premium/statistic/showcase.js +57 -25
- package/dist/showcase/premium/switch/showcase.cjs +1 -1
- package/dist/showcase/premium/switch/showcase.js +25 -14
- package/dist/showcase/premium/tabs/showcase.cjs +1 -1
- package/dist/showcase/premium/tabs/showcase.js +171 -48
- package/dist/showcase/premium/textarea/mock.cjs +12 -4
- package/dist/showcase/premium/textarea/mock.js +1 -1
- package/dist/showcase/premium/textarea/showcase.cjs +1 -1
- package/dist/showcase/premium/textarea/showcase.js +8 -3
- package/dist/showcase/premium/toast/showcase.cjs +1 -1
- package/dist/showcase/premium/toast/showcase.js +32 -6
- package/dist/showcase/premium/types.d.ts +1 -1
- package/dist/showcase/registry-quality.cjs +1 -1
- package/dist/showcase/registry-quality.js +1 -0
- package/dist/showcase/registry-specific.cjs +1 -1
- package/dist/showcase/registry-specific.js +78 -74
- package/dist/showcase/render-registry-preview.cjs +1 -1
- package/dist/showcase/render-registry-preview.js +90 -108
- package/dist/showcase/site-data.cjs +1 -1
- package/dist/showcase/site-data.js +60 -21
- package/dist/showcase/tembro-registry.json.cjs +1 -1
- package/dist/showcase/tembro-registry.json.js +34 -20
- package/dist/showcase/types.d.ts +1 -1
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +31 -31
- package/packages/cli/vendor/src/components/calendar/calendar.tsx +59 -50
- package/packages/cli/vendor/src/components/calendar/date-range-picker.tsx +7 -4
- package/packages/cli/vendor/src/components/charts/charts.tsx +109 -66
- package/packages/cli/vendor/src/components/charts/progress-ring.tsx +37 -26
- package/packages/cli/vendor/src/components/data-table/data-table-column-visibility-menu.tsx +41 -22
- package/packages/cli/vendor/src/components/data-table/data-table-pagination.tsx +7 -7
- package/packages/cli/vendor/src/components/data-table/data-table-toolbar.tsx +8 -6
- package/packages/cli/vendor/src/components/data-table/data-table.tsx +21 -20
- package/packages/cli/vendor/src/components/display/carousel.tsx +102 -9
- package/packages/cli/vendor/src/components/display/code-block.tsx +22 -2
- package/packages/cli/vendor/src/components/display/delta-badge.tsx +11 -11
- package/packages/cli/vendor/src/components/display/kanban.tsx +103 -57
- package/packages/cli/vendor/src/components/display/metric-grid.tsx +16 -13
- package/packages/cli/vendor/src/components/display/qr-code.tsx +17 -15
- package/packages/cli/vendor/src/components/display/smart-card.tsx +1 -1
- package/packages/cli/vendor/src/components/display/status-legend.tsx +1 -1
- package/packages/cli/vendor/src/components/display/tag.tsx +39 -21
- package/packages/cli/vendor/src/components/display/tree-view.tsx +221 -84
- package/packages/cli/vendor/src/components/display/trend-card.tsx +6 -40
- package/packages/cli/vendor/src/components/feedback/alert.tsx +3 -1
- package/packages/cli/vendor/src/components/feedback/loading-state.tsx +33 -17
- package/packages/cli/vendor/src/components/feedback/page-state.tsx +8 -7
- package/packages/cli/vendor/src/components/form/form-field-shell.tsx +37 -8
- package/packages/cli/vendor/src/components/form/form-input.tsx +11 -12
- package/packages/cli/vendor/src/components/form/form-select.tsx +6 -4
- package/packages/cli/vendor/src/components/form/form-switch.tsx +9 -3
- package/packages/cli/vendor/src/components/form/form-textarea.tsx +6 -2
- package/packages/cli/vendor/src/components/inputs/async-select.tsx +11 -8
- package/packages/cli/vendor/src/components/inputs/search-input.tsx +5 -2
- package/packages/cli/vendor/src/components/inputs/simple-select.tsx +20 -190
- package/packages/cli/vendor/src/components/layout/app-sidebar.tsx +3 -1
- package/packages/cli/vendor/src/components/layout/breadcrumbs.tsx +3 -1
- package/packages/cli/vendor/src/components/modern/calendar-scheduler.tsx +28 -13
- package/packages/cli/vendor/src/components/modern/dual-list-picker.tsx +103 -35
- package/packages/cli/vendor/src/components/modern/rich-text-editor.tsx +25 -22
- package/packages/cli/vendor/src/components/modern/tour.tsx +47 -29
- package/packages/cli/vendor/src/components/navigation/command-bar.tsx +6 -0
- package/packages/cli/vendor/src/components/navigation/demo.tsx +0 -1
- package/packages/cli/vendor/src/components/navigation/nav-tabs.tsx +38 -29
- package/packages/cli/vendor/src/components/navigation/page-tabs.tsx +35 -23
- package/packages/cli/vendor/src/components/navigation/pagination.tsx +65 -31
- package/packages/cli/vendor/src/components/notifications/notification-center.tsx +64 -39
- package/packages/cli/vendor/src/components/notifications/toast.tsx +23 -21
- package/packages/cli/vendor/src/components/overlay/alert-dialog.tsx +1 -1
- package/packages/cli/vendor/src/components/overlay/confirm-dialog.tsx +45 -22
- package/packages/cli/vendor/src/components/overlay/drawer.tsx +18 -5
- package/packages/cli/vendor/src/components/ui/accordion/index.tsx +4 -0
- package/packages/cli/vendor/src/components/ui/badge/index.tsx +2 -1
- package/packages/cli/vendor/src/components/ui/button/index.tsx +11 -5
- package/packages/cli/vendor/src/components/ui/card/index.tsx +95 -25
- package/packages/cli/vendor/src/components/ui/dialog/index.tsx +2 -1
- package/packages/cli/vendor/src/components/ui/hover-card.tsx +54 -28
- package/packages/cli/vendor/src/components/ui/input/index.tsx +98 -0
- package/packages/cli/vendor/src/components/ui/popover/index.tsx +10 -8
- package/packages/cli/vendor/src/components/ui/radio-group/index.tsx +55 -6
- package/packages/cli/vendor/src/components/ui/right-click-menu/index.tsx +120 -9
- package/packages/cli/vendor/src/components/ui/segmented-control/index.tsx +29 -3
- package/packages/cli/vendor/src/components/ui/select/index.tsx +260 -34
- package/packages/cli/vendor/src/components/ui/switch/index.tsx +71 -6
- package/packages/cli/vendor/src/components/ui/tabs/index.tsx +22 -6
- package/packages/cli/vendor/src/components/ui/textarea/index.tsx +105 -15
- package/packages/cli/vendor/src/components/ui/textarea.tsx +2 -0
- package/packages/cli/vendor/src/components/ui/tooltip/index.tsx +67 -22
- package/packages/cli/vendor/src/components/upload/file-upload.tsx +120 -57
- package/packages/cli/vendor/src/components/upload/image-upload.tsx +71 -24
- package/packages/cli/vendor/src/public-component-surface.ts +3 -0
- package/packages/cli/vendor/src/showcase/component-api-schema.ts +79 -41
- package/packages/cli/vendor/src/showcase/create-demo.tsx +16 -15
- package/packages/cli/vendor/src/showcase/fallback.tsx +4 -19
- package/packages/cli/vendor/src/showcase/premium/alert/showcase.tsx +1 -0
- package/packages/cli/vendor/src/showcase/premium/app-sidebar/showcase.tsx +1 -0
- package/packages/cli/vendor/src/showcase/premium/badge/showcase.tsx +4 -2
- package/packages/cli/vendor/src/showcase/premium/badge/types.ts +1 -1
- package/packages/cli/vendor/src/showcase/premium/breadcrumbs/showcase.tsx +3 -1
- package/packages/cli/vendor/src/showcase/premium/button/mock.ts +2 -5
- package/packages/cli/vendor/src/showcase/premium/button/showcase.tsx +2 -2
- package/packages/cli/vendor/src/showcase/premium/card/showcase.tsx +26 -1
- package/packages/cli/vendor/src/showcase/premium/carousel/showcase.tsx +19 -3
- package/packages/cli/vendor/src/showcase/premium/command-bar/showcase.tsx +1 -1
- package/packages/cli/vendor/src/showcase/premium/data-table/mock.ts +26 -25
- package/packages/cli/vendor/src/showcase/premium/data-table/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/data-table-parts/showcase.tsx +3 -3
- package/packages/cli/vendor/src/showcase/premium/file-upload/showcase.tsx +21 -1
- package/packages/cli/vendor/src/showcase/premium/image-upload/showcase.tsx +4 -1
- package/packages/cli/vendor/src/showcase/premium/index.ts +0 -2
- package/packages/cli/vendor/src/showcase/premium/loading-state/showcase.tsx +1 -1
- package/packages/cli/vendor/src/showcase/premium/metric-grid/showcase.tsx +36 -4
- package/packages/cli/vendor/src/showcase/premium/notification-center/showcase.tsx +4 -3
- package/packages/cli/vendor/src/showcase/premium/page-state/showcase.tsx +1 -0
- package/packages/cli/vendor/src/showcase/premium/pagination/showcase.tsx +13 -1
- package/packages/cli/vendor/src/showcase/premium/popover/showcase.tsx +27 -11
- package/packages/cli/vendor/src/showcase/premium/radio-group/showcase.tsx +13 -1
- package/packages/cli/vendor/src/showcase/premium/right-click-menu/showcase.tsx +8 -5
- package/packages/cli/vendor/src/showcase/premium/segmented-control/showcase.tsx +1 -0
- package/packages/cli/vendor/src/showcase/premium/select/data.ts +12 -3
- package/packages/cli/vendor/src/showcase/premium/select/mock.ts +4 -4
- package/packages/cli/vendor/src/showcase/premium/select/showcase.tsx +35 -22
- package/packages/cli/vendor/src/showcase/premium/select/types.ts +3 -0
- package/packages/cli/vendor/src/showcase/premium/statistic/showcase.tsx +10 -1
- package/packages/cli/vendor/src/showcase/premium/switch/showcase.tsx +15 -6
- package/packages/cli/vendor/src/showcase/premium/tabs/showcase.tsx +48 -1
- package/packages/cli/vendor/src/showcase/premium/textarea/mock.ts +12 -4
- package/packages/cli/vendor/src/showcase/premium/textarea/showcase.tsx +5 -0
- package/packages/cli/vendor/src/showcase/premium/toast/showcase.tsx +17 -1
- package/packages/cli/vendor/src/showcase/premium/types.ts +1 -1
- package/packages/cli/vendor/src/showcase/registry-quality.ts +3 -2
- package/packages/cli/vendor/src/showcase/registry-specific.tsx +7 -8
- package/packages/cli/vendor/src/showcase/render-registry-preview.tsx +5 -21
- package/packages/cli/vendor/src/showcase/site-data.tsx +21 -15
- package/packages/cli/vendor/src/showcase/tembro-registry.json +42 -20
- package/packages/cli/vendor/src/showcase/types.ts +1 -1
- package/registry.json +18 -6
|
@@ -14,61 +14,61 @@ function f(e) {
|
|
|
14
14
|
function p(e, t) {
|
|
15
15
|
return typeof e == "string" ? e : t;
|
|
16
16
|
}
|
|
17
|
-
function m({ className: a, value: m, onValueChange: h, labels: g, placeholder: _, disabled: v = !1, clearable: y = !0, formatValue: b = f, closeOnSelect: x = !1, closeOnPresetSelect: S = !1, showFooter: C = !0, presets: w, triggerClassName: T, contentClassName: E,
|
|
18
|
-
let [
|
|
17
|
+
function m({ className: a, value: m, onValueChange: h, labels: g, placeholder: _, disabled: v = !1, clearable: y = !0, formatValue: b = f, closeOnSelect: x = !1, closeOnPresetSelect: S = !1, showFooter: C = !0, presets: w, triggerClassName: T, contentClassName: E, months: D, numberOfMonths: O = 2, pagedNavigation: k = !0, ...A }) {
|
|
18
|
+
let [j, M] = s.useState(!1), [N, P] = s.useState(m ?? {}), F = m?.from ?? "", I = m?.to ?? "", L = !!(F || I), R = C ? N : m, z = R?.from ?? "", B = R?.to ?? "", V = !!(z || B), H = D ?? O, U = F && I ? `${b(F)} - ${b(I)}` : F ? `${b(F)} - ...` : _ ?? g?.placeholder ?? "Select date range", W = z && B ? `${b(z)} - ${b(B)}` : z ? `${b(z)} - ...` : g?.placeholder ?? "Select date range";
|
|
19
19
|
s.useEffect(() => {
|
|
20
|
-
|
|
20
|
+
j && C && P(m ?? {});
|
|
21
21
|
}, [
|
|
22
|
-
|
|
22
|
+
j,
|
|
23
23
|
C,
|
|
24
24
|
m
|
|
25
25
|
]);
|
|
26
|
-
let
|
|
26
|
+
let G = (e) => {
|
|
27
27
|
if (C) {
|
|
28
|
-
|
|
28
|
+
P(e);
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
h?.(e), x && e.from && e.to &&
|
|
32
|
-
},
|
|
33
|
-
h?.(
|
|
34
|
-
},
|
|
31
|
+
h?.(e), x && e.from && e.to && M(!1);
|
|
32
|
+
}, K = () => {
|
|
33
|
+
h?.(N), M(!1);
|
|
34
|
+
}, q = () => {
|
|
35
35
|
let e = {};
|
|
36
36
|
if (C) {
|
|
37
|
-
|
|
37
|
+
P(e);
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
h?.(e);
|
|
41
|
-
},
|
|
41
|
+
}, J = () => {
|
|
42
42
|
let e = {};
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
e.preventDefault(), e.stopPropagation(),
|
|
46
|
-
},
|
|
43
|
+
P(e), h?.(e);
|
|
44
|
+
}, Y = (e) => {
|
|
45
|
+
e.preventDefault(), e.stopPropagation(), J();
|
|
46
|
+
}, X = (e) => {
|
|
47
47
|
if (C) {
|
|
48
|
-
|
|
48
|
+
P(e), S && (h?.(e), M(!1));
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
h?.(e), (x || S) && e.from && e.to &&
|
|
51
|
+
h?.(e), (x || S) && e.from && e.to && M(!1);
|
|
52
52
|
};
|
|
53
53
|
return /* @__PURE__ */ u("div", {
|
|
54
54
|
"data-slot": "date-range-picker",
|
|
55
55
|
className: e("w-full", a),
|
|
56
56
|
children: /* @__PURE__ */ d(n, {
|
|
57
|
-
open:
|
|
58
|
-
onOpenChange:
|
|
57
|
+
open: j,
|
|
58
|
+
onOpenChange: M,
|
|
59
59
|
children: [/* @__PURE__ */ d(i, {
|
|
60
60
|
render: /* @__PURE__ */ u(t, {
|
|
61
61
|
type: "button",
|
|
62
62
|
variant: "outline",
|
|
63
63
|
disabled: v,
|
|
64
|
-
className: e("group min-h-11 w-full justify-start gap-3 rounded-[var(--aui-control-radius,var(--radius-md))] border-border/80 bg-background/96 px-3 text-left font-normal shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04))]", !
|
|
64
|
+
className: e("group min-h-11 w-full justify-start gap-3 rounded-[var(--aui-control-radius,var(--radius-md))] border-border/80 bg-background/96 px-3 text-left font-normal shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04))]", !L && "text-muted-foreground", T)
|
|
65
65
|
}),
|
|
66
66
|
children: [
|
|
67
67
|
/* @__PURE__ */ u(c, {
|
|
68
68
|
"data-icon": "inline-start",
|
|
69
|
-
className: e(
|
|
69
|
+
className: e(L && "text-primary")
|
|
70
70
|
}),
|
|
71
|
-
|
|
71
|
+
L ? /* @__PURE__ */ d("span", {
|
|
72
72
|
className: "grid min-w-0 flex-1 grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-2",
|
|
73
73
|
children: [
|
|
74
74
|
/* @__PURE__ */ d("span", {
|
|
@@ -78,7 +78,7 @@ function m({ className: a, value: m, onValueChange: h, labels: g, placeholder: _
|
|
|
78
78
|
children: g?.start ?? "Start"
|
|
79
79
|
}), /* @__PURE__ */ u("span", {
|
|
80
80
|
className: "truncate text-sm font-semibold text-foreground",
|
|
81
|
-
children:
|
|
81
|
+
children: F ? b(F) : "..."
|
|
82
82
|
})]
|
|
83
83
|
}),
|
|
84
84
|
/* @__PURE__ */ u("span", {
|
|
@@ -92,7 +92,7 @@ function m({ className: a, value: m, onValueChange: h, labels: g, placeholder: _
|
|
|
92
92
|
children: g?.end ?? "End"
|
|
93
93
|
}), /* @__PURE__ */ u("span", {
|
|
94
94
|
className: "truncate text-sm font-semibold text-foreground",
|
|
95
|
-
children:
|
|
95
|
+
children: I ? b(I) : "..."
|
|
96
96
|
})]
|
|
97
97
|
})
|
|
98
98
|
]
|
|
@@ -103,17 +103,17 @@ function m({ className: a, value: m, onValueChange: h, labels: g, placeholder: _
|
|
|
103
103
|
children: "Range"
|
|
104
104
|
}), /* @__PURE__ */ u("span", {
|
|
105
105
|
className: "truncate text-sm",
|
|
106
|
-
children:
|
|
106
|
+
children: U
|
|
107
107
|
})]
|
|
108
108
|
}),
|
|
109
|
-
y &&
|
|
109
|
+
y && L ? /* @__PURE__ */ u("span", {
|
|
110
110
|
role: "button",
|
|
111
111
|
tabIndex: 0,
|
|
112
112
|
"aria-label": p(g?.clear, "Clear date range"),
|
|
113
113
|
className: "ml-auto inline-flex size-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground opacity-80 transition hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
|
|
114
|
-
onClick:
|
|
114
|
+
onClick: Y,
|
|
115
115
|
onKeyDown: (e) => {
|
|
116
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
116
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), J());
|
|
117
117
|
},
|
|
118
118
|
children: /* @__PURE__ */ u(l, { className: "size-3.5" })
|
|
119
119
|
}) : null
|
|
@@ -129,24 +129,24 @@ function m({ className: a, value: m, onValueChange: h, labels: g, placeholder: _
|
|
|
129
129
|
variant: "outline",
|
|
130
130
|
size: "sm",
|
|
131
131
|
className: "h-7 rounded-full px-3 text-xs",
|
|
132
|
-
onClick: () =>
|
|
132
|
+
onClick: () => X(e.value),
|
|
133
133
|
children: e.label
|
|
134
134
|
}, n))
|
|
135
135
|
}) : null,
|
|
136
136
|
/* @__PURE__ */ u(o, {
|
|
137
137
|
mode: "range",
|
|
138
|
-
range:
|
|
139
|
-
onRangeChange:
|
|
138
|
+
range: R,
|
|
139
|
+
onRangeChange: G,
|
|
140
140
|
labels: g,
|
|
141
141
|
renderSelectionSummary: ({ range: e }) => {
|
|
142
142
|
let t = e?.from ? b(e.from) : null, n = e?.to ? b(e.to) : null;
|
|
143
143
|
return t && n ? `${t} -> ${n}` : t ? `${t} -> ...` : "No range selected";
|
|
144
144
|
},
|
|
145
|
-
numberOfMonths:
|
|
146
|
-
pagedNavigation:
|
|
145
|
+
numberOfMonths: H,
|
|
146
|
+
pagedNavigation: k,
|
|
147
147
|
showClearShortcut: !C && y,
|
|
148
148
|
showSelectionSummary: !0,
|
|
149
|
-
...
|
|
149
|
+
...A
|
|
150
150
|
}),
|
|
151
151
|
C && /* @__PURE__ */ d("div", {
|
|
152
152
|
className: "flex flex-wrap items-center justify-between gap-3 border-t border-border/70 bg-muted/24 px-4 py-3",
|
|
@@ -154,7 +154,7 @@ function m({ className: a, value: m, onValueChange: h, labels: g, placeholder: _
|
|
|
154
154
|
className: "min-w-0 text-sm text-muted-foreground",
|
|
155
155
|
children: /* @__PURE__ */ u("span", {
|
|
156
156
|
className: "block truncate",
|
|
157
|
-
children:
|
|
157
|
+
children: W
|
|
158
158
|
})
|
|
159
159
|
}), /* @__PURE__ */ d("div", {
|
|
160
160
|
className: "flex items-center gap-2",
|
|
@@ -162,13 +162,13 @@ function m({ className: a, value: m, onValueChange: h, labels: g, placeholder: _
|
|
|
162
162
|
type: "button",
|
|
163
163
|
variant: "ghost",
|
|
164
164
|
size: "sm",
|
|
165
|
-
onClick:
|
|
165
|
+
onClick: q,
|
|
166
166
|
children: g?.clear ?? "Clear"
|
|
167
167
|
}), /* @__PURE__ */ u(t, {
|
|
168
168
|
type: "button",
|
|
169
169
|
size: "sm",
|
|
170
|
-
disabled: !
|
|
171
|
-
onClick:
|
|
170
|
+
disabled: !V,
|
|
171
|
+
onClick: K,
|
|
172
172
|
children: g?.apply ?? "Apply"
|
|
173
173
|
})]
|
|
174
174
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={sm:120,md:180,lg:260};function o(e,t=1){return Math.max(...e,t)}function s(e,t){return!Number.isFinite(e)||t<=0?0:Math.max(0,Math.min(e/t,1))}function c(e,t,n,r){let i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={sm:120,md:180,lg:260};function o(e,t=1){return Math.max(...e,t)}function s(e,t){return!Number.isFinite(e)||t<=0?0:Math.max(0,Math.min(e/t,1))}function c(e,t){return t??`var(--color-chart-${e%5+1}, var(--primary))`}function l(e,t,n,r){let i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function u(e,t,n,r,i){let a=l(e,t,n,i),o=l(e,t,n,r),s=i-r<=180?`0`:`1`;return[`M`,a.x,a.y,`A`,n,n,0,s,0,o.x,o.y].join(` `)}function d(e,t,n,r=12){let i=o(e),a=Math.max(t-r*2,1),c=Math.max(n-r*2,1);return e.length===0?``:e.map((t,n)=>{let o=r+(e.length===1?a/2:n/(e.length-1)*a),l=r+(1-s(t,i))*c;return`${n===0?`M`:`L`} ${o} ${l}`}).join(` `)}function f(e,t,n,r=12){let i=d(e,t,n,r);if(!i)return``;let a=n-r;return`${i} L ${e.length===1?t/2:t-r} ${a} L ${e.length===1?t/2:r} ${a} Z`}function p({title:e,description:r,action:a,state:o=`ready`,emptyLabel:s=`No data available.`,className:c,children:l,...u}){return(0,i.jsxs)(n.Card,{"data-slot":`chart-frame`,className:t.cn(`border-border/75 bg-card/96 shadow-sm ring-1 ring-foreground/4`,c),...u,children:[(e||r||a)&&(0,i.jsxs)(n.CardHeader,{className:`flex flex-row items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`grid gap-1`,children:[e&&(0,i.jsx)(n.CardTitle,{children:e}),r&&(0,i.jsx)(n.CardDescription,{children:r})]}),a]}),(0,i.jsxs)(n.CardContent,{children:[o===`loading`?(0,i.jsxs)(`div`,{className:`grid gap-3`,children:[(0,i.jsx)(`div`,{className:`h-4 w-24 animate-pulse rounded bg-muted`}),(0,i.jsx)(`div`,{className:`h-36 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70`})]}):null,o===`empty`?(0,i.jsx)(`div`,{className:`rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground`,children:s}):null,o===`ready`?l:null]})]})}function m({data:e,size:n=`md`,max:r,showLabels:l=!0,showValues:u=!0,state:d=`ready`,emptyLabel:f=`No chart data.`,className:p,barClassName:m,...h}){let g=e.map(e=>e.value),_=r??o(g.map(e=>Math.abs(e))),v=a[n];return d===`loading`?(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`grid gap-3`,p),...h,children:(0,i.jsx)(`div`,{className:`h-40 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70`})}):d===`empty`||e.length===0?(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground`,p),...h,children:f}):(0,i.jsx)(`div`,{"data-slot":`bar-chart`,className:t.cn(`grid gap-3`,p),...h,children:(0,i.jsx)(`div`,{className:`flex items-end gap-2`,style:{height:v},children:e.map((e,n)=>{let r=s(Math.abs(e.value),_),a=e.value<0;return(0,i.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col items-center gap-2`,children:[u&&(0,i.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.value}),(0,i.jsx)(`div`,{className:`flex w-full flex-1 items-end rounded-[min(var(--radius-xl),16px)] border border-border/60 bg-muted/38 p-1`,children:(0,i.jsx)(`div`,{className:t.cn(`w-full rounded-[min(var(--radius-lg),12px)] bg-primary transition-all`,m),style:{height:`${Math.max(r*100,Math.abs(e.value)>0?3:0)}%`,background:c(n,e.color),opacity:a?.72:1}})}),l&&(0,i.jsx)(`div`,{className:`max-w-full truncate text-xs text-muted-foreground`,children:e.label})]},n)})})})}function h({values:e,size:n=`md`,width:r=560,showArea:c=!1,stroke:l=`var(--primary)`,state:u=`ready`,emptyLabel:p=`No line data.`,className:m,...h}){let g=a[n],_=d(e,r,g),v=f(e,r,g);return u===`loading`?(0,i.jsx)(`div`,{className:t.cn(`h-36 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70`,m)}):u===`empty`||e.length===0?(0,i.jsx)(`div`,{className:t.cn(`rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground`,m),children:p}):(0,i.jsxs)(`svg`,{"data-slot":`line-chart`,viewBox:`0 0 ${r} ${g}`,className:t.cn(`h-auto w-full overflow-visible`,m),role:`img`,...h,children:[c&&(0,i.jsx)(`path`,{d:v,fill:`var(--primary)`,opacity:`0.12`}),(0,i.jsx)(`path`,{d:_,fill:`none`,stroke:l,strokeWidth:`3`,strokeLinecap:`round`,strokeLinejoin:`round`}),e.map((t,n)=>{let a=o(e);return(0,i.jsx)(`circle`,{cx:12+(e.length===1?(r-24)/2:n/(e.length-1)*(r-24)),cy:12+(1-s(t,a))*(g-24),r:`3`,fill:l},n)})]})}function g({values:e,positive:n=!0,stroke:r,className:a,...o}){return(0,i.jsx)(h,{values:e,width:180,size:`sm`,stroke:r??(n?`var(--primary)`:`var(--destructive)`),className:t.cn(`max-w-44`,a),"aria-label":`Sparkline`,...o})}function _({data:e,size:n=180,strokeWidth:r=18,centerLabel:a,centerValue:o,state:s=`ready`,emptyLabel:l=`No distribution data.`,className:d,...f}){let p=e.reduce((e,t)=>e+Math.max(t.value,0),0),m=n/2-r,h=e.map((t,n)=>{let r=Math.max(t.value,0),i=e.slice(0,n).reduce((e,t)=>e+Math.max(t.value,0),0);return{item:t,start:i,end:p>0?i+r/p*360:i}});return s===`loading`?(0,i.jsx)(`div`,{className:t.cn(`h-44 w-full max-w-48 animate-pulse rounded-full bg-muted/70`,d)}):s===`empty`||e.length===0||p<=0?(0,i.jsx)(`div`,{className:t.cn(`flex h-44 w-full max-w-48 items-center justify-center rounded-full border border-dashed border-border/70 px-4 text-center text-sm text-muted-foreground`,d),children:l}):(0,i.jsxs)(`svg`,{"data-slot":`donut-chart`,viewBox:`0 0 ${n} ${n}`,className:t.cn(`h-auto w-full max-w-48`,d),role:`img`,...f,children:[(0,i.jsx)(`circle`,{cx:n/2,cy:n/2,r:m,fill:`none`,stroke:`var(--muted)`,strokeWidth:r}),h.map(({item:e,start:t,end:a},o)=>(0,i.jsx)(`path`,{d:u(n/2,n/2,m,t,a),fill:`none`,stroke:c(o,e.color),strokeWidth:r,strokeLinecap:`round`},o)),(o||a)&&(0,i.jsxs)(`text`,{x:`50%`,y:`50%`,textAnchor:`middle`,dominantBaseline:`middle`,fill:`var(--foreground)`,children:[o&&(0,i.jsx)(`tspan`,{x:`50%`,dy:a?`-0.2em`:`0`,className:`text-lg font-semibold`,children:o}),a&&(0,i.jsx)(`tspan`,{x:`50%`,dy:`1.3em`,className:`text-xs fill-muted-foreground`,children:a})]})]})}function v({data:e,className:n,...r}){return(0,i.jsx)(`div`,{"data-slot":`chart-legend`,className:t.cn(`flex flex-wrap gap-3 text-xs text-muted-foreground`,n),...r,children:e.map((e,t)=>(0,i.jsxs)(`div`,{className:`inline-flex items-center gap-1.5`,children:[(0,i.jsx)(`span`,{className:`size-2 rounded-full bg-primary`,style:{background:c(t,e.color)}}),(0,i.jsx)(`span`,{children:e.label})]},t))})}function y({label:e,value:n,change:r,positive:a=!0,values:o,className:s,...c}){return(0,i.jsxs)(`div`,{"data-slot":`metric-trend`,className:t.cn(`grid gap-3 rounded-[var(--radius-2xl)] border border-border/75 bg-card/96 p-4 shadow-sm ring-1 ring-foreground/4`,s),...c,children:[(0,i.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,i.jsxs)(`div`,{className:`grid gap-1`,children:[(0,i.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:e}),(0,i.jsx)(`div`,{className:`text-2xl font-semibold tracking-tight`,children:n})]}),r&&(0,i.jsx)(`div`,{className:t.cn(`rounded-full px-2 py-1 text-xs font-medium`,a?`bg-primary/10 text-primary`:`bg-destructive/10 text-destructive`),children:r})]}),o&&(0,i.jsx)(g,{values:o,positive:a})]})}exports.BarChart=m,exports.ChartFrame=p,exports.ChartLegend=v,exports.DonutChart=_,exports.LineChart=h,exports.MetricTrend=y,exports.Sparkline=g;
|
|
@@ -14,12 +14,15 @@ export type ChartSeries = {
|
|
|
14
14
|
};
|
|
15
15
|
export type ChartAxisLabel = string | number | React.ReactNode;
|
|
16
16
|
export type ChartSize = "sm" | "md" | "lg";
|
|
17
|
+
export type ChartState = "ready" | "loading" | "empty";
|
|
17
18
|
export type ChartFrameProps = React.ComponentProps<typeof Card> & {
|
|
18
19
|
title?: React.ReactNode;
|
|
19
20
|
description?: React.ReactNode;
|
|
20
21
|
action?: React.ReactNode;
|
|
22
|
+
state?: ChartState;
|
|
23
|
+
emptyLabel?: React.ReactNode;
|
|
21
24
|
};
|
|
22
|
-
declare function ChartFrame({ title, description, action, className, children, ...props }: ChartFrameProps): React.JSX.Element;
|
|
25
|
+
declare function ChartFrame({ title, description, action, state, emptyLabel, className, children, ...props }: ChartFrameProps): React.JSX.Element;
|
|
23
26
|
export type BarChartProps = React.ComponentProps<"div"> & {
|
|
24
27
|
data: ChartDatum[];
|
|
25
28
|
size?: ChartSize;
|
|
@@ -27,16 +30,20 @@ export type BarChartProps = React.ComponentProps<"div"> & {
|
|
|
27
30
|
showLabels?: boolean;
|
|
28
31
|
showValues?: boolean;
|
|
29
32
|
barClassName?: string;
|
|
33
|
+
state?: ChartState;
|
|
34
|
+
emptyLabel?: React.ReactNode;
|
|
30
35
|
};
|
|
31
|
-
declare function BarChart({ data, size, max, showLabels, showValues, className, barClassName, ...props }: BarChartProps): React.JSX.Element;
|
|
36
|
+
declare function BarChart({ data, size, max, showLabels, showValues, state, emptyLabel, className, barClassName, ...props }: BarChartProps): React.JSX.Element;
|
|
32
37
|
export type LineChartProps = Omit<React.ComponentProps<"svg">, "values"> & {
|
|
33
38
|
values: number[];
|
|
34
39
|
size?: ChartSize;
|
|
35
40
|
width?: number;
|
|
36
41
|
showArea?: boolean;
|
|
37
42
|
stroke?: string;
|
|
43
|
+
state?: ChartState;
|
|
44
|
+
emptyLabel?: React.ReactNode;
|
|
38
45
|
};
|
|
39
|
-
declare function LineChart({ values, size, width, showArea, stroke, className, ...props }: LineChartProps): React.JSX.Element;
|
|
46
|
+
declare function LineChart({ values, size, width, showArea, stroke, state, emptyLabel, className, ...props }: LineChartProps): React.JSX.Element;
|
|
40
47
|
export type SparklineProps = Omit<LineChartProps, "size" | "showArea"> & {
|
|
41
48
|
values: number[];
|
|
42
49
|
positive?: boolean;
|
|
@@ -48,8 +55,10 @@ export type DonutChartProps = React.ComponentProps<"svg"> & {
|
|
|
48
55
|
strokeWidth?: number;
|
|
49
56
|
centerLabel?: React.ReactNode;
|
|
50
57
|
centerValue?: React.ReactNode;
|
|
58
|
+
state?: ChartState;
|
|
59
|
+
emptyLabel?: React.ReactNode;
|
|
51
60
|
};
|
|
52
|
-
declare function DonutChart({ data, size, strokeWidth, centerLabel, centerValue, className, ...props }: DonutChartProps): React.JSX.Element;
|
|
61
|
+
declare function DonutChart({ data, size, strokeWidth, centerLabel, centerValue, state, emptyLabel, className, ...props }: DonutChartProps): React.JSX.Element;
|
|
53
62
|
export type ChartLegendProps = React.ComponentProps<"div"> & {
|
|
54
63
|
data: ChartDatum[];
|
|
55
64
|
};
|
|
@@ -14,15 +14,18 @@ function l(e, t = 1) {
|
|
|
14
14
|
function u(e, t) {
|
|
15
15
|
return !Number.isFinite(e) || t <= 0 ? 0 : Math.max(0, Math.min(e / t, 1));
|
|
16
16
|
}
|
|
17
|
-
function d(e, t
|
|
17
|
+
function d(e, t) {
|
|
18
|
+
return t ?? `var(--color-chart-${e % 5 + 1}, var(--primary))`;
|
|
19
|
+
}
|
|
20
|
+
function f(e, t, n, r) {
|
|
18
21
|
let i = (r - 90) * Math.PI / 180;
|
|
19
22
|
return {
|
|
20
23
|
x: e + n * Math.cos(i),
|
|
21
24
|
y: t + n * Math.sin(i)
|
|
22
25
|
};
|
|
23
26
|
}
|
|
24
|
-
function
|
|
25
|
-
let a =
|
|
27
|
+
function p(e, t, n, r, i) {
|
|
28
|
+
let a = f(e, t, n, i), o = f(e, t, n, r), s = i - r <= 180 ? "0" : "1";
|
|
26
29
|
return [
|
|
27
30
|
"M",
|
|
28
31
|
a.x,
|
|
@@ -37,44 +40,64 @@ function f(e, t, n, r, i) {
|
|
|
37
40
|
o.y
|
|
38
41
|
].join(" ");
|
|
39
42
|
}
|
|
40
|
-
function
|
|
43
|
+
function m(e, t, n, r = 12) {
|
|
41
44
|
let i = l(e), a = Math.max(t - r * 2, 1), o = Math.max(n - r * 2, 1);
|
|
42
45
|
return e.length === 0 ? "" : e.map((t, n) => {
|
|
43
46
|
let s = r + (e.length === 1 ? a / 2 : n / (e.length - 1) * a), c = r + (1 - u(t, i)) * o;
|
|
44
47
|
return `${n === 0 ? "M" : "L"} ${s} ${c}`;
|
|
45
48
|
}).join(" ");
|
|
46
49
|
}
|
|
47
|
-
function
|
|
48
|
-
let i =
|
|
50
|
+
function h(e, t, n, r = 12) {
|
|
51
|
+
let i = m(e, t, n, r);
|
|
49
52
|
if (!i) return "";
|
|
50
53
|
let a = n - r;
|
|
51
54
|
return `${i} L ${e.length === 1 ? t / 2 : t - r} ${a} L ${e.length === 1 ? t / 2 : r} ${a} Z`;
|
|
52
55
|
}
|
|
53
|
-
function
|
|
56
|
+
function g({ title: c, description: l, action: u, state: d = "ready", emptyLabel: f = "No data available.", className: p, children: m, ...h }) {
|
|
54
57
|
return /* @__PURE__ */ s(t, {
|
|
55
58
|
"data-slot": "chart-frame",
|
|
56
|
-
className: e("border-border/75 bg-card/96 shadow-sm ring-1 ring-foreground/4",
|
|
57
|
-
...
|
|
59
|
+
className: e("border-border/75 bg-card/96 shadow-sm ring-1 ring-foreground/4", p),
|
|
60
|
+
...h,
|
|
58
61
|
children: [(c || l || u) && /* @__PURE__ */ s(i, {
|
|
59
62
|
className: "flex flex-row items-start justify-between gap-3",
|
|
60
63
|
children: [/* @__PURE__ */ s("div", {
|
|
61
64
|
className: "grid gap-1",
|
|
62
65
|
children: [c && /* @__PURE__ */ o(a, { children: c }), l && /* @__PURE__ */ o(r, { children: l })]
|
|
63
66
|
}), u]
|
|
64
|
-
}), /* @__PURE__ */
|
|
67
|
+
}), /* @__PURE__ */ s(n, { children: [
|
|
68
|
+
d === "loading" ? /* @__PURE__ */ s("div", {
|
|
69
|
+
className: "grid gap-3",
|
|
70
|
+
children: [/* @__PURE__ */ o("div", { className: "h-4 w-24 animate-pulse rounded bg-muted" }), /* @__PURE__ */ o("div", { className: "h-36 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70" })]
|
|
71
|
+
}) : null,
|
|
72
|
+
d === "empty" ? /* @__PURE__ */ o("div", {
|
|
73
|
+
className: "rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground",
|
|
74
|
+
children: f
|
|
75
|
+
}) : null,
|
|
76
|
+
d === "ready" ? m : null
|
|
77
|
+
] })]
|
|
65
78
|
});
|
|
66
79
|
}
|
|
67
|
-
function
|
|
68
|
-
let
|
|
69
|
-
return /* @__PURE__ */ o("div", {
|
|
80
|
+
function _({ data: t, size: n = "md", max: r, showLabels: i = !0, showValues: a = !0, state: f = "ready", emptyLabel: p = "No chart data.", className: m, barClassName: h, ...g }) {
|
|
81
|
+
let _ = t.map((e) => e.value), v = r ?? l(_.map((e) => Math.abs(e))), y = c[n];
|
|
82
|
+
return f === "loading" ? /* @__PURE__ */ o("div", {
|
|
83
|
+
"data-slot": "bar-chart",
|
|
84
|
+
className: e("grid gap-3", m),
|
|
85
|
+
...g,
|
|
86
|
+
children: /* @__PURE__ */ o("div", { className: "h-40 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70" })
|
|
87
|
+
}) : f === "empty" || t.length === 0 ? /* @__PURE__ */ o("div", {
|
|
70
88
|
"data-slot": "bar-chart",
|
|
71
|
-
className: e("
|
|
72
|
-
...
|
|
89
|
+
className: e("rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground", m),
|
|
90
|
+
...g,
|
|
91
|
+
children: p
|
|
92
|
+
}) : /* @__PURE__ */ o("div", {
|
|
93
|
+
"data-slot": "bar-chart",
|
|
94
|
+
className: e("grid gap-3", m),
|
|
95
|
+
...g,
|
|
73
96
|
children: /* @__PURE__ */ o("div", {
|
|
74
97
|
className: "flex items-end gap-2",
|
|
75
|
-
style: { height:
|
|
98
|
+
style: { height: y },
|
|
76
99
|
children: t.map((t, n) => {
|
|
77
|
-
let r = u(t.value,
|
|
100
|
+
let r = u(Math.abs(t.value), v), c = t.value < 0;
|
|
78
101
|
return /* @__PURE__ */ s("div", {
|
|
79
102
|
className: "flex min-w-0 flex-1 flex-col items-center gap-2",
|
|
80
103
|
children: [
|
|
@@ -85,10 +108,11 @@ function g({ data: t, size: n = "md", max: r, showLabels: i = !0, showValues: a
|
|
|
85
108
|
/* @__PURE__ */ o("div", {
|
|
86
109
|
className: "flex w-full flex-1 items-end rounded-[min(var(--radius-xl),16px)] border border-border/60 bg-muted/38 p-1",
|
|
87
110
|
children: /* @__PURE__ */ o("div", {
|
|
88
|
-
className: e("w-full rounded-[min(var(--radius-lg),12px)] bg-primary transition-all",
|
|
111
|
+
className: e("w-full rounded-[min(var(--radius-lg),12px)] bg-primary transition-all", h),
|
|
89
112
|
style: {
|
|
90
|
-
height: `${Math.max(r * 100, t.value > 0 ? 3 : 0)}%`,
|
|
91
|
-
background: t.color
|
|
113
|
+
height: `${Math.max(r * 100, Math.abs(t.value) > 0 ? 3 : 0)}%`,
|
|
114
|
+
background: d(n, t.color),
|
|
115
|
+
opacity: c ? .72 : 1
|
|
92
116
|
}
|
|
93
117
|
})
|
|
94
118
|
}),
|
|
@@ -102,22 +126,25 @@ function g({ data: t, size: n = "md", max: r, showLabels: i = !0, showValues: a
|
|
|
102
126
|
})
|
|
103
127
|
});
|
|
104
128
|
}
|
|
105
|
-
function
|
|
106
|
-
let
|
|
107
|
-
return /* @__PURE__ */
|
|
129
|
+
function v({ values: t, size: n = "md", width: r = 560, showArea: i = !1, stroke: a = "var(--primary)", state: d = "ready", emptyLabel: f = "No line data.", className: p, ...g }) {
|
|
130
|
+
let _ = c[n], v = m(t, r, _), y = h(t, r, _);
|
|
131
|
+
return d === "loading" ? /* @__PURE__ */ o("div", { className: e("h-36 animate-pulse rounded-[min(var(--radius-xl),16px)] bg-muted/70", p) }) : d === "empty" || t.length === 0 ? /* @__PURE__ */ o("div", {
|
|
132
|
+
className: e("rounded-[min(var(--radius-xl),16px)] border border-dashed border-border/70 px-4 py-10 text-center text-sm text-muted-foreground", p),
|
|
133
|
+
children: f
|
|
134
|
+
}) : /* @__PURE__ */ s("svg", {
|
|
108
135
|
"data-slot": "line-chart",
|
|
109
|
-
viewBox: `0 0 ${r} ${
|
|
110
|
-
className: e("h-auto w-full overflow-visible",
|
|
136
|
+
viewBox: `0 0 ${r} ${_}`,
|
|
137
|
+
className: e("h-auto w-full overflow-visible", p),
|
|
111
138
|
role: "img",
|
|
112
|
-
...
|
|
139
|
+
...g,
|
|
113
140
|
children: [
|
|
114
141
|
i && /* @__PURE__ */ o("path", {
|
|
115
|
-
d:
|
|
142
|
+
d: y,
|
|
116
143
|
fill: "var(--primary)",
|
|
117
144
|
opacity: "0.12"
|
|
118
145
|
}),
|
|
119
146
|
/* @__PURE__ */ o("path", {
|
|
120
|
-
d:
|
|
147
|
+
d: v,
|
|
121
148
|
fill: "none",
|
|
122
149
|
stroke: a,
|
|
123
150
|
strokeWidth: "3",
|
|
@@ -128,7 +155,7 @@ function _({ values: t, size: n = "md", width: r = 560, showArea: i = !1, stroke
|
|
|
128
155
|
let i = l(t);
|
|
129
156
|
return /* @__PURE__ */ o("circle", {
|
|
130
157
|
cx: 12 + (t.length === 1 ? (r - 24) / 2 : n / (t.length - 1) * (r - 24)),
|
|
131
|
-
cy: 12 + (1 - u(e, i)) * (
|
|
158
|
+
cy: 12 + (1 - u(e, i)) * (_ - 24),
|
|
132
159
|
r: "3",
|
|
133
160
|
fill: a
|
|
134
161
|
}, n);
|
|
@@ -136,8 +163,8 @@ function _({ values: t, size: n = "md", width: r = 560, showArea: i = !1, stroke
|
|
|
136
163
|
]
|
|
137
164
|
});
|
|
138
165
|
}
|
|
139
|
-
function
|
|
140
|
-
return /* @__PURE__ */ o(
|
|
166
|
+
function y({ values: t, positive: n = !0, stroke: r, className: i, ...a }) {
|
|
167
|
+
return /* @__PURE__ */ o(v, {
|
|
141
168
|
values: t,
|
|
142
169
|
width: 180,
|
|
143
170
|
size: "sm",
|
|
@@ -147,34 +174,37 @@ function v({ values: t, positive: n = !0, stroke: r, className: i, ...a }) {
|
|
|
147
174
|
...a
|
|
148
175
|
});
|
|
149
176
|
}
|
|
150
|
-
function
|
|
151
|
-
let
|
|
177
|
+
function b({ data: t, size: n = 180, strokeWidth: r = 18, centerLabel: i, centerValue: a, state: c = "ready", emptyLabel: l = "No distribution data.", className: u, ...f }) {
|
|
178
|
+
let m = t.reduce((e, t) => e + Math.max(t.value, 0), 0), h = n / 2 - r, g = t.map((e, n) => {
|
|
152
179
|
let r = Math.max(e.value, 0), i = t.slice(0, n).reduce((e, t) => e + Math.max(t.value, 0), 0);
|
|
153
180
|
return {
|
|
154
181
|
item: e,
|
|
155
182
|
start: i,
|
|
156
|
-
end:
|
|
183
|
+
end: m > 0 ? i + r / m * 360 : i
|
|
157
184
|
};
|
|
158
185
|
});
|
|
159
|
-
return /* @__PURE__ */
|
|
186
|
+
return c === "loading" ? /* @__PURE__ */ o("div", { className: e("h-44 w-full max-w-48 animate-pulse rounded-full bg-muted/70", u) }) : c === "empty" || t.length === 0 || m <= 0 ? /* @__PURE__ */ o("div", {
|
|
187
|
+
className: e("flex h-44 w-full max-w-48 items-center justify-center rounded-full border border-dashed border-border/70 px-4 text-center text-sm text-muted-foreground", u),
|
|
188
|
+
children: l
|
|
189
|
+
}) : /* @__PURE__ */ s("svg", {
|
|
160
190
|
"data-slot": "donut-chart",
|
|
161
191
|
viewBox: `0 0 ${n} ${n}`,
|
|
162
|
-
className: e("h-auto w-full max-w-48",
|
|
192
|
+
className: e("h-auto w-full max-w-48", u),
|
|
163
193
|
role: "img",
|
|
164
|
-
...
|
|
194
|
+
...f,
|
|
165
195
|
children: [
|
|
166
196
|
/* @__PURE__ */ o("circle", {
|
|
167
197
|
cx: n / 2,
|
|
168
198
|
cy: n / 2,
|
|
169
|
-
r:
|
|
199
|
+
r: h,
|
|
170
200
|
fill: "none",
|
|
171
201
|
stroke: "var(--muted)",
|
|
172
202
|
strokeWidth: r
|
|
173
203
|
}),
|
|
174
|
-
|
|
175
|
-
d:
|
|
204
|
+
g.map(({ item: e, start: t, end: i }, a) => /* @__PURE__ */ o("path", {
|
|
205
|
+
d: p(n / 2, n / 2, h, t, i),
|
|
176
206
|
fill: "none",
|
|
177
|
-
stroke: e.color
|
|
207
|
+
stroke: d(a, e.color),
|
|
178
208
|
strokeWidth: r,
|
|
179
209
|
strokeLinecap: "round"
|
|
180
210
|
}, a)),
|
|
@@ -199,7 +229,7 @@ function y({ data: t, size: n = 180, strokeWidth: r = 18, centerLabel: i, center
|
|
|
199
229
|
]
|
|
200
230
|
});
|
|
201
231
|
}
|
|
202
|
-
function
|
|
232
|
+
function x({ data: t, className: n, ...r }) {
|
|
203
233
|
return /* @__PURE__ */ o("div", {
|
|
204
234
|
"data-slot": "chart-legend",
|
|
205
235
|
className: e("flex flex-wrap gap-3 text-xs text-muted-foreground", n),
|
|
@@ -208,12 +238,12 @@ function b({ data: t, className: n, ...r }) {
|
|
|
208
238
|
className: "inline-flex items-center gap-1.5",
|
|
209
239
|
children: [/* @__PURE__ */ o("span", {
|
|
210
240
|
className: "size-2 rounded-full bg-primary",
|
|
211
|
-
style: { background: e.color }
|
|
241
|
+
style: { background: d(t, e.color) }
|
|
212
242
|
}), /* @__PURE__ */ o("span", { children: e.label })]
|
|
213
243
|
}, t))
|
|
214
244
|
});
|
|
215
245
|
}
|
|
216
|
-
function
|
|
246
|
+
function S({ label: t, value: n, change: r, positive: i = !0, values: a, className: c, ...l }) {
|
|
217
247
|
return /* @__PURE__ */ s("div", {
|
|
218
248
|
"data-slot": "metric-trend",
|
|
219
249
|
className: e("grid gap-3 rounded-[var(--radius-2xl)] border border-border/75 bg-card/96 p-4 shadow-sm ring-1 ring-foreground/4", c),
|
|
@@ -233,11 +263,11 @@ function x({ label: t, value: n, change: r, positive: i = !0, values: a, classNa
|
|
|
233
263
|
className: e("rounded-full px-2 py-1 text-xs font-medium", i ? "bg-primary/10 text-primary" : "bg-destructive/10 text-destructive"),
|
|
234
264
|
children: r
|
|
235
265
|
})]
|
|
236
|
-
}), a && /* @__PURE__ */ o(
|
|
266
|
+
}), a && /* @__PURE__ */ o(y, {
|
|
237
267
|
values: a,
|
|
238
268
|
positive: i
|
|
239
269
|
})]
|
|
240
270
|
});
|
|
241
271
|
}
|
|
242
272
|
//#endregion
|
|
243
|
-
export {
|
|
273
|
+
export { _ as BarChart, g as ChartFrame, x as ChartLegend, b as DonutChart, v as LineChart, S as MetricTrend, y as Sparkline };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({value:e,max:n=100,size:i=120,strokeWidth:a=10,label:o,description:s,className:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({value:e,max:n=100,size:i=120,strokeWidth:a=10,label:o,description:s,tone:c=`default`,loading:l=!1,className:u,...d}){let f=(i-a)/2,p=2*Math.PI*f,m=p-(n>0?Math.min(Math.max(e/n,0),1):0)*p,h=c===`success`?`var(--color-chart-3, var(--primary))`:c===`warning`?`var(--color-chart-4, var(--primary))`:c===`danger`?`var(--destructive)`:`var(--primary)`;return(0,r.jsxs)(`svg`,{"data-slot":`progress-ring`,viewBox:`0 0 ${i} ${i}`,className:t.cn(`h-auto w-full max-w-32`,u),role:`img`,...d,children:[(0,r.jsx)(`circle`,{cx:i/2,cy:i/2,r:f,fill:`none`,stroke:`var(--muted)`,strokeWidth:a}),(0,r.jsx)(`circle`,{cx:i/2,cy:i/2,r:f,fill:`none`,stroke:h,strokeWidth:a,strokeLinecap:`round`,strokeDasharray:p,strokeDashoffset:l?p*.45:m,transform:`rotate(-90 ${i/2} ${i/2})`,className:l?`animate-pulse`:void 0}),(o||s)&&(0,r.jsxs)(`text`,{x:`50%`,y:`50%`,textAnchor:`middle`,dominantBaseline:`middle`,fill:`var(--foreground)`,children:[o&&(0,r.jsx)(`tspan`,{x:`50%`,dy:s?`-0.15em`:`0`,className:`text-base font-semibold`,children:o}),s&&(0,r.jsx)(`tspan`,{x:`50%`,dy:`1.25em`,className:`text-xs fill-muted-foreground`,children:s})]})]})}exports.ProgressRing=i;
|
|
@@ -6,6 +6,8 @@ export type ProgressRingProps = React.ComponentProps<"svg"> & {
|
|
|
6
6
|
strokeWidth?: number;
|
|
7
7
|
label?: React.ReactNode;
|
|
8
8
|
description?: React.ReactNode;
|
|
9
|
+
tone?: "default" | "success" | "warning" | "danger";
|
|
10
|
+
loading?: boolean;
|
|
9
11
|
};
|
|
10
|
-
declare function ProgressRing({ value, max, size, strokeWidth, label, description, className, ...props }: ProgressRingProps): React.JSX.Element;
|
|
12
|
+
declare function ProgressRing({ value, max, size, strokeWidth, label, description, tone, loading, className, ...props }: ProgressRingProps): React.JSX.Element;
|
|
11
13
|
export { ProgressRing };
|
|
@@ -2,19 +2,19 @@ import { cn as e } from "../../lib/utils.js";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/charts/progress-ring.tsx
|
|
5
|
-
function r({ value: r, max: i = 100, size: a = 120, strokeWidth: o = 10, label: s, description: c,
|
|
6
|
-
let
|
|
5
|
+
function r({ value: r, max: i = 100, size: a = 120, strokeWidth: o = 10, label: s, description: c, tone: l = "default", loading: u = !1, className: d, ...f }) {
|
|
6
|
+
let p = (a - o) / 2, m = 2 * Math.PI * p, h = m - (i > 0 ? Math.min(Math.max(r / i, 0), 1) : 0) * m, g = l === "success" ? "var(--color-chart-3, var(--primary))" : l === "warning" ? "var(--color-chart-4, var(--primary))" : l === "danger" ? "var(--destructive)" : "var(--primary)";
|
|
7
7
|
return /* @__PURE__ */ n("svg", {
|
|
8
8
|
"data-slot": "progress-ring",
|
|
9
9
|
viewBox: `0 0 ${a} ${a}`,
|
|
10
|
-
className: e("h-auto w-full max-w-32",
|
|
10
|
+
className: e("h-auto w-full max-w-32", d),
|
|
11
11
|
role: "img",
|
|
12
|
-
...
|
|
12
|
+
...f,
|
|
13
13
|
children: [
|
|
14
14
|
/* @__PURE__ */ t("circle", {
|
|
15
15
|
cx: a / 2,
|
|
16
16
|
cy: a / 2,
|
|
17
|
-
r:
|
|
17
|
+
r: p,
|
|
18
18
|
fill: "none",
|
|
19
19
|
stroke: "var(--muted)",
|
|
20
20
|
strokeWidth: o
|
|
@@ -22,14 +22,15 @@ function r({ value: r, max: i = 100, size: a = 120, strokeWidth: o = 10, label:
|
|
|
22
22
|
/* @__PURE__ */ t("circle", {
|
|
23
23
|
cx: a / 2,
|
|
24
24
|
cy: a / 2,
|
|
25
|
-
r:
|
|
25
|
+
r: p,
|
|
26
26
|
fill: "none",
|
|
27
|
-
stroke:
|
|
27
|
+
stroke: g,
|
|
28
28
|
strokeWidth: o,
|
|
29
29
|
strokeLinecap: "round",
|
|
30
|
-
strokeDasharray:
|
|
31
|
-
strokeDashoffset:
|
|
32
|
-
transform: `rotate(-90 ${a / 2} ${a / 2})
|
|
30
|
+
strokeDasharray: m,
|
|
31
|
+
strokeDashoffset: u ? m * .45 : h,
|
|
32
|
+
transform: `rotate(-90 ${a / 2} ${a / 2})`,
|
|
33
|
+
className: u ? "animate-pulse" : void 0
|
|
33
34
|
}),
|
|
34
35
|
(s || c) && /* @__PURE__ */ n("text", {
|
|
35
36
|
x: "50%",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/dropdown-menu/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");function s(e){return e.replace(/_/g,` `).replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function c({table:e,label:i=`Columns`,triggerLabel:c,align:l=`end`,side:u=`bottom`,triggerClassName:d,contentClassName:f,getColumnLabel:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/dropdown-menu/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");function s(e){return e.replace(/_/g,` `).replace(/-/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function c({table:e,label:i=`Columns`,triggerLabel:c,align:l=`end`,side:u=`bottom`,triggerClassName:d,contentClassName:f,emptyLabel:p=`No hideable columns`,showCount:m=!0,triggerAriaLabel:h,getColumnLabel:g=s}){let _=e.getAllLeafColumns().filter(e=>e.getCanHide()),v=_.filter(e=>e.getIsVisible()).length;return(0,o.jsxs)(r.DropdownMenu,{children:[(0,o.jsxs)(r.DropdownMenuTrigger,{render:(0,o.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,"aria-label":h??`Choose visible columns`,className:t.cn(`min-w-0 border-border/80 bg-background/94 px-2.5 shadow-[0_1px_0_rgba(255,255,255,0.06)] hover:border-border hover:bg-accent/70`,d)}),children:[(0,o.jsx)(a.Columns3Icon,{"data-icon":`inline-start`,className:`size-4 shrink-0`}),(0,o.jsx)(`span`,{className:`truncate`,children:c??i}),m&&_.length>0?(0,o.jsxs)(`span`,{className:`ml-0.5 rounded-[var(--radius-sm)] bg-muted px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground`,children:[v,`/`,_.length]}):null]}),(0,o.jsxs)(r.DropdownMenuContent,{align:l,side:u,className:t.cn(`max-h-[min(24rem,var(--radix-dropdown-menu-content-available-height,24rem))] min-w-56 overflow-y-auto rounded-[var(--radius-lg)] border-border/80 bg-popover/98 p-1 shadow-[0_24px_80px_rgba(15,23,42,0.18)] backdrop-blur`,f),children:[(0,o.jsxs)(r.DropdownMenuLabel,{className:`flex items-center justify-between gap-3`,children:[(0,o.jsx)(`span`,{children:i}),m?(0,o.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[v,` visible`]}):null]}),(0,o.jsx)(r.DropdownMenuSeparator,{}),_.length===0?(0,o.jsx)(r.DropdownMenuLabel,{className:`py-3 text-sm font-normal text-muted-foreground`,children:p}):null,_.map(e=>(0,o.jsx)(r.DropdownMenuCheckboxItem,{checked:e.getIsVisible(),onCheckedChange:t=>e.toggleVisibility(!!t),children:g(e.id)},e.id))]})]})}exports.DataTableColumnVisibilityMenu=c;
|
|
@@ -8,7 +8,10 @@ export type DataTableColumnVisibilityMenuProps<TData> = {
|
|
|
8
8
|
side?: "top" | "right" | "bottom" | "left";
|
|
9
9
|
triggerClassName?: string;
|
|
10
10
|
contentClassName?: string;
|
|
11
|
+
emptyLabel?: React.ReactNode;
|
|
12
|
+
showCount?: boolean;
|
|
13
|
+
triggerAriaLabel?: string;
|
|
11
14
|
getColumnLabel?: (columnId: string) => React.ReactNode;
|
|
12
15
|
};
|
|
13
|
-
declare function DataTableColumnVisibilityMenu<TData>({ table, label, triggerLabel, align, side, triggerClassName, contentClassName, getColumnLabel, }: DataTableColumnVisibilityMenuProps<TData>): React.JSX.Element;
|
|
16
|
+
declare function DataTableColumnVisibilityMenu<TData>({ table, label, triggerLabel, align, side, triggerClassName, contentClassName, emptyLabel, showCount, triggerAriaLabel, getColumnLabel, }: DataTableColumnVisibilityMenuProps<TData>): React.JSX.Element;
|
|
14
17
|
export { DataTableColumnVisibilityMenu };
|