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
|
@@ -1,51 +1,107 @@
|
|
|
1
1
|
import { cn as e } from "../../lib/utils.js";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { CalendarClockIcon as t, ClockIcon as n, XIcon as r } from "lucide-react";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/inputs/time-picker.tsx
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
className: e("grid gap-1.5 text-sm",
|
|
8
|
-
children: [
|
|
6
|
+
function o({ label: t, className: n, children: r }) {
|
|
7
|
+
return /* @__PURE__ */ a("label", {
|
|
8
|
+
className: e("grid gap-1.5 text-sm", n),
|
|
9
|
+
children: [t && /* @__PURE__ */ i("span", {
|
|
9
10
|
className: "font-medium",
|
|
10
|
-
children:
|
|
11
|
-
}),
|
|
11
|
+
children: t
|
|
12
|
+
}), r]
|
|
12
13
|
});
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
function s(e, t, n) {
|
|
16
|
+
e.preventDefault(), e.stopPropagation(), t?.({
|
|
17
|
+
target: { value: "" },
|
|
18
|
+
currentTarget: { value: "" }
|
|
19
|
+
}), n?.();
|
|
20
|
+
}
|
|
21
|
+
function c({ label: t, className: c, clearable: l = !1, onClear: u, value: d, defaultValue: f, disabled: p, onChange: m, ...h }) {
|
|
22
|
+
let g = d === void 0 ? f !== void 0 && String(f).length > 0 : String(d).length > 0;
|
|
23
|
+
return /* @__PURE__ */ i(o, {
|
|
24
|
+
label: t,
|
|
25
|
+
children: /* @__PURE__ */ a("span", {
|
|
26
|
+
className: "relative grid",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ i(n, { className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
29
|
+
/* @__PURE__ */ i("input", {
|
|
30
|
+
type: "time",
|
|
31
|
+
value: d,
|
|
32
|
+
defaultValue: f,
|
|
33
|
+
disabled: p,
|
|
34
|
+
onChange: m,
|
|
35
|
+
className: e("h-11 rounded-[var(--aui-control-radius,var(--radius-md))] border border-input/82 bg-background px-10 text-sm tabular-nums outline-none transition-[border-color,box-shadow] hover:border-ring/30 focus-visible:border-ring focus-visible:ring-4 focus-visible:ring-ring/16 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground", c),
|
|
36
|
+
...h
|
|
37
|
+
}),
|
|
38
|
+
l && g && !p ? /* @__PURE__ */ i("button", {
|
|
39
|
+
type: "button",
|
|
40
|
+
"aria-label": "Clear time",
|
|
41
|
+
className: "absolute right-2 top-1/2 grid size-7 -translate-y-1/2 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
42
|
+
onClick: (e) => s(e, m, u),
|
|
43
|
+
children: /* @__PURE__ */ i(r, { className: "size-3.5" })
|
|
44
|
+
}) : null
|
|
45
|
+
]
|
|
21
46
|
})
|
|
22
47
|
});
|
|
23
48
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
49
|
+
function l({ label: n, className: c, clearable: l = !1, onClear: u, value: d, defaultValue: f, disabled: p, onChange: m, ...h }) {
|
|
50
|
+
let g = d === void 0 ? f !== void 0 && String(f).length > 0 : String(d).length > 0;
|
|
51
|
+
return /* @__PURE__ */ i(o, {
|
|
26
52
|
label: n,
|
|
27
|
-
children: /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
53
|
+
children: /* @__PURE__ */ a("span", {
|
|
54
|
+
className: "relative grid",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ i(t, { className: "pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }),
|
|
57
|
+
/* @__PURE__ */ i("input", {
|
|
58
|
+
type: "datetime-local",
|
|
59
|
+
value: d,
|
|
60
|
+
defaultValue: f,
|
|
61
|
+
disabled: p,
|
|
62
|
+
onChange: m,
|
|
63
|
+
className: e("h-11 rounded-[var(--aui-control-radius,var(--radius-md))] border border-input/82 bg-background px-10 text-sm tabular-nums outline-none transition-[border-color,box-shadow] hover:border-ring/30 focus-visible:border-ring focus-visible:ring-4 focus-visible:ring-ring/16 disabled:cursor-not-allowed disabled:bg-muted disabled:text-muted-foreground", c),
|
|
64
|
+
...h
|
|
65
|
+
}),
|
|
66
|
+
l && g && !p ? /* @__PURE__ */ i("button", {
|
|
67
|
+
type: "button",
|
|
68
|
+
"aria-label": "Clear date and time",
|
|
69
|
+
className: "absolute right-2 top-1/2 grid size-7 -translate-y-1/2 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
70
|
+
onClick: (e) => s(e, m, u),
|
|
71
|
+
children: /* @__PURE__ */ i(r, { className: "size-3.5" })
|
|
72
|
+
}) : null
|
|
73
|
+
]
|
|
31
74
|
})
|
|
32
75
|
});
|
|
33
76
|
}
|
|
34
|
-
function
|
|
35
|
-
return /* @__PURE__ */
|
|
77
|
+
function u({ from: t, to: n, onFromChange: r, onToChange: o, disabled: s, labels: l, className: u, ...d }) {
|
|
78
|
+
return /* @__PURE__ */ a("div", {
|
|
36
79
|
"data-slot": "time-range-picker",
|
|
37
|
-
className: e("grid gap-2 sm:grid-cols-
|
|
38
|
-
...
|
|
39
|
-
children: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
80
|
+
className: e("grid gap-2 sm:grid-cols-[1fr_auto_1fr] sm:items-end", u),
|
|
81
|
+
...d,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ i(c, {
|
|
84
|
+
label: l?.from,
|
|
85
|
+
value: t,
|
|
86
|
+
clearable: !0,
|
|
87
|
+
disabled: s,
|
|
88
|
+
onChange: (e) => r?.(e.target.value),
|
|
89
|
+
onClear: () => r?.("")
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ i("span", {
|
|
92
|
+
className: "hidden h-11 items-center text-sm text-muted-foreground sm:inline-flex",
|
|
93
|
+
children: "to"
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ i(c, {
|
|
96
|
+
label: l?.to,
|
|
97
|
+
value: n,
|
|
98
|
+
clearable: !0,
|
|
99
|
+
disabled: s,
|
|
100
|
+
onChange: (e) => o?.(e.target.value),
|
|
101
|
+
onClear: () => o?.("")
|
|
102
|
+
})
|
|
103
|
+
]
|
|
48
104
|
});
|
|
49
105
|
}
|
|
50
106
|
//#endregion
|
|
51
|
-
export {
|
|
107
|
+
export { l as DateTimePicker, c as TimePicker, u as TimeRangePicker };
|
|
@@ -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("../ui/input/index.cjs"),a=require("../ui/scroll-box/index.cjs");let o=require("react");o=e.__toESM(o,1);let s=require("lucide-react"),c=require("react/jsx-runtime");function l({items:e,selectedId:l,onSelect:u,onOpen:d,searchValue:f,onSearchChange:p,actions:m,className:h,...g}){let[_,v]=o.useState(``),y=f??_,b=e.filter(e=>e.name.toLowerCase().includes(y.toLowerCase()));return(0,c.jsxs)(`div`,{"data-slot":`file-manager`,className:t.cn(`grid min-w-0 gap-3 rounded-lg border bg-card p-3`,h),...g,children:[(0,c.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,c.jsx)(i.Input,{kind:`search`,placeholder:`Search files...`,value:y,onValueChange:e=>{v(e),p?.(e)},className:`max-w-sm`}),m]}),(0,c.jsx)(a.ScrollBox,{className:`max-h-[420px]`,children:(0,c.jsx)(`div`,{className:`grid gap-1`,children:b.map(e=>(0,c.jsxs)(`button`,{type:`button`,"data-selected":l===e.id||void 0,className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-md px-3 py-2 text-left transition hover:bg-muted/60 data-[selected=true]:bg-muted`,onClick:()=>u?.(e),onDoubleClick:()=>d?.(e),children:[e.type===`folder`?(0,c.jsx)(s.FolderIcon,{className:`size-4 text-primary`}):(0,c.jsx)(s.FileIcon,{className:`size-4 text-muted-foreground`}),(0,c.jsxs)(`span`,{className:`min-w-0`,children:[(0,c.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,c.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.owner??`Shared`,` `,e.size?`- ${e.size}`:``]})]}),(0,c.jsxs)(`span`,{className:`flex items-center gap-2`,children:[e.status?(0,c.jsx)(r.Badge,{label:e.status,variant:`soft`,status:`info`}):null,(0,c.jsx)(n.Button,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`File actions`,children:(0,c.jsx)(s.MoreHorizontalIcon,{})})]})]},e.id))})})]})}exports.FileManager=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 { Input as r } from "../ui/input/index.js";
|
|
6
|
+
import { ScrollBox as i } from "../ui/scroll-box/index.js";
|
|
7
|
+
import * as a from "react";
|
|
8
|
+
import { FileIcon as o, FolderIcon as s, MoreHorizontalIcon as c } from "lucide-react";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/modern/file-manager.tsx
|
|
11
|
+
function d({ items: d, selectedId: f, onSelect: p, onOpen: m, searchValue: h, onSearchChange: g, actions: _, className: v, ...y }) {
|
|
12
|
+
let [b, x] = a.useState(""), S = h ?? b, C = d.filter((e) => e.name.toLowerCase().includes(S.toLowerCase()));
|
|
13
|
+
return /* @__PURE__ */ u("div", {
|
|
14
|
+
"data-slot": "file-manager",
|
|
15
|
+
className: e("grid min-w-0 gap-3 rounded-lg border bg-card p-3", v),
|
|
16
|
+
...y,
|
|
17
|
+
children: [/* @__PURE__ */ u("div", {
|
|
18
|
+
className: "flex flex-wrap items-center justify-between gap-2",
|
|
19
|
+
children: [/* @__PURE__ */ l(r, {
|
|
20
|
+
kind: "search",
|
|
21
|
+
placeholder: "Search files...",
|
|
22
|
+
value: S,
|
|
23
|
+
onValueChange: (e) => {
|
|
24
|
+
x(e), g?.(e);
|
|
25
|
+
},
|
|
26
|
+
className: "max-w-sm"
|
|
27
|
+
}), _]
|
|
28
|
+
}), /* @__PURE__ */ l(i, {
|
|
29
|
+
className: "max-h-[420px]",
|
|
30
|
+
children: /* @__PURE__ */ l("div", {
|
|
31
|
+
className: "grid gap-1",
|
|
32
|
+
children: C.map((e) => /* @__PURE__ */ u("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
"data-selected": f === e.id || void 0,
|
|
35
|
+
className: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-md px-3 py-2 text-left transition hover:bg-muted/60 data-[selected=true]:bg-muted",
|
|
36
|
+
onClick: () => p?.(e),
|
|
37
|
+
onDoubleClick: () => m?.(e),
|
|
38
|
+
children: [
|
|
39
|
+
e.type === "folder" ? /* @__PURE__ */ l(s, { className: "size-4 text-primary" }) : /* @__PURE__ */ l(o, { className: "size-4 text-muted-foreground" }),
|
|
40
|
+
/* @__PURE__ */ u("span", {
|
|
41
|
+
className: "min-w-0",
|
|
42
|
+
children: [/* @__PURE__ */ l("span", {
|
|
43
|
+
className: "block truncate text-sm font-medium",
|
|
44
|
+
children: e.name
|
|
45
|
+
}), /* @__PURE__ */ u("span", {
|
|
46
|
+
className: "text-xs text-muted-foreground",
|
|
47
|
+
children: [
|
|
48
|
+
e.owner ?? "Shared",
|
|
49
|
+
" ",
|
|
50
|
+
e.size ? `- ${e.size}` : ""
|
|
51
|
+
]
|
|
52
|
+
})]
|
|
53
|
+
}),
|
|
54
|
+
/* @__PURE__ */ u("span", {
|
|
55
|
+
className: "flex items-center gap-2",
|
|
56
|
+
children: [e.status ? /* @__PURE__ */ l(n, {
|
|
57
|
+
label: e.status,
|
|
58
|
+
variant: "soft",
|
|
59
|
+
status: "info"
|
|
60
|
+
}) : null, /* @__PURE__ */ l(t, {
|
|
61
|
+
type: "button",
|
|
62
|
+
variant: "ghost",
|
|
63
|
+
size: "icon-xs",
|
|
64
|
+
"aria-label": "File actions",
|
|
65
|
+
children: /* @__PURE__ */ l(c, {})
|
|
66
|
+
})]
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}, e.id))
|
|
70
|
+
})
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { d as FileManager };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./calendar-scheduler.cjs"),t=require("./dual-list-picker.cjs"),n=require("./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./calendar-scheduler.cjs"),t=require("./dual-list-picker.cjs"),n=require("./file-manager.cjs"),r=require("./resizable-panel.cjs"),i=require("./rich-text-editor.cjs"),a=require("./map.cjs"),o=require("./media-player.cjs"),s=require("./spreadsheet.cjs");exports.CalendarScheduler=e.CalendarScheduler,exports.DualListPicker=t.DualListPicker,exports.EditorToolbar=i.EditorToolbar,exports.FileManager=n.FileManager,exports.MapView=a.MapView,exports.MediaPlayer=o.MediaPlayer,exports.ResizableHandle=r.ResizableHandle,exports.ResizablePanel=r.ResizablePanel,exports.ResizablePanelGroup=r.ResizablePanelGroup,exports.RichTextEditor=i.RichTextEditor,exports.Spreadsheet=s.Spreadsheet;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { CalendarScheduler as e } from "./calendar-scheduler.js";
|
|
2
2
|
import { DualListPicker as t } from "./dual-list-picker.js";
|
|
3
|
-
import {
|
|
4
|
-
import { ResizableHandle as
|
|
5
|
-
import { EditorToolbar as
|
|
6
|
-
|
|
3
|
+
import { FileManager as n } from "./file-manager.js";
|
|
4
|
+
import { ResizableHandle as r, ResizablePanel as i, ResizablePanelGroup as a } from "./resizable-panel.js";
|
|
5
|
+
import { EditorToolbar as o, RichTextEditor as s } from "./rich-text-editor.js";
|
|
6
|
+
import { MapView as c } from "./map.js";
|
|
7
|
+
import { MediaPlayer as l } from "./media-player.js";
|
|
8
|
+
import { Spreadsheet as u } from "./spreadsheet.js";
|
|
9
|
+
export { e as CalendarScheduler, t as DualListPicker, o as EditorToolbar, n as FileManager, c as MapView, l as MediaPlayer, r as ResizableHandle, i as ResizablePanel, a as ResizablePanelGroup, s as RichTextEditor, u as Spreadsheet };
|
|
@@ -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");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");function s(e){return Math.max(1,Math.min(19,e))}function c(e){return Number.isFinite(e)?e:0}function l(e,t,n){let r=c(n?.latitude??e.latitude),i=c(n?.longitude??e.longitude),a=.012*(20-s(t));return`https://www.openstreetmap.org/export/embed.html?bbox=${[i-a,r-a,i+a,r+a].map(e=>e.toFixed(6)).join(`%2C`)}&layer=mapnik&marker=${r.toFixed(6)}%2C${i.toFixed(6)}`}function u(e,t,n){let r=c(n?.latitude??e.latitude),i=c(n?.longitude??e.longitude);return`https://www.openstreetmap.org/?mlat=${r.toFixed(6)}&mlon=${i.toFixed(6)}#map=${s(t)}/${r.toFixed(6)}/${i.toFixed(6)}`}function d({center:e={latitude:41.311081,longitude:69.240562},zoom:c=13,markers:d=[],title:f=`Map`,description:p,height:m=420,showMarkerList:h=!0,showControls:g=!0,iframeTitle:_=`Interactive map`,mapUrl:v,onMarkerSelect:y,selectedMarkerKey:b,defaultSelectedMarkerKey:x,className:S,...C}){let[w,T]=i.useState(s(c)),[E,D]=i.useState(x??d[0]?.key),O=b??E,k=d.find(e=>e.key===O),A=v??l(e,w,k),j=u(e,w,k);i.useEffect(()=>{T(s(c))},[c]);let M=e=>{b===void 0&&D(e.key),y?.(e)};return(0,o.jsxs)(`section`,{"data-slot":`map-view`,className:t.cn(`grid min-w-0 gap-3 rounded-lg border bg-card p-3 shadow-sm`,S),...C,children:[(0,o.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,o.jsxs)(`div`,{className:`min-w-0`,children:[f?(0,o.jsx)(`h3`,{className:`text-base font-semibold tracking-tight`,children:f}):null,p?(0,o.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:p}):null]}),g?(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`outline`,iconOnly:!0,"aria-label":`Zoom out`,onClick:()=>T(e=>s(e-1)),children:(0,o.jsx)(a.MinusIcon,{})}),(0,o.jsxs)(r.Badge,{variant:`outline`,tone:`muted`,children:[w,`x`]}),(0,o.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`outline`,iconOnly:!0,"aria-label":`Zoom in`,onClick:()=>T(e=>s(e+1)),children:(0,o.jsx)(a.PlusIcon,{})}),(0,o.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`outline`,iconOnly:!0,"aria-label":`Open in OpenStreetMap`,onClick:()=>window.open(j,`_blank`,`noopener,noreferrer`),children:(0,o.jsx)(a.ExternalLinkIcon,{})})]}):null]}),(0,o.jsxs)(`div`,{className:t.cn(`grid gap-3`,h&&d.length?`lg:grid-cols-[minmax(0,1fr)_18rem]`:``),children:[(0,o.jsxs)(`div`,{className:`relative overflow-hidden rounded-lg border bg-muted`,style:{height:m},children:[(0,o.jsx)(`iframe`,{title:_,src:A,className:`absolute inset-0 size-full border-0`,loading:`lazy`,referrerPolicy:`no-referrer-when-downgrade`}),k?(0,o.jsxs)(`div`,{className:`absolute left-3 top-3 max-w-[calc(100%-1.5rem)] rounded-lg border bg-background/95 p-3 text-sm shadow-lg backdrop-blur`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-2 font-medium`,children:[(0,o.jsx)(a.LocateFixedIcon,{className:`size-4 text-primary`}),k.label]}),k.description?(0,o.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:k.description}):null]}):null]}),h&&d.length?(0,o.jsx)(`div`,{"data-slot":`map-marker-list`,className:`grid content-start gap-2`,children:d.map(e=>{let t=e.key===O;return(0,o.jsxs)(`button`,{type:`button`,"aria-pressed":t,className:`grid gap-1 rounded-lg border bg-background p-3 text-left text-sm outline-none transition hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring aria-pressed:border-primary aria-pressed:bg-primary/5`,onClick:()=>M(e),children:[(0,o.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,o.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 font-medium`,children:[(0,o.jsx)(a.MapPinIcon,{className:`size-4 shrink-0 text-primary`}),(0,o.jsx)(`span`,{className:`truncate`,children:e.label})]}),(0,o.jsx)(r.Badge,{size:`sm`,tone:e.tone??`muted`,showDot:!0,children:t?`selected`:`marker`})]}),e.description?(0,o.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.description}):null,(0,o.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[e.latitude.toFixed(4),`, `,e.longitude.toFixed(4)]})]},e.key)})}):null]})]})}exports.MapView=d;
|
|
@@ -0,0 +1,158 @@
|
|
|
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 * as r from "react";
|
|
6
|
+
import { ExternalLinkIcon as i, LocateFixedIcon as a, MapPinIcon as o, MinusIcon as s, PlusIcon as c } from "lucide-react";
|
|
7
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/modern/map.tsx
|
|
9
|
+
function d(e) {
|
|
10
|
+
return Math.max(1, Math.min(19, e));
|
|
11
|
+
}
|
|
12
|
+
function f(e) {
|
|
13
|
+
return Number.isFinite(e) ? e : 0;
|
|
14
|
+
}
|
|
15
|
+
function p(e, t, n) {
|
|
16
|
+
let r = f(n?.latitude ?? e.latitude), i = f(n?.longitude ?? e.longitude), a = .012 * (20 - d(t));
|
|
17
|
+
return `https://www.openstreetmap.org/export/embed.html?bbox=${[
|
|
18
|
+
i - a,
|
|
19
|
+
r - a,
|
|
20
|
+
i + a,
|
|
21
|
+
r + a
|
|
22
|
+
].map((e) => e.toFixed(6)).join("%2C")}&layer=mapnik&marker=${r.toFixed(6)}%2C${i.toFixed(6)}`;
|
|
23
|
+
}
|
|
24
|
+
function m(e, t, n) {
|
|
25
|
+
let r = f(n?.latitude ?? e.latitude), i = f(n?.longitude ?? e.longitude);
|
|
26
|
+
return `https://www.openstreetmap.org/?mlat=${r.toFixed(6)}&mlon=${i.toFixed(6)}#map=${d(t)}/${r.toFixed(6)}/${i.toFixed(6)}`;
|
|
27
|
+
}
|
|
28
|
+
function h({ center: f = {
|
|
29
|
+
latitude: 41.311081,
|
|
30
|
+
longitude: 69.240562
|
|
31
|
+
}, zoom: h = 13, markers: g = [], title: _ = "Map", description: v, height: y = 420, showMarkerList: b = !0, showControls: x = !0, iframeTitle: S = "Interactive map", mapUrl: C, onMarkerSelect: w, selectedMarkerKey: T, defaultSelectedMarkerKey: E, className: D, ...O }) {
|
|
32
|
+
let [k, A] = r.useState(d(h)), [j, M] = r.useState(E ?? g[0]?.key), N = T ?? j, P = g.find((e) => e.key === N), F = C ?? p(f, k, P), I = m(f, k, P);
|
|
33
|
+
r.useEffect(() => {
|
|
34
|
+
A(d(h));
|
|
35
|
+
}, [h]);
|
|
36
|
+
let L = (e) => {
|
|
37
|
+
T === void 0 && M(e.key), w?.(e);
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ u("section", {
|
|
40
|
+
"data-slot": "map-view",
|
|
41
|
+
className: e("grid min-w-0 gap-3 rounded-lg border bg-card p-3 shadow-sm", D),
|
|
42
|
+
...O,
|
|
43
|
+
children: [/* @__PURE__ */ u("div", {
|
|
44
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
45
|
+
children: [/* @__PURE__ */ u("div", {
|
|
46
|
+
className: "min-w-0",
|
|
47
|
+
children: [_ ? /* @__PURE__ */ l("h3", {
|
|
48
|
+
className: "text-base font-semibold tracking-tight",
|
|
49
|
+
children: _
|
|
50
|
+
}) : null, v ? /* @__PURE__ */ l("p", {
|
|
51
|
+
className: "mt-1 text-sm text-muted-foreground",
|
|
52
|
+
children: v
|
|
53
|
+
}) : null]
|
|
54
|
+
}), x ? /* @__PURE__ */ u("div", {
|
|
55
|
+
className: "flex items-center gap-1",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ l(t, {
|
|
58
|
+
type: "button",
|
|
59
|
+
size: "icon-sm",
|
|
60
|
+
variant: "outline",
|
|
61
|
+
iconOnly: !0,
|
|
62
|
+
"aria-label": "Zoom out",
|
|
63
|
+
onClick: () => A((e) => d(e - 1)),
|
|
64
|
+
children: /* @__PURE__ */ l(s, {})
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ u(n, {
|
|
67
|
+
variant: "outline",
|
|
68
|
+
tone: "muted",
|
|
69
|
+
children: [k, "x"]
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ l(t, {
|
|
72
|
+
type: "button",
|
|
73
|
+
size: "icon-sm",
|
|
74
|
+
variant: "outline",
|
|
75
|
+
iconOnly: !0,
|
|
76
|
+
"aria-label": "Zoom in",
|
|
77
|
+
onClick: () => A((e) => d(e + 1)),
|
|
78
|
+
children: /* @__PURE__ */ l(c, {})
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ l(t, {
|
|
81
|
+
type: "button",
|
|
82
|
+
size: "icon-sm",
|
|
83
|
+
variant: "outline",
|
|
84
|
+
iconOnly: !0,
|
|
85
|
+
"aria-label": "Open in OpenStreetMap",
|
|
86
|
+
onClick: () => window.open(I, "_blank", "noopener,noreferrer"),
|
|
87
|
+
children: /* @__PURE__ */ l(i, {})
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
}) : null]
|
|
91
|
+
}), /* @__PURE__ */ u("div", {
|
|
92
|
+
className: e("grid gap-3", b && g.length ? "lg:grid-cols-[minmax(0,1fr)_18rem]" : ""),
|
|
93
|
+
children: [/* @__PURE__ */ u("div", {
|
|
94
|
+
className: "relative overflow-hidden rounded-lg border bg-muted",
|
|
95
|
+
style: { height: y },
|
|
96
|
+
children: [/* @__PURE__ */ l("iframe", {
|
|
97
|
+
title: S,
|
|
98
|
+
src: F,
|
|
99
|
+
className: "absolute inset-0 size-full border-0",
|
|
100
|
+
loading: "lazy",
|
|
101
|
+
referrerPolicy: "no-referrer-when-downgrade"
|
|
102
|
+
}), P ? /* @__PURE__ */ u("div", {
|
|
103
|
+
className: "absolute left-3 top-3 max-w-[calc(100%-1.5rem)] rounded-lg border bg-background/95 p-3 text-sm shadow-lg backdrop-blur",
|
|
104
|
+
children: [/* @__PURE__ */ u("div", {
|
|
105
|
+
className: "flex items-center gap-2 font-medium",
|
|
106
|
+
children: [/* @__PURE__ */ l(a, { className: "size-4 text-primary" }), P.label]
|
|
107
|
+
}), P.description ? /* @__PURE__ */ l("p", {
|
|
108
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
109
|
+
children: P.description
|
|
110
|
+
}) : null]
|
|
111
|
+
}) : null]
|
|
112
|
+
}), b && g.length ? /* @__PURE__ */ l("div", {
|
|
113
|
+
"data-slot": "map-marker-list",
|
|
114
|
+
className: "grid content-start gap-2",
|
|
115
|
+
children: g.map((e) => {
|
|
116
|
+
let t = e.key === N;
|
|
117
|
+
return /* @__PURE__ */ u("button", {
|
|
118
|
+
type: "button",
|
|
119
|
+
"aria-pressed": t,
|
|
120
|
+
className: "grid gap-1 rounded-lg border bg-background p-3 text-left text-sm outline-none transition hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring aria-pressed:border-primary aria-pressed:bg-primary/5",
|
|
121
|
+
onClick: () => L(e),
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ u("span", {
|
|
124
|
+
className: "flex items-center justify-between gap-2",
|
|
125
|
+
children: [/* @__PURE__ */ u("span", {
|
|
126
|
+
className: "flex min-w-0 items-center gap-2 font-medium",
|
|
127
|
+
children: [/* @__PURE__ */ l(o, { className: "size-4 shrink-0 text-primary" }), /* @__PURE__ */ l("span", {
|
|
128
|
+
className: "truncate",
|
|
129
|
+
children: e.label
|
|
130
|
+
})]
|
|
131
|
+
}), /* @__PURE__ */ l(n, {
|
|
132
|
+
size: "sm",
|
|
133
|
+
tone: e.tone ?? "muted",
|
|
134
|
+
showDot: !0,
|
|
135
|
+
children: t ? "selected" : "marker"
|
|
136
|
+
})]
|
|
137
|
+
}),
|
|
138
|
+
e.description ? /* @__PURE__ */ l("span", {
|
|
139
|
+
className: "text-xs text-muted-foreground",
|
|
140
|
+
children: e.description
|
|
141
|
+
}) : null,
|
|
142
|
+
/* @__PURE__ */ u("span", {
|
|
143
|
+
className: "text-[11px] text-muted-foreground",
|
|
144
|
+
children: [
|
|
145
|
+
e.latitude.toFixed(4),
|
|
146
|
+
", ",
|
|
147
|
+
e.longitude.toFixed(4)
|
|
148
|
+
]
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
}, e.key);
|
|
152
|
+
})
|
|
153
|
+
}) : null]
|
|
154
|
+
})]
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
//#endregion
|
|
158
|
+
export { h as MapView };
|
|
@@ -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");let i=require("react");i=e.__toESM(i,1);let a=require("lucide-react"),o=require("react/jsx-runtime");function s(e){return!Number.isFinite(e)||e<0?`0:00`:`${Math.floor(e/60)}:${Math.floor(e%60).toString().padStart(2,`0`)}`}function c(e){return e===`video`?`aspect-video`:e===`square`?`aspect-square`:e===`wide`?`aspect-[21/9]`:``}function l({src:e,title:l,description:u,tracks:d=[],actions:f,aspectRatio:p=`video`,showMeta:m=!0,poster:h,autoPlay:g,muted:_,loop:v,playsInline:y=!0,preload:b=`metadata`,onTimeChange:x,onVolumeValueChange:S,className:C,...w}){let T=i.useRef(null),[E,D]=i.useState(!!g),[O,k]=i.useState(0),[A,j]=i.useState(0),[M,N]=i.useState(1),[P,F]=i.useState(!!_),[I,L]=i.useState(!1),R=i.useCallback(()=>{let e=T.current;e&&(D(!e.paused),k(e.duration||0),j(e.currentTime||0),N(e.volume),F(e.muted),x?.(e.currentTime||0,e.duration||0))},[x]),z=async()=>{let e=T.current;e&&(e.paused?await e.play():e.pause(),R())},B=e=>{let t=T.current;t&&(t.currentTime=e,j(e),x?.(e,O))},V=e=>{let t=T.current,n=Math.max(0,Math.min(1,e));t&&(t.volume=n,t.muted=n===0?!0:P),N(n);let r=n===0?!0:P;F(r),S?.(n,r)},H=()=>{let e=T.current,t=!P;e&&(e.muted=t),F(t),S?.(M,t)},U=P||M===0?a.VolumeXIcon:M<.6?a.Volume1Icon:a.Volume2Icon;return(0,o.jsxs)(`section`,{"data-slot":`media-player`,className:t.cn(`overflow-hidden rounded-lg border bg-card shadow-sm`,C),children:[(0,o.jsxs)(`div`,{className:t.cn(`relative bg-black`,c(p)),style:[`video`,`square`,`wide`].includes(String(p))?void 0:{aspectRatio:String(p)},children:[(0,o.jsx)(`video`,{ref:T,src:e,poster:h,autoPlay:g,muted:P,loop:v,playsInline:y,preload:b,className:`size-full object-cover`,onLoadedMetadata:()=>{L(!0),R()},onPlay:()=>D(!0),onPause:()=>D(!1),onTimeUpdate:R,onVolumeChange:R,...w,children:d.map(e=>(0,o.jsx)(`track`,{...e},`${e.src}-${e.srcLang??``}`))}),(0,o.jsx)(`button`,{type:`button`,"aria-label":E?`Pause media`:`Play media`,className:`absolute inset-0 grid place-items-center bg-black/0 text-white opacity-0 transition hover:bg-black/20 hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>void z(),children:(0,o.jsx)(`span`,{className:`grid size-14 place-items-center rounded-full bg-black/55 backdrop-blur`,children:E?(0,o.jsx)(a.PauseIcon,{className:`size-6`}):(0,o.jsx)(a.PlayIcon,{className:`size-6 translate-x-0.5`})})})]}),(0,o.jsxs)(`div`,{className:`grid gap-3 p-3`,children:[m&&(l||u||f)?(0,o.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,o.jsxs)(`div`,{className:`min-w-0`,children:[l?(0,o.jsx)(`h3`,{className:`truncate text-sm font-semibold`,children:l}):null,u?(0,o.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:u}):null]}),(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[I?null:(0,o.jsx)(r.Badge,{tone:`muted`,variant:`soft`,children:`loading`}),f]})]}):null,(0,o.jsxs)(`div`,{className:`grid gap-2`,children:[(0,o.jsx)(`input`,{"aria-label":`Media progress`,type:`range`,min:0,max:O||0,step:.1,value:Math.min(A,O||A),onChange:e=>B(Number(e.target.value)),className:`h-2 w-full cursor-pointer accent-primary`}),(0,o.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,o.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,o.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`outline`,iconOnly:!0,"aria-label":E?`Pause`:`Play`,onClick:()=>void z(),children:E?(0,o.jsx)(a.PauseIcon,{}):(0,o.jsx)(a.PlayIcon,{})}),(0,o.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`ghost`,iconOnly:!0,"aria-label":`Restart`,onClick:()=>B(0),children:(0,o.jsx)(a.RotateCcwIcon,{})}),(0,o.jsxs)(`span`,{className:`min-w-20 text-xs tabular-nums text-muted-foreground`,children:[s(A),` / `,s(O)]})]}),(0,o.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,o.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`ghost`,iconOnly:!0,"aria-label":P?`Unmute`:`Mute`,onClick:H,children:(0,o.jsx)(U,{})}),(0,o.jsx)(`input`,{"aria-label":`Volume`,type:`range`,min:0,max:1,step:.01,value:P?0:M,onChange:e=>V(Number(e.target.value)),className:`h-2 w-24 cursor-pointer accent-primary`}),(0,o.jsx)(n.Button,{type:`button`,size:`icon-sm`,variant:`ghost`,iconOnly:!0,"aria-label":`Fullscreen`,onClick:()=>T.current?.requestFullscreen?.(),children:(0,o.jsx)(a.MaximizeIcon,{})})]})]})]})]})]})}exports.MediaPlayer=l;
|
|
@@ -0,0 +1,176 @@
|
|
|
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 * as r from "react";
|
|
6
|
+
import { MaximizeIcon as i, PauseIcon as a, PlayIcon as o, RotateCcwIcon as s, Volume1Icon as c, Volume2Icon as l, VolumeXIcon as u } from "lucide-react";
|
|
7
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/modern/media-player.tsx
|
|
9
|
+
function p(e) {
|
|
10
|
+
return !Number.isFinite(e) || e < 0 ? "0:00" : `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
11
|
+
}
|
|
12
|
+
function m(e) {
|
|
13
|
+
return e === "video" ? "aspect-video" : e === "square" ? "aspect-square" : e === "wide" ? "aspect-[21/9]" : "";
|
|
14
|
+
}
|
|
15
|
+
function h({ src: h, title: g, description: _, tracks: v = [], actions: y, aspectRatio: b = "video", showMeta: x = !0, poster: S, autoPlay: C, muted: w, loop: T, playsInline: E = !0, preload: D = "metadata", onTimeChange: O, onVolumeValueChange: k, className: A, ...j }) {
|
|
16
|
+
let M = r.useRef(null), [N, P] = r.useState(!!C), [F, I] = r.useState(0), [L, R] = r.useState(0), [z, B] = r.useState(1), [V, H] = r.useState(!!w), [U, W] = r.useState(!1), G = r.useCallback(() => {
|
|
17
|
+
let e = M.current;
|
|
18
|
+
e && (P(!e.paused), I(e.duration || 0), R(e.currentTime || 0), B(e.volume), H(e.muted), O?.(e.currentTime || 0, e.duration || 0));
|
|
19
|
+
}, [O]), K = async () => {
|
|
20
|
+
let e = M.current;
|
|
21
|
+
e && (e.paused ? await e.play() : e.pause(), G());
|
|
22
|
+
}, q = (e) => {
|
|
23
|
+
let t = M.current;
|
|
24
|
+
t && (t.currentTime = e, R(e), O?.(e, F));
|
|
25
|
+
}, J = (e) => {
|
|
26
|
+
let t = M.current, n = Math.max(0, Math.min(1, e));
|
|
27
|
+
t && (t.volume = n, t.muted = n === 0 ? !0 : V), B(n);
|
|
28
|
+
let r = n === 0 ? !0 : V;
|
|
29
|
+
H(r), k?.(n, r);
|
|
30
|
+
}, Y = () => {
|
|
31
|
+
let e = M.current, t = !V;
|
|
32
|
+
e && (e.muted = t), H(t), k?.(z, t);
|
|
33
|
+
}, X = V || z === 0 ? u : z < .6 ? c : l;
|
|
34
|
+
return /* @__PURE__ */ f("section", {
|
|
35
|
+
"data-slot": "media-player",
|
|
36
|
+
className: e("overflow-hidden rounded-lg border bg-card shadow-sm", A),
|
|
37
|
+
children: [/* @__PURE__ */ f("div", {
|
|
38
|
+
className: e("relative bg-black", m(b)),
|
|
39
|
+
style: [
|
|
40
|
+
"video",
|
|
41
|
+
"square",
|
|
42
|
+
"wide"
|
|
43
|
+
].includes(String(b)) ? void 0 : { aspectRatio: String(b) },
|
|
44
|
+
children: [/* @__PURE__ */ d("video", {
|
|
45
|
+
ref: M,
|
|
46
|
+
src: h,
|
|
47
|
+
poster: S,
|
|
48
|
+
autoPlay: C,
|
|
49
|
+
muted: V,
|
|
50
|
+
loop: T,
|
|
51
|
+
playsInline: E,
|
|
52
|
+
preload: D,
|
|
53
|
+
className: "size-full object-cover",
|
|
54
|
+
onLoadedMetadata: () => {
|
|
55
|
+
W(!0), G();
|
|
56
|
+
},
|
|
57
|
+
onPlay: () => P(!0),
|
|
58
|
+
onPause: () => P(!1),
|
|
59
|
+
onTimeUpdate: G,
|
|
60
|
+
onVolumeChange: G,
|
|
61
|
+
...j,
|
|
62
|
+
children: v.map((e) => /* @__PURE__ */ d("track", { ...e }, `${e.src}-${e.srcLang ?? ""}`))
|
|
63
|
+
}), /* @__PURE__ */ d("button", {
|
|
64
|
+
type: "button",
|
|
65
|
+
"aria-label": N ? "Pause media" : "Play media",
|
|
66
|
+
className: "absolute inset-0 grid place-items-center bg-black/0 text-white opacity-0 transition hover:bg-black/20 hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
67
|
+
onClick: () => void K(),
|
|
68
|
+
children: /* @__PURE__ */ d("span", {
|
|
69
|
+
className: "grid size-14 place-items-center rounded-full bg-black/55 backdrop-blur",
|
|
70
|
+
children: N ? /* @__PURE__ */ d(a, { className: "size-6" }) : /* @__PURE__ */ d(o, { className: "size-6 translate-x-0.5" })
|
|
71
|
+
})
|
|
72
|
+
})]
|
|
73
|
+
}), /* @__PURE__ */ f("div", {
|
|
74
|
+
className: "grid gap-3 p-3",
|
|
75
|
+
children: [x && (g || _ || y) ? /* @__PURE__ */ f("div", {
|
|
76
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
77
|
+
children: [/* @__PURE__ */ f("div", {
|
|
78
|
+
className: "min-w-0",
|
|
79
|
+
children: [g ? /* @__PURE__ */ d("h3", {
|
|
80
|
+
className: "truncate text-sm font-semibold",
|
|
81
|
+
children: g
|
|
82
|
+
}) : null, _ ? /* @__PURE__ */ d("p", {
|
|
83
|
+
className: "mt-1 text-xs text-muted-foreground",
|
|
84
|
+
children: _
|
|
85
|
+
}) : null]
|
|
86
|
+
}), /* @__PURE__ */ f("div", {
|
|
87
|
+
className: "flex items-center gap-2",
|
|
88
|
+
children: [U ? null : /* @__PURE__ */ d(n, {
|
|
89
|
+
tone: "muted",
|
|
90
|
+
variant: "soft",
|
|
91
|
+
children: "loading"
|
|
92
|
+
}), y]
|
|
93
|
+
})]
|
|
94
|
+
}) : null, /* @__PURE__ */ f("div", {
|
|
95
|
+
className: "grid gap-2",
|
|
96
|
+
children: [/* @__PURE__ */ d("input", {
|
|
97
|
+
"aria-label": "Media progress",
|
|
98
|
+
type: "range",
|
|
99
|
+
min: 0,
|
|
100
|
+
max: F || 0,
|
|
101
|
+
step: .1,
|
|
102
|
+
value: Math.min(L, F || L),
|
|
103
|
+
onChange: (e) => q(Number(e.target.value)),
|
|
104
|
+
className: "h-2 w-full cursor-pointer accent-primary"
|
|
105
|
+
}), /* @__PURE__ */ f("div", {
|
|
106
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
107
|
+
children: [/* @__PURE__ */ f("div", {
|
|
108
|
+
className: "flex items-center gap-1",
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ d(t, {
|
|
111
|
+
type: "button",
|
|
112
|
+
size: "icon-sm",
|
|
113
|
+
variant: "outline",
|
|
114
|
+
iconOnly: !0,
|
|
115
|
+
"aria-label": N ? "Pause" : "Play",
|
|
116
|
+
onClick: () => void K(),
|
|
117
|
+
children: d(N ? a : o, {})
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ d(t, {
|
|
120
|
+
type: "button",
|
|
121
|
+
size: "icon-sm",
|
|
122
|
+
variant: "ghost",
|
|
123
|
+
iconOnly: !0,
|
|
124
|
+
"aria-label": "Restart",
|
|
125
|
+
onClick: () => q(0),
|
|
126
|
+
children: /* @__PURE__ */ d(s, {})
|
|
127
|
+
}),
|
|
128
|
+
/* @__PURE__ */ f("span", {
|
|
129
|
+
className: "min-w-20 text-xs tabular-nums text-muted-foreground",
|
|
130
|
+
children: [
|
|
131
|
+
p(L),
|
|
132
|
+
" / ",
|
|
133
|
+
p(F)
|
|
134
|
+
]
|
|
135
|
+
})
|
|
136
|
+
]
|
|
137
|
+
}), /* @__PURE__ */ f("div", {
|
|
138
|
+
className: "flex items-center gap-2",
|
|
139
|
+
children: [
|
|
140
|
+
/* @__PURE__ */ d(t, {
|
|
141
|
+
type: "button",
|
|
142
|
+
size: "icon-sm",
|
|
143
|
+
variant: "ghost",
|
|
144
|
+
iconOnly: !0,
|
|
145
|
+
"aria-label": V ? "Unmute" : "Mute",
|
|
146
|
+
onClick: Y,
|
|
147
|
+
children: /* @__PURE__ */ d(X, {})
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ d("input", {
|
|
150
|
+
"aria-label": "Volume",
|
|
151
|
+
type: "range",
|
|
152
|
+
min: 0,
|
|
153
|
+
max: 1,
|
|
154
|
+
step: .01,
|
|
155
|
+
value: V ? 0 : z,
|
|
156
|
+
onChange: (e) => J(Number(e.target.value)),
|
|
157
|
+
className: "h-2 w-24 cursor-pointer accent-primary"
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ d(t, {
|
|
160
|
+
type: "button",
|
|
161
|
+
size: "icon-sm",
|
|
162
|
+
variant: "ghost",
|
|
163
|
+
iconOnly: !0,
|
|
164
|
+
"aria-label": "Fullscreen",
|
|
165
|
+
onClick: () => M.current?.requestFullscreen?.(),
|
|
166
|
+
children: /* @__PURE__ */ d(i, {})
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
})]
|
|
170
|
+
})]
|
|
171
|
+
})]
|
|
172
|
+
})]
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { h as MediaPlayer };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";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=n.createContext(null);function o(e){if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e.replace(`%`,``));return Number.isFinite(t)?t:void 0}}function s({direction:e=`horizontal`,className:r,children:s,...u}){let d=n.useRef(null),f=n.Children.toArray(s).filter(e=>n.isValidElement(e)&&e.type===c),p=f.length,m=n.useMemo(()=>{let e=f.map(e=>o(e.props.defaultSize)),t=e.reduce((e,t)=>e+(t??0),0),n=e.filter(e=>e===void 0).length,r=Math.max(100-t,0),i=n>0?r/n:p>0?100/p:100;return e.map(e=>e??i)},[p,f]),h=n.useMemo(()=>f.map(e=>e.props.minSize??15),[f]),[g,_]=n.useState(m);n.useEffect(()=>{_(m)},[m]);let v=n.useCallback((t,n)=>{let r=d.current;if(!r||t<0||t>=p-1)return;let i=e===`horizontal`?r.getBoundingClientRect().width:r.getBoundingClientRect().height;if(!i)return;let a=n/i*100;_(e=>{let n=[...e],r=n[t]??0,i=n[t+1]??0,o=h[t]??15,s=h[t+1]??15,c=r+a,l=Math.min(Math.max(c,o),r+i-s),u=l-r;return n[t]=l,n[t+1]=i-u,n})},[e,h,p]),y=n.Children.map(s,e=>{if(!n.isValidElement(e))return e;if(e.type===c){let t=f.findIndex(t=>t===e);return n.cloneElement(e,{"data-panel-index":t})}if(e.type===l){let t=n.Children.toArray(s).slice(0,n.Children.toArray(s).indexOf(e)).filter(e=>n.isValidElement(e)&&e.type===c).length-1;return n.cloneElement(e,{"data-handle-index":t})}return e});return(0,i.jsx)(a.Provider,{value:{direction:e,getSize:e=>g[e]??100/Math.max(p,1),resizePanels:v},children:(0,i.jsx)(`div`,{ref:d,"data-slot":`resizable-panel-group`,"data-direction":e,className:t.cn(`flex
|
|
1
|
+
"use client";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=n.createContext(null);function o(e){if(typeof e==`number`)return e;if(typeof e==`string`){let t=Number.parseFloat(e.replace(`%`,``));return Number.isFinite(t)?t:void 0}}function s({direction:e=`horizontal`,className:r,children:s,...u}){let d=n.useRef(null),f=n.Children.toArray(s).filter(e=>n.isValidElement(e)&&e.type===c),p=f.length,m=n.useMemo(()=>{let e=f.map(e=>o(e.props.defaultSize)),t=e.reduce((e,t)=>e+(t??0),0),n=e.filter(e=>e===void 0).length,r=Math.max(100-t,0),i=n>0?r/n:p>0?100/p:100;return e.map(e=>e??i)},[p,f]),h=n.useMemo(()=>f.map(e=>e.props.minSize??15),[f]),[g,_]=n.useState(m);n.useEffect(()=>{_(m)},[m]);let v=n.useCallback((t,n)=>{let r=d.current;if(!r||t<0||t>=p-1)return;let i=e===`horizontal`?r.getBoundingClientRect().width:r.getBoundingClientRect().height;if(!i)return;let a=n/i*100;_(e=>{let n=[...e],r=n[t]??0,i=n[t+1]??0,o=h[t]??15,s=h[t+1]??15,c=r+a,l=Math.min(Math.max(c,o),r+i-s),u=l-r;return n[t]=l,n[t+1]=i-u,n})},[e,h,p]),y=n.Children.map(s,e=>{if(!n.isValidElement(e))return e;if(e.type===c){let t=f.findIndex(t=>t===e);return n.cloneElement(e,{"data-panel-index":t})}if(e.type===l){let t=n.Children.toArray(s).slice(0,n.Children.toArray(s).indexOf(e)).filter(e=>n.isValidElement(e)&&e.type===c).length-1;return n.cloneElement(e,{"data-handle-index":t})}return e});return(0,i.jsx)(a.Provider,{value:{direction:e,getSize:e=>g[e]??100/Math.max(p,1),resizePanels:v},children:(0,i.jsx)(`div`,{ref:d,"data-slot":`resizable-panel-group`,"data-direction":e,className:t.cn(`flex`,e===`horizontal`?`flex-row items-stretch`:`flex-col`,r),...u,children:y})})}function c({className:e,style:r,defaultSize:s,minSize:c,...l}){let u=n.useContext(a),d=Number(l[`data-panel-index`]??0),f=u?u.getSize(d):o(s)??100;return(0,i.jsx)(`div`,{"data-slot":`resizable-panel`,className:t.cn(`min-h-24 min-w-0 overflow-auto rounded-[var(--aui-card-radius,var(--radius-lg))] border border-[color:var(--aui-card-border,var(--border))] bg-card p-3 shadow-[var(--aui-card-shadow,0_10px_24px_rgba(15,23,42,0.07))]`,e),style:{flexBasis:`${f}%`,flexGrow:0,flexShrink:0,...r},...l})}function l({className:e,...o}){let s=n.useContext(a),c=Number(o[`data-handle-index`]??0),l=n.useRef(null);return(0,i.jsxs)(`button`,{type:`button`,"data-slot":`resizable-handle`,"aria-label":`Resize panels`,"aria-orientation":s?.direction??`horizontal`,className:t.cn(`group relative flex shrink-0 items-center justify-center text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,s?.direction===`horizontal`?`w-4 cursor-col-resize px-1`:`h-4 cursor-row-resize py-1`,e),onPointerDown:e=>{s&&(l.current={pointerId:e.pointerId,axis:s.direction===`horizontal`?e.clientX:e.clientY},e.currentTarget.setPointerCapture(e.pointerId))},onPointerMove:e=>{if(!s||!l.current||l.current.pointerId!==e.pointerId)return;let t=s.direction===`horizontal`?e.clientX:e.clientY,n=t-l.current.axis;n!==0&&(l.current.axis=t,s.resizePanels(c,n))},onPointerUp:e=>{l.current?.pointerId===e.pointerId&&(l.current=null)},onPointerCancel:()=>{l.current=null},onKeyDown:e=>{if(!s)return;let t=e.shiftKey?24:12;s.direction===`horizontal`&&e.key===`ArrowLeft`&&(e.preventDefault(),s.resizePanels(c,-t)),s.direction===`horizontal`&&e.key===`ArrowRight`&&(e.preventDefault(),s.resizePanels(c,t)),s.direction===`vertical`&&e.key===`ArrowUp`&&(e.preventDefault(),s.resizePanels(c,-t)),s.direction===`vertical`&&e.key===`ArrowDown`&&(e.preventDefault(),s.resizePanels(c,t))},...o,children:[(0,i.jsx)(`span`,{"aria-hidden":`true`,className:t.cn(`absolute rounded-full bg-border transition-colors group-hover:bg-ring/55`,s?.direction===`horizontal`?`inset-y-2 left-1/2 w-px -translate-x-1/2`:`inset-x-2 top-1/2 h-px -translate-y-1/2`)}),(0,i.jsx)(`span`,{className:`relative grid size-5 place-items-center rounded-full border border-border/75 bg-background shadow-sm transition-colors group-hover:border-ring/45`,children:(0,i.jsx)(r.GripVerticalIcon,{className:t.cn(`size-3`,s?.direction===`vertical`&&`rotate-90`)})})]})}exports.ResizableHandle=l,exports.ResizablePanel=c,exports.ResizablePanelGroup=s;
|