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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import { Loader2Icon } from "lucide-react"
|
|
2
3
|
|
|
3
4
|
import { cn } from "@/lib/utils"
|
|
4
5
|
|
|
@@ -9,8 +10,29 @@ export type SwitchProps = Omit<
|
|
|
9
10
|
checked?: boolean
|
|
10
11
|
defaultChecked?: boolean
|
|
11
12
|
onCheckedChange?: (checked: boolean) => void
|
|
13
|
+
size?: "sm" | "md" | "lg"
|
|
14
|
+
loading?: boolean
|
|
15
|
+
invalid?: boolean
|
|
16
|
+
label?: React.ReactNode
|
|
17
|
+
description?: React.ReactNode
|
|
18
|
+
labelPlacement?: "start" | "end" | "top" | "bottom"
|
|
19
|
+
switchClassName?: string
|
|
20
|
+
labelClassName?: string
|
|
21
|
+
descriptionClassName?: string
|
|
12
22
|
}
|
|
13
23
|
|
|
24
|
+
const switchSizeClassName = {
|
|
25
|
+
sm: "h-5 w-9",
|
|
26
|
+
md: "h-6.5 w-11.5",
|
|
27
|
+
lg: "h-8 w-14",
|
|
28
|
+
} satisfies Record<NonNullable<SwitchProps["size"]>, string>
|
|
29
|
+
|
|
30
|
+
const thumbSizeClassName = {
|
|
31
|
+
sm: "size-4 data-[state=checked]:translate-x-4.5 data-[state=unchecked]:translate-x-0.5",
|
|
32
|
+
md: "size-5 data-[state=checked]:translate-x-5.5 data-[state=unchecked]:translate-x-0.5",
|
|
33
|
+
lg: "size-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-1",
|
|
34
|
+
} satisfies Record<NonNullable<SwitchProps["size"]>, string>
|
|
35
|
+
|
|
14
36
|
const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(
|
|
15
37
|
(
|
|
16
38
|
{
|
|
@@ -18,6 +40,15 @@ const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(
|
|
|
18
40
|
checked,
|
|
19
41
|
defaultChecked = false,
|
|
20
42
|
onCheckedChange,
|
|
43
|
+
size = "md",
|
|
44
|
+
loading = false,
|
|
45
|
+
invalid = false,
|
|
46
|
+
label,
|
|
47
|
+
description,
|
|
48
|
+
labelPlacement = "end",
|
|
49
|
+
switchClassName,
|
|
50
|
+
labelClassName,
|
|
51
|
+
descriptionClassName,
|
|
21
52
|
disabled,
|
|
22
53
|
onClick,
|
|
23
54
|
...props
|
|
@@ -27,8 +58,10 @@ const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(
|
|
|
27
58
|
const isControlled = checked !== undefined
|
|
28
59
|
const [internalChecked, setInternalChecked] = React.useState(defaultChecked)
|
|
29
60
|
const currentChecked = isControlled ? checked : internalChecked
|
|
61
|
+
const isDisabled = disabled || loading
|
|
30
62
|
|
|
31
63
|
const handleClick: React.MouseEventHandler<HTMLButtonElement> = (event) => {
|
|
64
|
+
if (isDisabled) return
|
|
32
65
|
const nextChecked = !currentChecked
|
|
33
66
|
|
|
34
67
|
if (!isControlled) {
|
|
@@ -39,18 +72,23 @@ const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(
|
|
|
39
72
|
onClick?.(event)
|
|
40
73
|
}
|
|
41
74
|
|
|
42
|
-
|
|
75
|
+
const control = (
|
|
43
76
|
<button
|
|
44
77
|
ref={ref}
|
|
45
78
|
type="button"
|
|
46
79
|
role="switch"
|
|
47
80
|
aria-checked={currentChecked}
|
|
81
|
+
aria-invalid={invalid || undefined}
|
|
82
|
+
aria-busy={loading || undefined}
|
|
48
83
|
data-state={currentChecked ? "checked" : "unchecked"}
|
|
84
|
+
data-size={size}
|
|
49
85
|
data-slot="switch"
|
|
50
|
-
disabled={
|
|
86
|
+
disabled={isDisabled}
|
|
51
87
|
className={cn(
|
|
52
|
-
"peer inline-flex
|
|
53
|
-
|
|
88
|
+
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border border-border/78 bg-input/70 shadow-[inset_0_1px_0_rgba(255,255,255,0.08)] transition-[background-color,border-color,box-shadow] outline-none hover:border-ring/30 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/45 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[state=checked]:border-primary/22 data-[state=checked]:bg-primary data-[state=checked]:shadow-[0_10px_22px_color-mix(in_oklch,var(--primary),transparent_82%)] dark:border-white/10 dark:bg-white/[0.08]",
|
|
89
|
+
switchSizeClassName[size],
|
|
90
|
+
switchClassName,
|
|
91
|
+
!label && className
|
|
54
92
|
)}
|
|
55
93
|
onClick={handleClick}
|
|
56
94
|
{...props}
|
|
@@ -59,11 +97,38 @@ const Switch = React.forwardRef<HTMLButtonElement, SwitchProps>(
|
|
|
59
97
|
data-slot="switch-thumb"
|
|
60
98
|
data-state={currentChecked ? "checked" : "unchecked"}
|
|
61
99
|
className={cn(
|
|
62
|
-
"pointer-events-none
|
|
100
|
+
"pointer-events-none flex items-center justify-center rounded-full bg-white shadow-[0_2px_10px_color-mix(in_oklch,var(--foreground),transparent_88%)] ring-1 ring-foreground/6 transition-transform dark:bg-[rgba(255,255,255,0.96)]",
|
|
101
|
+
thumbSizeClassName[size]
|
|
63
102
|
)}
|
|
64
|
-
|
|
103
|
+
>
|
|
104
|
+
{loading ? <Loader2Icon className="size-3 animate-spin text-muted-foreground" /> : null}
|
|
105
|
+
</span>
|
|
65
106
|
</button>
|
|
66
107
|
)
|
|
108
|
+
|
|
109
|
+
if (!label && !description) return control
|
|
110
|
+
|
|
111
|
+
const labelBlock = (
|
|
112
|
+
<span className="grid min-w-0 gap-0.5">
|
|
113
|
+
{label ? <span className={cn("text-sm font-medium leading-5 text-foreground", labelClassName)}>{label}</span> : null}
|
|
114
|
+
{description ? <span className={cn("text-xs leading-5 text-muted-foreground", descriptionClassName)}>{description}</span> : null}
|
|
115
|
+
</span>
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<label
|
|
120
|
+
data-slot="switch-field"
|
|
121
|
+
data-label-placement={labelPlacement}
|
|
122
|
+
className={cn(
|
|
123
|
+
"inline-flex min-w-0 gap-3",
|
|
124
|
+
labelPlacement === "top" || labelPlacement === "bottom" ? "flex-col" : "items-start",
|
|
125
|
+
labelPlacement === "start" && "flex-row-reverse justify-end",
|
|
126
|
+
className
|
|
127
|
+
)}
|
|
128
|
+
>
|
|
129
|
+
{labelPlacement === "bottom" ? <>{control}{labelBlock}</> : <>{labelBlock}{control}</>}
|
|
130
|
+
</label>
|
|
131
|
+
)
|
|
67
132
|
}
|
|
68
133
|
)
|
|
69
134
|
Switch.displayName = "Switch"
|
|
@@ -4,8 +4,13 @@ import { Tabs as BaseTabs } from "@base-ui/react/tabs"
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
6
|
export type TabsRootProps = React.ComponentPropsWithoutRef<typeof BaseTabs.Root>
|
|
7
|
-
export type TabsListProps = React.ComponentPropsWithoutRef<typeof BaseTabs.List>
|
|
8
|
-
|
|
7
|
+
export type TabsListProps = React.ComponentPropsWithoutRef<typeof BaseTabs.List> & {
|
|
8
|
+
variant?: "default" | "pills" | "underline" | "compact"
|
|
9
|
+
overflow?: "wrap" | "scroll"
|
|
10
|
+
}
|
|
11
|
+
export type TabsTriggerProps = React.ComponentPropsWithoutRef<typeof BaseTabs.Tab> & {
|
|
12
|
+
variant?: "default" | "pills" | "underline" | "compact"
|
|
13
|
+
}
|
|
9
14
|
export type TabsContentProps = React.ComponentPropsWithoutRef<typeof BaseTabs.Panel>
|
|
10
15
|
|
|
11
16
|
const Tabs = BaseTabs.Root
|
|
@@ -13,12 +18,19 @@ const Tabs = BaseTabs.Root
|
|
|
13
18
|
const TabsList = React.forwardRef<
|
|
14
19
|
React.ElementRef<typeof BaseTabs.List>,
|
|
15
20
|
TabsListProps
|
|
16
|
-
>(({ className, ...props }, ref) => (
|
|
21
|
+
>(({ className, variant = "default", overflow = "scroll", ...props }, ref) => (
|
|
17
22
|
<BaseTabs.List
|
|
18
23
|
ref={ref}
|
|
19
24
|
data-slot="tabs-list"
|
|
25
|
+
data-variant={variant}
|
|
26
|
+
data-overflow={overflow}
|
|
20
27
|
className={cn(
|
|
21
|
-
"inline-flex min-h-11 items-center justify-
|
|
28
|
+
"inline-flex max-w-full min-h-11 items-center justify-start gap-1 rounded-[var(--aui-card-radius,var(--radius-xl))] border border-[color:color-mix(in_oklch,var(--border),white_4%)] bg-[color:var(--aui-control-panel-bg,var(--muted))] p-1 text-muted-foreground shadow-[var(--aui-control-panel-shadow,var(--aui-control-shadow,none))] backdrop-blur",
|
|
29
|
+
overflow === "scroll" && "overflow-x-auto overflow-y-hidden overscroll-x-contain [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
|
|
30
|
+
overflow === "wrap" && "flex-wrap",
|
|
31
|
+
variant === "underline" && "min-h-10 rounded-none border-x-0 border-t-0 bg-transparent p-0 shadow-none",
|
|
32
|
+
variant === "compact" && "min-h-9 rounded-[var(--radius-lg)] p-0.5",
|
|
33
|
+
variant === "pills" && "rounded-full",
|
|
22
34
|
className
|
|
23
35
|
)}
|
|
24
36
|
{...props}
|
|
@@ -29,12 +41,16 @@ TabsList.displayName = "TabsList"
|
|
|
29
41
|
const TabsTrigger = React.forwardRef<
|
|
30
42
|
React.ElementRef<typeof BaseTabs.Tab>,
|
|
31
43
|
TabsTriggerProps
|
|
32
|
-
>(({ className, ...props }, ref) => (
|
|
44
|
+
>(({ className, variant = "default", ...props }, ref) => (
|
|
33
45
|
<BaseTabs.Tab
|
|
34
46
|
ref={ref}
|
|
35
47
|
data-slot="tabs-trigger"
|
|
48
|
+
data-variant={variant}
|
|
36
49
|
className={cn(
|
|
37
|
-
"inline-flex min-h-9 items-center justify-center whitespace-nowrap rounded-[var(--radius-md)] border border-transparent px-3.5 py-1.5 text-sm font-medium text-muted-foreground ring-offset-background transition-[background-color,color,box-shadow,border-color] hover:bg-[color:color-mix(in_oklch,var(--background),transparent_18%)] hover:text-foreground data-[selected]:border-[color:color-mix(in_oklch,var(--border),var(--foreground)_8%)] data-[selected]:bg-[color:var(--aui-control-surface,var(--background))] data-[selected]:text-foreground data-[selected]:shadow-[var(--aui-control-shadow,none)] aria-selected:border-[color:color-mix(in_oklch,var(--border),var(--foreground)_8%)] aria-selected:bg-[color:var(--aui-control-surface,var(--background))] aria-selected:text-foreground aria-selected:shadow-[var(--aui-control-shadow,none)] focus-visible:outline-none focus-visible:ring-0 focus-visible:shadow-[var(--aui-control-shadow,none),0_0_0_1px_var(--aui-focus-ring,var(--ring)),0_0_0_5px_var(--aui-focus-ring-soft,transparent)] disabled:pointer-events-none disabled:opacity-50",
|
|
50
|
+
"inline-flex min-h-9 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-[var(--radius-md)] border border-transparent px-3.5 py-1.5 text-sm font-medium text-muted-foreground ring-offset-background transition-[background-color,color,box-shadow,border-color] hover:bg-[color:color-mix(in_oklch,var(--background),transparent_18%)] hover:text-foreground data-[selected]:border-[color:color-mix(in_oklch,var(--border),var(--foreground)_8%)] data-[selected]:bg-[color:var(--aui-control-surface,var(--background))] data-[selected]:text-foreground data-[selected]:shadow-[var(--aui-control-shadow,none)] aria-selected:border-[color:color-mix(in_oklch,var(--border),var(--foreground)_8%)] aria-selected:bg-[color:var(--aui-control-surface,var(--background))] aria-selected:text-foreground aria-selected:shadow-[var(--aui-control-shadow,none)] focus-visible:outline-none focus-visible:ring-0 focus-visible:shadow-[var(--aui-control-shadow,none),0_0_0_1px_var(--aui-focus-ring,var(--ring)),0_0_0_5px_var(--aui-focus-ring-soft,transparent)] disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",
|
|
51
|
+
variant === "underline" && "min-h-10 rounded-none border-b-2 px-2 shadow-none data-[selected]:border-b-primary data-[selected]:bg-transparent data-[selected]:shadow-none aria-selected:border-b-primary aria-selected:bg-transparent aria-selected:shadow-none",
|
|
52
|
+
variant === "pills" && "rounded-full",
|
|
53
|
+
variant === "compact" && "min-h-8 px-2.5 text-xs",
|
|
38
54
|
className
|
|
39
55
|
)}
|
|
40
56
|
{...props}
|
|
@@ -2,19 +2,109 @@ import * as React from "react"
|
|
|
2
2
|
|
|
3
3
|
import { cn } from "@/lib/utils"
|
|
4
4
|
|
|
5
|
-
export type TextareaProps = React.ComponentProps<"textarea">
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
export type TextareaProps = React.ComponentProps<"textarea"> & {
|
|
6
|
+
onValueChange?: (value: string) => void
|
|
7
|
+
helperText?: React.ReactNode
|
|
8
|
+
errorText?: React.ReactNode
|
|
9
|
+
showCharacterCount?: boolean
|
|
10
|
+
countFormatter?: (currentLength: number, maxLength?: number) => React.ReactNode
|
|
11
|
+
wrapperClassName?: string
|
|
12
|
+
textareaClassName?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getTextareaLength(value: TextareaProps["value"] | TextareaProps["defaultValue"]) {
|
|
16
|
+
if (typeof value === "string") return value.length
|
|
17
|
+
if (typeof value === "number") return String(value).length
|
|
18
|
+
if (Array.isArray(value)) return value.join("").length
|
|
19
|
+
return 0
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
23
|
+
(
|
|
24
|
+
{
|
|
25
|
+
className,
|
|
26
|
+
value,
|
|
27
|
+
defaultValue,
|
|
28
|
+
onChange,
|
|
29
|
+
onValueChange,
|
|
30
|
+
helperText,
|
|
31
|
+
errorText,
|
|
32
|
+
showCharacterCount = false,
|
|
33
|
+
countFormatter,
|
|
34
|
+
wrapperClassName,
|
|
35
|
+
textareaClassName,
|
|
36
|
+
maxLength,
|
|
37
|
+
"aria-invalid": ariaInvalid,
|
|
38
|
+
...props
|
|
39
|
+
},
|
|
40
|
+
ref
|
|
41
|
+
) => {
|
|
42
|
+
const isControlled = value !== undefined
|
|
43
|
+
const [uncontrolledLength, setUncontrolledLength] = React.useState(() => getTextareaLength(defaultValue))
|
|
44
|
+
const currentLength = isControlled ? getTextareaLength(value) : uncontrolledLength
|
|
45
|
+
const helperMessage = errorText ?? helperText
|
|
46
|
+
const invalid = Boolean(errorText) || ariaInvalid === true || ariaInvalid === "true"
|
|
47
|
+
|
|
48
|
+
const handleChange: React.ChangeEventHandler<HTMLTextAreaElement> = (event) => {
|
|
49
|
+
if (!isControlled) {
|
|
50
|
+
setUncontrolledLength(event.target.value.length)
|
|
51
|
+
}
|
|
52
|
+
onChange?.(event)
|
|
53
|
+
onValueChange?.(event.target.value)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const textarea = (
|
|
57
|
+
<textarea
|
|
58
|
+
data-slot="textarea"
|
|
59
|
+
value={value}
|
|
60
|
+
defaultValue={isControlled ? undefined : defaultValue}
|
|
61
|
+
maxLength={maxLength}
|
|
62
|
+
aria-invalid={invalid || undefined}
|
|
63
|
+
className={cn(
|
|
64
|
+
"flex field-sizing-content min-h-28 w-full rounded-[var(--aui-control-radius,var(--radius-lg))] border border-[color:var(--aui-control-border-strong,var(--input))] bg-[color:var(--aui-control-surface,var(--background))] px-4 py-3.5 text-sm font-medium text-foreground shadow-[var(--aui-shadow-xs,0_1px_2px_rgba(15,23,42,0.04))] transition-[background-color,border-color,box-shadow,color] outline-none placeholder:text-muted-foreground/78 hover:border-[color:var(--aui-control-hover-border,var(--ring))] hover:bg-[color:var(--aui-control-surface-hover,var(--background))] focus-visible:border-[color:var(--ring)] focus-visible:ring-0 focus-visible:shadow-[var(--aui-shadow-xs,0_1px_2px_rgba(15,23,42,0.04)),0_0_0_1px_var(--aui-focus-ring,var(--ring)),0_0_0_5px_var(--aui-focus-ring-soft,transparent)] disabled:cursor-not-allowed disabled:border-[color:color-mix(in_oklch,var(--border),transparent_18%)] disabled:bg-[color:var(--aui-control-surface-disabled,var(--muted))] disabled:text-muted-foreground disabled:shadow-none disabled:opacity-100 aria-invalid:border-destructive aria-invalid:shadow-[0_0_0_1px_color-mix(in_oklch,var(--destructive),transparent_32%)] read-only:bg-[color:var(--aui-control-surface-readonly,var(--muted))]",
|
|
65
|
+
textareaClassName,
|
|
66
|
+
className
|
|
67
|
+
)}
|
|
68
|
+
onChange={handleChange}
|
|
69
|
+
ref={ref}
|
|
70
|
+
{...props}
|
|
71
|
+
/>
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
if (!helperMessage && !showCharacterCount) {
|
|
75
|
+
return textarea
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return (
|
|
79
|
+
<div data-slot="textarea-field" className={cn("grid gap-1.5", wrapperClassName)}>
|
|
80
|
+
{textarea}
|
|
81
|
+
<div data-slot="textarea-meta" className="flex items-start justify-between gap-3 px-1">
|
|
82
|
+
<div
|
|
83
|
+
data-slot="textarea-helper"
|
|
84
|
+
className={cn(
|
|
85
|
+
"min-w-0 text-xs leading-5",
|
|
86
|
+
errorText ? "text-destructive" : "text-muted-foreground"
|
|
87
|
+
)}
|
|
88
|
+
>
|
|
89
|
+
{helperMessage}
|
|
90
|
+
</div>
|
|
91
|
+
{showCharacterCount ? (
|
|
92
|
+
<div
|
|
93
|
+
data-slot="textarea-count"
|
|
94
|
+
className={cn(
|
|
95
|
+
"shrink-0 text-[11px] font-medium tabular-nums",
|
|
96
|
+
errorText ? "text-destructive" : "text-muted-foreground"
|
|
97
|
+
)}
|
|
98
|
+
>
|
|
99
|
+
{countFormatter?.(currentLength, maxLength) ??
|
|
100
|
+
(typeof maxLength === "number" ? `${currentLength}/${maxLength}` : currentLength)}
|
|
101
|
+
</div>
|
|
102
|
+
) : null}
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
Textarea.displayName = "Textarea"
|
|
109
|
+
|
|
20
110
|
export { Textarea }
|
|
@@ -1,37 +1,82 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
+
import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip"
|
|
2
3
|
|
|
3
4
|
import { cn } from "@/lib/utils"
|
|
4
5
|
|
|
5
|
-
export type TooltipProps = Omit<
|
|
6
|
+
export type TooltipProps = Omit<TooltipPrimitive.Root.Props, "children"> &
|
|
7
|
+
Omit<React.ComponentProps<"span">, "content" | "children"> & {
|
|
6
8
|
content: React.ReactNode
|
|
7
|
-
|
|
9
|
+
children: React.ReactNode
|
|
10
|
+
side?: TooltipPrimitive.Positioner.Props["side"]
|
|
11
|
+
align?: TooltipPrimitive.Positioner.Props["align"]
|
|
12
|
+
sideOffset?: TooltipPrimitive.Positioner.Props["sideOffset"]
|
|
13
|
+
alignOffset?: TooltipPrimitive.Positioner.Props["alignOffset"]
|
|
14
|
+
collisionPadding?: TooltipPrimitive.Positioner.Props["collisionPadding"]
|
|
15
|
+
delay?: TooltipPrimitive.Trigger.Props["delay"]
|
|
16
|
+
closeDelay?: TooltipPrimitive.Trigger.Props["closeDelay"]
|
|
8
17
|
disabled?: boolean
|
|
9
18
|
}
|
|
10
19
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
function getPlainText(node: React.ReactNode): string {
|
|
21
|
+
if (typeof node === "string" || typeof node === "number") return String(node)
|
|
22
|
+
if (Array.isArray(node)) return node.map(getPlainText).join("")
|
|
23
|
+
if (React.isValidElement<{ children?: React.ReactNode }>(node)) return getPlainText(node.props.children)
|
|
24
|
+
return ""
|
|
16
25
|
}
|
|
17
26
|
|
|
18
|
-
function Tooltip({
|
|
27
|
+
function Tooltip({
|
|
28
|
+
content,
|
|
29
|
+
side = "top",
|
|
30
|
+
align = "center",
|
|
31
|
+
sideOffset = 8,
|
|
32
|
+
alignOffset = 0,
|
|
33
|
+
collisionPadding = 8,
|
|
34
|
+
delay = 500,
|
|
35
|
+
closeDelay = 0,
|
|
36
|
+
disabled = false,
|
|
37
|
+
className,
|
|
38
|
+
children,
|
|
39
|
+
...props
|
|
40
|
+
}: TooltipProps) {
|
|
41
|
+
const trigger = React.isValidElement(children) ? (
|
|
42
|
+
children
|
|
43
|
+
) : (
|
|
44
|
+
<span className="inline-flex">{children}</span>
|
|
45
|
+
)
|
|
46
|
+
const contentText = getPlainText(content)
|
|
47
|
+
const shouldRenderFallbackLabel =
|
|
48
|
+
!disabled && contentText.length > 0 && !getPlainText(children).includes(contentText)
|
|
49
|
+
|
|
19
50
|
return (
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
51
|
+
<TooltipPrimitive.Root disabled={disabled}>
|
|
52
|
+
<TooltipPrimitive.Trigger
|
|
53
|
+
data-slot="tooltip-trigger"
|
|
54
|
+
delay={delay}
|
|
55
|
+
closeDelay={closeDelay}
|
|
56
|
+
disabled={disabled}
|
|
57
|
+
render={<span data-slot="tooltip" className={cn("inline-flex", className)} {...props} />}
|
|
58
|
+
>
|
|
59
|
+
{trigger}
|
|
60
|
+
{shouldRenderFallbackLabel ? <span className="sr-only">{content}</span> : null}
|
|
61
|
+
</TooltipPrimitive.Trigger>
|
|
62
|
+
<TooltipPrimitive.Portal>
|
|
63
|
+
<TooltipPrimitive.Positioner
|
|
64
|
+
className="isolate z-50"
|
|
65
|
+
side={side}
|
|
66
|
+
align={align}
|
|
67
|
+
sideOffset={sideOffset}
|
|
68
|
+
alignOffset={alignOffset}
|
|
69
|
+
collisionPadding={collisionPadding}
|
|
30
70
|
>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
71
|
+
<TooltipPrimitive.Popup
|
|
72
|
+
data-slot="tooltip-content"
|
|
73
|
+
className="z-50 max-w-64 origin-(--transform-origin) rounded-[var(--radius-lg)] border border-border/75 bg-popover/98 px-2.5 py-1.5 text-[11px] font-medium leading-4 text-popover-foreground shadow-[0_16px_42px_color-mix(in_oklch,var(--foreground),transparent_86%)] outline-hidden backdrop-blur duration-100 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95"
|
|
74
|
+
>
|
|
75
|
+
{content}
|
|
76
|
+
</TooltipPrimitive.Popup>
|
|
77
|
+
</TooltipPrimitive.Positioner>
|
|
78
|
+
</TooltipPrimitive.Portal>
|
|
79
|
+
</TooltipPrimitive.Root>
|
|
35
80
|
)
|
|
36
81
|
}
|
|
37
82
|
|