tembro 6.0.3 → 6.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/CHANGELOG.md +13 -0
- package/dist/components/actions/action-menu.d.ts +11 -1
- package/dist/components/calendar/calendar-range-scheduler.cjs +1 -0
- package/dist/components/calendar/calendar-range-scheduler.d.ts +20 -0
- package/dist/components/calendar/calendar-range-scheduler.js +1 -0
- package/dist/components/calendar/date-time-picker.cjs +1 -0
- package/dist/components/calendar/date-time-picker.d.ts +15 -0
- package/dist/components/calendar/date-time-picker.js +1 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/charts/chart-card.cjs +1 -0
- package/dist/components/charts/chart-card.d.ts +24 -0
- package/dist/components/charts/chart-card.js +1 -0
- package/dist/components/charts/index.d.ts +1 -0
- package/dist/components/command/advanced-command-menu.cjs +1 -0
- package/dist/components/command/advanced-command-menu.d.ts +25 -0
- package/dist/components/command/advanced-command-menu.js +1 -0
- package/dist/components/command/index.d.ts +1 -0
- package/dist/components/data-table/data-grid.cjs +1 -0
- package/dist/components/data-table/data-grid.d.ts +15 -0
- package/dist/components/data-table/data-grid.js +1 -0
- package/dist/components/data-table/index.d.ts +1 -0
- package/dist/components/data-table/public.d.ts +1 -0
- package/dist/components/display/index.d.ts +0 -2
- package/dist/components/feedback/async-boundary.cjs +1 -0
- package/dist/components/feedback/async-boundary.d.ts +12 -0
- package/dist/components/feedback/async-boundary.js +1 -0
- package/dist/components/feedback/index.d.ts +1 -0
- package/dist/components/filters/index.d.ts +0 -1
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/inputs/multi-select.cjs +1 -0
- package/dist/components/inputs/multi-select.d.ts +16 -0
- package/dist/components/inputs/multi-select.js +1 -0
- package/dist/components/inputs/public.d.ts +1 -0
- package/dist/components/inputs/time-picker.d.ts +11 -3
- package/dist/components/modern/file-manager.cjs +1 -0
- package/dist/components/modern/file-manager.d.ts +20 -0
- package/dist/components/modern/file-manager.js +1 -0
- package/dist/components/modern/index.d.ts +4 -1
- package/dist/components/modern/map.cjs +1 -0
- package/dist/components/modern/map.d.ts +29 -0
- package/dist/components/modern/map.js +1 -0
- package/dist/components/modern/media-player.cjs +1 -0
- package/dist/components/modern/media-player.d.ts +21 -0
- package/dist/components/modern/media-player.js +1 -0
- package/dist/components/modern/spreadsheet.cjs +1 -0
- package/dist/components/modern/spreadsheet.d.ts +35 -0
- package/dist/components/modern/spreadsheet.js +1 -0
- package/dist/components/notifications/action-toast.cjs +1 -0
- package/dist/components/notifications/action-toast.d.ts +16 -0
- package/dist/components/notifications/action-toast.js +1 -0
- package/dist/components/notifications/index.d.ts +1 -0
- package/dist/components/overlay/drawer.d.ts +3 -1
- package/dist/components/patterns/index.d.ts +1 -0
- package/dist/components/patterns/permissions-matrix.cjs +1 -0
- package/dist/components/patterns/permissions-matrix.d.ts +19 -0
- package/dist/components/patterns/permissions-matrix.js +1 -0
- package/dist/components/patterns/public.d.ts +1 -0
- package/dist/index.d.ts +0 -2
- package/dist/src/components/actions/action-menu.cjs +1 -1
- package/dist/src/components/actions/action-menu.js +47 -39
- package/dist/src/components/actions/copy-button.cjs +1 -1
- package/dist/src/components/actions/copy-button.js +4 -1
- package/dist/src/components/calendar/calendar-range-scheduler.cjs +1 -0
- package/dist/src/components/calendar/calendar-range-scheduler.js +75 -0
- package/dist/src/components/calendar/date-picker.cjs +1 -1
- package/dist/src/components/calendar/date-picker.js +5 -8
- package/dist/src/components/calendar/date-range-picker.cjs +1 -1
- package/dist/src/components/calendar/date-range-picker.js +12 -27
- package/dist/src/components/calendar/date-time-picker.cjs +1 -0
- package/dist/src/components/calendar/date-time-picker.js +36 -0
- package/dist/src/components/calendar/index.cjs +1 -1
- package/dist/src/components/calendar/index.js +5 -3
- package/dist/src/components/charts/chart-card.cjs +1 -0
- package/dist/src/components/charts/chart-card.js +55 -0
- package/dist/src/components/charts/index.cjs +1 -1
- package/dist/src/components/charts/index.js +3 -2
- package/dist/src/components/command/advanced-command-menu.cjs +1 -0
- package/dist/src/components/command/advanced-command-menu.js +57 -0
- package/dist/src/components/command/index.cjs +1 -1
- package/dist/src/components/command/index.js +3 -2
- package/dist/src/components/data-table/data-grid.cjs +1 -0
- package/dist/src/components/data-table/data-grid.js +32 -0
- package/dist/src/components/data-table/data-table-saved-filters.cjs +1 -1
- package/dist/src/components/data-table/data-table-saved-filters.js +11 -11
- package/dist/src/components/data-table/data-table.cjs +1 -1
- package/dist/src/components/data-table/data-table.js +175 -174
- package/dist/src/components/data-table/index.cjs +1 -1
- package/dist/src/components/data-table/index.js +15 -14
- package/dist/src/components/data-table/public.cjs +1 -1
- package/dist/src/components/data-table/public.js +3 -2
- package/dist/src/components/display/index.cjs +1 -1
- package/dist/src/components/display/index.js +9 -11
- package/dist/src/components/feedback/async-boundary.cjs +1 -0
- package/dist/src/components/feedback/async-boundary.js +22 -0
- package/dist/src/components/feedback/index.cjs +1 -1
- package/dist/src/components/feedback/index.js +2 -1
- package/dist/src/components/filters/index.cjs +1 -1
- package/dist/src/components/filters/index.js +2 -3
- package/dist/src/components/inputs/color-picker.cjs +1 -1
- package/dist/src/components/inputs/color-picker.js +63 -46
- package/dist/src/components/inputs/index.cjs +1 -1
- package/dist/src/components/inputs/index.js +13 -12
- package/dist/src/components/inputs/multi-select.cjs +1 -0
- package/dist/src/components/inputs/multi-select.js +80 -0
- package/dist/src/components/inputs/public.cjs +1 -1
- package/dist/src/components/inputs/public.js +13 -12
- package/dist/src/components/inputs/slider.cjs +1 -1
- package/dist/src/components/inputs/slider.js +3 -3
- package/dist/src/components/inputs/tag-input.cjs +1 -1
- package/dist/src/components/inputs/tag-input.js +7 -4
- package/dist/src/components/inputs/time-picker.cjs +1 -1
- package/dist/src/components/inputs/time-picker.js +90 -34
- package/dist/src/components/modern/file-manager.cjs +1 -0
- package/dist/src/components/modern/file-manager.js +75 -0
- package/dist/src/components/modern/index.cjs +1 -1
- package/dist/src/components/modern/index.js +7 -4
- package/dist/src/components/modern/map.cjs +1 -0
- package/dist/src/components/modern/map.js +158 -0
- package/dist/src/components/modern/media-player.cjs +1 -0
- package/dist/src/components/modern/media-player.js +176 -0
- package/dist/src/components/modern/resizable-panel.cjs +1 -1
- package/dist/src/components/modern/resizable-panel.js +39 -32
- package/dist/src/components/modern/spreadsheet.cjs +1 -0
- package/dist/src/components/modern/spreadsheet.js +97 -0
- package/dist/src/components/navigation/pagination.cjs +1 -1
- package/dist/src/components/navigation/pagination.js +5 -5
- package/dist/src/components/notifications/action-toast.cjs +1 -0
- package/dist/src/components/notifications/action-toast.js +49 -0
- package/dist/src/components/notifications/index.cjs +1 -1
- package/dist/src/components/notifications/index.js +3 -2
- package/dist/src/components/notifications/toast.cjs +1 -1
- package/dist/src/components/notifications/toast.js +68 -63
- package/dist/src/components/overlay/alert-dialog.cjs +1 -1
- package/dist/src/components/overlay/alert-dialog.js +8 -6
- package/dist/src/components/overlay/drawer.cjs +1 -1
- package/dist/src/components/overlay/drawer.js +38 -20
- package/dist/src/components/patterns/index.cjs +1 -1
- package/dist/src/components/patterns/index.js +2 -1
- package/dist/src/components/patterns/permissions-matrix.cjs +1 -0
- package/dist/src/components/patterns/permissions-matrix.js +43 -0
- package/dist/src/components/patterns/public.cjs +1 -1
- package/dist/src/components/patterns/public.js +2 -1
- package/dist/src/components/ui/checkbox/index.cjs +1 -1
- package/dist/src/components/ui/checkbox/index.js +2 -1
- package/dist/src/components/ui/dialog/index.cjs +1 -1
- package/dist/src/components/ui/dialog/index.js +8 -8
- package/dist/src/components/ui/dropdown-menu/index.cjs +1 -1
- package/dist/src/components/ui/dropdown-menu/index.js +21 -19
- package/dist/src/components/ui/input/group.cjs +1 -1
- package/dist/src/components/ui/input/group.js +8 -8
- package/dist/src/components/ui/popover/index.cjs +1 -1
- package/dist/src/components/ui/popover/index.js +10 -10
- package/dist/src/components/ui/tabs/index.cjs +1 -1
- package/dist/src/components/ui/tabs/index.js +6 -6
- package/dist/src/components/ui/toggle-group/index.cjs +1 -1
- package/dist/src/components/ui/toggle-group/index.js +2 -2
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.js +111 -104
- package/dist/src/public-component-surface.cjs +1 -1
- package/dist/src/public-component-surface.js +59 -14
- package/package.json +1 -2
- package/packages/cli/dist/index.cjs +45 -165
- package/packages/cli/vendor/src/components/actions/action-menu.tsx +47 -19
- package/packages/cli/vendor/src/components/actions/copy-button.tsx +2 -2
- package/packages/cli/vendor/src/components/calendar/calendar-range-scheduler.tsx +72 -0
- package/packages/cli/vendor/src/components/calendar/date-picker.tsx +2 -5
- package/packages/cli/vendor/src/components/calendar/date-range-picker.tsx +5 -12
- package/packages/cli/vendor/src/components/calendar/date-time-picker.tsx +53 -0
- package/packages/cli/vendor/src/components/calendar/index.ts +5 -3
- package/packages/cli/vendor/src/components/charts/chart-card.tsx +81 -0
- package/packages/cli/vendor/src/components/charts/index.ts +1 -0
- package/packages/cli/vendor/src/components/command/advanced-command-menu.tsx +88 -0
- package/packages/cli/vendor/src/components/command/index.ts +2 -1
- package/packages/cli/vendor/src/components/data-table/data-grid.tsx +59 -0
- package/packages/cli/vendor/src/components/data-table/data-table.tsx +45 -34
- package/packages/cli/vendor/src/components/data-table/index.ts +3 -2
- package/packages/cli/vendor/src/components/data-table/public.ts +1 -0
- package/packages/cli/vendor/src/components/display/index.ts +3 -5
- package/packages/cli/vendor/src/components/feedback/async-boundary.tsx +36 -0
- package/packages/cli/vendor/src/components/feedback/index.ts +1 -0
- package/packages/cli/vendor/src/components/filters/index.ts +0 -1
- package/packages/cli/vendor/src/components/inputs/color-picker.tsx +15 -1
- package/packages/cli/vendor/src/components/inputs/index.ts +1 -0
- package/packages/cli/vendor/src/components/inputs/multi-select.tsx +75 -0
- package/packages/cli/vendor/src/components/inputs/public.ts +1 -0
- package/packages/cli/vendor/src/components/inputs/slider.tsx +3 -3
- package/packages/cli/vendor/src/components/inputs/tag-input.tsx +4 -4
- package/packages/cli/vendor/src/components/inputs/time-picker.tsx +91 -38
- package/packages/cli/vendor/src/components/modern/file-manager.tsx +79 -0
- package/packages/cli/vendor/src/components/modern/index.ts +4 -1
- package/packages/cli/vendor/src/components/modern/map.tsx +146 -0
- package/packages/cli/vendor/src/components/modern/media-player.tsx +182 -0
- package/packages/cli/vendor/src/components/modern/resizable-panel.tsx +15 -5
- package/packages/cli/vendor/src/components/modern/spreadsheet.tsx +155 -0
- package/packages/cli/vendor/src/components/navigation/pagination.tsx +9 -5
- package/packages/cli/vendor/src/components/notifications/action-toast.tsx +78 -0
- package/packages/cli/vendor/src/components/notifications/index.ts +2 -1
- package/packages/cli/vendor/src/components/notifications/toast.tsx +20 -10
- package/packages/cli/vendor/src/components/overlay/alert-dialog.tsx +3 -5
- package/packages/cli/vendor/src/components/overlay/drawer.tsx +22 -11
- package/packages/cli/vendor/src/components/patterns/index.ts +1 -0
- package/packages/cli/vendor/src/components/patterns/permissions-matrix.tsx +71 -0
- package/packages/cli/vendor/src/components/patterns/public.ts +1 -0
- package/packages/cli/vendor/src/components/ui/checkbox/index.tsx +3 -1
- package/packages/cli/vendor/src/components/ui/dialog/index.tsx +4 -4
- package/packages/cli/vendor/src/components/ui/dropdown-menu/index.tsx +18 -22
- package/packages/cli/vendor/src/components/ui/popover/index.tsx +4 -4
- package/packages/cli/vendor/src/components/ui/tabs/index.tsx +8 -3
- package/packages/cli/vendor/src/components/ui/toggle-group/index.tsx +6 -6
- package/packages/cli/vendor/src/index.ts +0 -2
- package/packages/cli/vendor/src/public-component-surface.ts +13 -4
- package/packages/cli/vendor/templates/showcase/src/showcase/data/registry.ts +6 -6
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +23 -8
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
- package/packages/cli/vendor/templates/showcase/src/showcase/sections/PatternsSection.tsx +1 -1
- package/packages/cli/vendor/templates/styles/globals.css +0 -120
- package/registry.json +3197 -2794
- package/dist/components/display/info-card.cjs +0 -1
- package/dist/components/display/info-card.d.ts +0 -51
- package/dist/components/display/info-card.js +0 -1
- package/dist/components/display/statistic.cjs +0 -1
- package/dist/components/display/statistic.d.ts +0 -25
- package/dist/components/display/statistic.js +0 -1
- package/dist/components/filters/filter-bar.cjs +0 -1
- package/dist/components/filters/filter-bar.d.ts +0 -28
- package/dist/components/filters/filter-bar.js +0 -1
- package/dist/components/modern/image-cropper.cjs +0 -1
- package/dist/components/modern/image-cropper.d.ts +0 -39
- package/dist/components/modern/image-cropper.js +0 -1
- package/dist/components/ui/number-field/index.cjs +0 -1
- package/dist/components/ui/number-field/index.d.ts +0 -18
- package/dist/components/ui/number-field/index.js +0 -1
- package/dist/components/ui/toolbar/index.cjs +0 -1
- package/dist/components/ui/toolbar/index.d.ts +0 -14
- package/dist/components/ui/toolbar/index.js +0 -1
- package/dist/src/components/display/info-card.cjs +0 -1
- package/dist/src/components/display/info-card.js +0 -124
- package/dist/src/components/display/statistic.cjs +0 -1
- package/dist/src/components/display/statistic.js +0 -104
- package/dist/src/components/filters/filter-bar.cjs +0 -1
- package/dist/src/components/filters/filter-bar.js +0 -103
- package/dist/src/components/modern/image-cropper.cjs +0 -1
- package/dist/src/components/modern/image-cropper.js +0 -143
- package/dist/src/components/ui/number-field/index.cjs +0 -1
- package/dist/src/components/ui/number-field/index.js +0 -73
- package/dist/src/components/ui/toolbar/index.cjs +0 -1
- package/dist/src/components/ui/toolbar/index.js +0 -50
- package/packages/cli/vendor/src/components/display/info-card.tsx +0 -195
- package/packages/cli/vendor/src/components/display/statistic.tsx +0 -114
- package/packages/cli/vendor/src/components/filters/filter-bar.tsx +0 -163
- package/packages/cli/vendor/src/components/modern/image-cropper.tsx +0 -226
- package/packages/cli/vendor/src/components/ui/number-field/index.tsx +0 -89
- package/packages/cli/vendor/src/components/ui/toolbar/index.tsx +0 -67
|
@@ -6,73 +6,81 @@ import * as d from "react";
|
|
|
6
6
|
import { Loader2Icon as f, MoreHorizontalIcon as p } from "lucide-react";
|
|
7
7
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
8
|
//#region src/components/actions/action-menu.tsx
|
|
9
|
-
function _({ actions: _,
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
function _({ actions: _, open: v, defaultOpen: y = !1, onOpenChange: b, label: x, triggerLabel: S = "Open actions", trigger: C, align: w = "end", side: T = "bottom", sideOffset: E = 4, disabled: D = !1, triggerVariant: O = "ghost", triggerSize: k = "icon-sm", showChevron: A = !1, closeOnSelect: j = !0, contentClassName: M, triggerClassName: N, itemClassName: P, emptyLabel: F = "No actions", menuWidth: I, loadingLabel: L = "Working...", persistIconSpace: R = !0, itemRoleDescription: z, renderItem: B, onActionError: V }) {
|
|
10
|
+
let H = _.filter((e) => !e.hidden), [U, W] = d.useState(null), [G, K] = d.useState(y), q = v ?? G, J = d.useRef(null), Y = d.useCallback((e) => {
|
|
11
|
+
v === void 0 && K(e), b?.(e);
|
|
12
|
+
}, [b, v]), X = async (e) => {
|
|
13
|
+
if (!(e.disabled || e.loading || U)) try {
|
|
14
|
+
W(e.key), await e.onSelect?.(), j && !e.keepOpen && Y(!1);
|
|
15
|
+
} catch (t) {
|
|
16
|
+
if (V?.(t, e), !V) throw t;
|
|
13
17
|
} finally {
|
|
14
|
-
|
|
18
|
+
W(null);
|
|
15
19
|
}
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}),
|
|
20
|
+
}, Z = (e) => {
|
|
21
|
+
J.current !== e.key && (J.current = e.key, queueMicrotask(() => {
|
|
22
|
+
J.current === e.key && (J.current = null);
|
|
23
|
+
}), X(e));
|
|
20
24
|
};
|
|
21
25
|
return /* @__PURE__ */ g(r, {
|
|
22
|
-
open:
|
|
23
|
-
onOpenChange:
|
|
26
|
+
open: q,
|
|
27
|
+
onOpenChange: Y,
|
|
24
28
|
children: [/* @__PURE__ */ g(u, {
|
|
25
|
-
render:
|
|
29
|
+
render: C ?? /* @__PURE__ */ h(n, {
|
|
26
30
|
type: "button",
|
|
27
|
-
variant:
|
|
28
|
-
size:
|
|
29
|
-
disabled:
|
|
30
|
-
className: e("rounded-full border border-transparent text-muted-foreground shadow-none transition-[background-color,border-color,color,box-shadow] hover:border-border/70 hover:bg-accent hover:text-foreground focus-visible:border-[color:var(--aui-focus-ring,var(--ring))] focus-visible:shadow-[0_0_0_3px_var(--aui-focus-ring-soft,transparent)]",
|
|
31
|
+
variant: O,
|
|
32
|
+
size: k,
|
|
33
|
+
disabled: D,
|
|
34
|
+
className: e("rounded-full border border-transparent text-muted-foreground shadow-none transition-[background-color,border-color,color,box-shadow] hover:border-border/70 hover:bg-accent hover:text-foreground focus-visible:border-[color:var(--aui-focus-ring,var(--ring))] focus-visible:shadow-[0_0_0_3px_var(--aui-focus-ring-soft,transparent)]", N),
|
|
31
35
|
onMouseDown: t,
|
|
32
36
|
onDoubleClick: t
|
|
33
37
|
}),
|
|
34
38
|
children: [
|
|
35
|
-
!
|
|
36
|
-
!
|
|
39
|
+
!C && /* @__PURE__ */ h(p, {}),
|
|
40
|
+
!C && A && /* @__PURE__ */ h("span", {
|
|
37
41
|
className: "text-[10px] font-medium uppercase tracking-[0.18em]",
|
|
38
42
|
children: "Menu"
|
|
39
43
|
}),
|
|
40
44
|
/* @__PURE__ */ h("span", {
|
|
41
45
|
className: "sr-only",
|
|
42
|
-
children:
|
|
46
|
+
children: S
|
|
43
47
|
})
|
|
44
48
|
]
|
|
45
49
|
}), /* @__PURE__ */ g(i, {
|
|
46
|
-
align:
|
|
47
|
-
side:
|
|
48
|
-
sideOffset:
|
|
49
|
-
className: e("min-w-48 rounded-[var(--aui-card-radius,var(--radius-lg))]",
|
|
50
|
-
style:
|
|
50
|
+
align: w,
|
|
51
|
+
side: T,
|
|
52
|
+
sideOffset: E,
|
|
53
|
+
className: e("min-w-48 rounded-[var(--aui-card-radius,var(--radius-lg))]", M),
|
|
54
|
+
style: I ? { width: typeof I == "number" ? `${I}px` : I } : void 0,
|
|
51
55
|
children: [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
56
|
+
x && /* @__PURE__ */ h(s, { children: x }),
|
|
57
|
+
x && H.length > 0 && /* @__PURE__ */ h(c, {}),
|
|
58
|
+
H.length === 0 && /* @__PURE__ */ h(a, {
|
|
55
59
|
disabled: !0,
|
|
56
|
-
children:
|
|
60
|
+
children: F
|
|
57
61
|
}),
|
|
58
|
-
|
|
59
|
-
let i = n.loading ||
|
|
60
|
-
return /* @__PURE__ */ g(d.Fragment, { children: [p ? /* @__PURE__ */ g(m, { children: [r > 0 ? /* @__PURE__ */ h(c, {}) : null, /* @__PURE__ */ h(s, { children: n.section })] }) : null, /* @__PURE__ */
|
|
62
|
+
H.map((n, r) => {
|
|
63
|
+
let i = n.loading || U === n.key, u = r > 0 ? H[r - 1]?.section : void 0, p = !!(n.section && n.section !== u);
|
|
64
|
+
return /* @__PURE__ */ g(d.Fragment, { children: [p ? /* @__PURE__ */ g(m, { children: [r > 0 ? /* @__PURE__ */ h(c, {}) : null, /* @__PURE__ */ h(s, { children: n.section })] }) : null, /* @__PURE__ */ h(a, {
|
|
61
65
|
disabled: n.disabled || i,
|
|
62
66
|
variant: n.destructive ? "destructive" : "default",
|
|
63
|
-
closeOnSelect:
|
|
64
|
-
|
|
67
|
+
closeOnSelect: j && !n.keepOpen,
|
|
68
|
+
"aria-roledescription": z,
|
|
69
|
+
className: e("min-h-11 items-start gap-3 rounded-[calc(var(--radius-md)+1px)] border border-transparent py-2.5 transition-[background-color,color,border-color,box-shadow] data-[highlighted]:shadow-[inset_0_0_0_1px_color-mix(in_oklch,var(--primary),transparent_76%)] data-[disabled]:opacity-45", P),
|
|
65
70
|
onSelect: (e) => {
|
|
66
|
-
(n.keepOpen || !
|
|
71
|
+
(n.keepOpen || !j) && e.preventDefault(), t(e), Z(n);
|
|
67
72
|
},
|
|
68
73
|
onClick: (e) => {
|
|
69
|
-
t(e),
|
|
74
|
+
t(e), Z(n);
|
|
70
75
|
},
|
|
71
76
|
onMouseDown: t,
|
|
72
77
|
onDoubleClick: t,
|
|
73
|
-
children:
|
|
78
|
+
children: B?.(n, {
|
|
79
|
+
loading: i,
|
|
80
|
+
close: () => Y(!1)
|
|
81
|
+
}) ?? /* @__PURE__ */ g(m, { children: [
|
|
74
82
|
/* @__PURE__ */ h("span", {
|
|
75
|
-
className: e("mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground", !
|
|
83
|
+
className: e("mt-0.5 flex size-5 shrink-0 items-center justify-center text-muted-foreground", !R && !i && !n.icon && "hidden"),
|
|
76
84
|
children: i ? /* @__PURE__ */ h(f, { className: "size-4 animate-spin" }) : n.icon
|
|
77
85
|
}),
|
|
78
86
|
/* @__PURE__ */ g("span", {
|
|
@@ -82,11 +90,11 @@ function _({ actions: _, label: v, trigger: y, align: b = "end", side: x = "bott
|
|
|
82
90
|
children: n.label
|
|
83
91
|
}), n.description ? /* @__PURE__ */ h(o, {
|
|
84
92
|
className: "mt-0.5 truncate",
|
|
85
|
-
children: i ?
|
|
93
|
+
children: i ? L : n.description
|
|
86
94
|
}) : null]
|
|
87
95
|
}),
|
|
88
96
|
n.shortcut && /* @__PURE__ */ h(l, { children: n.shortcut })
|
|
89
|
-
]
|
|
97
|
+
] })
|
|
90
98
|
})] }, n.key);
|
|
91
99
|
})
|
|
92
100
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");async function o(e){if(typeof navigator<`u`&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}if(typeof document>`u`)throw Error(`Clipboard is not available`);let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();try{document.execCommand(`copy`)}finally{document.body.removeChild(t)}}function s({value:e,copiedLabel:s=`Copied`,copyLabel:c=`Copy`,copiedTimeout:l=1600,onCopied:u,onCopyError:d,showIcon:f=!0,copiedVariant:p,variant:m,disabled:h,children:g,type:_=`button`,...v}){let[y,b]=r.useState(!1),x=r.useRef(void 0);r.useEffect(()=>()=>{x.current&&window.clearTimeout(x.current)},[]);let S=r.useCallback(async()=>{try{await o(e),b(!0),u?.(e),x.current&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>b(!1),l)}catch(e){d?.(e)}},[l,u,d,e]);return(0,a.jsxs)(n.Button,{"data-slot":`copy-button`,"data-copied":y||void 0,type:_,variant:y?p??`secondary`:m,disabled:h||!e,onClick:e=>{t.stopInteractivePropagation(e),S()},onMouseDown:t.stopInteractivePropagation,onDoubleClick:t.stopInteractivePropagation,"aria-live":`polite`,...v,children:[f&&(y?(0,a.jsx)(i.CheckIcon,{"data-icon":`inline-start`}):(0,a.jsx)(i.CopyIcon,{"data-icon":`inline-start`})),g??(y?s:c)]})}exports.CopyButton=s;
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs");let r=require("react");r=e.__toESM(r,1);let i=require("lucide-react"),a=require("react/jsx-runtime");async function o(e){if(typeof navigator<`u`&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}if(typeof document>`u`)throw Error(`Clipboard is not available`);let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();try{document.execCommand(`copy`)}finally{document.body.removeChild(t)}}function s({value:e,copiedLabel:s=`Copied`,copyLabel:c=`Copy`,copiedTimeout:l=1600,onCopied:u,onCopyError:d,showIcon:f=!0,copiedVariant:p,variant:m,disabled:h,children:g,type:_=`button`,...v}){let[y,b]=r.useState(!1),x=r.useRef(void 0);r.useEffect(()=>()=>{x.current&&window.clearTimeout(x.current)},[]);let S=r.useCallback(async()=>{try{await o(e),b(!0),u?.(e),x.current&&window.clearTimeout(x.current),x.current=window.setTimeout(()=>b(!1),l)}catch(e){d?.(e)}},[l,u,d,e]);return(0,a.jsxs)(n.Button,{"data-slot":`copy-button`,"data-copied":y||void 0,type:_,variant:y?p??`secondary`:m,disabled:h||!e,onClick:e=>{t.stopInteractivePropagation(e),S()},onMouseDown:t.stopInteractivePropagation,onDoubleClick:t.stopInteractivePropagation,"aria-live":`polite`,...v,children:[f&&(y?(0,a.jsx)(i.CheckIcon,{"data-icon":`inline-start`,className:`size-3.5`}):(0,a.jsx)(i.CopyIcon,{"data-icon":`inline-start`,className:`size-3.5`})),g??(y?s:c)]})}exports.CopyButton=s;
|
|
@@ -49,7 +49,10 @@ function c({ value: c, copiedLabel: l = "Copied", copyLabel: u = "Copy", copiedT
|
|
|
49
49
|
onDoubleClick: e,
|
|
50
50
|
"aria-live": "polite",
|
|
51
51
|
...b,
|
|
52
|
-
children: [m && a(x ? r : i, {
|
|
52
|
+
children: [m && a(x ? r : i, {
|
|
53
|
+
"data-icon": "inline-start",
|
|
54
|
+
className: "size-3.5"
|
|
55
|
+
}), v ?? (x ? l : u)]
|
|
53
56
|
});
|
|
54
57
|
}
|
|
55
58
|
//#endregion
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("../ui/badge/index.cjs"),i=require("./date-range-picker.cjs"),a=require("../ui/card/index.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("lucide-react"),c=require("react/jsx-runtime");function l({value:e,onValueChange:o,events:l=[],onEventSelect:u,title:d=`Schedule range`,action:f,className:p,...m}){return(0,c.jsxs)(a.Card,{"data-slot":`calendar-range-scheduler`,className:t.cn(`min-w-0`,p),...m,children:[(0,c.jsxs)(a.CardHeader,{className:`flex-row items-center justify-between gap-3`,children:[(0,c.jsxs)(a.CardTitle,{className:`flex items-center gap-2`,children:[(0,c.jsx)(s.CalendarDaysIcon,{className:`size-4`}),d]}),f]}),(0,c.jsxs)(a.CardContent,{className:`grid gap-4 lg:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,c.jsx)(i.DateRangePicker,{value:e,onValueChange:o}),(0,c.jsxs)(`div`,{className:`grid content-start gap-2`,children:[l.length?l.map(e=>(0,c.jsxs)(`button`,{type:`button`,className:`grid gap-1 rounded-lg border bg-background p-3 text-left transition hover:border-primary/45 hover:bg-muted/40`,onClick:()=>u?.(e),children:[(0,c.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,c.jsx)(`span`,{className:`font-medium`,children:e.title}),(0,c.jsx)(r.Badge,{label:e.tone??`scheduled`,status:e.tone===`danger`?`danger`:e.tone===`warning`?`warning`:e.tone===`success`?`success`:`info`,variant:`soft`})]}),(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.range.from||`Start`,` - `,e.range.to||`End`]}),e.meta?(0,c.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.meta}):null]},e.id)):(0,c.jsx)(`div`,{className:`rounded-lg border border-dashed p-6 text-sm text-muted-foreground`,children:`No scheduled ranges.`}),(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,onClick:()=>o?.({from:``,to:``}),children:`Clear range`})]})]})]})}exports.CalendarRangeScheduler=l;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t } from "../ui/button/index.js";
|
|
4
|
+
import { Badge as n } from "../ui/badge/index.js";
|
|
5
|
+
import { DateRangePicker as r } from "./date-range-picker.js";
|
|
6
|
+
import { Card as i, CardContent as a, CardHeader as o, CardTitle as s } from "../ui/card/index.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import { CalendarDaysIcon as c } from "lucide-react";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/calendar/calendar-range-scheduler.tsx
|
|
11
|
+
function d({ value: d, onValueChange: f, events: p = [], onEventSelect: m, title: h = "Schedule range", action: g, className: _, ...v }) {
|
|
12
|
+
return /* @__PURE__ */ u(i, {
|
|
13
|
+
"data-slot": "calendar-range-scheduler",
|
|
14
|
+
className: e("min-w-0", _),
|
|
15
|
+
...v,
|
|
16
|
+
children: [/* @__PURE__ */ u(o, {
|
|
17
|
+
className: "flex-row items-center justify-between gap-3",
|
|
18
|
+
children: [/* @__PURE__ */ u(s, {
|
|
19
|
+
className: "flex items-center gap-2",
|
|
20
|
+
children: [/* @__PURE__ */ l(c, { className: "size-4" }), h]
|
|
21
|
+
}), g]
|
|
22
|
+
}), /* @__PURE__ */ u(a, {
|
|
23
|
+
className: "grid gap-4 lg:grid-cols-[320px_minmax(0,1fr)]",
|
|
24
|
+
children: [/* @__PURE__ */ l(r, {
|
|
25
|
+
value: d,
|
|
26
|
+
onValueChange: f
|
|
27
|
+
}), /* @__PURE__ */ u("div", {
|
|
28
|
+
className: "grid content-start gap-2",
|
|
29
|
+
children: [p.length ? p.map((e) => /* @__PURE__ */ u("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
className: "grid gap-1 rounded-lg border bg-background p-3 text-left transition hover:border-primary/45 hover:bg-muted/40",
|
|
32
|
+
onClick: () => m?.(e),
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ u("span", {
|
|
35
|
+
className: "flex items-center justify-between gap-2",
|
|
36
|
+
children: [/* @__PURE__ */ l("span", {
|
|
37
|
+
className: "font-medium",
|
|
38
|
+
children: e.title
|
|
39
|
+
}), /* @__PURE__ */ l(n, {
|
|
40
|
+
label: e.tone ?? "scheduled",
|
|
41
|
+
status: e.tone === "danger" ? "danger" : e.tone === "warning" ? "warning" : e.tone === "success" ? "success" : "info",
|
|
42
|
+
variant: "soft"
|
|
43
|
+
})]
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ u("span", {
|
|
46
|
+
className: "text-xs text-muted-foreground",
|
|
47
|
+
children: [
|
|
48
|
+
e.range.from || "Start",
|
|
49
|
+
" - ",
|
|
50
|
+
e.range.to || "End"
|
|
51
|
+
]
|
|
52
|
+
}),
|
|
53
|
+
e.meta ? /* @__PURE__ */ l("span", {
|
|
54
|
+
className: "text-xs text-muted-foreground",
|
|
55
|
+
children: e.meta
|
|
56
|
+
}) : null
|
|
57
|
+
]
|
|
58
|
+
}, e.id)) : /* @__PURE__ */ l("div", {
|
|
59
|
+
className: "rounded-lg border border-dashed p-6 text-sm text-muted-foreground",
|
|
60
|
+
children: "No scheduled ranges."
|
|
61
|
+
}), /* @__PURE__ */ l(t, {
|
|
62
|
+
type: "button",
|
|
63
|
+
variant: "outline",
|
|
64
|
+
onClick: () => f?.({
|
|
65
|
+
from: "",
|
|
66
|
+
to: ""
|
|
67
|
+
}),
|
|
68
|
+
children: "Clear range"
|
|
69
|
+
})]
|
|
70
|
+
})]
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { d as CalendarRangeScheduler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("./date-utils.cjs"),i=require("./calendar.cjs"),a=require("../ui/popover/index.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("lucide-react"),c=require("react/jsx-runtime");function l(e){let t=r.parseDateKey(e);return t?new Intl.DateTimeFormat(`en-US`,{dateStyle:`medium`}).format(t):e}function u({value:e,onValueChange:r,placeholder:u,labels:d,disabled:f=!1,clearable:p=!0,triggerVariant:m=`default`,formatValue:h=l,triggerClassName:g,contentClassName:_,className:v,...y}){let[b,x]=o.useState(!1),S=!!e,C=e=>{r?.(e),x(!1)},w=()=>{r?.(``),x(!1)};return(0,c.jsx)(`div`,{"data-slot":`date-picker`,"data-trigger-variant":m,className:t.cn(`w-full`,v),children:(0,c.jsxs)(a.Popover,{open:b,onOpenChange:x,children:[(0,c.jsxs)(a.PopoverTrigger,{render:(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,disabled:f,labelClassName:`flex-1`,className:t.cn(`group w-full justify-start rounded-[var(--aui-control-radius,var(--radius-md))] border-border/80 bg-background/96 text-left font-normal shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04))]`,m==="default"?`min-h-11 gap-3 px-3`:`min-h-9 gap-2 px-2.5`,!S&&`text-muted-foreground`,g)}),children:[(0,c.jsx)(s.CalendarIcon,{"data-icon":`inline-start`,className:t.cn(S&&`text-primary`)}),(0,c.
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("./date-utils.cjs"),i=require("./calendar.cjs"),a=require("../ui/popover/index.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("lucide-react"),c=require("react/jsx-runtime");function l(e){let t=r.parseDateKey(e);return t?new Intl.DateTimeFormat(`en-US`,{dateStyle:`medium`}).format(t):e}function u({value:e,onValueChange:r,placeholder:u,labels:d,disabled:f=!1,clearable:p=!0,triggerVariant:m=`default`,formatValue:h=l,triggerClassName:g,contentClassName:_,className:v,...y}){let[b,x]=o.useState(!1),S=!!e,C=e=>{r?.(e),x(!1)},w=()=>{r?.(``),x(!1)};return(0,c.jsx)(`div`,{"data-slot":`date-picker`,"data-trigger-variant":m,className:t.cn(`w-full`,v),children:(0,c.jsxs)(a.Popover,{open:b,onOpenChange:x,children:[(0,c.jsxs)(a.PopoverTrigger,{render:(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,disabled:f,labelClassName:`flex-1`,className:t.cn(`group w-full justify-start rounded-[var(--aui-control-radius,var(--radius-md))] border-border/80 bg-background/96 text-left font-normal shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04))]`,m==="default"?`min-h-11 gap-3 px-3`:`min-h-9 gap-2 px-2.5`,!S&&`text-muted-foreground`,g)}),children:[(0,c.jsx)(s.CalendarIcon,{"data-icon":`inline-start`,className:t.cn(`size-4`,S&&`text-primary`)}),(0,c.jsx)(`span`,{className:`grid min-w-0 flex-1`,children:(0,c.jsx)(`span`,{className:t.cn(`truncate text-sm`,S&&`font-semibold text-foreground`),children:S?h(String(e)):u??d?.placeholder??`Select date`})}),p&&S?(0,c.jsx)(`span`,{role:`button`,tabIndex:0,"aria-label":d?.clear??`Clear date`,className:t.cn(`ml-auto inline-flex shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground opacity-80 transition hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,m==="default"?`size-7`:`size-6`),onClick:e=>{e.preventDefault(),e.stopPropagation(),w()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),w())},children:(0,c.jsx)(s.XIcon,{className:`size-3.5`})}):null]}),(0,c.jsx)(a.PopoverContent,{align:`start`,className:t.cn(`w-auto overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border-border/70 bg-popover p-0 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))] backdrop-blur`,_),children:(0,c.jsx)(i.Calendar,{value:e,onValueChange:C,labels:d,showTodayShortcut:!0,showClearShortcut:p,showSelectionSummary:!0,...y})})]})})}exports.DatePicker=u;
|
|
@@ -36,17 +36,14 @@ function p({ value: n, onValueChange: p, placeholder: m, labels: h, disabled: g
|
|
|
36
36
|
children: [
|
|
37
37
|
/* @__PURE__ */ u(c, {
|
|
38
38
|
"data-icon": "inline-start",
|
|
39
|
-
className: e(E && "text-primary")
|
|
39
|
+
className: e("size-4", E && "text-primary")
|
|
40
40
|
}),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
className:
|
|
43
|
-
children:
|
|
44
|
-
className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",
|
|
45
|
-
children: h?.selected ?? "Date"
|
|
46
|
-
}) : null, /* @__PURE__ */ u("span", {
|
|
41
|
+
/* @__PURE__ */ u("span", {
|
|
42
|
+
className: "grid min-w-0 flex-1",
|
|
43
|
+
children: /* @__PURE__ */ u("span", {
|
|
47
44
|
className: e("truncate text-sm", E && "font-semibold text-foreground"),
|
|
48
45
|
children: E ? y(String(n)) : m ?? h?.placeholder ?? "Select date"
|
|
49
|
-
})
|
|
46
|
+
})
|
|
50
47
|
}),
|
|
51
48
|
_ && E ? /* @__PURE__ */ u("span", {
|
|
52
49
|
role: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("./date-utils.cjs"),i=require("./calendar.cjs"),a=require("../ui/popover/index.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("lucide-react"),c=require("react/jsx-runtime");function l(e){let t=r.parseDateKey(e);return t?new Intl.DateTimeFormat(`en-US`,{dateStyle:`medium`}).format(t):e}function u(e,t){return typeof e==`string`?e:t}function d({className:e,value:r,onValueChange:d,labels:f,placeholder:p,disabled:m=!1,clearable:h=!0,formatValue:g=l,closeOnSelect:_=!1,closeOnPresetSelect:v=!1,showFooter:y=!0,presets:b,triggerClassName:x,contentClassName:S,months:C,numberOfMonths:w=2,pagedNavigation:T=!0,...E}){let[D,O]=o.useState(!1),[k,A]=o.useState(r??{}),j=r?.from??``,M=r?.to??``,N=!!(j||M),P=y?k:r,F=P?.from??``,I=P?.to??``,L=!!(F||I),R=C??w,z=j&&M?`${g(j)} - ${g(M)}`:j?`${g(j)} - ...`:p??f?.placeholder??`Select date range`,B=F&&I?`${g(F)} - ${g(I)}`:F?`${g(F)} - ...`:f?.placeholder??`Select date range`;o.useEffect(()=>{D&&y&&A(r??{})},[D,y,r]);let V=e=>{if(y){A(e);return}d?.(e),_&&e.from&&e.to&&O(!1)},H=()=>{d?.(k),O(!1)},U=()=>{let e={};if(y){A(e);return}d?.(e)},W=()=>{let e={};A(e),d?.(e)},G=e=>{e.preventDefault(),e.stopPropagation(),W()},K=e=>{if(y){A(e),v&&(d?.(e),O(!1));return}d?.(e),(_||v)&&e.from&&e.to&&O(!1)};return(0,c.jsx)(`div`,{"data-slot":`date-range-picker`,className:t.cn(`w-full`,e),children:(0,c.jsxs)(a.Popover,{open:D,onOpenChange:O,children:[(0,c.jsxs)(a.PopoverTrigger,{render:(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,disabled:m,className:t.cn(`group min-h-11 w-full justify-start gap-3 rounded-[var(--aui-control-radius,var(--radius-md))] border-border/80 bg-background/96 px-3 text-left font-normal shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04))]`,!N&&`text-muted-foreground`,x)}),children:[(0,c.jsx)(s.CalendarIcon,{"data-icon":`inline-start`,className:t.cn(N&&`text-primary`)}),N?(0,c.jsxs)(`span`,{className:`
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/button/index.cjs"),r=require("./date-utils.cjs"),i=require("./calendar.cjs"),a=require("../ui/popover/index.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("lucide-react"),c=require("react/jsx-runtime");function l(e){let t=r.parseDateKey(e);return t?new Intl.DateTimeFormat(`en-US`,{dateStyle:`medium`}).format(t):e}function u(e,t){return typeof e==`string`?e:t}function d({className:e,value:r,onValueChange:d,labels:f,placeholder:p,disabled:m=!1,clearable:h=!0,formatValue:g=l,closeOnSelect:_=!1,closeOnPresetSelect:v=!1,showFooter:y=!0,presets:b,triggerClassName:x,contentClassName:S,months:C,numberOfMonths:w=2,pagedNavigation:T=!0,...E}){let[D,O]=o.useState(!1),[k,A]=o.useState(r??{}),j=r?.from??``,M=r?.to??``,N=!!(j||M),P=y?k:r,F=P?.from??``,I=P?.to??``,L=!!(F||I),R=C??w,z=j&&M?`${g(j)} - ${g(M)}`:j?`${g(j)} - ...`:p??f?.placeholder??`Select date range`,B=F&&I?`${g(F)} - ${g(I)}`:F?`${g(F)} - ...`:f?.placeholder??`Select date range`;o.useEffect(()=>{D&&y&&A(r??{})},[D,y,r]);let V=e=>{if(y){A(e);return}d?.(e),_&&e.from&&e.to&&O(!1)},H=()=>{d?.(k),O(!1)},U=()=>{let e={};if(y){A(e);return}d?.(e)},W=()=>{let e={};A(e),d?.(e)},G=e=>{e.preventDefault(),e.stopPropagation(),W()},K=e=>{if(y){A(e),v&&(d?.(e),O(!1));return}d?.(e),(_||v)&&e.from&&e.to&&O(!1)};return(0,c.jsx)(`div`,{"data-slot":`date-range-picker`,className:t.cn(`w-full`,e),children:(0,c.jsxs)(a.Popover,{open:D,onOpenChange:O,children:[(0,c.jsxs)(a.PopoverTrigger,{render:(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,disabled:m,className:t.cn(`group min-h-11 w-full justify-start gap-3 rounded-[var(--aui-control-radius,var(--radius-md))] border-border/80 bg-background/96 px-3 text-left font-normal shadow-[var(--aui-control-shadow,0_1px_2px_rgba(15,23,42,0.04))]`,!N&&`text-muted-foreground`,x)}),children:[(0,c.jsx)(s.CalendarIcon,{"data-icon":`inline-start`,className:t.cn(`size-4`,N&&`text-primary`)}),N?(0,c.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,c.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold text-foreground`,children:j?g(j):`...`}),(0,c.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}),(0,c.jsx)(`span`,{className:`min-w-0 truncate text-sm font-semibold text-foreground`,children:M?g(M):`...`})]}):(0,c.jsx)(`span`,{className:`grid min-w-0 flex-1`,children:(0,c.jsx)(`span`,{className:`truncate text-sm`,children:z})}),h&&N?(0,c.jsx)(`span`,{role:`button`,tabIndex:0,"aria-label":u(f?.clear,`Clear date range`),className:`ml-auto inline-flex size-7 shrink-0 items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground opacity-80 transition hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,onClick:G,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),W())},children:(0,c.jsx)(s.XIcon,{className:`size-3.5`})}):null]}),(0,c.jsxs)(a.PopoverContent,{align:`start`,className:t.cn(`w-auto overflow-hidden rounded-[var(--aui-card-radius,var(--radius-lg))] border-border/70 bg-popover p-0 shadow-[var(--aui-control-panel-shadow,0_18px_40px_rgba(15,23,42,0.14))] backdrop-blur`,S),children:[b?.length?(0,c.jsx)(`div`,{className:`flex flex-wrap gap-2 border-b border-border/70 bg-muted/20 px-3 py-3`,children:b.map((e,t)=>(0,c.jsx)(n.Button,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 rounded-full px-3 text-xs`,onClick:()=>K(e.value),children:e.label},t))}):null,(0,c.jsx)(i.Calendar,{mode:`range`,range:P,onRangeChange:V,labels:f,renderSelectionSummary:({range:e})=>{let t=e?.from?g(e.from):null,n=e?.to?g(e.to):null;return t&&n?`${t} -> ${n}`:t?`${t} -> ...`:`No range selected`},numberOfMonths:R,pagedNavigation:T,showClearShortcut:!y&&h,showSelectionSummary:!0,...E}),y&&(0,c.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 border-t border-border/70 bg-muted/24 px-4 py-3`,children:[(0,c.jsx)(`div`,{className:`min-w-0 text-sm text-muted-foreground`,children:(0,c.jsx)(`span`,{className:`block truncate`,children:B})}),(0,c.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,c.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`sm`,onClick:U,children:f?.clear??`Clear`}),(0,c.jsx)(n.Button,{type:`button`,size:`sm`,disabled:!L,onClick:H,children:f?.apply??`Apply`})]})]})]})]})})}exports.DateRangePicker=d;
|
|
@@ -67,45 +67,30 @@ function m({ className: n, value: m, onValueChange: h, labels: g, placeholder: _
|
|
|
67
67
|
children: [
|
|
68
68
|
/* @__PURE__ */ u(c, {
|
|
69
69
|
"data-icon": "inline-start",
|
|
70
|
-
className: e(L && "text-primary")
|
|
70
|
+
className: e("size-4", L && "text-primary")
|
|
71
71
|
}),
|
|
72
72
|
L ? /* @__PURE__ */ d("span", {
|
|
73
|
-
className: "
|
|
73
|
+
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
74
74
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
className: "
|
|
77
|
-
children:
|
|
78
|
-
className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",
|
|
79
|
-
children: g?.start ?? "Start"
|
|
80
|
-
}), /* @__PURE__ */ u("span", {
|
|
81
|
-
className: "truncate text-sm font-semibold text-foreground",
|
|
82
|
-
children: F ? b(F) : "..."
|
|
83
|
-
})]
|
|
75
|
+
/* @__PURE__ */ u("span", {
|
|
76
|
+
className: "min-w-0 truncate text-sm font-semibold text-foreground",
|
|
77
|
+
children: F ? b(F) : "..."
|
|
84
78
|
}),
|
|
85
79
|
/* @__PURE__ */ u("span", {
|
|
86
80
|
className: "text-muted-foreground",
|
|
87
81
|
children: "-"
|
|
88
82
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
className: "
|
|
91
|
-
children:
|
|
92
|
-
className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",
|
|
93
|
-
children: g?.end ?? "End"
|
|
94
|
-
}), /* @__PURE__ */ u("span", {
|
|
95
|
-
className: "truncate text-sm font-semibold text-foreground",
|
|
96
|
-
children: I ? b(I) : "..."
|
|
97
|
-
})]
|
|
83
|
+
/* @__PURE__ */ u("span", {
|
|
84
|
+
className: "min-w-0 truncate text-sm font-semibold text-foreground",
|
|
85
|
+
children: I ? b(I) : "..."
|
|
98
86
|
})
|
|
99
87
|
]
|
|
100
|
-
}) : /* @__PURE__ */
|
|
101
|
-
className: "grid min-w-0 flex-1
|
|
102
|
-
children:
|
|
103
|
-
className: "text-[11px] font-semibold uppercase tracking-[0.16em] text-muted-foreground",
|
|
104
|
-
children: "Range"
|
|
105
|
-
}), /* @__PURE__ */ u("span", {
|
|
88
|
+
}) : /* @__PURE__ */ u("span", {
|
|
89
|
+
className: "grid min-w-0 flex-1",
|
|
90
|
+
children: /* @__PURE__ */ u("span", {
|
|
106
91
|
className: "truncate text-sm",
|
|
107
92
|
children: U
|
|
108
|
-
})
|
|
93
|
+
})
|
|
109
94
|
}),
|
|
110
95
|
y && L ? /* @__PURE__ */ u("span", {
|
|
111
96
|
role: "button",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("./date-picker.cjs"),r=require("../inputs/time-picker.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");function o({value:e,onValueChange:i,datePickerProps:o,timeLabel:s=`Time`,disabled:c,className:l,...u}){let d=e??{};return(0,a.jsxs)(`div`,{"data-slot":`date-time-picker`,className:t.cn(`grid gap-3 sm:grid-cols-2`,l),...u,children:[(0,a.jsx)(n.DatePicker,{...o,value:d.date,disabled:c||o?.disabled,onValueChange:e=>i?.({...d,date:e})}),(0,a.jsxs)(`label`,{className:`grid gap-1.5 text-sm font-medium`,children:[(0,a.jsx)(`span`,{children:s}),(0,a.jsx)(r.TimePicker,{value:d.time??``,onChange:e=>i?.({...d,time:e.currentTarget.value}),disabled:c})]})]})}exports.CalendarDateTimePicker=o;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { DatePicker as t } from "./date-picker.js";
|
|
4
|
+
import { TimePicker as n } from "../inputs/time-picker.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/calendar/date-time-picker.tsx
|
|
8
|
+
function a({ value: a, onValueChange: o, datePickerProps: s, timeLabel: c = "Time", disabled: l, className: u, ...d }) {
|
|
9
|
+
let f = a ?? {};
|
|
10
|
+
return /* @__PURE__ */ i("div", {
|
|
11
|
+
"data-slot": "date-time-picker",
|
|
12
|
+
className: e("grid gap-3 sm:grid-cols-2", u),
|
|
13
|
+
...d,
|
|
14
|
+
children: [/* @__PURE__ */ r(t, {
|
|
15
|
+
...s,
|
|
16
|
+
value: f.date,
|
|
17
|
+
disabled: l || s?.disabled,
|
|
18
|
+
onValueChange: (e) => o?.({
|
|
19
|
+
...f,
|
|
20
|
+
date: e
|
|
21
|
+
})
|
|
22
|
+
}), /* @__PURE__ */ i("label", {
|
|
23
|
+
className: "grid gap-1.5 text-sm font-medium",
|
|
24
|
+
children: [/* @__PURE__ */ r("span", { children: c }), /* @__PURE__ */ r(n, {
|
|
25
|
+
value: f.time ?? "",
|
|
26
|
+
onChange: (e) => o?.({
|
|
27
|
+
...f,
|
|
28
|
+
time: e.currentTarget.value
|
|
29
|
+
}),
|
|
30
|
+
disabled: l
|
|
31
|
+
})]
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { a as CalendarDateTimePicker };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./date-utils.cjs"),t=require("./calendar.cjs"),n=require("./date-picker.cjs"),r=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./date-utils.cjs"),t=require("./calendar.cjs"),n=require("./date-range-picker.cjs"),r=require("./calendar-range-scheduler.cjs"),i=require("./date-picker.cjs"),a=require("./date-time-picker.cjs");exports.Calendar=t.Calendar,exports.CalendarDateTimePicker=a.CalendarDateTimePicker,exports.CalendarRangeScheduler=r.CalendarRangeScheduler,exports.DatePicker=i.DatePicker,exports.DateRangePicker=n.DateRangePicker,exports.addMonths=e.addMonths,exports.getMonthDays=e.getMonthDays,exports.getMonthLabel=e.getMonthLabel,exports.getWeekdayLabels=e.getWeekdayLabels,exports.isAfterDate=e.isAfterDate,exports.isBeforeDate=e.isBeforeDate,exports.isSameMonth=e.isSameMonth,exports.isWithinRange=e.isWithinRange,exports.parseDateKey=e.parseDateKey,exports.startOfMonth=e.startOfMonth,exports.toDateKey=e.toDateKey;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { addMonths as e, getMonthDays as t, getMonthLabel as n, getWeekdayLabels as r, isAfterDate as i, isBeforeDate as a, isSameMonth as o, isWithinRange as s, parseDateKey as c, startOfMonth as l, toDateKey as u } from "./date-utils.js";
|
|
2
2
|
import { Calendar as d } from "./calendar.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
3
|
+
import { DateRangePicker as f } from "./date-range-picker.js";
|
|
4
|
+
import { CalendarRangeScheduler as p } from "./calendar-range-scheduler.js";
|
|
5
|
+
import { DatePicker as m } from "./date-picker.js";
|
|
6
|
+
import { CalendarDateTimePicker as h } from "./date-time-picker.js";
|
|
7
|
+
export { d as Calendar, h as CalendarDateTimePicker, p as CalendarRangeScheduler, m as DatePicker, f as DateRangePicker, e as addMonths, t as getMonthDays, n as getMonthLabel, r as getWeekdayLabels, i as isAfterDate, a as isBeforeDate, o as isSameMonth, s as isWithinRange, c as parseDateKey, l as startOfMonth, u as toDateKey };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/badge/index.cjs"),r=require("../ui/card/index.cjs"),i=require("./charts.cjs"),a=require("../ui/select/index.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("react/jsx-runtime");function c({title:e,description:o,type:c=`bar`,data:l=[],series:u,labels:d,state:f,metric:p,badge:m,filters:h,filterValue:g,onFilterChange:_,className:v,...y}){return(0,s.jsxs)(r.Card,{"data-slot":`chart-card`,className:t.cn(`min-w-0`,v),...y,children:[(0,s.jsxs)(r.CardHeader,{className:`flex-row items-start justify-between gap-3`,children:[(0,s.jsxs)(`div`,{className:`grid gap-1`,children:[e?(0,s.jsx)(r.CardTitle,{children:e}):null,o?(0,s.jsx)(r.CardDescription,{children:o}):null,p?(0,s.jsx)(`div`,{className:`text-2xl font-semibold tracking-tight`,children:p}):null]}),(0,s.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[m??(0,s.jsx)(n.Badge,{label:c,variant:`secondary`}),h?.length?(0,s.jsx)(a.Select,{value:g,onValueChange:e=>e&&_?.(e),options:h,triggerClassName:`h-9 w-36`}):null]})]}),(0,s.jsx)(r.CardContent,{children:c===`line`?(0,s.jsx)(i.LineChart,{series:u,labels:d,values:l.map(e=>e.value),state:f}):c===`donut`?(0,s.jsx)(i.DonutChart,{data:l,state:f}):(0,s.jsx)(i.BarChart,{data:l,series:u,state:f})})]})}exports.ChartCard=c;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Badge as t } from "../ui/badge/index.js";
|
|
4
|
+
import { Card as n, CardContent as r, CardDescription as i, CardHeader as a, CardTitle as o } from "../ui/card/index.js";
|
|
5
|
+
import { BarChart as s, DonutChart as c, LineChart as l } from "./charts.js";
|
|
6
|
+
import { Select as u } from "../ui/select/index.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/charts/chart-card.tsx
|
|
10
|
+
function p({ title: p, description: m, type: h = "bar", data: g = [], series: _, labels: v, state: y, metric: b, badge: x, filters: S, filterValue: C, onFilterChange: w, className: T, ...E }) {
|
|
11
|
+
return /* @__PURE__ */ f(n, {
|
|
12
|
+
"data-slot": "chart-card",
|
|
13
|
+
className: e("min-w-0", T),
|
|
14
|
+
...E,
|
|
15
|
+
children: [/* @__PURE__ */ f(a, {
|
|
16
|
+
className: "flex-row items-start justify-between gap-3",
|
|
17
|
+
children: [/* @__PURE__ */ f("div", {
|
|
18
|
+
className: "grid gap-1",
|
|
19
|
+
children: [
|
|
20
|
+
p ? /* @__PURE__ */ d(o, { children: p }) : null,
|
|
21
|
+
m ? /* @__PURE__ */ d(i, { children: m }) : null,
|
|
22
|
+
b ? /* @__PURE__ */ d("div", {
|
|
23
|
+
className: "text-2xl font-semibold tracking-tight",
|
|
24
|
+
children: b
|
|
25
|
+
}) : null
|
|
26
|
+
]
|
|
27
|
+
}), /* @__PURE__ */ f("div", {
|
|
28
|
+
className: "flex shrink-0 items-center gap-2",
|
|
29
|
+
children: [x ?? /* @__PURE__ */ d(t, {
|
|
30
|
+
label: h,
|
|
31
|
+
variant: "secondary"
|
|
32
|
+
}), S?.length ? /* @__PURE__ */ d(u, {
|
|
33
|
+
value: C,
|
|
34
|
+
onValueChange: (e) => e && w?.(e),
|
|
35
|
+
options: S,
|
|
36
|
+
triggerClassName: "h-9 w-36"
|
|
37
|
+
}) : null]
|
|
38
|
+
})]
|
|
39
|
+
}), /* @__PURE__ */ d(r, { children: h === "line" ? /* @__PURE__ */ d(l, {
|
|
40
|
+
series: _,
|
|
41
|
+
labels: v,
|
|
42
|
+
values: g.map((e) => e.value),
|
|
43
|
+
state: y
|
|
44
|
+
}) : h === "donut" ? /* @__PURE__ */ d(c, {
|
|
45
|
+
data: g,
|
|
46
|
+
state: y
|
|
47
|
+
}) : /* @__PURE__ */ d(s, {
|
|
48
|
+
data: g,
|
|
49
|
+
series: _,
|
|
50
|
+
state: y
|
|
51
|
+
}) })]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { p as ChartCard };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./charts.cjs"),t=require("./progress-circle.cjs");exports.AreaChart=e.AreaChart,exports.BarChart=e.BarChart,exports.ChartFrame=e.ChartFrame,exports.ChartLegend=e.ChartLegend,exports.ChartTooltipContent=e.ChartTooltipContent,exports.DonutChart=e.DonutChart,exports.LineChart=e.LineChart,exports.MetricTrend=e.MetricTrend,exports.ProgressCircle=
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./charts.cjs"),t=require("./chart-card.cjs"),n=require("./progress-circle.cjs");exports.AreaChart=e.AreaChart,exports.BarChart=e.BarChart,exports.ChartCard=t.ChartCard,exports.ChartFrame=e.ChartFrame,exports.ChartLegend=e.ChartLegend,exports.ChartTooltipContent=e.ChartTooltipContent,exports.DonutChart=e.DonutChart,exports.LineChart=e.LineChart,exports.MetricTrend=e.MetricTrend,exports.ProgressCircle=n.ProgressCircle,exports.Sparkline=e.Sparkline;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { AreaChart as e, BarChart as t, ChartFrame as n, ChartLegend as r, ChartTooltipContent as i, DonutChart as a, LineChart as o, MetricTrend as s, Sparkline as c } from "./charts.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ChartCard as l } from "./chart-card.js";
|
|
3
|
+
import { ProgressCircle as u } from "./progress-circle.js";
|
|
4
|
+
export { e as AreaChart, t as BarChart, l as ChartCard, n as ChartFrame, r as ChartLegend, i as ChartTooltipContent, a as DonutChart, o as LineChart, s as MetricTrend, u as ProgressCircle, c as Sparkline };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../ui/button/index.cjs"),n=require("../ui/dialog/index.cjs"),r=require("../ui/command/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");function s({open:e,onOpenChange:s,groups:c,title:l=`Command menu`,triggerLabel:u=`Command`,placeholder:d=`Search commands...`}){let[f,p]=i.useState(!1),m=e??f,h=s??p;return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.Button,{type:`button`,variant:`outline`,leftIcon:(0,o.jsx)(a.SearchIcon,{className:`size-4`}),onClick:()=>h(!0),children:u}),(0,o.jsx)(n.Dialog,{open:m,onOpenChange:h,children:(0,o.jsxs)(n.DialogContent,{className:`overflow-hidden p-0`,children:[(0,o.jsx)(n.DialogHeader,{className:`border-b px-4 py-3`,children:(0,o.jsx)(n.DialogTitle,{children:l})}),(0,o.jsxs)(r.Command,{children:[(0,o.jsx)(r.CommandInput,{placeholder:d}),(0,o.jsxs)(r.CommandList,{children:[(0,o.jsx)(r.CommandEmpty,{children:`No command found.`}),c.map(e=>(0,o.jsx)(r.CommandGroup,{heading:e.label,children:e.items.map(e=>(0,o.jsxs)(r.CommandItem,{value:[e.id,e.label,e.description,...e.keywords??[]].filter(Boolean).join(` `),onSelect:()=>{e.onSelect?.(),h(!1)},children:[e.icon,(0,o.jsxs)(`span`,{className:`grid min-w-0 flex-1`,children:[(0,o.jsx)(`span`,{className:`truncate`,children:e.label}),e.description?(0,o.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e.description}):null]}),e.shortcut?(0,o.jsx)(r.CommandShortcut,{children:e.shortcut}):null]},e.id))},e.id))]})]})]})})]})}exports.AdvancedCommandMenu=s;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Button as e } from "../ui/button/index.js";
|
|
3
|
+
import { Dialog as t, DialogContent as n, DialogHeader as r, DialogTitle as i } from "../ui/dialog/index.js";
|
|
4
|
+
import { Command as a, CommandEmpty as o, CommandGroup as s, CommandInput as c, CommandItem as l, CommandList as u, CommandShortcut as d } from "../ui/command/index.js";
|
|
5
|
+
import * as f from "react";
|
|
6
|
+
import { SearchIcon as p } from "lucide-react";
|
|
7
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/command/advanced-command-menu.tsx
|
|
9
|
+
function _({ open: _, onOpenChange: v, groups: y, title: b = "Command menu", triggerLabel: x = "Command", placeholder: S = "Search commands..." }) {
|
|
10
|
+
let [C, w] = f.useState(!1), T = _ ?? C, E = v ?? w;
|
|
11
|
+
return /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(e, {
|
|
12
|
+
type: "button",
|
|
13
|
+
variant: "outline",
|
|
14
|
+
leftIcon: /* @__PURE__ */ h(p, { className: "size-4" }),
|
|
15
|
+
onClick: () => E(!0),
|
|
16
|
+
children: x
|
|
17
|
+
}), /* @__PURE__ */ h(t, {
|
|
18
|
+
open: T,
|
|
19
|
+
onOpenChange: E,
|
|
20
|
+
children: /* @__PURE__ */ g(n, {
|
|
21
|
+
className: "overflow-hidden p-0",
|
|
22
|
+
children: [/* @__PURE__ */ h(r, {
|
|
23
|
+
className: "border-b px-4 py-3",
|
|
24
|
+
children: /* @__PURE__ */ h(i, { children: b })
|
|
25
|
+
}), /* @__PURE__ */ g(a, { children: [/* @__PURE__ */ h(c, { placeholder: S }), /* @__PURE__ */ g(u, { children: [/* @__PURE__ */ h(o, { children: "No command found." }), y.map((e) => /* @__PURE__ */ h(s, {
|
|
26
|
+
heading: e.label,
|
|
27
|
+
children: e.items.map((e) => /* @__PURE__ */ g(l, {
|
|
28
|
+
value: [
|
|
29
|
+
e.id,
|
|
30
|
+
e.label,
|
|
31
|
+
e.description,
|
|
32
|
+
...e.keywords ?? []
|
|
33
|
+
].filter(Boolean).join(" "),
|
|
34
|
+
onSelect: () => {
|
|
35
|
+
e.onSelect?.(), E(!1);
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
e.icon,
|
|
39
|
+
/* @__PURE__ */ g("span", {
|
|
40
|
+
className: "grid min-w-0 flex-1",
|
|
41
|
+
children: [/* @__PURE__ */ h("span", {
|
|
42
|
+
className: "truncate",
|
|
43
|
+
children: e.label
|
|
44
|
+
}), e.description ? /* @__PURE__ */ h("span", {
|
|
45
|
+
className: "truncate text-xs text-muted-foreground",
|
|
46
|
+
children: e.description
|
|
47
|
+
}) : null]
|
|
48
|
+
}),
|
|
49
|
+
e.shortcut ? /* @__PURE__ */ h(d, { children: e.shortcut }) : null
|
|
50
|
+
]
|
|
51
|
+
}, e.id))
|
|
52
|
+
}, e.id))] })] })]
|
|
53
|
+
})
|
|
54
|
+
})] });
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { _ as AdvancedCommandMenu };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./command-palette.cjs");exports.
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./advanced-command-menu.cjs"),t=require("./command-palette.cjs");exports.AdvancedCommandMenu=e.AdvancedCommandMenu,exports.CommandPalette=t.CommandPalette,exports.useCommandPaletteShortcut=t.useCommandPaletteShortcut;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { AdvancedCommandMenu as e } from "./advanced-command-menu.js";
|
|
2
|
+
import { CommandPalette as t, useCommandPaletteShortcut as n } from "./command-palette.js";
|
|
3
|
+
export { e as AdvancedCommandMenu, t as CommandPalette, n as useCommandPaletteShortcut };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../ui/input/index.cjs"),r=require("../ui/table/index.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("react/jsx-runtime");function o({columns:e,rows:i,onRowsChange:o,className:s,...c}){let l=(e,t,n)=>{o?.(i.map((r,i)=>i===e?{...r,[t]:n}:r))};return(0,a.jsx)(`div`,{"data-slot":`data-grid`,className:t.cn(`overflow-hidden rounded-lg border`,s),...c,children:(0,a.jsxs)(r.Table,{children:[(0,a.jsx)(r.TableHeader,{children:(0,a.jsx)(r.TableRow,{children:e.map(e=>(0,a.jsx)(r.TableHead,{style:{width:e.width},children:e.header},e.key))})}),(0,a.jsx)(r.TableBody,{children:i.map((t,i)=>(0,a.jsx)(r.TableRow,{children:e.map(e=>{let o=t[e.key];return(0,a.jsx)(r.TableCell,{children:e.editable?(0,a.jsx)(n.Input,{value:String(o??``),onValueChange:t=>l(i,e.key,t)}):e.render?e.render(o,t,i):String(o??``)},e.key)})},i))})]})})}exports.DataGrid=o;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Input as t } from "../ui/input/index.js";
|
|
4
|
+
import { Table as n, TableBody as r, TableCell as i, TableHead as a, TableHeader as o, TableRow as s } from "../ui/table/index.js";
|
|
5
|
+
import "react";
|
|
6
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/data-table/data-grid.tsx
|
|
8
|
+
function u({ columns: u, rows: d, onRowsChange: f, className: p, ...m }) {
|
|
9
|
+
let h = (e, t, n) => {
|
|
10
|
+
f?.(d.map((r, i) => i === e ? {
|
|
11
|
+
...r,
|
|
12
|
+
[t]: n
|
|
13
|
+
} : r));
|
|
14
|
+
};
|
|
15
|
+
return /* @__PURE__ */ c("div", {
|
|
16
|
+
"data-slot": "data-grid",
|
|
17
|
+
className: e("overflow-hidden rounded-lg border", p),
|
|
18
|
+
...m,
|
|
19
|
+
children: /* @__PURE__ */ l(n, { children: [/* @__PURE__ */ c(o, { children: /* @__PURE__ */ c(s, { children: u.map((e) => /* @__PURE__ */ c(a, {
|
|
20
|
+
style: { width: e.width },
|
|
21
|
+
children: e.header
|
|
22
|
+
}, e.key)) }) }), /* @__PURE__ */ c(r, { children: d.map((e, n) => /* @__PURE__ */ c(s, { children: u.map((r) => {
|
|
23
|
+
let a = e[r.key];
|
|
24
|
+
return /* @__PURE__ */ c(i, { children: r.editable ? /* @__PURE__ */ c(t, {
|
|
25
|
+
value: String(a ?? ""),
|
|
26
|
+
onValueChange: (e) => h(n, r.key, e)
|
|
27
|
+
}) : r.render ? r.render(a, e, n) : String(a ?? "") }, r.key);
|
|
28
|
+
}) }, n)) })] })
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
export { u as DataGrid };
|