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
|
@@ -20,15 +20,21 @@ export type PaginationLabels = {
|
|
|
20
20
|
page?: (page: number) => string
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export type PaginationProps = Omit<React.ComponentProps<"nav">, "onChange"> & {
|
|
24
|
-
page: number
|
|
25
|
-
pageCount: number
|
|
26
|
-
onPageChange: (page: number) => void
|
|
27
|
-
siblingCount?: number
|
|
28
|
-
showEdges?: boolean
|
|
29
|
-
disabled?: boolean
|
|
30
|
-
labels?: PaginationLabels
|
|
31
|
-
|
|
23
|
+
export type PaginationProps = Omit<React.ComponentProps<"nav">, "onChange"> & {
|
|
24
|
+
page: number
|
|
25
|
+
pageCount: number
|
|
26
|
+
onPageChange: (page: number) => void
|
|
27
|
+
siblingCount?: number
|
|
28
|
+
showEdges?: boolean
|
|
29
|
+
disabled?: boolean
|
|
30
|
+
labels?: PaginationLabels
|
|
31
|
+
compact?: boolean
|
|
32
|
+
totalCount?: number
|
|
33
|
+
pageSize?: number
|
|
34
|
+
pageSizeOptions?: number[]
|
|
35
|
+
onPageSizeChange?: (pageSize: number) => void
|
|
36
|
+
showSummary?: boolean
|
|
37
|
+
}
|
|
32
38
|
|
|
33
39
|
function range(start: number, end: number) {
|
|
34
40
|
const length = Math.max(end - start + 1, 0)
|
|
@@ -71,11 +77,17 @@ function Pagination({
|
|
|
71
77
|
pageCount,
|
|
72
78
|
onPageChange,
|
|
73
79
|
siblingCount = 1,
|
|
74
|
-
showEdges = true,
|
|
75
|
-
disabled = false,
|
|
76
|
-
labels,
|
|
77
|
-
|
|
78
|
-
|
|
80
|
+
showEdges = true,
|
|
81
|
+
disabled = false,
|
|
82
|
+
labels,
|
|
83
|
+
compact = false,
|
|
84
|
+
totalCount,
|
|
85
|
+
pageSize,
|
|
86
|
+
pageSizeOptions,
|
|
87
|
+
onPageSizeChange,
|
|
88
|
+
showSummary = false,
|
|
89
|
+
...props
|
|
90
|
+
}: PaginationProps) {
|
|
79
91
|
const safePageCount = Math.max(pageCount, 1)
|
|
80
92
|
const currentPage = Math.min(Math.max(page, 1), safePageCount)
|
|
81
93
|
const items = getPaginationItems(currentPage, safePageCount, siblingCount)
|
|
@@ -88,21 +100,26 @@ function Pagination({
|
|
|
88
100
|
}
|
|
89
101
|
}
|
|
90
102
|
|
|
91
|
-
return (
|
|
103
|
+
return (
|
|
92
104
|
<nav
|
|
93
105
|
data-slot="pagination"
|
|
94
106
|
aria-label="Pagination"
|
|
95
107
|
className={cn(
|
|
96
|
-
"flex items-center justify-center gap-1 rounded-full border border-border/70 bg-background/76 p-1 shadow-none backdrop-blur",
|
|
108
|
+
"flex flex-wrap items-center justify-center gap-1 rounded-full border border-border/70 bg-background/76 p-1 shadow-none backdrop-blur",
|
|
97
109
|
className
|
|
98
110
|
)}
|
|
99
111
|
{...props}
|
|
100
112
|
>
|
|
101
|
-
{
|
|
102
|
-
<
|
|
113
|
+
{showSummary && totalCount !== undefined && pageSize ? (
|
|
114
|
+
<div className="px-2 text-xs text-muted-foreground">
|
|
115
|
+
{Math.min((currentPage - 1) * pageSize + 1, totalCount)}-{Math.min(currentPage * pageSize, totalCount)} of {totalCount}
|
|
116
|
+
</div>
|
|
117
|
+
) : null}
|
|
118
|
+
{showEdges && (
|
|
119
|
+
<Button
|
|
103
120
|
type="button"
|
|
104
|
-
variant="outline"
|
|
105
|
-
size="icon-sm"
|
|
121
|
+
variant="outline"
|
|
122
|
+
size={compact ? "icon-xs" : "icon-sm"}
|
|
106
123
|
disabled={disabled || currentPage <= 1}
|
|
107
124
|
aria-label={labels?.first ?? "First page"}
|
|
108
125
|
onClick={() => goToPage(1)}
|
|
@@ -113,8 +130,8 @@ function Pagination({
|
|
|
113
130
|
|
|
114
131
|
<Button
|
|
115
132
|
type="button"
|
|
116
|
-
variant="outline"
|
|
117
|
-
size="icon-sm"
|
|
133
|
+
variant="outline"
|
|
134
|
+
size={compact ? "icon-xs" : "icon-sm"}
|
|
118
135
|
disabled={disabled || currentPage <= 1}
|
|
119
136
|
aria-label={labels?.previous ?? "Previous page"}
|
|
120
137
|
onClick={() => goToPage(currentPage - 1)}
|
|
@@ -141,7 +158,7 @@ function Pagination({
|
|
|
141
158
|
key={item}
|
|
142
159
|
type="button"
|
|
143
160
|
variant={item === currentPage ? "default" : "outline"}
|
|
144
|
-
size="icon-sm"
|
|
161
|
+
size={compact ? "icon-xs" : "icon-sm"}
|
|
145
162
|
disabled={disabled}
|
|
146
163
|
aria-current={item === currentPage ? "page" : undefined}
|
|
147
164
|
aria-label={labels?.page?.(item) ?? `Page ${item}`}
|
|
@@ -155,8 +172,8 @@ function Pagination({
|
|
|
155
172
|
|
|
156
173
|
<Button
|
|
157
174
|
type="button"
|
|
158
|
-
variant="outline"
|
|
159
|
-
size="icon-sm"
|
|
175
|
+
variant="outline"
|
|
176
|
+
size={compact ? "icon-xs" : "icon-sm"}
|
|
160
177
|
disabled={disabled || currentPage >= safePageCount}
|
|
161
178
|
aria-label={labels?.next ?? "Next page"}
|
|
162
179
|
onClick={() => goToPage(currentPage + 1)}
|
|
@@ -167,17 +184,34 @@ function Pagination({
|
|
|
167
184
|
{showEdges && (
|
|
168
185
|
<Button
|
|
169
186
|
type="button"
|
|
170
|
-
variant="outline"
|
|
171
|
-
size="icon-sm"
|
|
187
|
+
variant="outline"
|
|
188
|
+
size={compact ? "icon-xs" : "icon-sm"}
|
|
172
189
|
disabled={disabled || currentPage >= safePageCount}
|
|
173
190
|
aria-label={labels?.last ?? "Last page"}
|
|
174
191
|
onClick={() => goToPage(safePageCount)}
|
|
175
192
|
>
|
|
176
193
|
<ChevronLastIcon />
|
|
177
194
|
</Button>
|
|
178
|
-
)}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
195
|
+
)}
|
|
196
|
+
{pageSizeOptions && pageSize && onPageSizeChange ? (
|
|
197
|
+
<label className="ml-1 inline-flex items-center gap-2 rounded-full border border-border/70 bg-background/90 px-3 py-1 text-xs text-muted-foreground">
|
|
198
|
+
<span>Rows</span>
|
|
199
|
+
<select
|
|
200
|
+
className="bg-transparent text-foreground outline-none"
|
|
201
|
+
value={pageSize}
|
|
202
|
+
onChange={(event) => onPageSizeChange(Number(event.target.value))}
|
|
203
|
+
disabled={disabled}
|
|
204
|
+
>
|
|
205
|
+
{pageSizeOptions.map((option) => (
|
|
206
|
+
<option key={option} value={option}>
|
|
207
|
+
{option}
|
|
208
|
+
</option>
|
|
209
|
+
))}
|
|
210
|
+
</select>
|
|
211
|
+
</label>
|
|
212
|
+
) : null}
|
|
213
|
+
</nav>
|
|
214
|
+
)
|
|
215
|
+
}
|
|
182
216
|
|
|
183
217
|
export { Pagination, getPaginationItems }
|
|
@@ -11,11 +11,13 @@ export type NotificationItem = {
|
|
|
11
11
|
description?: React.ReactNode
|
|
12
12
|
time?: React.ReactNode
|
|
13
13
|
read?: boolean
|
|
14
|
+
group?: React.ReactNode
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export type NotificationCenterProps = React.ComponentProps<"div"> & {
|
|
17
18
|
notifications: NotificationItem[]
|
|
18
19
|
onMarkAllRead?: () => void
|
|
20
|
+
onClearAll?: () => void
|
|
19
21
|
onNotificationClick?: (notification: NotificationItem) => void
|
|
20
22
|
emptyLabel?: React.ReactNode
|
|
21
23
|
title?: React.ReactNode
|
|
@@ -24,6 +26,7 @@ export type NotificationCenterProps = React.ComponentProps<"div"> & {
|
|
|
24
26
|
function NotificationCenter({
|
|
25
27
|
notifications,
|
|
26
28
|
onMarkAllRead,
|
|
29
|
+
onClearAll,
|
|
27
30
|
onNotificationClick,
|
|
28
31
|
emptyLabel = "No new notifications",
|
|
29
32
|
title = "Notifications",
|
|
@@ -31,6 +34,11 @@ function NotificationCenter({
|
|
|
31
34
|
...props
|
|
32
35
|
}: NotificationCenterProps) {
|
|
33
36
|
const unreadCount = notifications.filter((n) => !n.read).length
|
|
37
|
+
const groupedNotifications = notifications.reduce<Record<string, NotificationItem[]>>((accumulator, notification) => {
|
|
38
|
+
const key = String(notification.group ?? "Recent")
|
|
39
|
+
accumulator[key] = [...(accumulator[key] ?? []), notification]
|
|
40
|
+
return accumulator
|
|
41
|
+
}, {})
|
|
34
42
|
|
|
35
43
|
return (
|
|
36
44
|
<div data-slot="notification-center" className={className} {...props}>
|
|
@@ -60,16 +68,28 @@ function NotificationCenter({
|
|
|
60
68
|
{unreadCount > 0 ? `${unreadCount} unread update${unreadCount > 1 ? "s" : ""}` : "You're all caught up"}
|
|
61
69
|
</span>
|
|
62
70
|
</div>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
<div className="flex items-center gap-2">
|
|
72
|
+
{unreadCount > 0 && onMarkAllRead ? (
|
|
73
|
+
<Button
|
|
74
|
+
variant="ghost"
|
|
75
|
+
size="sm"
|
|
76
|
+
className="h-8 rounded-full border border-[color:var(--aui-surface-border)] px-3 text-xs font-semibold text-muted-foreground hover:bg-[color:var(--aui-page-bg)] hover:text-foreground"
|
|
77
|
+
onClick={onMarkAllRead}
|
|
78
|
+
>
|
|
79
|
+
Mark all read
|
|
80
|
+
</Button>
|
|
81
|
+
) : null}
|
|
82
|
+
{notifications.length > 0 && onClearAll ? (
|
|
83
|
+
<Button
|
|
84
|
+
variant="ghost"
|
|
85
|
+
size="sm"
|
|
86
|
+
className="h-8 rounded-full border border-[color:var(--aui-surface-border)] px-3 text-xs font-semibold text-muted-foreground hover:bg-[color:var(--aui-page-bg)] hover:text-foreground"
|
|
87
|
+
onClick={onClearAll}
|
|
88
|
+
>
|
|
89
|
+
Clear all
|
|
90
|
+
</Button>
|
|
91
|
+
) : null}
|
|
92
|
+
</div>
|
|
73
93
|
</div>
|
|
74
94
|
<div className="max-h-[400px] overflow-y-auto bg-[color:var(--aui-page-bg)] p-2">
|
|
75
95
|
{notifications.length === 0 ? (
|
|
@@ -77,35 +97,40 @@ function NotificationCenter({
|
|
|
77
97
|
{emptyLabel}
|
|
78
98
|
</div>
|
|
79
99
|
) : (
|
|
80
|
-
<div className="flex flex-col">
|
|
81
|
-
{
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
100
|
+
<div className="flex flex-col gap-3">
|
|
101
|
+
{Object.entries(groupedNotifications).map(([group, groupItems]) => (
|
|
102
|
+
<div key={group} className="grid gap-2">
|
|
103
|
+
<div className="px-2 pt-1 text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">{group}</div>
|
|
104
|
+
{groupItems.map((notification) => (
|
|
105
|
+
<button
|
|
106
|
+
key={notification.id}
|
|
107
|
+
className={cn(
|
|
108
|
+
"flex flex-col gap-1 rounded-2xl border border-transparent px-4 py-3 text-left transition hover:border-[color:var(--aui-surface-border)] hover:bg-[color:var(--aui-control-bg)]",
|
|
109
|
+
!notification.read && "border-[color:color-mix(in_srgb,var(--aui-brand-strong)_16%,var(--aui-surface-border))] bg-[color:color-mix(in_srgb,var(--aui-brand-strong)_8%,var(--aui-control-bg))]"
|
|
110
|
+
)}
|
|
111
|
+
onClick={() => onNotificationClick?.(notification)}
|
|
112
|
+
>
|
|
113
|
+
<div className="flex w-full items-start justify-between gap-2">
|
|
114
|
+
<span className="text-sm font-semibold leading-tight text-foreground">
|
|
115
|
+
{notification.title}
|
|
116
|
+
</span>
|
|
117
|
+
{!notification.read && (
|
|
118
|
+
<span className="mt-1 flex size-2 shrink-0 rounded-full bg-[color:var(--aui-brand-strong)] shadow-[0_0_0_4px_color-mix(in_srgb,var(--aui-brand-strong)_14%,transparent)]" />
|
|
119
|
+
)}
|
|
120
|
+
</div>
|
|
121
|
+
{notification.description && (
|
|
122
|
+
<span className="line-clamp-2 text-xs leading-5 text-muted-foreground">
|
|
123
|
+
{notification.description}
|
|
124
|
+
</span>
|
|
125
|
+
)}
|
|
126
|
+
{notification.time && (
|
|
127
|
+
<span className="mt-1 text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground/80">
|
|
128
|
+
{notification.time}
|
|
129
|
+
</span>
|
|
130
|
+
)}
|
|
131
|
+
</button>
|
|
132
|
+
))}
|
|
133
|
+
</div>
|
|
109
134
|
))}
|
|
110
135
|
</div>
|
|
111
136
|
)}
|
|
@@ -6,15 +6,16 @@ import { cn } from "@/lib/utils"
|
|
|
6
6
|
|
|
7
7
|
export type ToastTone = "default" | "success" | "info" | "warning" | "danger" | "loading"
|
|
8
8
|
|
|
9
|
-
export type ToastItem = {
|
|
9
|
+
export type ToastItem = {
|
|
10
10
|
id: string
|
|
11
11
|
title?: React.ReactNode
|
|
12
12
|
description?: React.ReactNode
|
|
13
13
|
tone?: ToastTone
|
|
14
14
|
action?: React.ReactNode
|
|
15
15
|
duration?: number
|
|
16
|
-
dismissible?: boolean
|
|
17
|
-
|
|
16
|
+
dismissible?: boolean
|
|
17
|
+
group?: React.ReactNode
|
|
18
|
+
}
|
|
18
19
|
|
|
19
20
|
export type CreateToastInput = Omit<ToastItem, "id"> & {
|
|
20
21
|
id?: string
|
|
@@ -39,8 +40,8 @@ export type ToastContextValue = {
|
|
|
39
40
|
warning: (toast: ToastShortcutInput) => string
|
|
40
41
|
error: (toast: ToastShortcutInput) => string
|
|
41
42
|
loading: (toast: ToastShortcutInput) => string
|
|
42
|
-
promise: <TData>(promise: Promise<TData>, messages: ToastPromiseMessages<TData>) => Promise<TData>
|
|
43
|
-
}
|
|
43
|
+
promise: <TData>(promise: Promise<TData>, messages: ToastPromiseMessages<TData>) => Promise<TData>
|
|
44
|
+
}
|
|
44
45
|
|
|
45
46
|
const ToastContext = React.createContext<ToastContextValue | null>(null)
|
|
46
47
|
|
|
@@ -187,17 +188,17 @@ function ToastProvider({
|
|
|
187
188
|
return (
|
|
188
189
|
<ToastContext.Provider value={value}>
|
|
189
190
|
{children}
|
|
190
|
-
<div
|
|
191
|
-
data-slot="toast-viewport"
|
|
192
|
-
className={cn("fixed z-[100] flex w-[min(100%-2rem,24rem)] flex-col gap-2", positionClassName[position])}
|
|
193
|
-
>
|
|
194
|
-
{toasts.map((toast) => (
|
|
195
|
-
<ToastCard key={toast.id} toast={toast} pauseOnHover={pauseOnHover} onDismiss={dismissToast} />
|
|
196
|
-
))}
|
|
197
|
-
</div>
|
|
198
|
-
</ToastContext.Provider>
|
|
199
|
-
)
|
|
200
|
-
}
|
|
191
|
+
<div
|
|
192
|
+
data-slot="toast-viewport"
|
|
193
|
+
className={cn("fixed z-[100] flex w-[min(100%-2rem,24rem)] flex-col gap-2", positionClassName[position])}
|
|
194
|
+
>
|
|
195
|
+
{toasts.map((toast) => (
|
|
196
|
+
<ToastCard key={toast.id} toast={toast} pauseOnHover={pauseOnHover} onDismiss={dismissToast} />
|
|
197
|
+
))}
|
|
198
|
+
</div>
|
|
199
|
+
</ToastContext.Provider>
|
|
200
|
+
)
|
|
201
|
+
}
|
|
201
202
|
|
|
202
203
|
function ToastCard({
|
|
203
204
|
toast,
|
|
@@ -231,11 +232,12 @@ function ToastCard({
|
|
|
231
232
|
onMouseLeave={() => setHovered(false)}
|
|
232
233
|
>
|
|
233
234
|
<div className="mt-0.5 shrink-0">{toneIcon[tone]}</div>
|
|
234
|
-
<div className="min-w-0 flex-1 space-y-1">
|
|
235
|
-
{toast.
|
|
236
|
-
{toast.
|
|
237
|
-
{toast.
|
|
238
|
-
|
|
235
|
+
<div className="min-w-0 flex-1 space-y-1">
|
|
236
|
+
{toast.group ? <div className="text-[10px] font-semibold uppercase tracking-[0.18em] text-muted-foreground">{toast.group}</div> : null}
|
|
237
|
+
{toast.title && <div className="text-sm font-medium leading-none">{toast.title}</div>}
|
|
238
|
+
{toast.description && <div className="text-sm text-muted-foreground">{toast.description}</div>}
|
|
239
|
+
{toast.action && <div className="pt-1">{toast.action}</div>}
|
|
240
|
+
</div>
|
|
239
241
|
{toast.dismissible !== false && (
|
|
240
242
|
<Button type="button" variant="ghost" size="icon-xs" onClick={() => onDismiss(toast.id)}>
|
|
241
243
|
<XIcon />
|
|
@@ -174,7 +174,7 @@ function AlertDialog({
|
|
|
174
174
|
type="button"
|
|
175
175
|
variant={actionTone === "destructive" ? "destructive" : "default"}
|
|
176
176
|
loading={resolvedLoading}
|
|
177
|
-
disabled={!canConfirm
|
|
177
|
+
disabled={!canConfirm || resolvedLoading}
|
|
178
178
|
onClick={() => void handleAction()}
|
|
179
179
|
{...actionButtonProps}
|
|
180
180
|
>
|
|
@@ -11,25 +11,32 @@ type ConfirmDialogProps = Omit<ModalShellProps, "footer"> & {
|
|
|
11
11
|
confirmVariant?: ConfirmVariant
|
|
12
12
|
confirmDisabled?: boolean
|
|
13
13
|
cancelDisabled?: boolean
|
|
14
|
-
isLoading?: boolean
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
isLoading?: boolean
|
|
15
|
+
closeOnConfirm?: boolean
|
|
16
|
+
onConfirmError?: (error: unknown) => void
|
|
17
|
+
onCancel?: () => void
|
|
18
|
+
onConfirm?: () => void | Promise<void>
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
function ConfirmDialog({
|
|
20
22
|
cancelText = "Cancel",
|
|
21
23
|
confirmText = "Confirm",
|
|
22
24
|
confirmVariant = "default",
|
|
23
25
|
confirmDisabled = false,
|
|
24
|
-
cancelDisabled = false,
|
|
25
|
-
isLoading = false,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
cancelDisabled = false,
|
|
27
|
+
isLoading = false,
|
|
28
|
+
closeOnConfirm = true,
|
|
29
|
+
onConfirmError,
|
|
30
|
+
onCancel,
|
|
31
|
+
onConfirm,
|
|
32
|
+
onOpenChange,
|
|
33
|
+
...props
|
|
30
34
|
}: ConfirmDialogProps) {
|
|
35
|
+
const [pending, setPending] = React.useState(false)
|
|
36
|
+
const resolvedLoading = isLoading || pending
|
|
37
|
+
|
|
31
38
|
const handleOpenChange = (open: boolean) => {
|
|
32
|
-
if (
|
|
39
|
+
if (resolvedLoading && open === false) {
|
|
33
40
|
return
|
|
34
41
|
}
|
|
35
42
|
|
|
@@ -38,31 +45,47 @@ function ConfirmDialog({
|
|
|
38
45
|
|
|
39
46
|
const handleCancel = () => {
|
|
40
47
|
onCancel?.()
|
|
41
|
-
if (!
|
|
48
|
+
if (!resolvedLoading) {
|
|
42
49
|
onOpenChange?.(false)
|
|
43
50
|
}
|
|
44
51
|
}
|
|
45
52
|
|
|
53
|
+
const handleConfirm = async () => {
|
|
54
|
+
if (confirmDisabled || resolvedLoading) return
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
setPending(true)
|
|
58
|
+
await onConfirm?.()
|
|
59
|
+
if (closeOnConfirm) {
|
|
60
|
+
onOpenChange?.(false)
|
|
61
|
+
}
|
|
62
|
+
} catch (error) {
|
|
63
|
+
onConfirmError?.(error)
|
|
64
|
+
} finally {
|
|
65
|
+
setPending(false)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
46
69
|
return (
|
|
47
70
|
<ModalShell
|
|
48
|
-
showCloseButton={!
|
|
71
|
+
showCloseButton={!resolvedLoading}
|
|
49
72
|
onOpenChange={handleOpenChange}
|
|
50
73
|
footer={
|
|
51
74
|
<DialogActions>
|
|
52
75
|
<DialogActionButton
|
|
53
|
-
type="button"
|
|
54
|
-
variant="outline"
|
|
55
|
-
disabled={cancelDisabled ||
|
|
56
|
-
onClick={handleCancel}
|
|
57
|
-
>
|
|
58
|
-
{cancelText}
|
|
76
|
+
type="button"
|
|
77
|
+
variant="outline"
|
|
78
|
+
disabled={cancelDisabled || resolvedLoading}
|
|
79
|
+
onClick={handleCancel}
|
|
80
|
+
>
|
|
81
|
+
{cancelText}
|
|
59
82
|
</DialogActionButton>
|
|
60
83
|
<DialogActionButton
|
|
61
84
|
type="button"
|
|
62
85
|
variant={confirmVariant}
|
|
63
|
-
disabled={confirmDisabled ||
|
|
64
|
-
isLoading={
|
|
65
|
-
onClick={
|
|
86
|
+
disabled={confirmDisabled || resolvedLoading}
|
|
87
|
+
isLoading={resolvedLoading}
|
|
88
|
+
onClick={() => void handleConfirm()}
|
|
66
89
|
>
|
|
67
90
|
{confirmText}
|
|
68
91
|
</DialogActionButton>
|
|
@@ -12,13 +12,15 @@ import {
|
|
|
12
12
|
} from "@/components/ui/dialog"
|
|
13
13
|
import { cn } from "@/lib/utils"
|
|
14
14
|
|
|
15
|
-
export type DrawerSide = "left" | "right" | "top" | "bottom"
|
|
15
|
+
export type DrawerSide = "left" | "right" | "top" | "bottom"
|
|
16
|
+
export type DrawerWidth = "sm" | "md" | "lg" | "xl" | "full"
|
|
16
17
|
|
|
17
18
|
export type DrawerProps = Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
18
19
|
trigger?: React.ReactNode
|
|
19
20
|
title?: React.ReactNode
|
|
20
21
|
description?: React.ReactNode
|
|
21
22
|
side?: DrawerSide
|
|
23
|
+
width?: DrawerWidth
|
|
22
24
|
footer?: React.ReactNode
|
|
23
25
|
headerClassName?: string
|
|
24
26
|
bodyClassName?: string
|
|
@@ -29,17 +31,26 @@ export type DrawerProps = Omit<React.ComponentProps<typeof Dialog>, "children">
|
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
const sideClassName: Record<DrawerSide, string> = {
|
|
32
|
-
right: "left-auto right-0 top-0 h-dvh max-h-dvh w-full
|
|
33
|
-
left: "left-0 top-0 h-dvh max-h-dvh w-full
|
|
34
|
+
right: "left-auto right-0 top-0 h-dvh max-h-dvh w-full translate-x-0 translate-y-0 rounded-none rounded-l-[var(--radius-3xl)] data-open:slide-in-from-right data-closed:slide-out-to-right",
|
|
35
|
+
left: "left-0 top-0 h-dvh max-h-dvh w-full translate-x-0 translate-y-0 rounded-none rounded-r-[var(--radius-3xl)] data-open:slide-in-from-left data-closed:slide-out-to-left",
|
|
34
36
|
top: "left-0 top-0 h-auto max-h-[85dvh] w-full max-w-none translate-x-0 translate-y-0 rounded-none rounded-b-[var(--radius-3xl)] data-open:slide-in-from-top data-closed:slide-out-to-top",
|
|
35
37
|
bottom: "bottom-0 left-0 top-auto h-auto max-h-[85dvh] w-full max-w-none translate-x-0 translate-y-0 rounded-none rounded-t-[var(--radius-3xl)] data-open:slide-in-from-bottom data-closed:slide-out-to-bottom",
|
|
36
38
|
}
|
|
39
|
+
|
|
40
|
+
const widthClassName: Record<DrawerWidth, string> = {
|
|
41
|
+
sm: "sm:max-w-sm",
|
|
42
|
+
md: "sm:max-w-md",
|
|
43
|
+
lg: "sm:max-w-lg",
|
|
44
|
+
xl: "sm:max-w-2xl",
|
|
45
|
+
full: "max-w-none sm:max-w-[min(100vw,72rem)]",
|
|
46
|
+
}
|
|
37
47
|
|
|
38
48
|
function Drawer({
|
|
39
49
|
trigger,
|
|
40
|
-
title,
|
|
50
|
+
title,
|
|
41
51
|
description,
|
|
42
52
|
side = "right",
|
|
53
|
+
width = "lg",
|
|
43
54
|
footer,
|
|
44
55
|
headerClassName,
|
|
45
56
|
bodyClassName,
|
|
@@ -55,7 +66,9 @@ function Drawer({
|
|
|
55
66
|
<DialogContent
|
|
56
67
|
size="full"
|
|
57
68
|
showCloseButton={showCloseButton}
|
|
58
|
-
|
|
69
|
+
data-side={side}
|
|
70
|
+
data-width={width}
|
|
71
|
+
className={cn("fixed grid grid-rows-[auto_minmax(0,1fr)_auto] gap-0 overscroll-contain p-0", sideClassName[side], (side === "left" || side === "right") && widthClassName[width], contentClassName)}
|
|
59
72
|
>
|
|
60
73
|
{(title || description) && (
|
|
61
74
|
<DialogHeader className={cn("border-b border-border/70 p-6", headerClassName)}>
|
|
@@ -17,6 +17,10 @@ export type AccordionRootProps = CollapseProps
|
|
|
17
17
|
export type AccordionTriggerProps = CollapseTriggerProps
|
|
18
18
|
export type AccordionContentProps = React.ComponentProps<"div">
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Accordion is the grouped disclosure API. Use CollapseRoot/CollapseTrigger/CollapseContent
|
|
22
|
+
* for a single standalone disclosure.
|
|
23
|
+
*/
|
|
20
24
|
function Accordion(props: AccordionProps) {
|
|
21
25
|
return <CollapseGroup data-slot="accordion" {...props} />
|
|
22
26
|
}
|
|
@@ -17,6 +17,7 @@ const badgeVariants = cva(
|
|
|
17
17
|
"border-[color:color-mix(in_oklch,var(--border),var(--foreground)_10%)] bg-[color:color-mix(in_oklch,var(--muted),var(--background)_8%)] text-foreground",
|
|
18
18
|
destructive:
|
|
19
19
|
"border-[color:color-mix(in_oklch,var(--destructive),transparent_52%)] bg-[color:color-mix(in_oklch,var(--destructive),transparent_82%)] text-[color:color-mix(in_oklch,var(--destructive),black_16%)] dark:text-[color:color-mix(in_oklch,var(--destructive),white_38%)]",
|
|
20
|
+
soft: "border-transparent bg-[color:color-mix(in_oklch,var(--muted),transparent_38%)] text-foreground shadow-none",
|
|
20
21
|
outline: "bg-[color:color-mix(in_oklch,var(--background),var(--muted)_6%)] text-foreground shadow-none",
|
|
21
22
|
ghost: "border-transparent bg-[color:color-mix(in_oklch,var(--muted),transparent_76%)] text-muted-foreground shadow-none",
|
|
22
23
|
link: "border-transparent bg-transparent p-0 text-primary shadow-none underline-offset-4",
|
|
@@ -115,7 +116,7 @@ function Badge({
|
|
|
115
116
|
event.stopPropagation()
|
|
116
117
|
onRemove?.()
|
|
117
118
|
}}
|
|
118
|
-
className="inline-flex size-4 shrink-0 items-center justify-center rounded-full bg-[color:color-mix(in_oklch,currentColor,transparent_90%)] opacity-80 transition hover:opacity-100"
|
|
119
|
+
className="inline-flex size-4 shrink-0 items-center justify-center rounded-full bg-[color:color-mix(in_oklch,currentColor,transparent_90%)] opacity-80 transition hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/35"
|
|
119
120
|
>
|
|
120
121
|
<XIcon className="size-3" />
|
|
121
122
|
</button>
|
|
@@ -46,6 +46,7 @@ export type ButtonProps = ButtonPrimitive.Props &
|
|
|
46
46
|
loadingLabel?: string
|
|
47
47
|
leftIcon?: React.ReactNode
|
|
48
48
|
rightIcon?: React.ReactNode
|
|
49
|
+
iconOnly?: boolean
|
|
49
50
|
fullWidth?: boolean
|
|
50
51
|
pressed?: boolean
|
|
51
52
|
}
|
|
@@ -59,25 +60,30 @@ function Button({
|
|
|
59
60
|
loadingLabel = "Loading",
|
|
60
61
|
leftIcon,
|
|
61
62
|
rightIcon,
|
|
63
|
+
iconOnly = false,
|
|
62
64
|
fullWidth = false,
|
|
63
65
|
pressed = false,
|
|
64
66
|
children,
|
|
67
|
+
"aria-label": ariaLabel,
|
|
65
68
|
...props
|
|
66
69
|
}: ButtonProps) {
|
|
67
|
-
const isDisabled = disabled || loading
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
const isDisabled = disabled || loading
|
|
71
|
+
const resolvedSize = iconOnly && (size === "default" || size === "md") ? "icon" : size
|
|
72
|
+
|
|
73
|
+
return (
|
|
70
74
|
<ButtonPrimitive
|
|
71
75
|
data-slot="button"
|
|
72
76
|
data-variant={variant ?? "default"}
|
|
73
|
-
data-size={
|
|
77
|
+
data-size={resolvedSize ?? "default"}
|
|
78
|
+
data-icon-only={iconOnly || undefined}
|
|
74
79
|
data-loading={loading || undefined}
|
|
75
80
|
data-pressed={pressed || undefined}
|
|
76
81
|
disabled={isDisabled}
|
|
77
82
|
aria-busy={loading || undefined}
|
|
78
83
|
aria-pressed={pressed || undefined}
|
|
84
|
+
aria-label={ariaLabel}
|
|
79
85
|
className={cn(
|
|
80
|
-
buttonVariants({ variant, size, className }),
|
|
86
|
+
buttonVariants({ variant, size: resolvedSize, className }),
|
|
81
87
|
fullWidth && "w-full",
|
|
82
88
|
pressed && "shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04)),0_0_0_1px_var(--aui-focus-ring,var(--ring))]"
|
|
83
89
|
)}
|