react-shadcn-kit 0.0.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/LICENSE +7 -0
- package/README.md +113 -0
- package/dist/assets/global.css +1 -0
- package/dist/atoms/accordion.d.ts +7 -0
- package/dist/atoms/accordion.js +62 -0
- package/dist/atoms/alert-dialog.d.ts +14 -0
- package/dist/atoms/alert-dialog.js +127 -0
- package/dist/atoms/alert.d.ts +9 -0
- package/dist/atoms/alert.js +60 -0
- package/dist/atoms/aspect-ratio.d.ts +3 -0
- package/dist/atoms/aspect-ratio.js +8 -0
- package/dist/atoms/avatar.d.ts +6 -0
- package/dist/atoms/avatar.js +41 -0
- package/dist/atoms/badge.d.ts +9 -0
- package/dist/atoms/badge.js +32 -0
- package/dist/atoms/breadcrumb.d.ts +11 -0
- package/dist/atoms/breadcrumb.js +95 -0
- package/dist/atoms/button-group.d.ts +11 -0
- package/dist/atoms/button-group.js +75 -0
- package/dist/atoms/button.d.ts +10 -0
- package/dist/atoms/button.js +51 -0
- package/dist/atoms/calendar.d.ts +8 -0
- package/dist/atoms/calendar.js +144 -0
- package/dist/atoms/card.d.ts +9 -0
- package/dist/atoms/card.js +80 -0
- package/dist/atoms/carousel.d.ts +19 -0
- package/dist/atoms/carousel.js +165 -0
- package/dist/atoms/chart.d.ts +43 -0
- package/dist/atoms/chart.js +203 -0
- package/dist/atoms/checkbox.d.ts +4 -0
- package/dist/atoms/checkbox.js +28 -0
- package/dist/atoms/collapsible.d.ts +5 -0
- package/dist/atoms/collapsible.js +20 -0
- package/dist/atoms/command.d.ts +18 -0
- package/dist/atoms/command.js +143 -0
- package/dist/atoms/context-menu.d.ts +25 -0
- package/dist/atoms/context-menu.js +200 -0
- package/dist/atoms/dialog.d.ts +15 -0
- package/dist/atoms/dialog.js +122 -0
- package/dist/atoms/drawer.d.ts +13 -0
- package/dist/atoms/drawer.js +117 -0
- package/dist/atoms/dropdown-menu.d.ts +25 -0
- package/dist/atoms/dropdown-menu.js +204 -0
- package/dist/atoms/empty.d.ts +11 -0
- package/dist/atoms/empty.js +99 -0
- package/dist/atoms/field.d.ts +24 -0
- package/dist/atoms/field.js +208 -0
- package/dist/atoms/form.d.ts +24 -0
- package/dist/atoms/form.js +87 -0
- package/dist/atoms/hover-card.d.ts +6 -0
- package/dist/atoms/hover-card.js +34 -0
- package/dist/atoms/input-group.d.ts +16 -0
- package/dist/atoms/input-group.js +142 -0
- package/dist/atoms/input-otp.d.ts +11 -0
- package/dist/atoms/input-otp.js +55 -0
- package/dist/atoms/input.d.ts +3 -0
- package/dist/atoms/input.js +21 -0
- package/dist/atoms/item.d.ts +23 -0
- package/dist/atoms/item.js +164 -0
- package/dist/atoms/kbd.d.ts +3 -0
- package/dist/atoms/kbd.js +31 -0
- package/dist/atoms/label.d.ts +4 -0
- package/dist/atoms/label.js +19 -0
- package/dist/atoms/menubar.d.ts +26 -0
- package/dist/atoms/menubar.js +229 -0
- package/dist/atoms/navigation-menu.d.ts +14 -0
- package/dist/atoms/navigation-menu.js +159 -0
- package/dist/atoms/pagination.d.ts +13 -0
- package/dist/atoms/pagination.js +100 -0
- package/dist/atoms/popover.d.ts +7 -0
- package/dist/atoms/popover.js +38 -0
- package/dist/atoms/progress.d.ts +4 -0
- package/dist/atoms/progress.js +28 -0
- package/dist/atoms/radio-group.d.ts +5 -0
- package/dist/atoms/radio-group.js +45 -0
- package/dist/atoms/resizable.d.ts +8 -0
- package/dist/atoms/resizable.js +43 -0
- package/dist/atoms/scroll-area.d.ts +5 -0
- package/dist/atoms/scroll-area.js +60 -0
- package/dist/atoms/select.d.ts +15 -0
- package/dist/atoms/select.js +156 -0
- package/dist/atoms/separator.d.ts +4 -0
- package/dist/atoms/separator.js +26 -0
- package/dist/atoms/sheet.d.ts +13 -0
- package/dist/atoms/sheet.js +117 -0
- package/dist/atoms/sidebar.d.ts +69 -0
- package/dist/atoms/sidebar.js +570 -0
- package/dist/atoms/skeleton.d.ts +2 -0
- package/dist/atoms/skeleton.js +15 -0
- package/dist/atoms/slider.d.ts +4 -0
- package/dist/atoms/slider.js +63 -0
- package/dist/atoms/sonner.d.ts +3 -0
- package/dist/atoms/sonner.js +31 -0
- package/dist/atoms/spinner.d.ts +2 -0
- package/dist/atoms/spinner.js +17 -0
- package/dist/atoms/switch.d.ts +4 -0
- package/dist/atoms/switch.js +28 -0
- package/dist/atoms/table.d.ts +10 -0
- package/dist/atoms/table.js +94 -0
- package/dist/atoms/tabs.d.ts +7 -0
- package/dist/atoms/tabs.js +55 -0
- package/dist/atoms/textarea.d.ts +3 -0
- package/dist/atoms/textarea.js +18 -0
- package/dist/atoms/toggle-group.d.ts +9 -0
- package/dist/atoms/toggle-group.js +68 -0
- package/dist/atoms/toggle.d.ts +9 -0
- package/dist/atoms/toggle.js +43 -0
- package/dist/atoms/tooltip.d.ts +7 -0
- package/dist/atoms/tooltip.js +51 -0
- package/dist/config/default-navigation.js +136 -0
- package/dist/hooks/use-mobile.d.ts +1 -0
- package/dist/hooks/use-mobile.js +14 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.js +347 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/molecules/app-navbar.d.ts +11 -0
- package/dist/molecules/app-navbar.js +117 -0
- package/dist/molecules/app-sidebar.d.ts +9 -0
- package/dist/molecules/app-sidebar.js +121 -0
- package/dist/organisms/layout.d.ts +3 -0
- package/dist/organisms/layout.js +16 -0
- package/package.json +120 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
import { jsx as t, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { Slot as h } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as M } from "class-variance-authority";
|
|
5
|
+
import { PanelLeftIcon as z } from "lucide-react";
|
|
6
|
+
import { useIsMobile as I } from "../hooks/use-mobile.js";
|
|
7
|
+
import { cn as r } from "../lib/utils.js";
|
|
8
|
+
import { Button as E } from "./button.js";
|
|
9
|
+
import { Input as D } from "./input.js";
|
|
10
|
+
import { Separator as T } from "./separator.js";
|
|
11
|
+
import { Sheet as B, SheetContent as A, SheetHeader as O, SheetTitle as R, SheetDescription as H } from "./sheet.js";
|
|
12
|
+
import { Skeleton as y } from "./skeleton.js";
|
|
13
|
+
import { Tooltip as K, TooltipTrigger as j, TooltipContent as G, TooltipProvider as L } from "./tooltip.js";
|
|
14
|
+
const W = "sidebar_state", $ = 3600 * 24 * 7, P = "16rem", V = "18rem", q = "3rem", F = "b", C = s.createContext(null);
|
|
15
|
+
function S() {
|
|
16
|
+
const a = s.useContext(C);
|
|
17
|
+
if (!a)
|
|
18
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
19
|
+
return a;
|
|
20
|
+
}
|
|
21
|
+
function de({
|
|
22
|
+
defaultOpen: a = !0,
|
|
23
|
+
open: e,
|
|
24
|
+
onOpenChange: i,
|
|
25
|
+
className: o,
|
|
26
|
+
style: n,
|
|
27
|
+
children: c,
|
|
28
|
+
...m
|
|
29
|
+
}) {
|
|
30
|
+
const l = I(), [f, u] = s.useState(!1), [v, _] = s.useState(a), g = e ?? v, x = s.useCallback(
|
|
31
|
+
(d) => {
|
|
32
|
+
const b = typeof d == "function" ? d(g) : d;
|
|
33
|
+
i ? i(b) : _(b), document.cookie = `${W}=${b}; path=/; max-age=${$}`;
|
|
34
|
+
},
|
|
35
|
+
[i, g]
|
|
36
|
+
), w = s.useCallback(() => l ? u((d) => !d) : x((d) => !d), [l, x, u]);
|
|
37
|
+
s.useEffect(() => {
|
|
38
|
+
const d = (b) => {
|
|
39
|
+
b.key === F && (b.metaKey || b.ctrlKey) && (b.preventDefault(), w());
|
|
40
|
+
};
|
|
41
|
+
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
42
|
+
}, [w]);
|
|
43
|
+
const N = g ? "expanded" : "collapsed", k = s.useMemo(
|
|
44
|
+
() => ({
|
|
45
|
+
state: N,
|
|
46
|
+
open: g,
|
|
47
|
+
setOpen: x,
|
|
48
|
+
isMobile: l,
|
|
49
|
+
openMobile: f,
|
|
50
|
+
setOpenMobile: u,
|
|
51
|
+
toggleSidebar: w
|
|
52
|
+
}),
|
|
53
|
+
[N, g, x, l, f, u, w]
|
|
54
|
+
);
|
|
55
|
+
return /* @__PURE__ */ t(C.Provider, { value: k, children: /* @__PURE__ */ t(L, { delayDuration: 0, children: /* @__PURE__ */ t(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
"data-slot": "sidebar-wrapper",
|
|
59
|
+
style: {
|
|
60
|
+
"--sidebar-width": P,
|
|
61
|
+
"--sidebar-width-icon": q,
|
|
62
|
+
...n
|
|
63
|
+
},
|
|
64
|
+
className: r(
|
|
65
|
+
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
|
|
66
|
+
o
|
|
67
|
+
),
|
|
68
|
+
...m,
|
|
69
|
+
children: c
|
|
70
|
+
}
|
|
71
|
+
) }) });
|
|
72
|
+
}
|
|
73
|
+
function se({
|
|
74
|
+
side: a = "left",
|
|
75
|
+
variant: e = "sidebar",
|
|
76
|
+
collapsible: i = "offcanvas",
|
|
77
|
+
className: o,
|
|
78
|
+
children: n,
|
|
79
|
+
...c
|
|
80
|
+
}) {
|
|
81
|
+
const { isMobile: m, state: l, openMobile: f, setOpenMobile: u } = S();
|
|
82
|
+
return i === "none" ? /* @__PURE__ */ t(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "sidebar",
|
|
86
|
+
className: r(
|
|
87
|
+
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
88
|
+
o
|
|
89
|
+
),
|
|
90
|
+
...c,
|
|
91
|
+
children: n
|
|
92
|
+
}
|
|
93
|
+
) : m ? /* @__PURE__ */ t(B, { open: f, onOpenChange: u, ...c, children: /* @__PURE__ */ p(
|
|
94
|
+
A,
|
|
95
|
+
{
|
|
96
|
+
"data-sidebar": "sidebar",
|
|
97
|
+
"data-slot": "sidebar",
|
|
98
|
+
"data-mobile": "true",
|
|
99
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
100
|
+
style: {
|
|
101
|
+
"--sidebar-width": V
|
|
102
|
+
},
|
|
103
|
+
side: a,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ p(O, { className: "sr-only", children: [
|
|
106
|
+
/* @__PURE__ */ t(R, { children: "Sidebar" }),
|
|
107
|
+
/* @__PURE__ */ t(H, { children: "Displays the mobile sidebar." })
|
|
108
|
+
] }),
|
|
109
|
+
/* @__PURE__ */ t("div", { className: "flex h-full w-full flex-col", children: n })
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
) }) : /* @__PURE__ */ p(
|
|
113
|
+
"div",
|
|
114
|
+
{
|
|
115
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
116
|
+
"data-state": l,
|
|
117
|
+
"data-collapsible": l === "collapsed" ? i : "",
|
|
118
|
+
"data-variant": e,
|
|
119
|
+
"data-side": a,
|
|
120
|
+
"data-slot": "sidebar",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ t(
|
|
123
|
+
"div",
|
|
124
|
+
{
|
|
125
|
+
"data-slot": "sidebar-gap",
|
|
126
|
+
className: r(
|
|
127
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
128
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
129
|
+
"group-data-[side=right]:rotate-180",
|
|
130
|
+
e === "floating" || e === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ t(
|
|
135
|
+
"div",
|
|
136
|
+
{
|
|
137
|
+
"data-slot": "sidebar-container",
|
|
138
|
+
className: r(
|
|
139
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
140
|
+
a === "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)]",
|
|
141
|
+
// Adjust the padding for floating and inset variants.
|
|
142
|
+
e === "floating" || e === "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",
|
|
143
|
+
o
|
|
144
|
+
),
|
|
145
|
+
...c,
|
|
146
|
+
children: /* @__PURE__ */ t(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
"data-sidebar": "sidebar",
|
|
150
|
+
"data-slot": "sidebar-inner",
|
|
151
|
+
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
152
|
+
children: n
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
function le({ className: a, onClick: e, ...i }) {
|
|
162
|
+
const { toggleSidebar: o } = S();
|
|
163
|
+
return /* @__PURE__ */ p(
|
|
164
|
+
E,
|
|
165
|
+
{
|
|
166
|
+
"data-sidebar": "trigger",
|
|
167
|
+
"data-slot": "sidebar-trigger",
|
|
168
|
+
variant: "ghost",
|
|
169
|
+
size: "icon",
|
|
170
|
+
className: r("size-7", a),
|
|
171
|
+
onClick: (n) => {
|
|
172
|
+
e?.(n), o();
|
|
173
|
+
},
|
|
174
|
+
...i,
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ t(z, {}),
|
|
177
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
function ce({ className: a, ...e }) {
|
|
183
|
+
const { toggleSidebar: i } = S();
|
|
184
|
+
return /* @__PURE__ */ t(
|
|
185
|
+
"button",
|
|
186
|
+
{
|
|
187
|
+
"data-sidebar": "rail",
|
|
188
|
+
"data-slot": "sidebar-rail",
|
|
189
|
+
"aria-label": "Toggle Sidebar",
|
|
190
|
+
tabIndex: -1,
|
|
191
|
+
onClick: i,
|
|
192
|
+
title: "Toggle Sidebar",
|
|
193
|
+
className: r(
|
|
194
|
+
"hover:after:bg-sidebar-border 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] sm:flex",
|
|
195
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
196
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
197
|
+
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
198
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
199
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
200
|
+
a
|
|
201
|
+
),
|
|
202
|
+
...e
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
function ue({ className: a, ...e }) {
|
|
207
|
+
return /* @__PURE__ */ t(
|
|
208
|
+
"main",
|
|
209
|
+
{
|
|
210
|
+
"data-slot": "sidebar-inset",
|
|
211
|
+
className: r(
|
|
212
|
+
"bg-background relative flex w-full flex-1 flex-col",
|
|
213
|
+
"md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
|
|
214
|
+
a
|
|
215
|
+
),
|
|
216
|
+
...e
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
function be({ className: a, ...e }) {
|
|
221
|
+
return /* @__PURE__ */ t(
|
|
222
|
+
D,
|
|
223
|
+
{
|
|
224
|
+
"data-slot": "sidebar-input",
|
|
225
|
+
"data-sidebar": "input",
|
|
226
|
+
className: r("bg-background h-8 w-full shadow-none", a),
|
|
227
|
+
...e
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
function fe({ className: a, ...e }) {
|
|
232
|
+
return /* @__PURE__ */ t(
|
|
233
|
+
"div",
|
|
234
|
+
{
|
|
235
|
+
"data-slot": "sidebar-header",
|
|
236
|
+
"data-sidebar": "header",
|
|
237
|
+
className: r("flex flex-col gap-2 p-2", a),
|
|
238
|
+
...e
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
function pe({ className: a, ...e }) {
|
|
243
|
+
return /* @__PURE__ */ t(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
"data-slot": "sidebar-footer",
|
|
247
|
+
"data-sidebar": "footer",
|
|
248
|
+
className: r("flex flex-col gap-2 p-2", a),
|
|
249
|
+
...e
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
function me({ className: a, ...e }) {
|
|
254
|
+
return /* @__PURE__ */ t(
|
|
255
|
+
T,
|
|
256
|
+
{
|
|
257
|
+
"data-slot": "sidebar-separator",
|
|
258
|
+
"data-sidebar": "separator",
|
|
259
|
+
className: r("bg-sidebar-border mx-2 w-auto", a),
|
|
260
|
+
...e
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
function ge({ className: a, ...e }) {
|
|
265
|
+
return /* @__PURE__ */ t(
|
|
266
|
+
"div",
|
|
267
|
+
{
|
|
268
|
+
"data-slot": "sidebar-content",
|
|
269
|
+
"data-sidebar": "content",
|
|
270
|
+
className: r(
|
|
271
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
272
|
+
a
|
|
273
|
+
),
|
|
274
|
+
...e
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
function he({ className: a, ...e }) {
|
|
279
|
+
return /* @__PURE__ */ t(
|
|
280
|
+
"div",
|
|
281
|
+
{
|
|
282
|
+
"data-slot": "sidebar-group",
|
|
283
|
+
"data-sidebar": "group",
|
|
284
|
+
className: r("relative flex w-full min-w-0 flex-col p-2", a),
|
|
285
|
+
...e
|
|
286
|
+
}
|
|
287
|
+
);
|
|
288
|
+
}
|
|
289
|
+
function ve({
|
|
290
|
+
className: a,
|
|
291
|
+
asChild: e = !1,
|
|
292
|
+
...i
|
|
293
|
+
}) {
|
|
294
|
+
return /* @__PURE__ */ t(
|
|
295
|
+
e ? h : "div",
|
|
296
|
+
{
|
|
297
|
+
"data-slot": "sidebar-group-label",
|
|
298
|
+
"data-sidebar": "group-label",
|
|
299
|
+
className: r(
|
|
300
|
+
"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
301
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
302
|
+
a
|
|
303
|
+
),
|
|
304
|
+
...i
|
|
305
|
+
}
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
function xe({
|
|
309
|
+
className: a,
|
|
310
|
+
asChild: e = !1,
|
|
311
|
+
...i
|
|
312
|
+
}) {
|
|
313
|
+
return /* @__PURE__ */ t(
|
|
314
|
+
e ? h : "button",
|
|
315
|
+
{
|
|
316
|
+
"data-slot": "sidebar-group-action",
|
|
317
|
+
"data-sidebar": "group-action",
|
|
318
|
+
className: r(
|
|
319
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
320
|
+
// Increases the hit area of the button on mobile.
|
|
321
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
322
|
+
"group-data-[collapsible=icon]:hidden",
|
|
323
|
+
a
|
|
324
|
+
),
|
|
325
|
+
...i
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
function we({ className: a, ...e }) {
|
|
330
|
+
return /* @__PURE__ */ t(
|
|
331
|
+
"div",
|
|
332
|
+
{
|
|
333
|
+
"data-slot": "sidebar-group-content",
|
|
334
|
+
"data-sidebar": "group-content",
|
|
335
|
+
className: r("w-full text-sm", a),
|
|
336
|
+
...e
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
function Se({ className: a, ...e }) {
|
|
341
|
+
return /* @__PURE__ */ t(
|
|
342
|
+
"ul",
|
|
343
|
+
{
|
|
344
|
+
"data-slot": "sidebar-menu",
|
|
345
|
+
"data-sidebar": "menu",
|
|
346
|
+
className: r("flex w-full min-w-0 flex-col gap-1", a),
|
|
347
|
+
...e
|
|
348
|
+
}
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
function Ne({ className: a, ...e }) {
|
|
352
|
+
return /* @__PURE__ */ t(
|
|
353
|
+
"li",
|
|
354
|
+
{
|
|
355
|
+
"data-slot": "sidebar-menu-item",
|
|
356
|
+
"data-sidebar": "menu-item",
|
|
357
|
+
className: r("group/menu-item relative", a),
|
|
358
|
+
...e
|
|
359
|
+
}
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
const U = M(
|
|
363
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] 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 group-has-data-[sidebar=menu-action]/menu-item:pr-8 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 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
364
|
+
{
|
|
365
|
+
variants: {
|
|
366
|
+
variant: {
|
|
367
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
368
|
+
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
369
|
+
},
|
|
370
|
+
size: {
|
|
371
|
+
default: "h-8 text-sm",
|
|
372
|
+
sm: "h-7 text-xs",
|
|
373
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
defaultVariants: {
|
|
377
|
+
variant: "default",
|
|
378
|
+
size: "default"
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
);
|
|
382
|
+
function ye({
|
|
383
|
+
asChild: a = !1,
|
|
384
|
+
isActive: e = !1,
|
|
385
|
+
variant: i = "default",
|
|
386
|
+
size: o = "default",
|
|
387
|
+
tooltip: n,
|
|
388
|
+
className: c,
|
|
389
|
+
...m
|
|
390
|
+
}) {
|
|
391
|
+
const l = a ? h : "button", { isMobile: f, state: u } = S(), v = /* @__PURE__ */ t(
|
|
392
|
+
l,
|
|
393
|
+
{
|
|
394
|
+
"data-slot": "sidebar-menu-button",
|
|
395
|
+
"data-sidebar": "menu-button",
|
|
396
|
+
"data-size": o,
|
|
397
|
+
"data-active": e,
|
|
398
|
+
className: r(U({ variant: i, size: o }), c),
|
|
399
|
+
...m
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
return n ? (typeof n == "string" && (n = {
|
|
403
|
+
children: n
|
|
404
|
+
}), /* @__PURE__ */ p(K, { children: [
|
|
405
|
+
/* @__PURE__ */ t(j, { asChild: !0, children: v }),
|
|
406
|
+
/* @__PURE__ */ t(
|
|
407
|
+
G,
|
|
408
|
+
{
|
|
409
|
+
side: "right",
|
|
410
|
+
align: "center",
|
|
411
|
+
hidden: u !== "collapsed" || f,
|
|
412
|
+
...n
|
|
413
|
+
}
|
|
414
|
+
)
|
|
415
|
+
] })) : v;
|
|
416
|
+
}
|
|
417
|
+
function Ce({
|
|
418
|
+
className: a,
|
|
419
|
+
asChild: e = !1,
|
|
420
|
+
showOnHover: i = !1,
|
|
421
|
+
...o
|
|
422
|
+
}) {
|
|
423
|
+
return /* @__PURE__ */ t(
|
|
424
|
+
e ? h : "button",
|
|
425
|
+
{
|
|
426
|
+
"data-slot": "sidebar-menu-action",
|
|
427
|
+
"data-sidebar": "menu-action",
|
|
428
|
+
className: r(
|
|
429
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
430
|
+
// Increases the hit area of the button on mobile.
|
|
431
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
432
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
433
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
434
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
435
|
+
"group-data-[collapsible=icon]:hidden",
|
|
436
|
+
i && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",
|
|
437
|
+
a
|
|
438
|
+
),
|
|
439
|
+
...o
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
}
|
|
443
|
+
function _e({ className: a, ...e }) {
|
|
444
|
+
return /* @__PURE__ */ t(
|
|
445
|
+
"div",
|
|
446
|
+
{
|
|
447
|
+
"data-slot": "sidebar-menu-badge",
|
|
448
|
+
"data-sidebar": "menu-badge",
|
|
449
|
+
className: r(
|
|
450
|
+
"text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none",
|
|
451
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
452
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
453
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
454
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
455
|
+
"group-data-[collapsible=icon]:hidden",
|
|
456
|
+
a
|
|
457
|
+
),
|
|
458
|
+
...e
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
function ke({
|
|
463
|
+
className: a,
|
|
464
|
+
showIcon: e = !1,
|
|
465
|
+
...i
|
|
466
|
+
}) {
|
|
467
|
+
const [o, n] = s.useState("50%");
|
|
468
|
+
return s.useEffect(() => {
|
|
469
|
+
n(`${Math.floor(Math.random() * 40) + 50}%`);
|
|
470
|
+
}, []), /* @__PURE__ */ p(
|
|
471
|
+
"div",
|
|
472
|
+
{
|
|
473
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
474
|
+
"data-sidebar": "menu-skeleton",
|
|
475
|
+
className: r("flex h-8 items-center gap-2 rounded-md px-2", a),
|
|
476
|
+
...i,
|
|
477
|
+
children: [
|
|
478
|
+
e && /* @__PURE__ */ t(y, { className: "size-4 rounded-md", "data-sidebar": "menu-skeleton-icon" }),
|
|
479
|
+
/* @__PURE__ */ t(
|
|
480
|
+
y,
|
|
481
|
+
{
|
|
482
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
483
|
+
"data-sidebar": "menu-skeleton-text",
|
|
484
|
+
style: {
|
|
485
|
+
"--skeleton-width": o
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
)
|
|
489
|
+
]
|
|
490
|
+
}
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
function Me({ className: a, ...e }) {
|
|
494
|
+
return /* @__PURE__ */ t(
|
|
495
|
+
"ul",
|
|
496
|
+
{
|
|
497
|
+
"data-slot": "sidebar-menu-sub",
|
|
498
|
+
"data-sidebar": "menu-sub",
|
|
499
|
+
className: r(
|
|
500
|
+
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
|
|
501
|
+
"group-data-[collapsible=icon]:hidden",
|
|
502
|
+
a
|
|
503
|
+
),
|
|
504
|
+
...e
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
function ze({ className: a, ...e }) {
|
|
509
|
+
return /* @__PURE__ */ t(
|
|
510
|
+
"li",
|
|
511
|
+
{
|
|
512
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
513
|
+
"data-sidebar": "menu-sub-item",
|
|
514
|
+
className: r("group/menu-sub-item relative", a),
|
|
515
|
+
...e
|
|
516
|
+
}
|
|
517
|
+
);
|
|
518
|
+
}
|
|
519
|
+
function Ie({
|
|
520
|
+
asChild: a = !1,
|
|
521
|
+
size: e = "md",
|
|
522
|
+
isActive: i = !1,
|
|
523
|
+
className: o,
|
|
524
|
+
...n
|
|
525
|
+
}) {
|
|
526
|
+
return /* @__PURE__ */ t(
|
|
527
|
+
a ? h : "a",
|
|
528
|
+
{
|
|
529
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
530
|
+
"data-sidebar": "menu-sub-button",
|
|
531
|
+
"data-size": e,
|
|
532
|
+
"data-active": i,
|
|
533
|
+
className: r(
|
|
534
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 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",
|
|
535
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
536
|
+
e === "sm" && "text-xs",
|
|
537
|
+
e === "md" && "text-sm",
|
|
538
|
+
"group-data-[collapsible=icon]:hidden",
|
|
539
|
+
o
|
|
540
|
+
),
|
|
541
|
+
...n
|
|
542
|
+
}
|
|
543
|
+
);
|
|
544
|
+
}
|
|
545
|
+
export {
|
|
546
|
+
se as Sidebar,
|
|
547
|
+
ge as SidebarContent,
|
|
548
|
+
pe as SidebarFooter,
|
|
549
|
+
he as SidebarGroup,
|
|
550
|
+
xe as SidebarGroupAction,
|
|
551
|
+
we as SidebarGroupContent,
|
|
552
|
+
ve as SidebarGroupLabel,
|
|
553
|
+
fe as SidebarHeader,
|
|
554
|
+
be as SidebarInput,
|
|
555
|
+
ue as SidebarInset,
|
|
556
|
+
Se as SidebarMenu,
|
|
557
|
+
Ce as SidebarMenuAction,
|
|
558
|
+
_e as SidebarMenuBadge,
|
|
559
|
+
ye as SidebarMenuButton,
|
|
560
|
+
Ne as SidebarMenuItem,
|
|
561
|
+
ke as SidebarMenuSkeleton,
|
|
562
|
+
Me as SidebarMenuSub,
|
|
563
|
+
Ie as SidebarMenuSubButton,
|
|
564
|
+
ze as SidebarMenuSubItem,
|
|
565
|
+
de as SidebarProvider,
|
|
566
|
+
ce as SidebarRail,
|
|
567
|
+
me as SidebarSeparator,
|
|
568
|
+
le as SidebarTrigger,
|
|
569
|
+
S as useSidebar
|
|
570
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { cn as n } from "../lib/utils.js";
|
|
3
|
+
function m({ className: e, ...t }) {
|
|
4
|
+
return /* @__PURE__ */ o(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
"data-slot": "skeleton",
|
|
8
|
+
className: n("bg-accent animate-pulse rounded-md", e),
|
|
9
|
+
...t
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
m as Skeleton
|
|
15
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
3
|
+
declare function Slider({ className, defaultValue, value, min, max, ...props }: React.ComponentProps<typeof SliderPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Slider };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsxs as h, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import * as m from "react";
|
|
3
|
+
import * as a from "@radix-ui/react-slider";
|
|
4
|
+
import { cn as n } from "../lib/utils.js";
|
|
5
|
+
function v({
|
|
6
|
+
className: l,
|
|
7
|
+
defaultValue: r,
|
|
8
|
+
value: t,
|
|
9
|
+
min: i = 0,
|
|
10
|
+
max: o = 100,
|
|
11
|
+
...s
|
|
12
|
+
}) {
|
|
13
|
+
const d = m.useMemo(
|
|
14
|
+
() => Array.isArray(t) ? t : Array.isArray(r) ? r : [i, o],
|
|
15
|
+
[t, r, i, o]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ h(
|
|
18
|
+
a.Root,
|
|
19
|
+
{
|
|
20
|
+
"data-slot": "slider",
|
|
21
|
+
defaultValue: r,
|
|
22
|
+
value: t,
|
|
23
|
+
min: i,
|
|
24
|
+
max: o,
|
|
25
|
+
className: n(
|
|
26
|
+
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
27
|
+
l
|
|
28
|
+
),
|
|
29
|
+
...s,
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ e(
|
|
32
|
+
a.Track,
|
|
33
|
+
{
|
|
34
|
+
"data-slot": "slider-track",
|
|
35
|
+
className: n(
|
|
36
|
+
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
37
|
+
),
|
|
38
|
+
children: /* @__PURE__ */ e(
|
|
39
|
+
a.Range,
|
|
40
|
+
{
|
|
41
|
+
"data-slot": "slider-range",
|
|
42
|
+
className: n(
|
|
43
|
+
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
Array.from({ length: d.length }, (f, c) => /* @__PURE__ */ e(
|
|
50
|
+
a.Thumb,
|
|
51
|
+
{
|
|
52
|
+
"data-slot": "slider-thumb",
|
|
53
|
+
className: "border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
54
|
+
},
|
|
55
|
+
c
|
|
56
|
+
))
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
v as Slider
|
|
63
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Loader2Icon as s, OctagonXIcon as a, TriangleAlertIcon as n, InfoIcon as m, CircleCheckIcon as t } from "lucide-react";
|
|
3
|
+
import { useTheme as c } from "next-themes";
|
|
4
|
+
import { Toaster as i } from "sonner";
|
|
5
|
+
const g = ({ ...o }) => {
|
|
6
|
+
const { theme: e = "system" } = c();
|
|
7
|
+
return /* @__PURE__ */ r(
|
|
8
|
+
i,
|
|
9
|
+
{
|
|
10
|
+
theme: e,
|
|
11
|
+
className: "toaster group",
|
|
12
|
+
icons: {
|
|
13
|
+
success: /* @__PURE__ */ r(t, { className: "size-4" }),
|
|
14
|
+
info: /* @__PURE__ */ r(m, { className: "size-4" }),
|
|
15
|
+
warning: /* @__PURE__ */ r(n, { className: "size-4" }),
|
|
16
|
+
error: /* @__PURE__ */ r(a, { className: "size-4" }),
|
|
17
|
+
loading: /* @__PURE__ */ r(s, { className: "size-4 animate-spin" })
|
|
18
|
+
},
|
|
19
|
+
style: {
|
|
20
|
+
"--normal-bg": "var(--popover)",
|
|
21
|
+
"--normal-text": "var(--popover-foreground)",
|
|
22
|
+
"--normal-border": "var(--border)",
|
|
23
|
+
"--border-radius": "var(--radius)"
|
|
24
|
+
},
|
|
25
|
+
...o
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
g as Toaster
|
|
31
|
+
};
|