@runlume/admin-ui 0.1.0 → 0.2.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/README.en.md +6 -13
- package/README.md +5 -11
- package/dist-package/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist-package/admin-ui.cjs +1 -0
- package/dist-package/admin-ui.d.ts +41 -1
- package/dist-package/admin-ui.d.ts.map +1 -1
- package/dist-package/admin-ui.js +79 -0
- package/dist-package/components/calendar.cjs +1 -0
- package/dist-package/components/calendar.d.ts +13 -0
- package/dist-package/components/calendar.d.ts.map +1 -0
- package/dist-package/components/calendar.js +91 -0
- package/dist-package/components/cascader.cjs +1 -0
- package/dist-package/components/cascader.d.ts +19 -0
- package/dist-package/components/cascader.d.ts.map +1 -0
- package/dist-package/components/cascader.js +85 -0
- package/dist-package/components/charts.cjs +1 -0
- package/dist-package/components/charts.d.ts +80 -0
- package/dist-package/components/charts.d.ts.map +1 -0
- package/dist-package/components/charts.js +374 -0
- package/dist-package/components/code-block.cjs +1 -0
- package/dist-package/components/code-block.d.ts +7 -0
- package/dist-package/components/code-block.d.ts.map +1 -0
- package/dist-package/components/code-block.js +47 -0
- package/dist-package/components/column-chart.cjs +1 -0
- package/dist-package/components/column-chart.d.ts +18 -0
- package/dist-package/components/column-chart.d.ts.map +1 -0
- package/dist-package/components/column-chart.js +89 -0
- package/dist-package/components/combobox.cjs +1 -0
- package/dist-package/components/combobox.d.ts +24 -0
- package/dist-package/components/combobox.d.ts.map +1 -0
- package/dist-package/components/combobox.js +111 -0
- package/dist-package/components/confirm-dialog.cjs +1 -0
- package/dist-package/components/confirm-dialog.d.ts +17 -0
- package/dist-package/components/confirm-dialog.d.ts.map +1 -0
- package/dist-package/components/confirm-dialog.js +44 -0
- package/dist-package/components/count-to.cjs +1 -0
- package/dist-package/components/count-to.d.ts +13 -0
- package/dist-package/components/count-to.d.ts.map +1 -0
- package/dist-package/components/count-to.js +36 -0
- package/dist-package/components/cursor-pagination.cjs +1 -0
- package/dist-package/components/cursor-pagination.d.ts +11 -0
- package/dist-package/components/cursor-pagination.d.ts.map +1 -0
- package/dist-package/components/cursor-pagination.js +39 -0
- package/dist-package/components/data-table.cjs +1 -0
- package/dist-package/components/data-table.d.ts +69 -0
- package/dist-package/components/data-table.d.ts.map +1 -0
- package/dist-package/components/data-table.js +377 -0
- package/dist-package/components/descriptions.cjs +1 -0
- package/dist-package/components/descriptions.d.ts +16 -0
- package/dist-package/components/descriptions.d.ts.map +1 -0
- package/dist-package/components/descriptions.js +28 -0
- package/dist-package/components/editable-table.cjs +1 -0
- package/dist-package/components/editable-table.d.ts +27 -0
- package/dist-package/components/editable-table.d.ts.map +1 -0
- package/dist-package/components/editable-table.js +212 -0
- package/dist-package/components/filter-presets.cjs +1 -0
- package/dist-package/components/filter-presets.d.ts +11 -0
- package/dist-package/components/filter-presets.d.ts.map +1 -0
- package/dist-package/components/filter-presets.js +17 -0
- package/dist-package/components/fixed-bar.cjs +1 -0
- package/dist-package/components/fixed-bar.d.ts +11 -0
- package/dist-package/components/fixed-bar.d.ts.map +1 -0
- package/dist-package/components/fixed-bar.js +18 -0
- package/dist-package/components/image-preview.cjs +1 -0
- package/dist-package/components/image-preview.d.ts +14 -0
- package/dist-package/components/image-preview.d.ts.map +1 -0
- package/dist-package/components/image-preview.js +166 -0
- package/dist-package/components/layout-container.cjs +1 -0
- package/dist-package/components/layout-container.d.ts +17 -0
- package/dist-package/components/layout-container.d.ts.map +1 -0
- package/dist-package/components/layout-container.js +85 -0
- package/dist-package/components/mention.cjs +1 -0
- package/dist-package/components/mention.d.ts +20 -0
- package/dist-package/components/mention.d.ts.map +1 -0
- package/dist-package/components/mention.js +126 -0
- package/dist-package/components/multi-select.cjs +1 -0
- package/dist-package/components/multi-select.d.ts +17 -0
- package/dist-package/components/multi-select.d.ts.map +1 -0
- package/dist-package/components/multi-select.js +126 -0
- package/dist-package/components/multi-step-loader.cjs +1 -0
- package/dist-package/components/multi-step-loader.d.ts +18 -0
- package/dist-package/components/multi-step-loader.d.ts.map +1 -0
- package/dist-package/components/multi-step-loader.js +38 -0
- package/dist-package/components/page-button.cjs +1 -0
- package/dist-package/components/page-button.d.ts +6 -0
- package/dist-package/components/page-button.d.ts.map +1 -0
- package/dist-package/components/page-button.js +24 -0
- package/dist-package/components/page-pager.cjs +1 -0
- package/dist-package/components/page-pager.d.ts +11 -0
- package/dist-package/components/page-pager.d.ts.map +1 -0
- package/dist-package/components/page-pager.js +51 -0
- package/dist-package/components/page.cjs +1 -0
- package/dist-package/components/page.d.ts +34 -0
- package/dist-package/components/page.d.ts.map +1 -0
- package/dist-package/components/page.js +208 -0
- package/dist-package/components/pagination-bar.cjs +1 -0
- package/dist-package/components/pagination-bar.d.ts +8 -0
- package/dist-package/components/pagination-bar.d.ts.map +1 -0
- package/dist-package/components/pagination-bar.js +23 -0
- package/dist-package/components/password-strength.cjs +1 -0
- package/dist-package/components/password-strength.d.ts +11 -0
- package/dist-package/components/password-strength.d.ts.map +1 -0
- package/dist-package/components/password-strength.js +70 -0
- package/dist-package/components/rate.cjs +1 -0
- package/dist-package/components/rate.d.ts +13 -0
- package/dist-package/components/rate.d.ts.map +1 -0
- package/dist-package/components/rate.js +56 -0
- package/dist-package/components/resizable-panel.cjs +1 -0
- package/dist-package/components/resizable-panel.d.ts +15 -0
- package/dist-package/components/resizable-panel.d.ts.map +1 -0
- package/dist-package/components/resizable-panel.js +56 -0
- package/dist-package/components/search-filters.cjs +1 -0
- package/dist-package/components/search-filters.d.ts +31 -0
- package/dist-package/components/search-filters.d.ts.map +1 -0
- package/dist-package/components/search-filters.js +110 -0
- package/dist-package/components/sortable-list.cjs +1 -0
- package/dist-package/components/sortable-list.d.ts +14 -0
- package/dist-package/components/sortable-list.d.ts.map +1 -0
- package/dist-package/components/sortable-list.js +48 -0
- package/dist-package/components/sparkline.cjs +1 -0
- package/dist-package/components/sparkline.d.ts +11 -0
- package/dist-package/components/sparkline.d.ts.map +1 -0
- package/dist-package/components/sparkline.js +50 -0
- package/dist-package/components/status-badge.cjs +1 -0
- package/dist-package/components/status-badge.d.ts +4 -0
- package/dist-package/components/status-badge.d.ts.map +1 -0
- package/dist-package/components/status-badge.js +28 -0
- package/dist-package/components/steps.cjs +1 -0
- package/dist-package/components/steps.d.ts +15 -0
- package/dist-package/components/steps.d.ts.map +1 -0
- package/dist-package/components/steps.js +41 -0
- package/dist-package/components/storage-box.cjs +1 -0
- package/dist-package/components/storage-box.d.ts +19 -0
- package/dist-package/components/storage-box.d.ts.map +1 -0
- package/dist-package/components/storage-box.js +153 -0
- package/dist-package/components/table-cell-overflow.cjs +1 -0
- package/dist-package/components/table-cell-overflow.d.ts +5 -0
- package/dist-package/components/table-cell-overflow.d.ts.map +1 -0
- package/dist-package/components/table-cell-overflow.js +31 -0
- package/dist-package/components/table-toolbar.cjs +1 -0
- package/dist-package/components/table-toolbar.d.ts +5 -0
- package/dist-package/components/table-toolbar.d.ts.map +1 -0
- package/dist-package/components/table-toolbar.js +11 -0
- package/dist-package/components/timeline.cjs +1 -0
- package/dist-package/components/timeline.d.ts +14 -0
- package/dist-package/components/timeline.d.ts.map +1 -0
- package/dist-package/components/timeline.js +40 -0
- package/dist-package/components/transfer.cjs +1 -0
- package/dist-package/components/transfer.d.ts +18 -0
- package/dist-package/components/transfer.d.ts.map +1 -0
- package/dist-package/components/transfer.js +98 -0
- package/dist-package/components/tree-table.cjs +1 -0
- package/dist-package/components/tree-table.d.ts +23 -0
- package/dist-package/components/tree-table.d.ts.map +1 -0
- package/dist-package/components/tree-table.js +53 -0
- package/dist-package/components/tree.cjs +1 -0
- package/dist-package/components/tree.d.ts +36 -0
- package/dist-package/components/tree.d.ts.map +1 -0
- package/dist-package/components/tree.js +204 -0
- package/dist-package/components/trend.cjs +1 -0
- package/dist-package/components/trend.d.ts +19 -0
- package/dist-package/components/trend.d.ts.map +1 -0
- package/dist-package/components/trend.js +18 -0
- package/dist-package/components/ui/alert-dialog.cjs +1 -0
- package/dist-package/components/ui/alert-dialog.js +57 -0
- package/dist-package/components/ui/alert.cjs +1 -0
- package/dist-package/components/ui/alert.js +63 -0
- package/dist-package/components/ui/avatar.cjs +1 -0
- package/dist-package/components/ui/avatar.js +27 -0
- package/dist-package/components/ui/badge.cjs +1 -0
- package/dist-package/components/ui/badge.js +40 -0
- package/dist-package/components/ui/breadcrumb.cjs +1 -0
- package/dist-package/components/ui/breadcrumb.js +70 -0
- package/dist-package/components/ui/button.cjs +1 -0
- package/dist-package/components/ui/button.js +58 -0
- package/dist-package/components/ui/card.cjs +1 -0
- package/dist-package/components/ui/card.js +55 -0
- package/dist-package/components/ui/checkbox.cjs +1 -0
- package/dist-package/components/ui/checkbox.js +19 -0
- package/dist-package/components/ui/collapsible.cjs +1 -0
- package/dist-package/components/ui/collapsible.js +32 -0
- package/dist-package/components/ui/context-menu.cjs +1 -0
- package/dist-package/components/ui/context-menu.js +46 -0
- package/dist-package/components/ui/date-input.cjs +1 -0
- package/dist-package/components/ui/date-input.js +183 -0
- package/dist-package/components/ui/date-range-input.cjs +1 -0
- package/dist-package/components/ui/date-range-input.js +209 -0
- package/dist-package/components/ui/date-time-input.cjs +1 -0
- package/dist-package/components/ui/date-time-input.js +23 -0
- package/dist-package/components/ui/dialog.cjs +1 -0
- package/dist-package/components/ui/dialog.js +189 -0
- package/dist-package/components/ui/dropdown-menu.cjs +1 -0
- package/dist-package/components/ui/dropdown-menu.js +124 -0
- package/dist-package/components/ui/file-upload.cjs +1 -0
- package/dist-package/components/ui/file-upload.js +160 -0
- package/dist-package/components/ui/hover-card.cjs +1 -0
- package/dist-package/components/ui/hover-card.js +28 -0
- package/dist-package/components/ui/input-otp.cjs +1 -0
- package/dist-package/components/ui/input-otp.js +33 -0
- package/dist-package/components/ui/input.cjs +1 -0
- package/dist-package/components/ui/input.js +65 -0
- package/dist-package/components/ui/kbd.cjs +1 -0
- package/dist-package/components/ui/kbd.js +20 -0
- package/dist-package/components/ui/label.cjs +1 -0
- package/dist-package/components/ui/label.js +14 -0
- package/dist-package/components/ui/native-select.cjs +1 -0
- package/dist-package/components/ui/native-select.js +125 -0
- package/dist-package/components/ui/number-field.cjs +1 -0
- package/dist-package/components/ui/number-field.js +50 -0
- package/dist-package/components/ui/progress.cjs +1 -0
- package/dist-package/components/ui/progress.js +28 -0
- package/dist-package/components/ui/radio-group.cjs +1 -0
- package/dist-package/components/ui/radio-group.js +27 -0
- package/dist-package/components/ui/scroll-area.cjs +1 -0
- package/dist-package/components/ui/scroll-area.js +25 -0
- package/dist-package/components/ui/select.cjs +1 -0
- package/dist-package/components/ui/select.js +23 -0
- package/dist-package/components/ui/separator.cjs +1 -0
- package/dist-package/components/ui/separator.js +17 -0
- package/dist-package/components/ui/sheet.cjs +1 -0
- package/dist-package/components/ui/sheet.js +86 -0
- package/dist-package/components/ui/sidebar.cjs +1 -0
- package/dist-package/components/ui/sidebar.js +350 -0
- package/dist-package/components/ui/skeleton.cjs +1 -0
- package/dist-package/components/ui/skeleton.js +12 -0
- package/dist-package/components/ui/slider.cjs +1 -0
- package/dist-package/components/ui/slider.js +36 -0
- package/dist-package/components/ui/switch.cjs +1 -0
- package/dist-package/components/ui/switch.js +14 -0
- package/dist-package/components/ui/table.cjs +1 -0
- package/dist-package/components/ui/table.js +66 -0
- package/dist-package/components/ui/tabs.cjs +1 -0
- package/dist-package/components/ui/tabs.js +47 -0
- package/dist-package/components/ui/tag-variants.cjs +1 -0
- package/dist-package/components/ui/tag-variants.js +15 -0
- package/dist-package/components/ui/tag.cjs +1 -0
- package/dist-package/components/ui/tag.js +31 -0
- package/dist-package/components/ui/textarea.cjs +1 -0
- package/dist-package/components/ui/textarea.js +13 -0
- package/dist-package/components/ui/time-input.cjs +1 -0
- package/dist-package/components/ui/time-input.js +89 -0
- package/dist-package/components/ui/tooltip.cjs +1 -0
- package/dist-package/components/ui/tooltip.js +35 -0
- package/dist-package/hooks/use-mobile.cjs +1 -0
- package/dist-package/hooks/use-mobile.js +11 -0
- package/dist-package/lib/dialog-focus.cjs +1 -0
- package/dist-package/lib/dialog-focus.js +10 -0
- package/dist-package/lib/metrics.cjs +1 -0
- package/dist-package/lib/metrics.d.ts +18 -0
- package/dist-package/lib/metrics.d.ts.map +1 -0
- package/dist-package/lib/metrics.js +22 -0
- package/dist-package/lib/pager.cjs +1 -0
- package/dist-package/lib/pager.d.ts +8 -0
- package/dist-package/lib/pager.d.ts.map +1 -0
- package/dist-package/lib/pager.js +18 -0
- package/dist-package/lib/password.cjs +1 -0
- package/dist-package/lib/password.d.ts +14 -0
- package/dist-package/lib/password.d.ts.map +1 -0
- package/dist-package/lib/password.js +34 -0
- package/dist-package/lib/presets.cjs +1 -0
- package/dist-package/lib/presets.d.ts +25 -0
- package/dist-package/lib/presets.d.ts.map +1 -0
- package/dist-package/lib/presets.js +48 -0
- package/dist-package/lib/range.cjs +1 -0
- package/dist-package/lib/range.js +57 -0
- package/dist-package/lib/storage-key.cjs +1 -0
- package/dist-package/lib/storage-key.d.ts +2 -0
- package/dist-package/lib/storage-key.d.ts.map +1 -0
- package/dist-package/lib/storage-key.js +6 -0
- package/dist-package/lib/table-prefs.cjs +1 -0
- package/dist-package/lib/table-prefs.d.ts +17 -0
- package/dist-package/lib/table-prefs.d.ts.map +1 -0
- package/dist-package/lib/table-prefs.js +64 -0
- package/dist-package/lib/tree.cjs +1 -0
- package/dist-package/lib/tree.d.ts +37 -0
- package/dist-package/lib/tree.d.ts.map +1 -0
- package/dist-package/lib/tree.js +57 -0
- package/dist-package/lib/use-ui-translation.cjs +1 -0
- package/dist-package/lib/use-ui-translation.d.ts +15 -0
- package/dist-package/lib/use-ui-translation.d.ts.map +1 -0
- package/dist-package/lib/use-ui-translation.js +65 -0
- package/dist-package/lib/utils.cjs +1 -0
- package/dist-package/lib/utils.js +8 -0
- package/dist-package/styles.css +1 -1
- package/package.json +25 -15
- package/dist-package/index.js +0 -12212
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t } from "./button.js";
|
|
4
|
+
import { Input as n } from "./input.js";
|
|
5
|
+
import { Separator as r } from "./separator.js";
|
|
6
|
+
import { Sheet as i, SheetContent as a, SheetDescription as o, SheetHeader as s, SheetTitle as c } from "./sheet.js";
|
|
7
|
+
import { useIsMobile as l } from "../../hooks/use-mobile.js";
|
|
8
|
+
import { Skeleton as u } from "./skeleton.js";
|
|
9
|
+
import { Tooltip as d, TooltipContent as f, TooltipProvider as p, TooltipTrigger as m } from "./tooltip.js";
|
|
10
|
+
import * as h from "react";
|
|
11
|
+
import { Slot as g } from "radix-ui";
|
|
12
|
+
import { cva as _ } from "class-variance-authority";
|
|
13
|
+
import { PanelLeftIcon as v } from "lucide-react";
|
|
14
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
15
|
+
//#region src/components/ui/sidebar.tsx
|
|
16
|
+
var x = "16rem", S = "18rem", C = "3rem", w = "b", T = h.createContext(null);
|
|
17
|
+
function E() {
|
|
18
|
+
let e = h.useContext(T);
|
|
19
|
+
if (!e) throw Error("useSidebar must be used within a SidebarProvider.");
|
|
20
|
+
return e;
|
|
21
|
+
}
|
|
22
|
+
function D({ defaultOpen: t = !0, open: n, onOpenChange: r, className: i, style: a, children: o, ...s }) {
|
|
23
|
+
let c = l(), [u, d] = h.useState(!1), [f, m] = h.useState(t), g = n ?? f, _ = h.useCallback((e) => {
|
|
24
|
+
let t = typeof e == "function" ? e(g) : e;
|
|
25
|
+
r ? r(t) : m(t);
|
|
26
|
+
}, [r, g]), v = h.useCallback(() => c ? d((e) => !e) : _((e) => !e), [
|
|
27
|
+
c,
|
|
28
|
+
_,
|
|
29
|
+
d
|
|
30
|
+
]);
|
|
31
|
+
h.useEffect(() => {
|
|
32
|
+
let e = (e) => {
|
|
33
|
+
!e.defaultPrevented && !e.repeat && !e.altKey && !(e.target instanceof HTMLElement && e.target.closest("input, textarea, select, [contenteditable]:not([contenteditable=false])")) && e.key.toLowerCase() === w && (e.metaKey || e.ctrlKey) && (e.preventDefault(), v());
|
|
34
|
+
};
|
|
35
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
36
|
+
}, [v]);
|
|
37
|
+
let b = g ? "expanded" : "collapsed", S = h.useMemo(() => ({
|
|
38
|
+
state: b,
|
|
39
|
+
open: g,
|
|
40
|
+
setOpen: _,
|
|
41
|
+
isMobile: c,
|
|
42
|
+
openMobile: u,
|
|
43
|
+
setOpenMobile: d,
|
|
44
|
+
toggleSidebar: v
|
|
45
|
+
}), [
|
|
46
|
+
b,
|
|
47
|
+
g,
|
|
48
|
+
_,
|
|
49
|
+
c,
|
|
50
|
+
u,
|
|
51
|
+
d,
|
|
52
|
+
v
|
|
53
|
+
]);
|
|
54
|
+
return /* @__PURE__ */ y(T.Provider, {
|
|
55
|
+
value: S,
|
|
56
|
+
children: /* @__PURE__ */ y(p, {
|
|
57
|
+
delayDuration: 0,
|
|
58
|
+
children: /* @__PURE__ */ y("div", {
|
|
59
|
+
"data-slot": "sidebar-wrapper",
|
|
60
|
+
style: {
|
|
61
|
+
"--sidebar-width": x,
|
|
62
|
+
"--sidebar-width-icon": C,
|
|
63
|
+
...a
|
|
64
|
+
},
|
|
65
|
+
className: e("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar", i),
|
|
66
|
+
...s,
|
|
67
|
+
children: o
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function O({ side: t = "left", variant: n = "sidebar", collapsible: r = "offcanvas", mobileTitle: l = "Sidebar", mobileDescription: u = "Displays the mobile sidebar.", onMobileCloseAutoFocus: d, className: f, children: p, ...m }) {
|
|
73
|
+
let { isMobile: h, state: g, openMobile: _, setOpenMobile: v } = E();
|
|
74
|
+
return r === "none" ? /* @__PURE__ */ y("div", {
|
|
75
|
+
"data-slot": "sidebar",
|
|
76
|
+
className: e("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground", f),
|
|
77
|
+
...m,
|
|
78
|
+
children: p
|
|
79
|
+
}) : h ? /* @__PURE__ */ y(i, {
|
|
80
|
+
open: _,
|
|
81
|
+
onOpenChange: v,
|
|
82
|
+
...m,
|
|
83
|
+
children: /* @__PURE__ */ b(a, {
|
|
84
|
+
"data-sidebar": "sidebar",
|
|
85
|
+
"data-slot": "sidebar",
|
|
86
|
+
"data-mobile": "true",
|
|
87
|
+
className: "w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground ",
|
|
88
|
+
style: { "--sidebar-width": S },
|
|
89
|
+
side: t,
|
|
90
|
+
onCloseAutoFocus: d,
|
|
91
|
+
children: [/* @__PURE__ */ b(s, {
|
|
92
|
+
className: "sr-only",
|
|
93
|
+
children: [/* @__PURE__ */ y(c, { children: l }), /* @__PURE__ */ y(o, { children: u })]
|
|
94
|
+
}), /* @__PURE__ */ y("div", {
|
|
95
|
+
className: "flex h-full w-full flex-col",
|
|
96
|
+
children: p
|
|
97
|
+
})]
|
|
98
|
+
})
|
|
99
|
+
}) : /* @__PURE__ */ b("div", {
|
|
100
|
+
className: "group peer hidden text-sidebar-foreground lg:block",
|
|
101
|
+
"data-state": g,
|
|
102
|
+
"data-collapsible": g === "collapsed" ? r : "",
|
|
103
|
+
"data-variant": n,
|
|
104
|
+
"data-side": t,
|
|
105
|
+
"data-slot": "sidebar",
|
|
106
|
+
children: [/* @__PURE__ */ y("div", {
|
|
107
|
+
"data-slot": "sidebar-gap",
|
|
108
|
+
className: e("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-out motion-reduce:transition-none", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", n === "floating" || n === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
109
|
+
}), /* @__PURE__ */ y("div", {
|
|
110
|
+
"data-slot": "sidebar-container",
|
|
111
|
+
className: e("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-out motion-reduce:transition-none lg:flex", t === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", n === "floating" || n === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", f),
|
|
112
|
+
...m,
|
|
113
|
+
children: /* @__PURE__ */ y("div", {
|
|
114
|
+
"data-sidebar": "sidebar",
|
|
115
|
+
"data-slot": "sidebar-inner",
|
|
116
|
+
className: "flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm",
|
|
117
|
+
children: p
|
|
118
|
+
})
|
|
119
|
+
})]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function k({ className: n, onClick: r, ...i }) {
|
|
123
|
+
let { toggleSidebar: a } = E();
|
|
124
|
+
return /* @__PURE__ */ b(t, {
|
|
125
|
+
"data-sidebar": "trigger",
|
|
126
|
+
"data-slot": "sidebar-trigger",
|
|
127
|
+
variant: "ghost",
|
|
128
|
+
size: "icon",
|
|
129
|
+
className: e("size-7", n),
|
|
130
|
+
onClick: (e) => {
|
|
131
|
+
r?.(e), a();
|
|
132
|
+
},
|
|
133
|
+
...i,
|
|
134
|
+
children: [/* @__PURE__ */ y(v, {}), /* @__PURE__ */ y("span", {
|
|
135
|
+
className: "sr-only",
|
|
136
|
+
children: "Toggle Sidebar"
|
|
137
|
+
})]
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function A({ className: t, ...n }) {
|
|
141
|
+
let { toggleSidebar: r } = E();
|
|
142
|
+
return /* @__PURE__ */ y("button", {
|
|
143
|
+
"data-sidebar": "rail",
|
|
144
|
+
"data-slot": "sidebar-rail",
|
|
145
|
+
"aria-label": "Toggle Sidebar",
|
|
146
|
+
tabIndex: -1,
|
|
147
|
+
onClick: r,
|
|
148
|
+
title: "Toggle Sidebar",
|
|
149
|
+
className: e("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", t),
|
|
150
|
+
...n
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function j({ className: t, ...n }) {
|
|
154
|
+
return /* @__PURE__ */ y("main", {
|
|
155
|
+
"data-slot": "sidebar-inset",
|
|
156
|
+
className: e("relative flex w-full flex-1 flex-col bg-background", "lg:peer-data-[variant=inset]:m-2 lg:peer-data-[variant=inset]:ml-0 lg:peer-data-[variant=inset]:rounded-xl lg:peer-data-[variant=inset]:shadow-sm lg:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", t),
|
|
157
|
+
...n
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function M({ className: t, ...r }) {
|
|
161
|
+
return /* @__PURE__ */ y(n, {
|
|
162
|
+
"data-slot": "sidebar-input",
|
|
163
|
+
"data-sidebar": "input",
|
|
164
|
+
className: e("h-8 w-full bg-background shadow-none", t),
|
|
165
|
+
...r
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function N({ className: t, ...n }) {
|
|
169
|
+
return /* @__PURE__ */ y("div", {
|
|
170
|
+
"data-slot": "sidebar-header",
|
|
171
|
+
"data-sidebar": "header",
|
|
172
|
+
className: e("flex flex-col gap-2 p-2", t),
|
|
173
|
+
...n
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
function P({ className: t, ...n }) {
|
|
177
|
+
return /* @__PURE__ */ y("div", {
|
|
178
|
+
"data-slot": "sidebar-footer",
|
|
179
|
+
"data-sidebar": "footer",
|
|
180
|
+
className: e("flex flex-col gap-2 p-2", t),
|
|
181
|
+
...n
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function F({ className: t, ...n }) {
|
|
185
|
+
return /* @__PURE__ */ y(r, {
|
|
186
|
+
"data-slot": "sidebar-separator",
|
|
187
|
+
"data-sidebar": "separator",
|
|
188
|
+
className: e("mx-2 w-auto bg-sidebar-border", t),
|
|
189
|
+
...n
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
function I({ className: t, ...n }) {
|
|
193
|
+
return /* @__PURE__ */ y("div", {
|
|
194
|
+
"data-slot": "sidebar-content",
|
|
195
|
+
"data-sidebar": "content",
|
|
196
|
+
className: e("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", t),
|
|
197
|
+
...n
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
function L({ className: t, ...n }) {
|
|
201
|
+
return /* @__PURE__ */ y("div", {
|
|
202
|
+
"data-slot": "sidebar-group",
|
|
203
|
+
"data-sidebar": "group",
|
|
204
|
+
className: e("relative flex w-full min-w-0 flex-col p-2", t),
|
|
205
|
+
...n
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function R({ className: t, asChild: n = !1, ...r }) {
|
|
209
|
+
let i = n ? g.Root : "div";
|
|
210
|
+
return /* @__PURE__ */ y(i, {
|
|
211
|
+
"data-slot": "sidebar-group-label",
|
|
212
|
+
"data-sidebar": "group-label",
|
|
213
|
+
className: e("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", t),
|
|
214
|
+
...r
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function z({ className: t, asChild: n = !1, ...r }) {
|
|
218
|
+
let i = n ? g.Root : "button";
|
|
219
|
+
return /* @__PURE__ */ y(i, {
|
|
220
|
+
"data-slot": "sidebar-group-action",
|
|
221
|
+
"data-sidebar": "group-action",
|
|
222
|
+
className: e("absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "after:absolute after:-inset-2 lg:after:hidden", "group-data-[collapsible=icon]:hidden", t),
|
|
223
|
+
...r
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function B({ className: t, ...n }) {
|
|
227
|
+
return /* @__PURE__ */ y("div", {
|
|
228
|
+
"data-slot": "sidebar-group-content",
|
|
229
|
+
"data-sidebar": "group-content",
|
|
230
|
+
className: e("w-full text-sm", t),
|
|
231
|
+
...n
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
function V({ className: t, ...n }) {
|
|
235
|
+
return /* @__PURE__ */ y("ul", {
|
|
236
|
+
"data-slot": "sidebar-menu",
|
|
237
|
+
"data-sidebar": "menu",
|
|
238
|
+
className: e("flex w-full min-w-0 flex-col gap-1", t),
|
|
239
|
+
...n
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
function H({ className: t, ...n }) {
|
|
243
|
+
return /* @__PURE__ */ y("li", {
|
|
244
|
+
"data-slot": "sidebar-menu-item",
|
|
245
|
+
"data-sidebar": "menu-item",
|
|
246
|
+
className: e("group/menu-item relative", t),
|
|
247
|
+
...n
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
var U = _("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-10! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", {
|
|
251
|
+
variants: {
|
|
252
|
+
variant: {
|
|
253
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
254
|
+
outline: "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"
|
|
255
|
+
},
|
|
256
|
+
size: {
|
|
257
|
+
default: "h-8 text-sm",
|
|
258
|
+
sm: "h-7 text-xs",
|
|
259
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
defaultVariants: {
|
|
263
|
+
variant: "default",
|
|
264
|
+
size: "default"
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
function W({ asChild: t = !1, isActive: n = !1, variant: r = "default", size: i = "default", tooltip: a, className: o, ...s }) {
|
|
268
|
+
let c = t ? g.Root : "button", { isMobile: l, state: u } = E(), p = /* @__PURE__ */ y(c, {
|
|
269
|
+
"data-slot": "sidebar-menu-button",
|
|
270
|
+
"data-sidebar": "menu-button",
|
|
271
|
+
"data-size": i,
|
|
272
|
+
"data-active": n,
|
|
273
|
+
className: e(U({
|
|
274
|
+
variant: r,
|
|
275
|
+
size: i
|
|
276
|
+
}), o),
|
|
277
|
+
...s
|
|
278
|
+
});
|
|
279
|
+
return a ? (typeof a == "string" && (a = { children: a }), /* @__PURE__ */ b(d, { children: [/* @__PURE__ */ y(m, {
|
|
280
|
+
asChild: !0,
|
|
281
|
+
children: p
|
|
282
|
+
}), /* @__PURE__ */ y(f, {
|
|
283
|
+
side: "right",
|
|
284
|
+
align: "center",
|
|
285
|
+
hidden: u !== "collapsed" || l,
|
|
286
|
+
...a
|
|
287
|
+
})] })) : p;
|
|
288
|
+
}
|
|
289
|
+
function G({ className: t, asChild: n = !1, showOnHover: r = !1, ...i }) {
|
|
290
|
+
let a = n ? g.Root : "button";
|
|
291
|
+
return /* @__PURE__ */ y(a, {
|
|
292
|
+
"data-slot": "sidebar-menu-action",
|
|
293
|
+
"data-sidebar": "menu-action",
|
|
294
|
+
className: e("absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "after:absolute after:-inset-2 lg:after:hidden", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", r && "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 lg:opacity-0", t),
|
|
295
|
+
...i
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function K({ className: t, ...n }) {
|
|
299
|
+
return /* @__PURE__ */ y("div", {
|
|
300
|
+
"data-slot": "sidebar-menu-badge",
|
|
301
|
+
"data-sidebar": "menu-badge",
|
|
302
|
+
className: e("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none", "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", t),
|
|
303
|
+
...n
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function q({ className: t, showIcon: n = !1, ...r }) {
|
|
307
|
+
return /* @__PURE__ */ b("div", {
|
|
308
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
309
|
+
"data-sidebar": "menu-skeleton",
|
|
310
|
+
className: e("flex h-8 items-center gap-2 rounded-md px-2", t),
|
|
311
|
+
...r,
|
|
312
|
+
children: [n && /* @__PURE__ */ y(u, {
|
|
313
|
+
className: "size-4 rounded-md",
|
|
314
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
315
|
+
}), /* @__PURE__ */ y(u, {
|
|
316
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
317
|
+
"data-sidebar": "menu-skeleton-text",
|
|
318
|
+
style: { "--skeleton-width": "70%" }
|
|
319
|
+
})]
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function J({ className: t, ...n }) {
|
|
323
|
+
return /* @__PURE__ */ y("ul", {
|
|
324
|
+
"data-slot": "sidebar-menu-sub",
|
|
325
|
+
"data-sidebar": "menu-sub",
|
|
326
|
+
className: e("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5", "group-data-[collapsible=icon]:hidden", t),
|
|
327
|
+
...n
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
function Y({ className: t, ...n }) {
|
|
331
|
+
return /* @__PURE__ */ y("li", {
|
|
332
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
333
|
+
"data-sidebar": "menu-sub-item",
|
|
334
|
+
className: e("group/menu-sub-item relative", t),
|
|
335
|
+
...n
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
function X({ asChild: t = !1, size: n = "md", isActive: r = !1, className: i, ...a }) {
|
|
339
|
+
let o = t ? g.Root : "a";
|
|
340
|
+
return /* @__PURE__ */ y(o, {
|
|
341
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
342
|
+
"data-sidebar": "menu-sub-button",
|
|
343
|
+
"data-size": n,
|
|
344
|
+
"data-active": r,
|
|
345
|
+
className: e("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", n === "sm" && "text-xs", n === "md" && "text-sm", "group-data-[collapsible=icon]:hidden", i),
|
|
346
|
+
...a
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
//#endregion
|
|
350
|
+
export { O as Sidebar, I as SidebarContent, P as SidebarFooter, L as SidebarGroup, z as SidebarGroupAction, B as SidebarGroupContent, R as SidebarGroupLabel, N as SidebarHeader, M as SidebarInput, j as SidebarInset, V as SidebarMenu, G as SidebarMenuAction, K as SidebarMenuBadge, W as SidebarMenuButton, H as SidebarMenuItem, q as SidebarMenuSkeleton, J as SidebarMenuSub, X as SidebarMenuSubButton, Y as SidebarMenuSubItem, D as SidebarProvider, A as SidebarRail, F as SidebarSeparator, k as SidebarTrigger, E as useSidebar };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs");let t=require("react/jsx-runtime");function n({className:n,...r}){return(0,t.jsx)(`div`,{"data-slot":`skeleton`,className:e.cn(`animate-pulse rounded-md bg-accent`,n),...r})}exports.Skeleton=n;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/ui/skeleton.tsx
|
|
4
|
+
function n({ className: n, ...r }) {
|
|
5
|
+
return /* @__PURE__ */ t("div", {
|
|
6
|
+
"data-slot": "skeleton",
|
|
7
|
+
className: e("animate-pulse rounded-md bg-accent", n),
|
|
8
|
+
...r
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as Skeleton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({className:r,value:i,onValueChange:a,label:o,ticks:s,...c}){let l=i??[0];return(0,n.jsxs)(t.Slider.Root,{"data-slot":`slider`,"aria-label":o,value:i,onValueChange:a,className:e.cn(`relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-40 data-[orientation=vertical]:w-4 data-[orientation=vertical]:flex-col`,r),...c,children:[(0,n.jsx)(t.Slider.Track,{className:`relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5`,children:(0,n.jsx)(t.Slider.Range,{className:`absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full`})}),s&&s.length>0&&(0,n.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-x-0 top-full mt-1`,children:s.map(e=>(0,n.jsx)(`span`,{className:`absolute -translate-x-1/2 text-[10px] text-muted-foreground`,style:{left:`${((e-(c.min??0))/((c.max??100)-(c.min??0)||1)*100).toFixed(2)}%`},children:e},e))}),l.map((e,r)=>(0,n.jsx)(t.Slider.Thumb,{"aria-label":`${o} ${r+1}`,className:`block size-4 rounded-full border border-primary/40 bg-card shadow-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:opacity-50`},r))]})}exports.Slider=r;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Slider as t } from "radix-ui";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/slider.tsx
|
|
5
|
+
function i({ className: i, value: a, onValueChange: o, label: s, ticks: c, ...l }) {
|
|
6
|
+
let u = a ?? [0];
|
|
7
|
+
return /* @__PURE__ */ r(t.Root, {
|
|
8
|
+
"data-slot": "slider",
|
|
9
|
+
"aria-label": s,
|
|
10
|
+
value: a,
|
|
11
|
+
onValueChange: o,
|
|
12
|
+
className: e("relative flex w-full touch-none select-none items-center data-[orientation=vertical]:h-40 data-[orientation=vertical]:w-4 data-[orientation=vertical]:flex-col", i),
|
|
13
|
+
...l,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ n(t.Track, {
|
|
16
|
+
className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-muted data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5",
|
|
17
|
+
children: /* @__PURE__ */ n(t.Range, { className: "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full" })
|
|
18
|
+
}),
|
|
19
|
+
c && c.length > 0 && /* @__PURE__ */ n("span", {
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
className: "pointer-events-none absolute inset-x-0 top-full mt-1",
|
|
22
|
+
children: c.map((e) => /* @__PURE__ */ n("span", {
|
|
23
|
+
className: "absolute -translate-x-1/2 text-[10px] text-muted-foreground",
|
|
24
|
+
style: { left: `${((e - (l.min ?? 0)) / ((l.max ?? 100) - (l.min ?? 0) || 1) * 100).toFixed(2)}%` },
|
|
25
|
+
children: e
|
|
26
|
+
}, e))
|
|
27
|
+
}),
|
|
28
|
+
u.map((e, r) => /* @__PURE__ */ n(t.Thumb, {
|
|
29
|
+
"aria-label": `${s} ${r + 1}`,
|
|
30
|
+
className: "block size-4 rounded-full border border-primary/40 bg-card shadow-sm outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:opacity-50"
|
|
31
|
+
}, r))
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { i as Slider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs");let t=require("radix-ui"),n=require("react/jsx-runtime");function r({className:r,...i}){return(0,n.jsx)(t.Switch.Root,{"data-slot":`switch`,className:e.cn(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-muted outline-none transition-colors`,`data-[state=checked]:bg-primary focus-visible:ring-2 focus-visible:ring-ring/30`,`disabled:cursor-not-allowed disabled:opacity-50`,r),...i,children:(0,n.jsx)(t.Switch.Thumb,{className:e.cn(`pointer-events-none block size-4 rounded-full bg-card shadow-sm transition-transform`,`translate-x-0.5 data-[state=checked]:translate-x-[18px]`)})})}exports.Switch=r;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { Switch as t } from "radix-ui";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/switch.tsx
|
|
5
|
+
function r({ className: r, ...i }) {
|
|
6
|
+
return /* @__PURE__ */ n(t.Root, {
|
|
7
|
+
"data-slot": "switch",
|
|
8
|
+
className: e("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent bg-muted outline-none transition-colors", "data-[state=checked]:bg-primary focus-visible:ring-2 focus-visible:ring-ring/30", "disabled:cursor-not-allowed disabled:opacity-50", r),
|
|
9
|
+
...i,
|
|
10
|
+
children: /* @__PURE__ */ n(t.Thumb, { className: e("pointer-events-none block size-4 rounded-full bg-card shadow-sm transition-transform", "translate-x-0.5 data-[state=checked]:translate-x-[18px]") })
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { r as Switch };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:t.cn(`w-full caption-bottom text-sm`,e),...n})})}function a({className:e,...n}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:t.cn(`bg-table-header [&_tr]:border-b`,e),...n})}function o({className:e,...n}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:t.cn(`[&_tr:last-child]:border-0`,e),...n})}function s({className:e,...n}){return(0,r.jsx)(`tfoot`,{"data-slot":`table-footer`,className:t.cn(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...n})}function c({className:e,...n}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:t.cn(`border-b border-table-border transition-colors hover:bg-table-hover focus-within:bg-table-hover has-aria-expanded:bg-table-hover data-[state=selected]:bg-table-hover`,e),...n})}function l({className:e,...n}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:t.cn(`h-10 border-r border-table-border px-2 last:border-r-0 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...n})}function u({className:e,...n}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:t.cn(`border-r border-table-border p-2 last:border-r-0 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...n})}function d({className:e,...n}){return(0,r.jsx)(`caption`,{"data-slot":`table-caption`,className:t.cn(`mt-4 text-sm text-muted-foreground`,e),...n})}exports.Table=i,exports.TableBody=o,exports.TableCaption=d,exports.TableCell=u,exports.TableFooter=s,exports.TableHead=l,exports.TableHeader=a,exports.TableRow=c;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/table.tsx
|
|
5
|
+
function n({ className: n, ...r }) {
|
|
6
|
+
return /* @__PURE__ */ t("div", {
|
|
7
|
+
"data-slot": "table-container",
|
|
8
|
+
className: "relative w-full overflow-x-auto",
|
|
9
|
+
children: /* @__PURE__ */ t("table", {
|
|
10
|
+
"data-slot": "table",
|
|
11
|
+
className: e("w-full caption-bottom text-sm", n),
|
|
12
|
+
...r
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function r({ className: n, ...r }) {
|
|
17
|
+
return /* @__PURE__ */ t("thead", {
|
|
18
|
+
"data-slot": "table-header",
|
|
19
|
+
className: e("bg-table-header [&_tr]:border-b", n),
|
|
20
|
+
...r
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function i({ className: n, ...r }) {
|
|
24
|
+
return /* @__PURE__ */ t("tbody", {
|
|
25
|
+
"data-slot": "table-body",
|
|
26
|
+
className: e("[&_tr:last-child]:border-0", n),
|
|
27
|
+
...r
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function a({ className: n, ...r }) {
|
|
31
|
+
return /* @__PURE__ */ t("tfoot", {
|
|
32
|
+
"data-slot": "table-footer",
|
|
33
|
+
className: e("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", n),
|
|
34
|
+
...r
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function o({ className: n, ...r }) {
|
|
38
|
+
return /* @__PURE__ */ t("tr", {
|
|
39
|
+
"data-slot": "table-row",
|
|
40
|
+
className: e("border-b border-table-border transition-colors hover:bg-table-hover focus-within:bg-table-hover has-aria-expanded:bg-table-hover data-[state=selected]:bg-table-hover", n),
|
|
41
|
+
...r
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function s({ className: n, ...r }) {
|
|
45
|
+
return /* @__PURE__ */ t("th", {
|
|
46
|
+
"data-slot": "table-head",
|
|
47
|
+
className: e("h-10 border-r border-table-border px-2 last:border-r-0 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", n),
|
|
48
|
+
...r
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function c({ className: n, ...r }) {
|
|
52
|
+
return /* @__PURE__ */ t("td", {
|
|
53
|
+
"data-slot": "table-cell",
|
|
54
|
+
className: e("border-r border-table-border p-2 last:border-r-0 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", n),
|
|
55
|
+
...r
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
function l({ className: n, ...r }) {
|
|
59
|
+
return /* @__PURE__ */ t("caption", {
|
|
60
|
+
"data-slot": "table-caption",
|
|
61
|
+
className: e("mt-4 text-sm text-muted-foreground", n),
|
|
62
|
+
...r
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { n as Table, i as TableBody, l as TableCaption, c as TableCell, a as TableFooter, s as TableHead, r as TableHeader, o as TableRow };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("radix-ui"),i=require("class-variance-authority"),a=require("react/jsx-runtime");function o({className:e,orientation:n=`horizontal`,...i}){return(0,a.jsx)(r.Tabs.Root,{"data-slot":`tabs`,"data-orientation":n,orientation:n,className:t.cn(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...i})}var s=(0,i.cva)(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function c({className:e,variant:n=`default`,...i}){return(0,a.jsx)(r.Tabs.List,{"data-slot":`tabs-list`,"data-variant":n,className:t.cn(s({variant:n}),e),...i})}function l({className:e,...n}){return(0,a.jsx)(r.Tabs.Trigger,{"data-slot":`tabs-trigger`,className:t.cn(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-muted-foreground transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...n})}function u({className:e,...n}){return(0,a.jsx)(r.Tabs.Content,{"data-slot":`tabs-content`,className:t.cn(`flex-1 outline-none`,e),...n})}exports.Tabs=o,exports.TabsContent=u,exports.TabsList=c,exports.TabsTrigger=l,exports.tabsListVariants=s;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Tabs as t } from "radix-ui";
|
|
5
|
+
import { cva as n } from "class-variance-authority";
|
|
6
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/ui/tabs.tsx
|
|
8
|
+
function i({ className: n, orientation: i = "horizontal", ...a }) {
|
|
9
|
+
return /* @__PURE__ */ r(t.Root, {
|
|
10
|
+
"data-slot": "tabs",
|
|
11
|
+
"data-orientation": i,
|
|
12
|
+
orientation: i,
|
|
13
|
+
className: e("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col", n),
|
|
14
|
+
...a
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
var a = n("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none", {
|
|
18
|
+
variants: { variant: {
|
|
19
|
+
default: "bg-muted",
|
|
20
|
+
line: "gap-1 bg-transparent"
|
|
21
|
+
} },
|
|
22
|
+
defaultVariants: { variant: "default" }
|
|
23
|
+
});
|
|
24
|
+
function o({ className: n, variant: i = "default", ...o }) {
|
|
25
|
+
return /* @__PURE__ */ r(t.List, {
|
|
26
|
+
"data-slot": "tabs-list",
|
|
27
|
+
"data-variant": i,
|
|
28
|
+
className: e(a({ variant: i }), n),
|
|
29
|
+
...o
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function s({ className: n, ...i }) {
|
|
33
|
+
return /* @__PURE__ */ r(t.Trigger, {
|
|
34
|
+
"data-slot": "tabs-trigger",
|
|
35
|
+
className: e("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-muted-foreground transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent", "data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground", "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100", n),
|
|
36
|
+
...i
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function c({ className: n, ...i }) {
|
|
40
|
+
return /* @__PURE__ */ r(t.Content, {
|
|
41
|
+
"data-slot": "tabs-content",
|
|
42
|
+
className: e("flex-1 outline-none", n),
|
|
43
|
+
...i
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { i as Tabs, c as TabsContent, o as TabsList, s as TabsTrigger, a as tabsListVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=(0,require("class-variance-authority").cva)(`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium`,{variants:{tone:{default:`border-transparent bg-muted text-muted-foreground`,primary:`border-transparent bg-primary/12 text-primary`,success:`border-transparent bg-success-soft text-success`,warning:`border-transparent bg-warning-soft text-warning`,danger:`border-transparent bg-danger-soft text-danger`,outline:`border-border bg-transparent text-foreground`}},defaultVariants:{tone:`default`}});exports.tagVariants=e;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { cva as e } from "class-variance-authority";
|
|
2
|
+
//#region src/components/ui/tag-variants.ts
|
|
3
|
+
var t = e("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium", {
|
|
4
|
+
variants: { tone: {
|
|
5
|
+
default: "border-transparent bg-muted text-muted-foreground",
|
|
6
|
+
primary: "border-transparent bg-primary/12 text-primary",
|
|
7
|
+
success: "border-transparent bg-success-soft text-success",
|
|
8
|
+
warning: "border-transparent bg-warning-soft text-warning",
|
|
9
|
+
danger: "border-transparent bg-danger-soft text-danger",
|
|
10
|
+
outline: "border-border bg-transparent text-foreground"
|
|
11
|
+
} },
|
|
12
|
+
defaultVariants: { tone: "default" }
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { t as tagVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../lib/utils.cjs"),t=require("./tag-variants.cjs");let n=require("lucide-react"),r=require("react/jsx-runtime");function i({className:i,tone:a,icon:o,closable:s=!1,onClose:c,closeLabel:l,children:u,...d}){return(0,r.jsxs)(`span`,{"data-slot":`tag`,"data-tone":a??`default`,className:e.cn(t.tagVariants({tone:a}),i),...d,children:[o,u,s&&(0,r.jsx)(`button`,{type:`button`,"aria-label":l??`remove`,className:`-mr-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/15`,onClick:e=>{e.stopPropagation(),c?.()},children:(0,r.jsx)(n.X,{"aria-hidden":`true`,className:`size-3`})})]})}exports.Tag=i;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { tagVariants as t } from "./tag-variants.js";
|
|
3
|
+
import { X as n } from "lucide-react";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/ui/tag.tsx
|
|
6
|
+
function a({ className: a, tone: o, icon: s, closable: c = !1, onClose: l, closeLabel: u, children: d, ...f }) {
|
|
7
|
+
return /* @__PURE__ */ i("span", {
|
|
8
|
+
"data-slot": "tag",
|
|
9
|
+
"data-tone": o ?? "default",
|
|
10
|
+
className: e(t({ tone: o }), a),
|
|
11
|
+
...f,
|
|
12
|
+
children: [
|
|
13
|
+
s,
|
|
14
|
+
d,
|
|
15
|
+
c && /* @__PURE__ */ r("button", {
|
|
16
|
+
type: "button",
|
|
17
|
+
"aria-label": u ?? "remove",
|
|
18
|
+
className: "-mr-0.5 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/15",
|
|
19
|
+
onClick: (e) => {
|
|
20
|
+
e.stopPropagation(), l?.();
|
|
21
|
+
},
|
|
22
|
+
children: /* @__PURE__ */ r(n, {
|
|
23
|
+
"aria-hidden": "true",
|
|
24
|
+
className: "size-3"
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { a as Tag };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs");let n=require("react");n=e.__toESM(n,1);let r=require("react/jsx-runtime");function i({className:e,...n}){return(0,r.jsx)(`textarea`,{"data-slot":`textarea`,className:t.cn(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:border-danger aria-invalid:ring-danger/20 flex min-h-24 w-full rounded-lg border bg-card px-3.5 py-3 text-sm shadow-none outline-none transition-[border-color,box-shadow,background-color] focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50`,e),...n})}exports.Textarea=i;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/ui/textarea.tsx
|
|
5
|
+
function n({ className: n, ...r }) {
|
|
6
|
+
return /* @__PURE__ */ t("textarea", {
|
|
7
|
+
"data-slot": "textarea",
|
|
8
|
+
className: e("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:border-danger aria-invalid:ring-danger/20 flex min-h-24 w-full rounded-lg border bg-card px-3.5 py-3 text-sm shadow-none outline-none transition-[border-color,box-shadow,background-color] focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50", n),
|
|
9
|
+
...r
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { n as Textarea };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("../../_virtual/_rolldown/runtime.cjs"),t=require("../../lib/utils.cjs"),n=require("../../lib/use-ui-translation.cjs"),r=require("./input.cjs");let i=require("react");i=e.__toESM(i,1);let a=require("radix-ui"),o=require("lucide-react"),s=require("react/jsx-runtime");function c({ref:e,className:c,disabled:l,readOnly:u,onKeyDown:d,...f}){let{i18n:p}=n.useUiTranslation(),m=p.language.startsWith(`en`),h=i.useRef(null),[g,_]=i.useState(!1),[v,y]=i.useState(`00:00`);i.useImperativeHandle(e,()=>h.current);function b(e){e&&y(h.current.value||`00:00`),_(e)}function x(e,t){let n=v.split(`:`);n[e]=t;let r=n.join(`:`),i=h.current;Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`).set.call(i,r),i.dispatchEvent(new Event(`input`,{bubbles:!0})),i.dispatchEvent(new Event(`change`,{bubbles:!0})),y(r)}return(0,s.jsxs)(a.Popover.Root,{open:g,onOpenChange:b,children:[(0,s.jsx)(a.Popover.Anchor,{asChild:!0,children:(0,s.jsxs)(`div`,{className:`relative w-full min-w-0`,children:[(0,s.jsx)(`input`,{...f,ref:h,disabled:l,readOnly:u,className:t.cn(r.inputBaseClass,`themed-time-input pr-10`,c),onKeyDown:e=>{d?.(e),!e.defaultPrevented&&e.altKey&&e.key===`ArrowDown`&&!l&&!u&&(e.preventDefault(),b(!0))}}),(0,s.jsx)(a.Popover.Trigger,{asChild:!0,children:(0,s.jsx)(`button`,{type:`button`,disabled:l||u,"aria-label":m?`Choose time`:`选择时间`,className:`absolute right-1 top-1/2 flex size-8 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-50`,children:(0,s.jsx)(o.Clock,{className:`size-4`})})})]})}),(0,s.jsx)(a.Popover.Portal,{children:(0,s.jsxs)(a.Popover.Content,{align:`start`,sideOffset:4,"aria-label":m?`Choose time`:`选择时间`,className:`z-50 w-48 rounded-xl border bg-popover p-2 text-popover-foreground shadow-md`,children:[(0,s.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:[24,60].map((e,n)=>(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`p`,{className:`pb-2 text-center text-xs text-muted-foreground`,children:n===0?m?`Hour`:`时`:m?`Minute`:`分`}),(0,s.jsx)(`div`,{className:`h-48 space-y-1 overflow-y-auto`,role:`group`,"aria-label":n===0?m?`Hour`:`时`:m?`Minute`:`分`,children:Array.from({length:e},(e,r)=>{let i=String(r).padStart(2,`0`),a=v.split(`:`)[n]===i;return(0,s.jsx)(`button`,{type:`button`,"aria-pressed":a,ref:e=>{e&&a&&e.scrollIntoView?.({block:`nearest`})},onClick:()=>x(n,i),className:t.cn(`h-8 w-full rounded-md text-sm tabular-nums outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring`,a&&`bg-primary text-primary-foreground hover:bg-primary`),children:i},i)})})]},n))}),(0,s.jsx)(`div`,{className:`mt-2 flex justify-end border-t pt-2`,children:(0,s.jsx)(`button`,{type:`button`,onClick:()=>_(!1),className:`rounded-md px-3 py-1 text-sm text-primary hover:bg-accent`,children:m?`Done`:`完成`})})]})})]})}exports.TimeInput=c;
|