tembro 2.0.6 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-toolbar.cjs +1 -1
- package/dist/components/data-table/data-table-toolbar.js +12 -13
- package/dist/components/display/carousel.cjs +1 -1
- package/dist/components/display/carousel.d.ts +9 -1
- package/dist/components/display/carousel.js +123 -81
- 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/status-legend.cjs +1 -1
- package/dist/components/display/status-legend.js +6 -2
- 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.js +2 -0
- package/dist/components/form/form-select.cjs +1 -1
- package/dist/components/form/form-select.js +2 -0
- 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/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/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.d.ts +1 -1
- 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 +8 -1
- package/dist/components/ui/select/index.js +40 -35
- 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/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/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 +19 -6
- 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 +43 -18
- 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/render-registry-preview.cjs +1 -1
- package/dist/showcase/render-registry-preview.js +57 -79
- 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-toolbar.tsx +8 -6
- package/packages/cli/vendor/src/components/display/carousel.tsx +84 -3
- 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/status-legend.tsx +11 -8
- 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 +2 -0
- package/packages/cli/vendor/src/components/form/form-select.tsx +2 -0
- 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/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/dialog/index.tsx +2 -1
- package/packages/cli/vendor/src/components/ui/hover-card.tsx +54 -28
- 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 +64 -31
- 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/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/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 +22 -1
- 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/render-registry-preview.tsx +0 -15
- 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,63 +1,90 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import { Card as t, CardContent as n, CardHeader as r, CardTitle as i } from "../ui/card/index.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import { jsx as
|
|
3
|
+
import * as a from "react";
|
|
4
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/display/kanban.tsx
|
|
6
|
-
function
|
|
7
|
-
|
|
6
|
+
function c({ columns: t, renderCard: n, onCardClick: r, onCardMove: i, emptyColumn: s = "No cards yet.", columnClassName: c, cardClassName: u, className: d, ...f }) {
|
|
7
|
+
let p = a.useMemo(() => new Map(t.map((e) => [e.key, e])), [t]);
|
|
8
|
+
return /* @__PURE__ */ o("div", {
|
|
8
9
|
"data-slot": "kanban-board",
|
|
9
|
-
className: e("grid auto-cols-[minmax(280px,1fr)] grid-flow-col gap-4 overflow-x-auto pb-2",
|
|
10
|
-
...
|
|
11
|
-
children: t.map((e) => /* @__PURE__ */
|
|
10
|
+
className: e("grid auto-cols-[minmax(280px,1fr)] grid-flow-col gap-4 overflow-x-auto pb-2", d),
|
|
11
|
+
...f,
|
|
12
|
+
children: t.map((e) => /* @__PURE__ */ o(l, {
|
|
12
13
|
column: e,
|
|
13
14
|
renderCard: n,
|
|
14
15
|
onCardClick: r,
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
onCardMove: i,
|
|
17
|
+
columnByKey: p,
|
|
18
|
+
emptyColumn: s,
|
|
19
|
+
columnClassName: c,
|
|
20
|
+
cardClassName: u
|
|
17
21
|
}, e.key))
|
|
18
22
|
});
|
|
19
23
|
}
|
|
20
|
-
function
|
|
21
|
-
return /* @__PURE__ */
|
|
24
|
+
function l({ column: a, renderCard: c, onCardClick: l, onCardMove: u, columnByKey: d, emptyColumn: f, columnClassName: p, cardClassName: m }) {
|
|
25
|
+
return /* @__PURE__ */ s("section", {
|
|
22
26
|
"data-slot": "kanban-column",
|
|
23
|
-
className: e("grid min-h-40 content-start gap-3 rounded-lg border bg-muted/35 p-3",
|
|
24
|
-
|
|
27
|
+
className: e("grid min-h-40 content-start gap-3 rounded-lg border bg-muted/35 p-3", p),
|
|
28
|
+
onDragOver: (e) => {
|
|
29
|
+
u && e.preventDefault();
|
|
30
|
+
},
|
|
31
|
+
onDrop: (e) => {
|
|
32
|
+
let t = e.dataTransfer.getData("application/x-tembro-kanban-card"), n = e.dataTransfer.getData("application/x-tembro-kanban-column"), r = d.get(n), i = r?.cards.find((e) => e.key === t);
|
|
33
|
+
i && r && r.key !== a.key && u?.(i, r, a);
|
|
34
|
+
},
|
|
35
|
+
children: [/* @__PURE__ */ s("div", {
|
|
25
36
|
className: "flex items-start justify-between gap-3",
|
|
26
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ s("div", {
|
|
27
38
|
className: "grid gap-0.5",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
39
|
+
children: [/* @__PURE__ */ o("h3", {
|
|
29
40
|
className: "text-sm font-semibold text-foreground",
|
|
30
|
-
children:
|
|
31
|
-
}),
|
|
41
|
+
children: a.title
|
|
42
|
+
}), a.description && /* @__PURE__ */ o("p", {
|
|
32
43
|
className: "text-xs text-muted-foreground",
|
|
33
|
-
children:
|
|
44
|
+
children: a.description
|
|
34
45
|
})]
|
|
35
|
-
}), /* @__PURE__ */
|
|
46
|
+
}), /* @__PURE__ */ o("div", {
|
|
36
47
|
className: "rounded-full bg-background px-2 py-0.5 text-xs text-muted-foreground",
|
|
37
|
-
children:
|
|
48
|
+
children: a.count ?? a.cards.length
|
|
38
49
|
})]
|
|
39
|
-
}), /* @__PURE__ */
|
|
50
|
+
}), /* @__PURE__ */ o("div", {
|
|
40
51
|
className: "grid gap-2",
|
|
41
|
-
children:
|
|
52
|
+
children: a.cards.length === 0 ? /* @__PURE__ */ o("div", {
|
|
53
|
+
"data-slot": "kanban-column-empty",
|
|
54
|
+
className: "rounded-md border border-dashed bg-background/60 px-3 py-6 text-center text-sm text-muted-foreground",
|
|
55
|
+
children: typeof f == "function" ? f(a) : f
|
|
56
|
+
}) : a.cards.map((d) => c?.(d, a) ?? /* @__PURE__ */ s(t, {
|
|
42
57
|
"data-slot": "kanban-card",
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
58
|
+
role: l ? "button" : void 0,
|
|
59
|
+
tabIndex: l && !d.disabled ? 0 : void 0,
|
|
60
|
+
draggable: !!(u && !d.disabled),
|
|
61
|
+
className: e("transition-colors hover:bg-muted/40", l && !d.disabled && "cursor-pointer", u && !d.disabled && "cursor-grab active:cursor-grabbing", d.disabled && "pointer-events-none opacity-55", m),
|
|
62
|
+
onDragStart: (e) => {
|
|
63
|
+
e.dataTransfer.setData("application/x-tembro-kanban-card", d.key), e.dataTransfer.setData("application/x-tembro-kanban-column", a.key), e.dataTransfer.effectAllowed = "move";
|
|
64
|
+
},
|
|
65
|
+
onClick: () => l?.(d, a),
|
|
66
|
+
onKeyDown: (e) => {
|
|
67
|
+
(e.key === "Enter" || e.key === " ") && l && !d.disabled && (e.preventDefault(), l(d, a));
|
|
68
|
+
},
|
|
69
|
+
children: [/* @__PURE__ */ o(r, {
|
|
46
70
|
className: "p-3 pb-1",
|
|
47
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ s("div", {
|
|
48
72
|
className: "flex items-start justify-between gap-2",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
73
|
+
children: [/* @__PURE__ */ o(i, {
|
|
50
74
|
className: "text-sm",
|
|
51
|
-
children:
|
|
52
|
-
}),
|
|
75
|
+
children: d.title
|
|
76
|
+
}), (d.extra || d.actions) && /* @__PURE__ */ s("div", {
|
|
77
|
+
className: "flex shrink-0 items-center gap-1",
|
|
78
|
+
children: [d.extra, d.actions]
|
|
79
|
+
})]
|
|
53
80
|
})
|
|
54
|
-
}), (
|
|
81
|
+
}), (d.description || d.meta) && /* @__PURE__ */ s(n, {
|
|
55
82
|
className: "grid gap-2 p-3 pt-0 text-xs text-muted-foreground",
|
|
56
|
-
children: [
|
|
83
|
+
children: [d.description, d.meta && /* @__PURE__ */ o("div", { children: d.meta })]
|
|
57
84
|
})]
|
|
58
|
-
},
|
|
85
|
+
}, d.key))
|
|
59
86
|
})]
|
|
60
87
|
});
|
|
61
88
|
}
|
|
62
89
|
//#endregion
|
|
63
|
-
export {
|
|
90
|
+
export { c as KanbanBoard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 xl:grid-cols-3`,4:`grid-cols-1 sm:grid-cols-2 xl:grid-cols-4`},o={default:``,success:`border-emerald-500/20 bg-emerald-500/5`,warning:`border-amber-500/20 bg-amber-500/5`,danger:`border-destructive/20 bg-destructive/5`,info:`border-blue-500/20 bg-blue-500/5`,muted:`bg-muted/40`};function s({className:e,items:r,columns:s=4,compact:c=!1,itemClassName:l,...u}){let d=r.filter(e=>!e.hidden);return(0,i.jsx)(`div`,{"data-slot":`metric-grid`,className:t.cn(`grid gap-3`,a[s],e),...u,children:d.map(e=>(0,i.jsxs)(n.Card,{"data-slot":`stat-card`,"data-tone":e.tone??`default`,className:t.cn(`min-w-0 overflow-hidden`,o[e.tone??`default`],l,e.className),children:[(0,i.jsxs)(n.CardHeader,{className:t.cn(`flex flex-row items-start justify-between gap-3 space-y-0`,c?`p-3 pb-1`:`pb-2`),children:[(0,i.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,i.jsx)(n.CardDescription,{className:`truncate`,children:e.label}),(0,i.jsx)(n.CardTitle,{className:t.cn(`truncate`,c?`text-xl`:`text-2xl`),children:e.value})]}),e.icon&&(0,i.jsx)(`div`,{className:`shrink-0 rounded-lg bg-muted p-2 text-muted-foreground [&_svg]:size-4`,children:e.icon})]}),(e.description||e.trend)&&(0,i.jsxs)(n.CardContent,{className:t.cn(`flex min-w-0 items-center justify-between gap-2`,c?`p-3 pt-1`:`pt-0`),children:[e.description&&(0,i.jsx)(`div`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:e.description}),e.trend&&(0,i.jsx)(`div`,{className:`shrink-0 text-xs font-medium`,children:e.trend})]})]},e.key))})}exports.MetricGrid=s;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("react/jsx-runtime");var a={1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 xl:grid-cols-3`,4:`grid-cols-1 sm:grid-cols-2 xl:grid-cols-4`},o={default:``,success:`border-emerald-500/20 bg-emerald-500/5`,warning:`border-amber-500/20 bg-amber-500/5`,danger:`border-destructive/20 bg-destructive/5`,info:`border-blue-500/20 bg-blue-500/5`,muted:`bg-muted/40`};function s({className:e,items:r,columns:s=4,compact:c=!1,itemClassName:l,...u}){let d=r.filter(e=>!e.hidden);return(0,i.jsx)(`div`,{"data-slot":`metric-grid`,className:t.cn(`grid gap-3`,a[s],e),...u,children:d.map(e=>(0,i.jsxs)(n.Card,{"data-slot":`stat-card`,"data-tone":e.tone??`default`,className:t.cn(`min-w-0 overflow-hidden`,o[e.tone??`default`],l,e.className),children:[(0,i.jsxs)(n.CardHeader,{className:t.cn(`flex flex-row items-start justify-between gap-3 space-y-0`,c?`p-3 pb-1`:`pb-2`),children:[(0,i.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,i.jsx)(n.CardDescription,{className:`truncate`,children:e.label}),(0,i.jsx)(n.CardTitle,{className:t.cn(`truncate`,c?`text-xl`:`text-2xl`),children:e.loading?(0,i.jsx)(`span`,{className:`block h-8 w-24 animate-pulse rounded bg-muted`}):e.value})]}),e.icon&&(0,i.jsx)(`div`,{className:`shrink-0 rounded-lg bg-muted p-2 text-muted-foreground [&_svg]:size-4`,children:e.icon})]}),(e.description||e.trend)&&(0,i.jsxs)(n.CardContent,{className:t.cn(`flex min-w-0 items-center justify-between gap-2`,c?`p-3 pt-1`:`pt-0`),children:[e.description&&(0,i.jsx)(`div`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:e.description}),e.trend&&(0,i.jsx)(`div`,{className:`shrink-0 text-xs font-medium`,children:e.trend})]})]},e.key))})}exports.MetricGrid=s;
|
|
@@ -35,7 +35,7 @@ function u({ className: u, items: d, columns: f = 4, compact: p = !1, itemClassN
|
|
|
35
35
|
children: c.label
|
|
36
36
|
}), /* @__PURE__ */ o(a, {
|
|
37
37
|
className: e("truncate", p ? "text-xl" : "text-2xl"),
|
|
38
|
-
children: c.value
|
|
38
|
+
children: c.loading ? /* @__PURE__ */ o("span", { className: "block h-8 w-24 animate-pulse rounded bg-muted" }) : c.value
|
|
39
39
|
})]
|
|
40
40
|
}), c.icon && /* @__PURE__ */ o("div", {
|
|
41
41
|
className: "shrink-0 rounded-lg bg-muted p-2 text-muted-foreground [&_svg]:size-4",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function a(e,t,n){return e<7&&t<7||e<7&&t>20||e>20&&t<7?!1:((Math.imul(e+17,73856093)^Math.imul(t+31,19349663)^n)>>>0)%5<2}function o({x:e,y:t}){return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`rect`,{x:e,y:t,width:`7`,height:`7`,fill:`currentColor`}),(0,r.jsx)(`rect`,{x:e+1,y:t+1,width:`5`,height:`5`,fill:`white`}),(0,r.jsx)(`rect`,{x:e+2,y:t+2,width:`3`,height:`3`,fill:`currentColor`})]})}function s({value:e,cells:t=29,title:n}){let s=i(e),c=`0 0 ${t} ${t}`,l=Array.from({length:t},(e,t)=>t),u=Array.from({length:t},(e,t)=>t);return(0,r.jsxs)(`svg`,{role:`img`,"aria-label":n??e,viewBox:c,className:`size-full text-foreground`,shapeRendering:`crispEdges`,children:[(0,r.jsx)(`rect`,{width:t,height:t,fill:`white`}),(0,r.jsx)(o,{x:0,y:0}),(0,r.jsx)(o,{x:t-7,y:0}),(0,r.jsx)(o,{x:0,y:t-7}),l.map(e=>u.map(t=>a(e,t,s)?(0,r.jsx)(`rect`,{x:t,y:e,width:`1`,height:`1`,fill:`currentColor`},`${e}-${t}`):null))]})}function c({value:e,src:n,alt:i,size:a=160,cells:o=29,className:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function a(e,t,n){return e<7&&t<7||e<7&&t>20||e>20&&t<7?!1:((Math.imul(e+17,73856093)^Math.imul(t+31,19349663)^n)>>>0)%5<2}function o({x:e,y:t}){return(0,r.jsxs)(`g`,{children:[(0,r.jsx)(`rect`,{x:e,y:t,width:`7`,height:`7`,fill:`currentColor`}),(0,r.jsx)(`rect`,{x:e+1,y:t+1,width:`5`,height:`5`,fill:`white`}),(0,r.jsx)(`rect`,{x:e+2,y:t+2,width:`3`,height:`3`,fill:`currentColor`})]})}function s({value:e,cells:t=29,title:n}){let s=i(e),c=`0 0 ${t} ${t}`,l=Array.from({length:t},(e,t)=>t),u=Array.from({length:t},(e,t)=>t);return(0,r.jsxs)(`svg`,{role:`img`,"aria-label":n??e,viewBox:c,className:`size-full text-foreground`,shapeRendering:`crispEdges`,children:[(0,r.jsx)(`rect`,{width:t,height:t,fill:`white`}),(0,r.jsx)(o,{x:0,y:0}),(0,r.jsx)(o,{x:t-7,y:0}),(0,r.jsx)(o,{x:0,y:t-7}),l.map(e=>u.map(t=>a(e,t,s)?(0,r.jsx)(`rect`,{x:t,y:e,width:`1`,height:`1`,fill:`currentColor`},`${e}-${t}`):null))]})}function c({value:e,src:n,alt:i,size:a=160,cells:o=29,visualOnlyLabel:c=`Visual preview only. Provide src from a certified QR encoder for scan-critical use.`,className:l,...u}){return(0,r.jsxs)(`div`,{"data-slot":`qr-code`,className:t.cn(`inline-flex flex-col items-center gap-2 rounded-xl border bg-background p-3`,l),...u,children:[(0,r.jsx)(`div`,{className:`rounded-md bg-white p-2`,style:{width:a,height:a},children:n?(0,r.jsx)(`img`,{src:n,alt:i??e,width:a,height:a,className:`size-full rounded-sm object-contain`}):(0,r.jsx)(s,{value:e,cells:o,title:i})}),!n&&c&&(0,r.jsx)(`div`,{className:`max-w-48 text-center text-xs text-muted-foreground`,children:c})]})}exports.QRCode=c,exports.QRCodeSvg=s;
|
|
@@ -5,11 +5,12 @@ export type QRCodeProps = React.ComponentProps<"div"> & {
|
|
|
5
5
|
alt?: string;
|
|
6
6
|
size?: number;
|
|
7
7
|
cells?: number;
|
|
8
|
+
visualOnlyLabel?: React.ReactNode;
|
|
8
9
|
};
|
|
9
10
|
declare function QRCodeSvg({ value, cells, title }: {
|
|
10
11
|
value: string;
|
|
11
12
|
cells?: number;
|
|
12
13
|
title?: string;
|
|
13
14
|
}): React.JSX.Element;
|
|
14
|
-
declare function QRCode({ value, src, alt, size, cells, className, ...props }: QRCodeProps): React.JSX.Element;
|
|
15
|
+
declare function QRCode({ value, src, alt, size, cells, visualOnlyLabel, className, ...props }: QRCodeProps): React.JSX.Element;
|
|
15
16
|
export { QRCode, QRCodeSvg };
|
|
@@ -71,29 +71,32 @@ function o({ value: e, cells: o = 29, title: s }) {
|
|
|
71
71
|
]
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
function s({ value:
|
|
75
|
-
return /* @__PURE__ */
|
|
74
|
+
function s({ value: r, src: i, alt: a, size: s = 160, cells: c = 29, visualOnlyLabel: l = "Visual preview only. Provide src from a certified QR encoder for scan-critical use.", className: u, ...d }) {
|
|
75
|
+
return /* @__PURE__ */ n("div", {
|
|
76
76
|
"data-slot": "qr-code",
|
|
77
|
-
className: e("inline-flex flex-col items-center gap-2 rounded-xl border bg-background p-3",
|
|
78
|
-
...
|
|
79
|
-
children: /* @__PURE__ */ t("div", {
|
|
77
|
+
className: e("inline-flex flex-col items-center gap-2 rounded-xl border bg-background p-3", u),
|
|
78
|
+
...d,
|
|
79
|
+
children: [/* @__PURE__ */ t("div", {
|
|
80
80
|
className: "rounded-md bg-white p-2",
|
|
81
81
|
style: {
|
|
82
|
-
width:
|
|
83
|
-
height:
|
|
82
|
+
width: s,
|
|
83
|
+
height: s
|
|
84
84
|
},
|
|
85
|
-
children:
|
|
86
|
-
src:
|
|
87
|
-
alt:
|
|
88
|
-
width:
|
|
89
|
-
height:
|
|
85
|
+
children: i ? /* @__PURE__ */ t("img", {
|
|
86
|
+
src: i,
|
|
87
|
+
alt: a ?? r,
|
|
88
|
+
width: s,
|
|
89
|
+
height: s,
|
|
90
90
|
className: "size-full rounded-sm object-contain"
|
|
91
91
|
}) : /* @__PURE__ */ t(o, {
|
|
92
|
-
value:
|
|
93
|
-
cells:
|
|
94
|
-
title:
|
|
92
|
+
value: r,
|
|
93
|
+
cells: c,
|
|
94
|
+
title: a
|
|
95
95
|
})
|
|
96
|
-
})
|
|
96
|
+
}), !i && l && /* @__PURE__ */ t("div", {
|
|
97
|
+
className: "max-w-48 text-center text-xs text-muted-foreground",
|
|
98
|
+
children: l
|
|
99
|
+
})]
|
|
97
100
|
});
|
|
98
101
|
}
|
|
99
102
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("../ui/badge/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o={default:`bg-primary`,success:`bg-emerald-500`,warning:`bg-amber-500`,danger:`bg-destructive`,info:`bg-blue-500`,muted:`bg-muted-foreground`};function s({title:e,description:i,actions:s,items:c,orientation:l=`vertical`,compact:u=!1,showCounts:d=!0,contentClassName:f,itemClassName:p,className:m,...h}){let g=c.filter(e=>!e.hidden),_=!!(e||i||s);return(0,a.jsxs)(n.Card,{"data-slot":`status-legend`,className:t.cn(`min-w-0 border-[color:var(--aui-surface-border)] bg-[color:color-mix(in_srgb,var(--aui-page-bg)_92%,white_8%)] shadow-sm dark:bg-[color:color-mix(in_srgb,var(--aui-page-bg)_96%,black_4%)]`,m),...h,children:[_&&(0,a.jsx)(n.CardHeader,{className:t.cn(`pb-3`,u&&`p-4 pb-2`),children:(0,a.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,a.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e&&(0,a.jsx)(n.CardTitle,{className:`text-base tracking-tight`,children:e}),i&&(0,a.jsx)(n.CardDescription,{className:`leading-6`,children:i})]}),s&&(0,a.jsx)(`div`,{className:`shrink-0`,children:s})]})}),(0,a.jsx)(n.CardContent,{className:t.cn(`gap-3`,l
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("../ui/badge/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");var o={default:`bg-primary`,success:`bg-emerald-500`,warning:`bg-amber-500`,danger:`bg-destructive`,info:`bg-blue-500`,muted:`bg-muted-foreground`};function s({title:e,description:i,actions:s,items:c,orientation:l=`vertical`,compact:u=!1,showCounts:d=!0,contentClassName:f,itemClassName:p,className:m,...h}){let g=c.filter(e=>!e.hidden),_=!!(e||i||s),v={vertical:`grid`,horizontal:`flex flex-wrap`,grid:`grid sm:grid-cols-2`};return(0,a.jsxs)(n.Card,{"data-slot":`status-legend`,className:t.cn(`min-w-0 border-[color:var(--aui-surface-border)] bg-[color:color-mix(in_srgb,var(--aui-page-bg)_92%,white_8%)] shadow-sm dark:bg-[color:color-mix(in_srgb,var(--aui-page-bg)_96%,black_4%)]`,m),...h,children:[_&&(0,a.jsx)(n.CardHeader,{className:t.cn(`pb-3`,u&&`p-4 pb-2`),children:(0,a.jsxs)(`div`,{className:`flex min-w-0 items-start justify-between gap-3`,children:[(0,a.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[e&&(0,a.jsx)(n.CardTitle,{className:`text-base tracking-tight`,children:e}),i&&(0,a.jsx)(n.CardDescription,{className:`leading-6`,children:i})]}),s&&(0,a.jsx)(`div`,{className:`shrink-0`,children:s})]})}),(0,a.jsx)(n.CardContent,{className:t.cn(`gap-3`,v[l],u?`p-4 pt-2`:`pt-0`,f),children:g.map(e=>(0,a.jsxs)(`div`,{"data-slot":`status-legend-item`,"data-tone":e.tone??`default`,className:t.cn(`flex min-w-0 items-start justify-between gap-3 rounded-2xl border border-[color:var(--aui-surface-border)] bg-[color:var(--aui-control-bg)] p-3 shadow-[inset_0_1px_0_rgba(255,255,255,0.35)] transition hover:border-[color:color-mix(in_srgb,var(--aui-brand-strong)_26%,var(--aui-surface-border))]`,u&&`p-2.5`,p,e.className),children:[(0,a.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[e.icon?(0,a.jsx)(`span`,{className:`mt-0.5 inline-flex size-8 shrink-0 items-center justify-center rounded-xl bg-[color:var(--aui-page-bg)] text-muted-foreground [&_svg]:size-4`,children:e.icon}):(0,a.jsx)(`span`,{className:t.cn(`mt-1.5 size-2.5 shrink-0 rounded-full shadow-[0_0_0_4px_color-mix(in_srgb,var(--aui-page-bg)_72%,transparent)]`,o[e.tone??`default`])}),(0,a.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,a.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.label}),e.description&&(0,a.jsx)(`div`,{className:`text-xs leading-5 text-muted-foreground`,children:e.description})]})]}),d&&e.count!==void 0&&(0,a.jsx)(r.Badge,{variant:`secondary`,className:`shrink-0 rounded-full border border-[color:var(--aui-surface-border)] bg-[color:var(--aui-page-bg)] px-2.5 py-1 shadow-sm`,children:e.count})]},e.key))})]})}exports.StatusLegend=s;
|
|
@@ -13,7 +13,11 @@ var l = {
|
|
|
13
13
|
muted: "bg-muted-foreground"
|
|
14
14
|
};
|
|
15
15
|
function u({ title: u, description: d, actions: f, items: p, orientation: m = "vertical", compact: h = !1, showCounts: g = !0, contentClassName: _, itemClassName: v, className: y, ...b }) {
|
|
16
|
-
let x = p.filter((e) => !e.hidden), S = !!(u || d || f)
|
|
16
|
+
let x = p.filter((e) => !e.hidden), S = !!(u || d || f), C = {
|
|
17
|
+
vertical: "grid",
|
|
18
|
+
horizontal: "flex flex-wrap",
|
|
19
|
+
grid: "grid sm:grid-cols-2"
|
|
20
|
+
};
|
|
17
21
|
return /* @__PURE__ */ c(t, {
|
|
18
22
|
"data-slot": "status-legend",
|
|
19
23
|
className: e("min-w-0 border-[color:var(--aui-surface-border)] bg-[color:color-mix(in_srgb,var(--aui-page-bg)_92%,white_8%)] shadow-sm dark:bg-[color:color-mix(in_srgb,var(--aui-page-bg)_96%,black_4%)]", y),
|
|
@@ -37,7 +41,7 @@ function u({ title: u, description: d, actions: f, items: p, orientation: m = "v
|
|
|
37
41
|
})]
|
|
38
42
|
})
|
|
39
43
|
}), /* @__PURE__ */ s(n, {
|
|
40
|
-
className: e("gap-3", m
|
|
44
|
+
className: e("gap-3", C[m], h ? "p-4 pt-2" : "pt-0", _),
|
|
41
45
|
children: x.map((t) => /* @__PURE__ */ c("div", {
|
|
42
46
|
"data-slot": "status-legend-item",
|
|
43
47
|
"data-tone": t.tone ?? "default",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");var
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("lucide-react"),i=require("react/jsx-runtime");var a={neutral:`border-border bg-muted text-foreground`,info:`border-sky-200 bg-sky-50 text-sky-700 dark:border-sky-900 dark:bg-sky-950 dark:text-sky-300`,success:`border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-300`,warning:`border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-300`,danger:`border-red-200 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-300`},o={sm:`h-6 px-2 text-xs`,default:`h-7 px-2.5 text-sm`,lg:`h-8 px-3 text-sm`};function s({tone:e=`neutral`,size:n=`default`,removable:s,selected:c,onRemove:l,removeLabel:u=`Remove tag`,className:d,children:f,onKeyDown:p,...m}){let h=e=>{t.stopInteractivePropagation(e),l?.()};return(0,i.jsxs)(`span`,{"data-slot":`tag`,"data-tone":e,"data-selected":c?`true`:void 0,tabIndex:s?0:m.tabIndex,className:t.cn(`inline-flex items-center gap-1.5 rounded-full border font-medium transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/35`,a[e],o[n],c&&`ring-2 ring-ring ring-offset-1`,d),onKeyDown:e=>{s&&(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),l?.()),p?.(e)},...m,children:[(0,i.jsx)(`span`,{children:f}),s&&(0,i.jsx)(`button`,{type:`button`,"aria-label":u,className:`-mr-1 inline-flex size-4 shrink-0 items-center justify-center rounded-full opacity-80 transition hover:bg-black/10 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-current/35 dark:hover:bg-white/10`,onClick:h,onMouseDown:t.stopInteractivePropagation,onDoubleClick:t.stopInteractivePropagation,children:(0,i.jsx)(r.XIcon,{className:`size-3`})})]})}function c(e){return(0,i.jsx)(s,{...e})}function l({gap:e=`default`,className:n,...r}){return(0,i.jsx)(`div`,{"data-slot":`tag-group`,className:t.cn(`flex flex-wrap items-center`,e===`sm`&&`gap-1`,e==="default"&&`gap-2`,e===`lg`&&`gap-3`,n),...r})}exports.Chip=c,exports.Tag=s,exports.TagGroup=l;
|
|
@@ -7,11 +7,12 @@ export type TagProps = React.ComponentProps<"span"> & {
|
|
|
7
7
|
removable?: boolean;
|
|
8
8
|
selected?: boolean;
|
|
9
9
|
onRemove?: () => void;
|
|
10
|
+
removeLabel?: string;
|
|
10
11
|
};
|
|
11
12
|
export type TagGroupProps = React.ComponentProps<"div"> & {
|
|
12
13
|
gap?: "sm" | "default" | "lg";
|
|
13
14
|
};
|
|
14
|
-
declare function Tag({ tone, size, removable, selected, onRemove, className, children, ...props }: TagProps): React.JSX.Element;
|
|
15
|
+
declare function Tag({ tone, size, removable, selected, onRemove, removeLabel, className, children, onKeyDown, ...props }: TagProps): React.JSX.Element;
|
|
15
16
|
declare function Chip(props: TagProps): React.JSX.Element;
|
|
16
17
|
declare function TagGroup({ gap, className, ...props }: TagGroupProps): React.JSX.Element;
|
|
17
18
|
export { Chip, Tag, TagGroup };
|
|
@@ -1,47 +1,53 @@
|
|
|
1
1
|
import { cn as e, stopInteractivePropagation as t } from "../../lib/utils.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { XIcon as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/display/tag.tsx
|
|
5
|
-
var
|
|
6
|
+
var a = {
|
|
6
7
|
neutral: "border-border bg-muted text-foreground",
|
|
7
8
|
info: "border-sky-200 bg-sky-50 text-sky-700 dark:border-sky-900 dark:bg-sky-950 dark:text-sky-300",
|
|
8
9
|
success: "border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-900 dark:bg-emerald-950 dark:text-emerald-300",
|
|
9
10
|
warning: "border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950 dark:text-amber-300",
|
|
10
11
|
danger: "border-red-200 bg-red-50 text-red-700 dark:border-red-900 dark:bg-red-950 dark:text-red-300"
|
|
11
|
-
},
|
|
12
|
+
}, o = {
|
|
12
13
|
sm: "h-6 px-2 text-xs",
|
|
13
14
|
default: "h-7 px-2.5 text-sm",
|
|
14
15
|
lg: "h-8 px-3 text-sm"
|
|
15
16
|
};
|
|
16
|
-
function
|
|
17
|
-
|
|
17
|
+
function s({ tone: s = "neutral", size: c = "default", removable: l, selected: u, onRemove: d, removeLabel: f = "Remove tag", className: p, children: m, onKeyDown: h, ...g }) {
|
|
18
|
+
let _ = (e) => {
|
|
19
|
+
t(e), d?.();
|
|
20
|
+
};
|
|
21
|
+
return /* @__PURE__ */ i("span", {
|
|
18
22
|
"data-slot": "tag",
|
|
19
|
-
"data-tone":
|
|
20
|
-
"data-selected":
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
"data-tone": s,
|
|
24
|
+
"data-selected": u ? "true" : void 0,
|
|
25
|
+
tabIndex: l ? 0 : g.tabIndex,
|
|
26
|
+
className: e("inline-flex items-center gap-1.5 rounded-full border font-medium transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/35", a[s], o[c], u && "ring-2 ring-ring ring-offset-1", p),
|
|
27
|
+
onKeyDown: (e) => {
|
|
28
|
+
l && (e.key === "Backspace" || e.key === "Delete") && (e.preventDefault(), d?.()), h?.(e);
|
|
29
|
+
},
|
|
30
|
+
...g,
|
|
31
|
+
children: [/* @__PURE__ */ r("span", { children: m }), l && /* @__PURE__ */ r("button", {
|
|
24
32
|
type: "button",
|
|
25
|
-
"aria-label":
|
|
26
|
-
className: "-mr-1 inline-flex size-4 items-center justify-center rounded-full hover:bg-black/10 dark:hover:bg-white/10",
|
|
27
|
-
onClick:
|
|
28
|
-
t(e), u?.();
|
|
29
|
-
},
|
|
33
|
+
"aria-label": f,
|
|
34
|
+
className: "-mr-1 inline-flex size-4 shrink-0 items-center justify-center rounded-full opacity-80 transition hover:bg-black/10 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-current/35 dark:hover:bg-white/10",
|
|
35
|
+
onClick: _,
|
|
30
36
|
onMouseDown: t,
|
|
31
37
|
onDoubleClick: t,
|
|
32
|
-
children: "
|
|
38
|
+
children: /* @__PURE__ */ r(n, { className: "size-3" })
|
|
33
39
|
})]
|
|
34
40
|
});
|
|
35
41
|
}
|
|
36
|
-
function
|
|
37
|
-
return /* @__PURE__ */
|
|
42
|
+
function c(e) {
|
|
43
|
+
return /* @__PURE__ */ r(s, { ...e });
|
|
38
44
|
}
|
|
39
|
-
function
|
|
40
|
-
return /* @__PURE__ */
|
|
45
|
+
function l({ gap: t = "default", className: n, ...i }) {
|
|
46
|
+
return /* @__PURE__ */ r("div", {
|
|
41
47
|
"data-slot": "tag-group",
|
|
42
|
-
className: e("flex flex-wrap items-center", t === "sm" && "gap-1", t === "default" && "gap-2", t === "lg" && "gap-3",
|
|
48
|
+
className: e("flex flex-wrap items-center", t === "sm" && "gap-1", t === "default" && "gap-2", t === "lg" && "gap-3", n),
|
|
43
49
|
...i
|
|
44
50
|
});
|
|
45
51
|
}
|
|
46
52
|
//#endregion
|
|
47
|
-
export {
|
|
53
|
+
export { c as Chip, s as Tag, l as TagGroup };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("lucide-react"),i=require("react/jsx-runtime");function a({items:e,defaultExpandedKeys:r=[],expandedKeys:a,onExpandedKeysChange:s,selectedKey:c,onSelect:l,className:
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("lucide-react"),i=require("react/jsx-runtime");function a({items:e,defaultExpandedKeys:r=[],expandedKeys:a,onExpandedKeysChange:s,selectedKey:c,onSelect:l,checkedKeys:d,defaultCheckedKeys:f=[],onCheckedKeysChange:p,checkable:m=!1,searchQuery:h,onLoadChildren:g,className:_,...v}){let[y,b]=n.useState(r),[x,S]=n.useState(f),C=a??y,w=d??x,T=h?.trim().toLowerCase(),E=n.useCallback(e=>{a===void 0&&b(e),s?.(e)},[a,s]),D=(e,t)=>{let n=t?[...new Set([...w,e])]:w.filter(t=>t!==e);d===void 0&&S(n),p?.(n)},O=n.useCallback(e=>{E(C.includes(e)?C.filter(t=>t!==e):[...C,e])},[C,E]),k=n.useMemo(()=>o(e,C,T),[e,C,T]);return(0,i.jsx)(`div`,{"data-slot":`tree-view`,role:`tree`,className:t.cn(`grid gap-1 text-sm`,_),onKeyDown:e=>{let t=e.target.dataset.treeNodeKey;if(!t)return;let n=k.indexOf(t),r=t=>{if(!t)return;let n=t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`);e.currentTarget.querySelector(`[data-tree-node-key="${n}"]`)?.focus()};e.key===`ArrowDown`?(e.preventDefault(),r(k[Math.min(n+1,k.length-1)])):e.key===`ArrowUp`?(e.preventDefault(),r(k[Math.max(n-1,0)])):e.key===`ArrowRight`?(e.preventDefault(),C.includes(t)||O(t)):e.key===`ArrowLeft`&&(e.preventDefault(),C.includes(t)&&O(t)),v.onKeyDown?.(e)},...v,children:e.map(e=>(0,i.jsx)(u,{item:e,level:1,expandedKeys:C,selectedKey:c,onToggle:O,onSelect:l,checkedKeys:w,onCheckedChange:D,checkable:m,searchQuery:T,onLoadChildren:g},e.key))})}function o(e,t,n){return e.flatMap(e=>c(e,n)?[e.key,...e.children&&t.includes(e.key)?o(e.children,t,n):[]]:[])}function s(e){return e.searchText??(typeof e.label==`string`?e.label:e.key)}function c(e,t){return t?s(e).toLowerCase().includes(t)||!!e.children?.some(e=>c(e,t)):!0}function l(e,t){if(!t||typeof e!=`string`)return e;let n=e.toLowerCase().indexOf(t);return n<0?e:(0,i.jsxs)(i.Fragment,{children:[e.slice(0,n),(0,i.jsx)(`mark`,{className:`rounded bg-primary/15 px-0.5 text-foreground`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function u({item:e,level:n,expandedKeys:a,selectedKey:o,onToggle:d,onSelect:f,checkedKeys:p,onCheckedChange:m,checkable:h,searchQuery:g,onLoadChildren:_}){if(!c(e,g))return null;let v=!!e.children?.length||!!_,y=a.includes(e.key),b=o===e.key,x=p.includes(e.key);return(0,i.jsxs)(`div`,{"data-slot":`tree-node`,role:`treeitem`,"aria-expanded":v?y:void 0,"aria-selected":b||void 0,children:[(0,i.jsxs)(`div`,{className:t.cn(`flex items-center gap-1 rounded-md px-2 py-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,b&&`bg-muted text-foreground`,e.disabled&&`pointer-events-none opacity-50`),style:{paddingLeft:`${n*.75}rem`},children:[(0,i.jsx)(`button`,{type:`button`,"aria-label":y?`Collapse`:`Expand`,className:t.cn(`flex size-5 items-center justify-center rounded-sm`,!v&&`invisible`),onClick:()=>{!y&&!e.children?.length&&_?.(e),d(e.key)},children:(0,i.jsx)(r.ChevronRightIcon,{className:t.cn(`size-4 transition-transform`,y&&`rotate-90`)})}),h&&(0,i.jsx)(`input`,{type:`checkbox`,className:`size-4 rounded border-border accent-primary`,checked:x,disabled:e.disabled,"aria-label":`Select ${s(e)}`,onChange:t=>m(e.key,t.currentTarget.checked)}),e.icon,(0,i.jsx)(`button`,{type:`button`,"data-tree-node-key":e.key,className:`min-w-0 flex-1 truncate rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40`,disabled:e.disabled,onClick:()=>f?.(e),children:l(e.label,g)}),e.loading?(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Loading...`}):e.extra]}),v&&y&&(0,i.jsx)(`div`,{role:`group`,className:`grid gap-1`,children:e.children?.map(e=>(0,i.jsx)(u,{item:e,level:n+1,expandedKeys:a,selectedKey:o,onToggle:d,onSelect:f,checkedKeys:p,onCheckedChange:m,checkable:h,searchQuery:g,onLoadChildren:_},e.key))})]})}exports.TreeView=a;
|
|
@@ -2,9 +2,11 @@ import * as React from "react";
|
|
|
2
2
|
export type TreeViewItem = {
|
|
3
3
|
key: string;
|
|
4
4
|
label: React.ReactNode;
|
|
5
|
+
searchText?: string;
|
|
5
6
|
icon?: React.ReactNode;
|
|
6
7
|
extra?: React.ReactNode;
|
|
7
8
|
children?: TreeViewItem[];
|
|
9
|
+
loading?: boolean;
|
|
8
10
|
disabled?: boolean;
|
|
9
11
|
};
|
|
10
12
|
export type TreeViewProps = Omit<React.ComponentProps<"div">, "onSelect"> & {
|
|
@@ -14,6 +16,12 @@ export type TreeViewProps = Omit<React.ComponentProps<"div">, "onSelect"> & {
|
|
|
14
16
|
onExpandedKeysChange?: (keys: string[]) => void;
|
|
15
17
|
selectedKey?: string;
|
|
16
18
|
onSelect?: (item: TreeViewItem) => void;
|
|
19
|
+
checkedKeys?: string[];
|
|
20
|
+
defaultCheckedKeys?: string[];
|
|
21
|
+
onCheckedKeysChange?: (keys: string[]) => void;
|
|
22
|
+
checkable?: boolean;
|
|
23
|
+
searchQuery?: string;
|
|
24
|
+
onLoadChildren?: (item: TreeViewItem) => void | Promise<void>;
|
|
17
25
|
};
|
|
18
|
-
declare function TreeView({ items, defaultExpandedKeys, expandedKeys, onExpandedKeysChange, selectedKey, onSelect, className, ...props }: TreeViewProps): React.JSX.Element;
|
|
26
|
+
declare function TreeView({ items, defaultExpandedKeys, expandedKeys, onExpandedKeysChange, selectedKey, onSelect, checkedKeys, defaultCheckedKeys, onCheckedKeysChange, checkable, searchQuery, onLoadChildren, className, ...props }: TreeViewProps): React.JSX.Element;
|
|
19
27
|
export { TreeView };
|
|
@@ -1,69 +1,133 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import { ChevronRightIcon as n } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/display/tree-view.tsx
|
|
6
|
-
function
|
|
7
|
-
let [
|
|
8
|
-
a === void 0 &&
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
function o({ items: n, defaultExpandedKeys: r = [], expandedKeys: a, onExpandedKeysChange: o, selectedKey: c, onSelect: l, checkedKeys: u, defaultCheckedKeys: f = [], onCheckedKeysChange: p, checkable: m = !1, searchQuery: h, onLoadChildren: g, className: _, ...v }) {
|
|
7
|
+
let [y, b] = t.useState(r), [x, S] = t.useState(f), C = a ?? y, w = u ?? x, T = h?.trim().toLowerCase(), E = t.useCallback((e) => {
|
|
8
|
+
a === void 0 && b(e), o?.(e);
|
|
9
|
+
}, [a, o]), D = (e, t) => {
|
|
10
|
+
let n = t ? [...new Set([...w, e])] : w.filter((t) => t !== e);
|
|
11
|
+
u === void 0 && S(n), p?.(n);
|
|
12
|
+
}, O = t.useCallback((e) => {
|
|
13
|
+
E(C.includes(e) ? C.filter((t) => t !== e) : [...C, e]);
|
|
14
|
+
}, [C, E]), k = t.useMemo(() => s(n, C, T), [
|
|
15
|
+
n,
|
|
16
|
+
C,
|
|
17
|
+
T
|
|
18
|
+
]);
|
|
19
|
+
return /* @__PURE__ */ i("div", {
|
|
13
20
|
"data-slot": "tree-view",
|
|
14
21
|
role: "tree",
|
|
15
|
-
className: e("grid gap-1 text-sm",
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
className: e("grid gap-1 text-sm", _),
|
|
23
|
+
onKeyDown: (e) => {
|
|
24
|
+
let t = e.target.dataset.treeNodeKey;
|
|
25
|
+
if (!t) return;
|
|
26
|
+
let n = k.indexOf(t), r = (t) => {
|
|
27
|
+
if (!t) return;
|
|
28
|
+
let n = t.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
29
|
+
e.currentTarget.querySelector(`[data-tree-node-key="${n}"]`)?.focus();
|
|
30
|
+
};
|
|
31
|
+
e.key === "ArrowDown" ? (e.preventDefault(), r(k[Math.min(n + 1, k.length - 1)])) : e.key === "ArrowUp" ? (e.preventDefault(), r(k[Math.max(n - 1, 0)])) : e.key === "ArrowRight" ? (e.preventDefault(), C.includes(t) || O(t)) : e.key === "ArrowLeft" && (e.preventDefault(), C.includes(t) && O(t)), v.onKeyDown?.(e);
|
|
32
|
+
},
|
|
33
|
+
...v,
|
|
34
|
+
children: n.map((e) => /* @__PURE__ */ i(d, {
|
|
18
35
|
item: e,
|
|
19
36
|
level: 1,
|
|
20
|
-
expandedKeys:
|
|
37
|
+
expandedKeys: C,
|
|
21
38
|
selectedKey: c,
|
|
22
|
-
onToggle:
|
|
23
|
-
onSelect: l
|
|
39
|
+
onToggle: O,
|
|
40
|
+
onSelect: l,
|
|
41
|
+
checkedKeys: w,
|
|
42
|
+
onCheckedChange: D,
|
|
43
|
+
checkable: m,
|
|
44
|
+
searchQuery: T,
|
|
45
|
+
onLoadChildren: g
|
|
24
46
|
}, e.key))
|
|
25
47
|
});
|
|
26
48
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
49
|
+
function s(e, t, n) {
|
|
50
|
+
return e.flatMap((e) => l(e, n) ? [e.key, ...e.children && t.includes(e.key) ? s(e.children, t, n) : []] : []);
|
|
51
|
+
}
|
|
52
|
+
function c(e) {
|
|
53
|
+
return e.searchText ?? (typeof e.label == "string" ? e.label : e.key);
|
|
54
|
+
}
|
|
55
|
+
function l(e, t) {
|
|
56
|
+
return t ? c(e).toLowerCase().includes(t) || !!e.children?.some((e) => l(e, t)) : !0;
|
|
57
|
+
}
|
|
58
|
+
function u(e, t) {
|
|
59
|
+
if (!t || typeof e != "string") return e;
|
|
60
|
+
let n = e.toLowerCase().indexOf(t);
|
|
61
|
+
return n < 0 ? e : /* @__PURE__ */ a(r, { children: [
|
|
62
|
+
e.slice(0, n),
|
|
63
|
+
/* @__PURE__ */ i("mark", {
|
|
64
|
+
className: "rounded bg-primary/15 px-0.5 text-foreground",
|
|
65
|
+
children: e.slice(n, n + t.length)
|
|
66
|
+
}),
|
|
67
|
+
e.slice(n + t.length)
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
function d({ item: t, level: r, expandedKeys: o, selectedKey: s, onToggle: f, onSelect: p, checkedKeys: m, onCheckedChange: h, checkable: g, searchQuery: _, onLoadChildren: v }) {
|
|
71
|
+
if (!l(t, _)) return null;
|
|
72
|
+
let y = !!t.children?.length || !!v, b = o.includes(t.key), x = s === t.key, S = m.includes(t.key);
|
|
73
|
+
return /* @__PURE__ */ a("div", {
|
|
30
74
|
"data-slot": "tree-node",
|
|
31
75
|
role: "treeitem",
|
|
32
|
-
"aria-expanded":
|
|
33
|
-
"aria-selected":
|
|
34
|
-
children: [/* @__PURE__ */
|
|
35
|
-
className: e("flex items-center gap-1 rounded-md px-2 py-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
|
|
36
|
-
style: { paddingLeft: `${
|
|
76
|
+
"aria-expanded": y ? b : void 0,
|
|
77
|
+
"aria-selected": x || void 0,
|
|
78
|
+
children: [/* @__PURE__ */ a("div", {
|
|
79
|
+
className: e("flex items-center gap-1 rounded-md px-2 py-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", x && "bg-muted text-foreground", t.disabled && "pointer-events-none opacity-50"),
|
|
80
|
+
style: { paddingLeft: `${r * .75}rem` },
|
|
37
81
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ i("button", {
|
|
39
83
|
type: "button",
|
|
40
|
-
"aria-label":
|
|
41
|
-
className: e("flex size-5 items-center justify-center rounded-sm", !
|
|
42
|
-
onClick: () =>
|
|
43
|
-
|
|
84
|
+
"aria-label": b ? "Collapse" : "Expand",
|
|
85
|
+
className: e("flex size-5 items-center justify-center rounded-sm", !y && "invisible"),
|
|
86
|
+
onClick: () => {
|
|
87
|
+
!b && !t.children?.length && v?.(t), f(t.key);
|
|
88
|
+
},
|
|
89
|
+
children: /* @__PURE__ */ i(n, { className: e("size-4 transition-transform", b && "rotate-90") })
|
|
90
|
+
}),
|
|
91
|
+
g && /* @__PURE__ */ i("input", {
|
|
92
|
+
type: "checkbox",
|
|
93
|
+
className: "size-4 rounded border-border accent-primary",
|
|
94
|
+
checked: S,
|
|
95
|
+
disabled: t.disabled,
|
|
96
|
+
"aria-label": `Select ${c(t)}`,
|
|
97
|
+
onChange: (e) => h(t.key, e.currentTarget.checked)
|
|
44
98
|
}),
|
|
45
99
|
t.icon,
|
|
46
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ i("button", {
|
|
47
101
|
type: "button",
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
102
|
+
"data-tree-node-key": t.key,
|
|
103
|
+
className: "min-w-0 flex-1 truncate rounded-sm text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
104
|
+
disabled: t.disabled,
|
|
105
|
+
onClick: () => p?.(t),
|
|
106
|
+
children: u(t.label, _)
|
|
51
107
|
}),
|
|
52
|
-
t.
|
|
108
|
+
t.loading ? /* @__PURE__ */ i("span", {
|
|
109
|
+
className: "text-xs text-muted-foreground",
|
|
110
|
+
children: "Loading..."
|
|
111
|
+
}) : t.extra
|
|
53
112
|
]
|
|
54
|
-
}),
|
|
113
|
+
}), y && b && /* @__PURE__ */ i("div", {
|
|
55
114
|
role: "group",
|
|
56
115
|
className: "grid gap-1",
|
|
57
|
-
children: t.children?.map((e) => /* @__PURE__ */
|
|
116
|
+
children: t.children?.map((e) => /* @__PURE__ */ i(d, {
|
|
58
117
|
item: e,
|
|
59
|
-
level:
|
|
60
|
-
expandedKeys:
|
|
61
|
-
selectedKey:
|
|
62
|
-
onToggle:
|
|
63
|
-
onSelect:
|
|
118
|
+
level: r + 1,
|
|
119
|
+
expandedKeys: o,
|
|
120
|
+
selectedKey: s,
|
|
121
|
+
onToggle: f,
|
|
122
|
+
onSelect: p,
|
|
123
|
+
checkedKeys: m,
|
|
124
|
+
onCheckedChange: h,
|
|
125
|
+
checkable: g,
|
|
126
|
+
searchQuery: _,
|
|
127
|
+
onLoadChildren: v
|
|
64
128
|
}, e.key))
|
|
65
129
|
})]
|
|
66
130
|
});
|
|
67
131
|
}
|
|
68
132
|
//#endregion
|
|
69
|
-
export {
|
|
133
|
+
export { o as TreeView };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("./delta-badge.cjs");let
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/card/index.cjs"),r=require("./delta-badge.cjs"),i=require("../charts/charts.cjs");let a=require("react");a=e.__toESM(a,1);let o=require("react/jsx-runtime");function s({title:e,value:a,change:s,trend:c,description:l,icon:u,sparkline:d,className:f,...p}){return(0,o.jsxs)(n.Card,{"data-slot":`trend-card`,className:t.cn(`relative overflow-hidden`,f),...p,children:[(0,o.jsxs)(n.CardHeader,{className:`flex flex-row items-center justify-between space-y-0 pb-2`,children:[(0,o.jsx)(n.CardTitle,{className:`text-sm font-medium text-muted-foreground`,children:e}),u&&(0,o.jsx)(`div`,{className:`text-muted-foreground`,children:u})]}),(0,o.jsxs)(n.CardContent,{children:[(0,o.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,o.jsx)(`div`,{className:`text-2xl font-bold`,children:a}),s&&(0,o.jsx)(r.DeltaBadge,{value:s,trend:c})]}),l&&(0,o.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:l})]}),d&&d.length>1?(0,o.jsx)(`div`,{className:`px-6 pb-4`,children:(0,o.jsx)(i.Sparkline,{values:d,positive:c!==`down`})}):null]})}exports.TrendCard=s;
|