@yimingliao/cms 0.0.106 → 0.0.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XWXG67I4.js → chunk-4BSB3AZG.js} +1 -1
- package/dist/chunk-Q654SMCX.js +1511 -0
- package/dist/{chunk-OAENV763.js → chunk-VSV6SQWC.js} +8 -1
- package/dist/client/index.d.ts +41 -5
- package/dist/client/index.js +353 -79
- package/dist/client/shadcn/index.d.ts +53 -8
- package/dist/client/shadcn/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/sidebar-Dei7UxR1.d.ts +94 -0
- package/dist/storage/r2/index.js +2 -2
- package/dist/storage/sftp/index.js +2 -2
- package/package.json +7 -1
- package/dist/chunk-FLKUBNE4.js +0 -421
- package/dist/label-BF4qxS03.d.ts +0 -19
|
@@ -0,0 +1,1511 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
import * as React11 from 'react';
|
|
4
|
+
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
5
|
+
import { usePathname } from 'next/navigation';
|
|
6
|
+
import { UAParser } from 'ua-parser-js';
|
|
7
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
8
|
+
import { cva } from 'class-variance-authority';
|
|
9
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
10
|
+
import { Loader2Icon, XIcon, PanelLeftIcon, CheckIcon, CircleIcon, ChevronRightIcon } from 'lucide-react';
|
|
11
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
12
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
13
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
14
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
15
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
16
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
17
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
18
|
+
|
|
19
|
+
// src/client/applications/ui/utils.ts
|
|
20
|
+
var cn = (...inputs) => {
|
|
21
|
+
return twMerge(clsx(inputs));
|
|
22
|
+
};
|
|
23
|
+
var useCountdown = (initialTime) => {
|
|
24
|
+
const [timeLeft, setTimeLeft] = useState(initialTime);
|
|
25
|
+
const [isCounting, setIsCounting] = useState(false);
|
|
26
|
+
const intervalRef = useRef(null);
|
|
27
|
+
const startCountdown = useCallback(() => {
|
|
28
|
+
setTimeLeft(initialTime);
|
|
29
|
+
setIsCounting(true);
|
|
30
|
+
}, [initialTime]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
if (!isCounting) return;
|
|
33
|
+
intervalRef.current = setInterval(() => {
|
|
34
|
+
setTimeLeft((prev) => {
|
|
35
|
+
if (prev <= 1) {
|
|
36
|
+
clearInterval(intervalRef.current);
|
|
37
|
+
intervalRef.current = null;
|
|
38
|
+
setIsCounting(false);
|
|
39
|
+
return 0;
|
|
40
|
+
}
|
|
41
|
+
return prev - 1;
|
|
42
|
+
});
|
|
43
|
+
}, 1e3);
|
|
44
|
+
return () => {
|
|
45
|
+
if (intervalRef.current) {
|
|
46
|
+
clearInterval(intervalRef.current);
|
|
47
|
+
intervalRef.current = null;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}, [isCounting]);
|
|
51
|
+
return { timeLeft, isCounting, startCountdown };
|
|
52
|
+
};
|
|
53
|
+
var useParentPathname = () => {
|
|
54
|
+
const pathname = usePathname();
|
|
55
|
+
if (pathname === "/") return "/";
|
|
56
|
+
const index = pathname.lastIndexOf("/");
|
|
57
|
+
return index <= 0 ? "/" : pathname.slice(0, index);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
// src/client/applications/ui/is-confirm.ts
|
|
61
|
+
var isConfirm = (t, key = "ui.dialog.confirm.text") => {
|
|
62
|
+
return confirm(t(key));
|
|
63
|
+
};
|
|
64
|
+
function useDeviceInfo() {
|
|
65
|
+
const [deviceInfo, setDeviceInfo] = useState(null);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
const parser = new UAParser(navigator.userAgent);
|
|
68
|
+
const result = parser.getResult();
|
|
69
|
+
setDeviceInfo({
|
|
70
|
+
deviceType: result.device.type || "desktop",
|
|
71
|
+
platform: result.os.name || "Unknown",
|
|
72
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
73
|
+
language: navigator.language,
|
|
74
|
+
screenResolution: {
|
|
75
|
+
width: window.screen.width,
|
|
76
|
+
height: window.screen.height
|
|
77
|
+
},
|
|
78
|
+
browser: result.browser.name || "Unknown",
|
|
79
|
+
browserVersion: result.browser.version || "",
|
|
80
|
+
userAgent: navigator.userAgent
|
|
81
|
+
});
|
|
82
|
+
}, []);
|
|
83
|
+
return deviceInfo;
|
|
84
|
+
}
|
|
85
|
+
var MOBILE_BREAKPOINT = 768;
|
|
86
|
+
var useIsMobile = () => {
|
|
87
|
+
const [isMobile, setIsMobile] = React11.useState();
|
|
88
|
+
React11.useEffect(() => {
|
|
89
|
+
const mql = globalThis.matchMedia(
|
|
90
|
+
`(max-width: ${MOBILE_BREAKPOINT - 1}px)`
|
|
91
|
+
);
|
|
92
|
+
const onChange = () => {
|
|
93
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
94
|
+
};
|
|
95
|
+
mql.addEventListener("change", onChange);
|
|
96
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
97
|
+
return () => mql.removeEventListener("change", onChange);
|
|
98
|
+
}, []);
|
|
99
|
+
return !!isMobile;
|
|
100
|
+
};
|
|
101
|
+
var buttonVariants = cva(
|
|
102
|
+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
103
|
+
{
|
|
104
|
+
variants: {
|
|
105
|
+
variant: {
|
|
106
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
107
|
+
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
108
|
+
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
109
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
110
|
+
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
111
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
112
|
+
success: "bg-success text-white hover:bg-success/90 focus-visible:ring-success/20 dark:focus-visible:ring-success/40 dark:bg-success/60",
|
|
113
|
+
warning: "bg-warning text-white hover:bg-warning/90 focus-visible:ring-warning/20 dark:focus-visible:ring-warning/40 dark:bg-warning/60"
|
|
114
|
+
},
|
|
115
|
+
size: {
|
|
116
|
+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
117
|
+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
118
|
+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
119
|
+
icon: "size-9",
|
|
120
|
+
"icon-sm": "size-8",
|
|
121
|
+
"icon-lg": "size-10",
|
|
122
|
+
xs: "h-7 rounded-md px-2 text-xs has-[>svg]:px-2 gap-1"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
defaultVariants: {
|
|
126
|
+
variant: "default",
|
|
127
|
+
size: "default"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
function Button({
|
|
132
|
+
className,
|
|
133
|
+
variant,
|
|
134
|
+
size,
|
|
135
|
+
asChild = false,
|
|
136
|
+
...props
|
|
137
|
+
}) {
|
|
138
|
+
const Comp = asChild ? Slot : "button";
|
|
139
|
+
return /* @__PURE__ */ jsx(
|
|
140
|
+
Comp,
|
|
141
|
+
{
|
|
142
|
+
"data-slot": "button",
|
|
143
|
+
className: cn(buttonVariants({ variant, size, className })),
|
|
144
|
+
...props
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
function Card({ className, ...props }) {
|
|
149
|
+
return /* @__PURE__ */ jsx(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
"data-slot": "card",
|
|
153
|
+
className: cn(
|
|
154
|
+
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
155
|
+
className
|
|
156
|
+
),
|
|
157
|
+
...props
|
|
158
|
+
}
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
function CardHeader({ className, ...props }) {
|
|
162
|
+
return /* @__PURE__ */ jsx(
|
|
163
|
+
"div",
|
|
164
|
+
{
|
|
165
|
+
"data-slot": "card-header",
|
|
166
|
+
className: cn(
|
|
167
|
+
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
168
|
+
className
|
|
169
|
+
),
|
|
170
|
+
...props
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
function CardTitle({ className, ...props }) {
|
|
175
|
+
return /* @__PURE__ */ jsx(
|
|
176
|
+
"div",
|
|
177
|
+
{
|
|
178
|
+
"data-slot": "card-title",
|
|
179
|
+
className: cn("leading-none font-semibold", className),
|
|
180
|
+
...props
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
function CardDescription({ className, ...props }) {
|
|
185
|
+
return /* @__PURE__ */ jsx(
|
|
186
|
+
"div",
|
|
187
|
+
{
|
|
188
|
+
"data-slot": "card-description",
|
|
189
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
190
|
+
...props
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
function CardAction({ className, ...props }) {
|
|
195
|
+
return /* @__PURE__ */ jsx(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
"data-slot": "card-action",
|
|
199
|
+
className: cn(
|
|
200
|
+
"col-start-2 row-span-2 row-start-1 self-start justify-self-end",
|
|
201
|
+
className
|
|
202
|
+
),
|
|
203
|
+
...props
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
function CardContent({ className, ...props }) {
|
|
208
|
+
return /* @__PURE__ */ jsx(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
"data-slot": "card-content",
|
|
212
|
+
className: cn("px-6", className),
|
|
213
|
+
...props
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
function CardFooter({ className, ...props }) {
|
|
218
|
+
return /* @__PURE__ */ jsx(
|
|
219
|
+
"div",
|
|
220
|
+
{
|
|
221
|
+
"data-slot": "card-footer",
|
|
222
|
+
className: cn("flex items-center px-6 [.border-t]:pt-6", className),
|
|
223
|
+
...props
|
|
224
|
+
}
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
function Input({ className, type, ...props }) {
|
|
228
|
+
return /* @__PURE__ */ jsx(
|
|
229
|
+
"input",
|
|
230
|
+
{
|
|
231
|
+
type,
|
|
232
|
+
"data-slot": "input",
|
|
233
|
+
className: cn(
|
|
234
|
+
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
235
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
236
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
237
|
+
className
|
|
238
|
+
),
|
|
239
|
+
...props
|
|
240
|
+
}
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
function Textarea({ className, ...props }) {
|
|
244
|
+
return /* @__PURE__ */ jsx(
|
|
245
|
+
"textarea",
|
|
246
|
+
{
|
|
247
|
+
"data-slot": "textarea",
|
|
248
|
+
className: cn(
|
|
249
|
+
// "min-h-16",
|
|
250
|
+
// "field-sizing-content",
|
|
251
|
+
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
252
|
+
className
|
|
253
|
+
),
|
|
254
|
+
...props
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
function InputGroup({ className, ...props }) {
|
|
259
|
+
return /* @__PURE__ */ jsx(
|
|
260
|
+
"div",
|
|
261
|
+
{
|
|
262
|
+
"data-slot": "input-group",
|
|
263
|
+
role: "group",
|
|
264
|
+
className: cn(
|
|
265
|
+
"group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none",
|
|
266
|
+
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
267
|
+
// Variants based on alignment.
|
|
268
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
269
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
270
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
271
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
272
|
+
// Focus state.
|
|
273
|
+
"has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]",
|
|
274
|
+
// Error state.
|
|
275
|
+
"has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
|
|
276
|
+
className
|
|
277
|
+
),
|
|
278
|
+
...props
|
|
279
|
+
}
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
var inputGroupAddonVariants = cva(
|
|
283
|
+
"text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none [&>svg:not([class*='size-'])]:size-4 [&>kbd]:rounded-[calc(var(--radius)-5px)] group-data-[disabled=true]/input-group:opacity-50",
|
|
284
|
+
{
|
|
285
|
+
variants: {
|
|
286
|
+
align: {
|
|
287
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
288
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
289
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
290
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
defaultVariants: {
|
|
294
|
+
align: "inline-start"
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
function InputGroupAddon({
|
|
299
|
+
className,
|
|
300
|
+
align = "inline-start",
|
|
301
|
+
...props
|
|
302
|
+
}) {
|
|
303
|
+
return /* @__PURE__ */ jsx(
|
|
304
|
+
"div",
|
|
305
|
+
{
|
|
306
|
+
role: "group",
|
|
307
|
+
"data-slot": "input-group-addon",
|
|
308
|
+
"data-align": align,
|
|
309
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
310
|
+
onClick: (e) => {
|
|
311
|
+
if (e.target.closest("button")) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
315
|
+
},
|
|
316
|
+
...props
|
|
317
|
+
}
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
var inputGroupButtonVariants = cva(
|
|
321
|
+
"text-sm shadow-none flex gap-2 items-center",
|
|
322
|
+
{
|
|
323
|
+
variants: {
|
|
324
|
+
size: {
|
|
325
|
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
326
|
+
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
327
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
328
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
defaultVariants: {
|
|
332
|
+
size: "xs"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
);
|
|
336
|
+
function InputGroupButton({
|
|
337
|
+
className,
|
|
338
|
+
type = "button",
|
|
339
|
+
variant = "ghost",
|
|
340
|
+
size = "xs",
|
|
341
|
+
...props
|
|
342
|
+
}) {
|
|
343
|
+
return /* @__PURE__ */ jsx(
|
|
344
|
+
Button,
|
|
345
|
+
{
|
|
346
|
+
type,
|
|
347
|
+
"data-size": size,
|
|
348
|
+
variant,
|
|
349
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
350
|
+
...props
|
|
351
|
+
}
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
function InputGroupText({ className, ...props }) {
|
|
355
|
+
return /* @__PURE__ */ jsx(
|
|
356
|
+
"span",
|
|
357
|
+
{
|
|
358
|
+
className: cn(
|
|
359
|
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
360
|
+
className
|
|
361
|
+
),
|
|
362
|
+
...props
|
|
363
|
+
}
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
function InputGroupInput({
|
|
367
|
+
className,
|
|
368
|
+
...props
|
|
369
|
+
}) {
|
|
370
|
+
return /* @__PURE__ */ jsx(
|
|
371
|
+
Input,
|
|
372
|
+
{
|
|
373
|
+
"data-slot": "input-group-control",
|
|
374
|
+
className: cn(
|
|
375
|
+
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
376
|
+
className
|
|
377
|
+
),
|
|
378
|
+
...props
|
|
379
|
+
}
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
function InputGroupTextarea({
|
|
383
|
+
className,
|
|
384
|
+
...props
|
|
385
|
+
}) {
|
|
386
|
+
return /* @__PURE__ */ jsx(
|
|
387
|
+
Textarea,
|
|
388
|
+
{
|
|
389
|
+
"data-slot": "input-group-control",
|
|
390
|
+
className: cn(
|
|
391
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
392
|
+
className
|
|
393
|
+
),
|
|
394
|
+
...props
|
|
395
|
+
}
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
function Spinner({ className, ...props }) {
|
|
399
|
+
return /* @__PURE__ */ jsx(
|
|
400
|
+
Loader2Icon,
|
|
401
|
+
{
|
|
402
|
+
role: "status",
|
|
403
|
+
"aria-label": "Loading",
|
|
404
|
+
className: cn("size-4 animate-spin", className),
|
|
405
|
+
...props
|
|
406
|
+
}
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
function Label({ className, ...props }) {
|
|
410
|
+
return /* @__PURE__ */ jsx(
|
|
411
|
+
LabelPrimitive.Root,
|
|
412
|
+
{
|
|
413
|
+
"data-slot": "label",
|
|
414
|
+
className: cn(
|
|
415
|
+
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
416
|
+
className
|
|
417
|
+
),
|
|
418
|
+
...props
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
function Separator({
|
|
423
|
+
className,
|
|
424
|
+
orientation = "horizontal",
|
|
425
|
+
decorative = true,
|
|
426
|
+
...props
|
|
427
|
+
}) {
|
|
428
|
+
return /* @__PURE__ */ jsx(
|
|
429
|
+
SeparatorPrimitive.Root,
|
|
430
|
+
{
|
|
431
|
+
"data-slot": "separator",
|
|
432
|
+
decorative,
|
|
433
|
+
orientation,
|
|
434
|
+
className: cn(
|
|
435
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
436
|
+
className
|
|
437
|
+
),
|
|
438
|
+
...props
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
}
|
|
442
|
+
function Sheet({ ...props }) {
|
|
443
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
444
|
+
}
|
|
445
|
+
function SheetTrigger({
|
|
446
|
+
...props
|
|
447
|
+
}) {
|
|
448
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
449
|
+
}
|
|
450
|
+
function SheetClose({
|
|
451
|
+
...props
|
|
452
|
+
}) {
|
|
453
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
|
|
454
|
+
}
|
|
455
|
+
function SheetPortal({
|
|
456
|
+
...props
|
|
457
|
+
}) {
|
|
458
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
459
|
+
}
|
|
460
|
+
function SheetOverlay({
|
|
461
|
+
className,
|
|
462
|
+
...props
|
|
463
|
+
}) {
|
|
464
|
+
return /* @__PURE__ */ jsx(
|
|
465
|
+
SheetPrimitive.Overlay,
|
|
466
|
+
{
|
|
467
|
+
"data-slot": "sheet-overlay",
|
|
468
|
+
className: cn(
|
|
469
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
470
|
+
className
|
|
471
|
+
),
|
|
472
|
+
...props
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
}
|
|
476
|
+
function SheetContent({
|
|
477
|
+
className,
|
|
478
|
+
children,
|
|
479
|
+
side = "right",
|
|
480
|
+
...props
|
|
481
|
+
}) {
|
|
482
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
483
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
484
|
+
/* @__PURE__ */ jsxs(
|
|
485
|
+
SheetPrimitive.Content,
|
|
486
|
+
{
|
|
487
|
+
"data-slot": "sheet-content",
|
|
488
|
+
className: cn(
|
|
489
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
490
|
+
side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
491
|
+
side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
492
|
+
side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
493
|
+
side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
494
|
+
className
|
|
495
|
+
),
|
|
496
|
+
...props,
|
|
497
|
+
children: [
|
|
498
|
+
children,
|
|
499
|
+
/* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
500
|
+
/* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
|
|
501
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
502
|
+
] })
|
|
503
|
+
]
|
|
504
|
+
}
|
|
505
|
+
)
|
|
506
|
+
] });
|
|
507
|
+
}
|
|
508
|
+
function SheetHeader({ className, ...props }) {
|
|
509
|
+
return /* @__PURE__ */ jsx(
|
|
510
|
+
"div",
|
|
511
|
+
{
|
|
512
|
+
"data-slot": "sheet-header",
|
|
513
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
514
|
+
...props
|
|
515
|
+
}
|
|
516
|
+
);
|
|
517
|
+
}
|
|
518
|
+
function SheetFooter({ className, ...props }) {
|
|
519
|
+
return /* @__PURE__ */ jsx(
|
|
520
|
+
"div",
|
|
521
|
+
{
|
|
522
|
+
"data-slot": "sheet-footer",
|
|
523
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
524
|
+
...props
|
|
525
|
+
}
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
function SheetTitle({
|
|
529
|
+
className,
|
|
530
|
+
...props
|
|
531
|
+
}) {
|
|
532
|
+
return /* @__PURE__ */ jsx(
|
|
533
|
+
SheetPrimitive.Title,
|
|
534
|
+
{
|
|
535
|
+
"data-slot": "sheet-title",
|
|
536
|
+
className: cn("text-foreground font-semibold", className),
|
|
537
|
+
...props
|
|
538
|
+
}
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
function SheetDescription({
|
|
542
|
+
className,
|
|
543
|
+
...props
|
|
544
|
+
}) {
|
|
545
|
+
return /* @__PURE__ */ jsx(
|
|
546
|
+
SheetPrimitive.Description,
|
|
547
|
+
{
|
|
548
|
+
"data-slot": "sheet-description",
|
|
549
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
550
|
+
...props
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
function Skeleton({ className, ...props }) {
|
|
555
|
+
return /* @__PURE__ */ jsx(
|
|
556
|
+
"div",
|
|
557
|
+
{
|
|
558
|
+
"data-slot": "skeleton",
|
|
559
|
+
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
560
|
+
...props
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
function TooltipProvider({
|
|
565
|
+
delayDuration = 0,
|
|
566
|
+
...props
|
|
567
|
+
}) {
|
|
568
|
+
return /* @__PURE__ */ jsx(
|
|
569
|
+
TooltipPrimitive.Provider,
|
|
570
|
+
{
|
|
571
|
+
"data-slot": "tooltip-provider",
|
|
572
|
+
delayDuration,
|
|
573
|
+
...props
|
|
574
|
+
}
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
function Tooltip({
|
|
578
|
+
...props
|
|
579
|
+
}) {
|
|
580
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
581
|
+
}
|
|
582
|
+
function TooltipTrigger({
|
|
583
|
+
...props
|
|
584
|
+
}) {
|
|
585
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
586
|
+
}
|
|
587
|
+
function TooltipContent({
|
|
588
|
+
className,
|
|
589
|
+
sideOffset = 0,
|
|
590
|
+
children,
|
|
591
|
+
...props
|
|
592
|
+
}) {
|
|
593
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
594
|
+
TooltipPrimitive.Content,
|
|
595
|
+
{
|
|
596
|
+
"data-slot": "tooltip-content",
|
|
597
|
+
sideOffset,
|
|
598
|
+
className: cn(
|
|
599
|
+
"bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
|
|
600
|
+
className
|
|
601
|
+
),
|
|
602
|
+
...props,
|
|
603
|
+
children: [
|
|
604
|
+
children,
|
|
605
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
606
|
+
]
|
|
607
|
+
}
|
|
608
|
+
) });
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
// src/client/interfaces/styles/constants.ts
|
|
612
|
+
var NAVBAR_HEIGHT = 60;
|
|
613
|
+
var SIDEBAR_WIDTH = 288;
|
|
614
|
+
var PAGE_HEADER_HEIGHT = 56;
|
|
615
|
+
var FORM_SIDE_FIELDS_WIDTH = 320;
|
|
616
|
+
var FORM_MIDDLE_GAP_WIDTH = 24;
|
|
617
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
618
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
619
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
620
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
621
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
622
|
+
var SidebarContext = React11.createContext(null);
|
|
623
|
+
function useSidebar() {
|
|
624
|
+
const context = React11.useContext(SidebarContext);
|
|
625
|
+
if (!context) {
|
|
626
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
627
|
+
}
|
|
628
|
+
return context;
|
|
629
|
+
}
|
|
630
|
+
function SidebarProvider({
|
|
631
|
+
defaultOpen = true,
|
|
632
|
+
open: openProp,
|
|
633
|
+
onOpenChange: setOpenProp,
|
|
634
|
+
className,
|
|
635
|
+
style,
|
|
636
|
+
children,
|
|
637
|
+
...props
|
|
638
|
+
}) {
|
|
639
|
+
const isMobile = useIsMobile();
|
|
640
|
+
const [openMobile, setOpenMobile] = React11.useState(false);
|
|
641
|
+
const [_open, _setOpen] = React11.useState(defaultOpen);
|
|
642
|
+
const open = openProp ?? _open;
|
|
643
|
+
const setOpen = React11.useCallback(
|
|
644
|
+
(value) => {
|
|
645
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
646
|
+
if (setOpenProp) {
|
|
647
|
+
setOpenProp(openState);
|
|
648
|
+
} else {
|
|
649
|
+
_setOpen(openState);
|
|
650
|
+
}
|
|
651
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
652
|
+
},
|
|
653
|
+
[setOpenProp, open]
|
|
654
|
+
);
|
|
655
|
+
const toggleSidebar = React11.useCallback(() => {
|
|
656
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
657
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
658
|
+
React11.useEffect(() => {
|
|
659
|
+
const handleKeyDown = (event) => {
|
|
660
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
661
|
+
event.preventDefault();
|
|
662
|
+
toggleSidebar();
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
globalThis.addEventListener("keydown", handleKeyDown);
|
|
666
|
+
return () => globalThis.removeEventListener("keydown", handleKeyDown);
|
|
667
|
+
}, [toggleSidebar]);
|
|
668
|
+
const state = open ? "expanded" : "collapsed";
|
|
669
|
+
const contextValue = React11.useMemo(
|
|
670
|
+
() => ({
|
|
671
|
+
state,
|
|
672
|
+
open,
|
|
673
|
+
setOpen,
|
|
674
|
+
isMobile,
|
|
675
|
+
openMobile,
|
|
676
|
+
setOpenMobile,
|
|
677
|
+
toggleSidebar
|
|
678
|
+
}),
|
|
679
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
680
|
+
);
|
|
681
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
|
|
682
|
+
"div",
|
|
683
|
+
{
|
|
684
|
+
"data-slot": "sidebar-wrapper",
|
|
685
|
+
style: {
|
|
686
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
687
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
688
|
+
...style
|
|
689
|
+
},
|
|
690
|
+
className: cn(
|
|
691
|
+
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
|
|
692
|
+
className
|
|
693
|
+
),
|
|
694
|
+
...props,
|
|
695
|
+
children
|
|
696
|
+
}
|
|
697
|
+
) }) });
|
|
698
|
+
}
|
|
699
|
+
function Sidebar({
|
|
700
|
+
side = "left",
|
|
701
|
+
variant = "sidebar",
|
|
702
|
+
collapsible = "offcanvas",
|
|
703
|
+
className,
|
|
704
|
+
children,
|
|
705
|
+
...props
|
|
706
|
+
}) {
|
|
707
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
708
|
+
if (collapsible === "none") {
|
|
709
|
+
return /* @__PURE__ */ jsx(
|
|
710
|
+
"div",
|
|
711
|
+
{
|
|
712
|
+
"data-slot": "sidebar",
|
|
713
|
+
className: cn(
|
|
714
|
+
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
715
|
+
className
|
|
716
|
+
),
|
|
717
|
+
...props,
|
|
718
|
+
children
|
|
719
|
+
}
|
|
720
|
+
);
|
|
721
|
+
}
|
|
722
|
+
if (isMobile) {
|
|
723
|
+
return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
|
|
724
|
+
SheetContent,
|
|
725
|
+
{
|
|
726
|
+
"data-sidebar": "sidebar",
|
|
727
|
+
"data-slot": "sidebar",
|
|
728
|
+
"data-mobile": "true",
|
|
729
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
730
|
+
style: {
|
|
731
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
732
|
+
},
|
|
733
|
+
side,
|
|
734
|
+
children: [
|
|
735
|
+
/* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
|
|
736
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
|
|
737
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
738
|
+
] }),
|
|
739
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
|
|
740
|
+
]
|
|
741
|
+
}
|
|
742
|
+
) });
|
|
743
|
+
}
|
|
744
|
+
return /* @__PURE__ */ jsxs(
|
|
745
|
+
"div",
|
|
746
|
+
{
|
|
747
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
748
|
+
"data-state": state,
|
|
749
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
750
|
+
"data-variant": variant,
|
|
751
|
+
"data-side": side,
|
|
752
|
+
"data-slot": "sidebar",
|
|
753
|
+
children: [
|
|
754
|
+
/* @__PURE__ */ jsx(
|
|
755
|
+
"div",
|
|
756
|
+
{
|
|
757
|
+
"data-slot": "sidebar-gap",
|
|
758
|
+
className: cn(
|
|
759
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
760
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
761
|
+
"group-data-[side=right]:rotate-180",
|
|
762
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
763
|
+
)
|
|
764
|
+
}
|
|
765
|
+
),
|
|
766
|
+
/* @__PURE__ */ jsx(
|
|
767
|
+
"div",
|
|
768
|
+
{
|
|
769
|
+
"data-slot": "sidebar-container",
|
|
770
|
+
className: cn(
|
|
771
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
772
|
+
side === "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)]",
|
|
773
|
+
// Adjust the padding for floating and inset variants.
|
|
774
|
+
variant === "floating" || variant === "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",
|
|
775
|
+
className
|
|
776
|
+
),
|
|
777
|
+
...props,
|
|
778
|
+
children: /* @__PURE__ */ jsx(
|
|
779
|
+
"div",
|
|
780
|
+
{
|
|
781
|
+
"data-sidebar": "sidebar",
|
|
782
|
+
"data-slot": "sidebar-inner",
|
|
783
|
+
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",
|
|
784
|
+
children
|
|
785
|
+
}
|
|
786
|
+
)
|
|
787
|
+
}
|
|
788
|
+
)
|
|
789
|
+
]
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
}
|
|
793
|
+
function SidebarTrigger({
|
|
794
|
+
className,
|
|
795
|
+
onClick,
|
|
796
|
+
...props
|
|
797
|
+
}) {
|
|
798
|
+
const { toggleSidebar } = useSidebar();
|
|
799
|
+
return /* @__PURE__ */ jsxs(
|
|
800
|
+
Button,
|
|
801
|
+
{
|
|
802
|
+
"data-sidebar": "trigger",
|
|
803
|
+
"data-slot": "sidebar-trigger",
|
|
804
|
+
variant: "ghost",
|
|
805
|
+
size: "icon",
|
|
806
|
+
className: cn("size-7", className),
|
|
807
|
+
onClick: (event) => {
|
|
808
|
+
onClick?.(event);
|
|
809
|
+
toggleSidebar();
|
|
810
|
+
},
|
|
811
|
+
...props,
|
|
812
|
+
children: [
|
|
813
|
+
/* @__PURE__ */ jsx(PanelLeftIcon, {}),
|
|
814
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
815
|
+
]
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
function SidebarRail({ className, ...props }) {
|
|
820
|
+
const { toggleSidebar } = useSidebar();
|
|
821
|
+
return /* @__PURE__ */ jsx(
|
|
822
|
+
"button",
|
|
823
|
+
{
|
|
824
|
+
"data-sidebar": "rail",
|
|
825
|
+
"data-slot": "sidebar-rail",
|
|
826
|
+
"aria-label": "Toggle Sidebar",
|
|
827
|
+
tabIndex: -1,
|
|
828
|
+
onClick: toggleSidebar,
|
|
829
|
+
title: "Toggle Sidebar",
|
|
830
|
+
className: cn(
|
|
831
|
+
"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",
|
|
832
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
833
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
834
|
+
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
835
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
836
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
837
|
+
className
|
|
838
|
+
),
|
|
839
|
+
...props
|
|
840
|
+
}
|
|
841
|
+
);
|
|
842
|
+
}
|
|
843
|
+
function SidebarInset({ className, ...props }) {
|
|
844
|
+
return /* @__PURE__ */ jsx(
|
|
845
|
+
"main",
|
|
846
|
+
{
|
|
847
|
+
"data-slot": "sidebar-inset",
|
|
848
|
+
className: cn(
|
|
849
|
+
"bg-background relative flex w-full flex-1 flex-col",
|
|
850
|
+
"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",
|
|
851
|
+
"transition-[width]",
|
|
852
|
+
className
|
|
853
|
+
),
|
|
854
|
+
...props
|
|
855
|
+
}
|
|
856
|
+
);
|
|
857
|
+
}
|
|
858
|
+
function SidebarInput({
|
|
859
|
+
className,
|
|
860
|
+
...props
|
|
861
|
+
}) {
|
|
862
|
+
return /* @__PURE__ */ jsx(
|
|
863
|
+
Input,
|
|
864
|
+
{
|
|
865
|
+
"data-slot": "sidebar-input",
|
|
866
|
+
"data-sidebar": "input",
|
|
867
|
+
className: cn("bg-background h-8 w-full shadow-none", className),
|
|
868
|
+
...props
|
|
869
|
+
}
|
|
870
|
+
);
|
|
871
|
+
}
|
|
872
|
+
function SidebarHeader({ className, ...props }) {
|
|
873
|
+
return /* @__PURE__ */ jsx(
|
|
874
|
+
"div",
|
|
875
|
+
{
|
|
876
|
+
"data-slot": "sidebar-header",
|
|
877
|
+
"data-sidebar": "header",
|
|
878
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
879
|
+
...props
|
|
880
|
+
}
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
function SidebarFooter({ className, ...props }) {
|
|
884
|
+
return /* @__PURE__ */ jsx(
|
|
885
|
+
"div",
|
|
886
|
+
{
|
|
887
|
+
"data-slot": "sidebar-footer",
|
|
888
|
+
"data-sidebar": "footer",
|
|
889
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
890
|
+
...props
|
|
891
|
+
}
|
|
892
|
+
);
|
|
893
|
+
}
|
|
894
|
+
function SidebarSeparator({
|
|
895
|
+
className,
|
|
896
|
+
...props
|
|
897
|
+
}) {
|
|
898
|
+
return /* @__PURE__ */ jsx(
|
|
899
|
+
Separator,
|
|
900
|
+
{
|
|
901
|
+
"data-slot": "sidebar-separator",
|
|
902
|
+
"data-sidebar": "separator",
|
|
903
|
+
className: cn("bg-sidebar-border mx-2 w-auto", className),
|
|
904
|
+
...props
|
|
905
|
+
}
|
|
906
|
+
);
|
|
907
|
+
}
|
|
908
|
+
function SidebarContent({ className, ...props }) {
|
|
909
|
+
return /* @__PURE__ */ jsx(
|
|
910
|
+
"div",
|
|
911
|
+
{
|
|
912
|
+
"data-slot": "sidebar-content",
|
|
913
|
+
"data-sidebar": "content",
|
|
914
|
+
className: cn(
|
|
915
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
916
|
+
className
|
|
917
|
+
),
|
|
918
|
+
...props
|
|
919
|
+
}
|
|
920
|
+
);
|
|
921
|
+
}
|
|
922
|
+
function SidebarGroup({ className, ...props }) {
|
|
923
|
+
return /* @__PURE__ */ jsx(
|
|
924
|
+
"div",
|
|
925
|
+
{
|
|
926
|
+
"data-slot": "sidebar-group",
|
|
927
|
+
"data-sidebar": "group",
|
|
928
|
+
className: cn("relative flex w-full min-w-0 flex-col p-3", className),
|
|
929
|
+
...props
|
|
930
|
+
}
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
function SidebarGroupLabel({
|
|
934
|
+
className,
|
|
935
|
+
asChild = false,
|
|
936
|
+
...props
|
|
937
|
+
}) {
|
|
938
|
+
const Comp = asChild ? Slot : "div";
|
|
939
|
+
return /* @__PURE__ */ jsx(
|
|
940
|
+
Comp,
|
|
941
|
+
{
|
|
942
|
+
"data-slot": "sidebar-group-label",
|
|
943
|
+
"data-sidebar": "group-label",
|
|
944
|
+
className: cn(
|
|
945
|
+
"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",
|
|
946
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
947
|
+
className
|
|
948
|
+
),
|
|
949
|
+
...props
|
|
950
|
+
}
|
|
951
|
+
);
|
|
952
|
+
}
|
|
953
|
+
function SidebarGroupAction({
|
|
954
|
+
className,
|
|
955
|
+
asChild = false,
|
|
956
|
+
...props
|
|
957
|
+
}) {
|
|
958
|
+
const Comp = asChild ? Slot : "button";
|
|
959
|
+
return /* @__PURE__ */ jsx(
|
|
960
|
+
Comp,
|
|
961
|
+
{
|
|
962
|
+
"data-slot": "sidebar-group-action",
|
|
963
|
+
"data-sidebar": "group-action",
|
|
964
|
+
className: cn(
|
|
965
|
+
"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",
|
|
966
|
+
// Increases the hit area of the button on mobile.
|
|
967
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
968
|
+
"group-data-[collapsible=icon]:hidden",
|
|
969
|
+
className
|
|
970
|
+
),
|
|
971
|
+
...props
|
|
972
|
+
}
|
|
973
|
+
);
|
|
974
|
+
}
|
|
975
|
+
function SidebarGroupContent({
|
|
976
|
+
className,
|
|
977
|
+
...props
|
|
978
|
+
}) {
|
|
979
|
+
return /* @__PURE__ */ jsx(
|
|
980
|
+
"div",
|
|
981
|
+
{
|
|
982
|
+
"data-slot": "sidebar-group-content",
|
|
983
|
+
"data-sidebar": "group-content",
|
|
984
|
+
className: cn("w-full text-sm", className),
|
|
985
|
+
...props
|
|
986
|
+
}
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
function SidebarMenu({ className, ...props }) {
|
|
990
|
+
return /* @__PURE__ */ jsx(
|
|
991
|
+
"ul",
|
|
992
|
+
{
|
|
993
|
+
"data-slot": "sidebar-menu",
|
|
994
|
+
"data-sidebar": "menu",
|
|
995
|
+
className: cn("flex w-full min-w-0 flex-col gap-2", className),
|
|
996
|
+
...props
|
|
997
|
+
}
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
1001
|
+
return /* @__PURE__ */ jsx(
|
|
1002
|
+
"li",
|
|
1003
|
+
{
|
|
1004
|
+
"data-slot": "sidebar-menu-item",
|
|
1005
|
+
"data-sidebar": "menu-item",
|
|
1006
|
+
className: cn("group/menu-item relative", className),
|
|
1007
|
+
...props
|
|
1008
|
+
}
|
|
1009
|
+
);
|
|
1010
|
+
}
|
|
1011
|
+
var sidebarMenuButtonVariants = cva(
|
|
1012
|
+
"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",
|
|
1013
|
+
{
|
|
1014
|
+
variants: {
|
|
1015
|
+
variant: {
|
|
1016
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
1017
|
+
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))]"
|
|
1018
|
+
},
|
|
1019
|
+
size: {
|
|
1020
|
+
default: "h-8 text-sm",
|
|
1021
|
+
sm: "h-7 text-xs",
|
|
1022
|
+
md: "h-10 text-base group-data-[collapsible=icon]:p-0!",
|
|
1023
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
defaultVariants: {
|
|
1027
|
+
variant: "default",
|
|
1028
|
+
size: "default"
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
);
|
|
1032
|
+
function SidebarMenuButton({
|
|
1033
|
+
asChild = false,
|
|
1034
|
+
isActive = false,
|
|
1035
|
+
variant = "default",
|
|
1036
|
+
size = "default",
|
|
1037
|
+
tooltip,
|
|
1038
|
+
className,
|
|
1039
|
+
...props
|
|
1040
|
+
}) {
|
|
1041
|
+
const Comp = asChild ? Slot : "button";
|
|
1042
|
+
const { isMobile, state } = useSidebar();
|
|
1043
|
+
const button = /* @__PURE__ */ jsx(
|
|
1044
|
+
Comp,
|
|
1045
|
+
{
|
|
1046
|
+
"data-slot": "sidebar-menu-button",
|
|
1047
|
+
"data-sidebar": "menu-button",
|
|
1048
|
+
"data-size": size,
|
|
1049
|
+
"data-active": isActive,
|
|
1050
|
+
className: cn(
|
|
1051
|
+
sidebarMenuButtonVariants({ variant, size }),
|
|
1052
|
+
className,
|
|
1053
|
+
"[&>svg]:size-5"
|
|
1054
|
+
),
|
|
1055
|
+
...props
|
|
1056
|
+
}
|
|
1057
|
+
);
|
|
1058
|
+
if (!tooltip) {
|
|
1059
|
+
return button;
|
|
1060
|
+
}
|
|
1061
|
+
if (typeof tooltip === "string") {
|
|
1062
|
+
tooltip = {
|
|
1063
|
+
children: tooltip
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
1067
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
|
|
1068
|
+
/* @__PURE__ */ jsx(
|
|
1069
|
+
TooltipContent,
|
|
1070
|
+
{
|
|
1071
|
+
side: "right",
|
|
1072
|
+
align: "center",
|
|
1073
|
+
hidden: state !== "collapsed" || isMobile,
|
|
1074
|
+
...tooltip
|
|
1075
|
+
}
|
|
1076
|
+
)
|
|
1077
|
+
] });
|
|
1078
|
+
}
|
|
1079
|
+
function SidebarMenuAction({
|
|
1080
|
+
className,
|
|
1081
|
+
asChild = false,
|
|
1082
|
+
showOnHover = false,
|
|
1083
|
+
...props
|
|
1084
|
+
}) {
|
|
1085
|
+
const Comp = asChild ? Slot : "button";
|
|
1086
|
+
return /* @__PURE__ */ jsx(
|
|
1087
|
+
Comp,
|
|
1088
|
+
{
|
|
1089
|
+
"data-slot": "sidebar-menu-action",
|
|
1090
|
+
"data-sidebar": "menu-action",
|
|
1091
|
+
className: cn(
|
|
1092
|
+
"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",
|
|
1093
|
+
// Increases the hit area of the button on mobile.
|
|
1094
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
1095
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
1096
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
1097
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
1098
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1099
|
+
showOnHover && "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",
|
|
1100
|
+
className
|
|
1101
|
+
),
|
|
1102
|
+
...props
|
|
1103
|
+
}
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
function SidebarMenuBadge({
|
|
1107
|
+
className,
|
|
1108
|
+
...props
|
|
1109
|
+
}) {
|
|
1110
|
+
return /* @__PURE__ */ jsx(
|
|
1111
|
+
"div",
|
|
1112
|
+
{
|
|
1113
|
+
"data-slot": "sidebar-menu-badge",
|
|
1114
|
+
"data-sidebar": "menu-badge",
|
|
1115
|
+
className: cn(
|
|
1116
|
+
"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",
|
|
1117
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
1118
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
1119
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
1120
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
1121
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1122
|
+
className
|
|
1123
|
+
),
|
|
1124
|
+
...props
|
|
1125
|
+
}
|
|
1126
|
+
);
|
|
1127
|
+
}
|
|
1128
|
+
function SidebarMenuSkeleton({
|
|
1129
|
+
className,
|
|
1130
|
+
showIcon = false,
|
|
1131
|
+
...props
|
|
1132
|
+
}) {
|
|
1133
|
+
const [width, setWidth] = React11.useState("0%");
|
|
1134
|
+
React11.useEffect(() => {
|
|
1135
|
+
setWidth(`${Math.floor(Math.random() * 40) + 50}%`);
|
|
1136
|
+
}, []);
|
|
1137
|
+
return /* @__PURE__ */ jsxs(
|
|
1138
|
+
"div",
|
|
1139
|
+
{
|
|
1140
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
1141
|
+
"data-sidebar": "menu-skeleton",
|
|
1142
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
1143
|
+
...props,
|
|
1144
|
+
children: [
|
|
1145
|
+
showIcon && /* @__PURE__ */ jsx(
|
|
1146
|
+
Skeleton,
|
|
1147
|
+
{
|
|
1148
|
+
className: "size-4 rounded-md",
|
|
1149
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
1150
|
+
}
|
|
1151
|
+
),
|
|
1152
|
+
/* @__PURE__ */ jsx(
|
|
1153
|
+
Skeleton,
|
|
1154
|
+
{
|
|
1155
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
1156
|
+
"data-sidebar": "menu-skeleton-text",
|
|
1157
|
+
style: {
|
|
1158
|
+
"--skeleton-width": width
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
)
|
|
1162
|
+
]
|
|
1163
|
+
}
|
|
1164
|
+
);
|
|
1165
|
+
}
|
|
1166
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
1167
|
+
return /* @__PURE__ */ jsx(
|
|
1168
|
+
"ul",
|
|
1169
|
+
{
|
|
1170
|
+
"data-slot": "sidebar-menu-sub",
|
|
1171
|
+
"data-sidebar": "menu-sub",
|
|
1172
|
+
className: cn(
|
|
1173
|
+
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-2 border-l px-2.5 py-2",
|
|
1174
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1175
|
+
className
|
|
1176
|
+
),
|
|
1177
|
+
...props
|
|
1178
|
+
}
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1181
|
+
function SidebarMenuSubItem({
|
|
1182
|
+
className,
|
|
1183
|
+
...props
|
|
1184
|
+
}) {
|
|
1185
|
+
return /* @__PURE__ */ jsx(
|
|
1186
|
+
"li",
|
|
1187
|
+
{
|
|
1188
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
1189
|
+
"data-sidebar": "menu-sub-item",
|
|
1190
|
+
className: cn("group/menu-sub-item relative", className),
|
|
1191
|
+
...props
|
|
1192
|
+
}
|
|
1193
|
+
);
|
|
1194
|
+
}
|
|
1195
|
+
function SidebarMenuSubButton({
|
|
1196
|
+
asChild = false,
|
|
1197
|
+
size = "md",
|
|
1198
|
+
isActive = false,
|
|
1199
|
+
className,
|
|
1200
|
+
...props
|
|
1201
|
+
}) {
|
|
1202
|
+
const Comp = asChild ? Slot : "a";
|
|
1203
|
+
return /* @__PURE__ */ jsx(
|
|
1204
|
+
Comp,
|
|
1205
|
+
{
|
|
1206
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
1207
|
+
"data-sidebar": "menu-sub-button",
|
|
1208
|
+
"data-size": size,
|
|
1209
|
+
"data-active": isActive,
|
|
1210
|
+
className: cn(
|
|
1211
|
+
"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",
|
|
1212
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
1213
|
+
size === "sm" && "text-xs",
|
|
1214
|
+
size === "md" && "text-sm",
|
|
1215
|
+
size === "lg" && "text-bas h-10",
|
|
1216
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1217
|
+
isActive && "font-medium",
|
|
1218
|
+
className
|
|
1219
|
+
),
|
|
1220
|
+
...props
|
|
1221
|
+
}
|
|
1222
|
+
);
|
|
1223
|
+
}
|
|
1224
|
+
function Collapsible({
|
|
1225
|
+
...props
|
|
1226
|
+
}) {
|
|
1227
|
+
return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
1228
|
+
}
|
|
1229
|
+
function CollapsibleTrigger2({
|
|
1230
|
+
...props
|
|
1231
|
+
}) {
|
|
1232
|
+
return /* @__PURE__ */ jsx(
|
|
1233
|
+
CollapsiblePrimitive.CollapsibleTrigger,
|
|
1234
|
+
{
|
|
1235
|
+
"data-slot": "collapsible-trigger",
|
|
1236
|
+
...props
|
|
1237
|
+
}
|
|
1238
|
+
);
|
|
1239
|
+
}
|
|
1240
|
+
function CollapsibleContent2({
|
|
1241
|
+
...props
|
|
1242
|
+
}) {
|
|
1243
|
+
return /* @__PURE__ */ jsx(
|
|
1244
|
+
CollapsiblePrimitive.CollapsibleContent,
|
|
1245
|
+
{
|
|
1246
|
+
"data-slot": "collapsible-content",
|
|
1247
|
+
className: "CollapsibleContent",
|
|
1248
|
+
...props
|
|
1249
|
+
}
|
|
1250
|
+
);
|
|
1251
|
+
}
|
|
1252
|
+
function DropdownMenu({
|
|
1253
|
+
...props
|
|
1254
|
+
}) {
|
|
1255
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
1256
|
+
}
|
|
1257
|
+
function DropdownMenuPortal({
|
|
1258
|
+
...props
|
|
1259
|
+
}) {
|
|
1260
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
1261
|
+
}
|
|
1262
|
+
function DropdownMenuTrigger({
|
|
1263
|
+
...props
|
|
1264
|
+
}) {
|
|
1265
|
+
return /* @__PURE__ */ jsx(
|
|
1266
|
+
DropdownMenuPrimitive.Trigger,
|
|
1267
|
+
{
|
|
1268
|
+
"data-slot": "dropdown-menu-trigger",
|
|
1269
|
+
...props
|
|
1270
|
+
}
|
|
1271
|
+
);
|
|
1272
|
+
}
|
|
1273
|
+
function DropdownMenuContent({
|
|
1274
|
+
className,
|
|
1275
|
+
sideOffset = 4,
|
|
1276
|
+
...props
|
|
1277
|
+
}) {
|
|
1278
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
1279
|
+
DropdownMenuPrimitive.Content,
|
|
1280
|
+
{
|
|
1281
|
+
"data-slot": "dropdown-menu-content",
|
|
1282
|
+
sideOffset,
|
|
1283
|
+
className: cn(
|
|
1284
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
|
|
1285
|
+
className
|
|
1286
|
+
),
|
|
1287
|
+
...props
|
|
1288
|
+
}
|
|
1289
|
+
) });
|
|
1290
|
+
}
|
|
1291
|
+
function DropdownMenuGroup({
|
|
1292
|
+
...props
|
|
1293
|
+
}) {
|
|
1294
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
1295
|
+
}
|
|
1296
|
+
function DropdownMenuItem({
|
|
1297
|
+
className,
|
|
1298
|
+
inset,
|
|
1299
|
+
variant = "default",
|
|
1300
|
+
...props
|
|
1301
|
+
}) {
|
|
1302
|
+
return /* @__PURE__ */ jsx(
|
|
1303
|
+
DropdownMenuPrimitive.Item,
|
|
1304
|
+
{
|
|
1305
|
+
"data-slot": "dropdown-menu-item",
|
|
1306
|
+
"data-inset": inset,
|
|
1307
|
+
"data-variant": variant,
|
|
1308
|
+
className: cn(
|
|
1309
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1310
|
+
className
|
|
1311
|
+
),
|
|
1312
|
+
...props
|
|
1313
|
+
}
|
|
1314
|
+
);
|
|
1315
|
+
}
|
|
1316
|
+
function DropdownMenuCheckboxItem({
|
|
1317
|
+
className,
|
|
1318
|
+
children,
|
|
1319
|
+
checked,
|
|
1320
|
+
...props
|
|
1321
|
+
}) {
|
|
1322
|
+
return (
|
|
1323
|
+
// @ts-expect-error types too strict
|
|
1324
|
+
/* @__PURE__ */ jsxs(
|
|
1325
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
1326
|
+
{
|
|
1327
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
1328
|
+
className: cn(
|
|
1329
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1330
|
+
className
|
|
1331
|
+
),
|
|
1332
|
+
checked,
|
|
1333
|
+
...props,
|
|
1334
|
+
children: [
|
|
1335
|
+
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
1336
|
+
children
|
|
1337
|
+
]
|
|
1338
|
+
}
|
|
1339
|
+
)
|
|
1340
|
+
);
|
|
1341
|
+
}
|
|
1342
|
+
function DropdownMenuRadioGroup({
|
|
1343
|
+
...props
|
|
1344
|
+
}) {
|
|
1345
|
+
return /* @__PURE__ */ jsx(
|
|
1346
|
+
DropdownMenuPrimitive.RadioGroup,
|
|
1347
|
+
{
|
|
1348
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
1349
|
+
...props
|
|
1350
|
+
}
|
|
1351
|
+
);
|
|
1352
|
+
}
|
|
1353
|
+
function DropdownMenuRadioItem({
|
|
1354
|
+
className,
|
|
1355
|
+
children,
|
|
1356
|
+
...props
|
|
1357
|
+
}) {
|
|
1358
|
+
return /* @__PURE__ */ jsxs(
|
|
1359
|
+
DropdownMenuPrimitive.RadioItem,
|
|
1360
|
+
{
|
|
1361
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
1362
|
+
className: cn(
|
|
1363
|
+
"focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1364
|
+
className
|
|
1365
|
+
),
|
|
1366
|
+
...props,
|
|
1367
|
+
children: [
|
|
1368
|
+
/* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
|
|
1369
|
+
children
|
|
1370
|
+
]
|
|
1371
|
+
}
|
|
1372
|
+
);
|
|
1373
|
+
}
|
|
1374
|
+
function DropdownMenuLabel({
|
|
1375
|
+
className,
|
|
1376
|
+
inset,
|
|
1377
|
+
...props
|
|
1378
|
+
}) {
|
|
1379
|
+
return /* @__PURE__ */ jsx(
|
|
1380
|
+
DropdownMenuPrimitive.Label,
|
|
1381
|
+
{
|
|
1382
|
+
"data-slot": "dropdown-menu-label",
|
|
1383
|
+
"data-inset": inset,
|
|
1384
|
+
className: cn(
|
|
1385
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
1386
|
+
className
|
|
1387
|
+
),
|
|
1388
|
+
...props
|
|
1389
|
+
}
|
|
1390
|
+
);
|
|
1391
|
+
}
|
|
1392
|
+
function DropdownMenuSeparator({
|
|
1393
|
+
className,
|
|
1394
|
+
...props
|
|
1395
|
+
}) {
|
|
1396
|
+
return /* @__PURE__ */ jsx(
|
|
1397
|
+
DropdownMenuPrimitive.Separator,
|
|
1398
|
+
{
|
|
1399
|
+
"data-slot": "dropdown-menu-separator",
|
|
1400
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
1401
|
+
...props
|
|
1402
|
+
}
|
|
1403
|
+
);
|
|
1404
|
+
}
|
|
1405
|
+
function DropdownMenuShortcut({
|
|
1406
|
+
className,
|
|
1407
|
+
...props
|
|
1408
|
+
}) {
|
|
1409
|
+
return /* @__PURE__ */ jsx(
|
|
1410
|
+
"span",
|
|
1411
|
+
{
|
|
1412
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
1413
|
+
className: cn(
|
|
1414
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
1415
|
+
className
|
|
1416
|
+
),
|
|
1417
|
+
...props
|
|
1418
|
+
}
|
|
1419
|
+
);
|
|
1420
|
+
}
|
|
1421
|
+
function DropdownMenuSub({
|
|
1422
|
+
...props
|
|
1423
|
+
}) {
|
|
1424
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
1425
|
+
}
|
|
1426
|
+
function DropdownMenuSubTrigger({
|
|
1427
|
+
className,
|
|
1428
|
+
inset,
|
|
1429
|
+
children,
|
|
1430
|
+
...props
|
|
1431
|
+
}) {
|
|
1432
|
+
return /* @__PURE__ */ jsxs(
|
|
1433
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
1434
|
+
{
|
|
1435
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
1436
|
+
"data-inset": inset,
|
|
1437
|
+
className: cn(
|
|
1438
|
+
"focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1439
|
+
className
|
|
1440
|
+
),
|
|
1441
|
+
...props,
|
|
1442
|
+
children: [
|
|
1443
|
+
children,
|
|
1444
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
1445
|
+
]
|
|
1446
|
+
}
|
|
1447
|
+
);
|
|
1448
|
+
}
|
|
1449
|
+
function DropdownMenuSubContent({
|
|
1450
|
+
className,
|
|
1451
|
+
...props
|
|
1452
|
+
}) {
|
|
1453
|
+
return /* @__PURE__ */ jsx(
|
|
1454
|
+
DropdownMenuPrimitive.SubContent,
|
|
1455
|
+
{
|
|
1456
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
1457
|
+
className: cn(
|
|
1458
|
+
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
|
|
1459
|
+
className
|
|
1460
|
+
),
|
|
1461
|
+
...props
|
|
1462
|
+
}
|
|
1463
|
+
);
|
|
1464
|
+
}
|
|
1465
|
+
function Avatar({
|
|
1466
|
+
className,
|
|
1467
|
+
...props
|
|
1468
|
+
}) {
|
|
1469
|
+
return /* @__PURE__ */ jsx(
|
|
1470
|
+
AvatarPrimitive.Root,
|
|
1471
|
+
{
|
|
1472
|
+
"data-slot": "avatar",
|
|
1473
|
+
className: cn(
|
|
1474
|
+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
1475
|
+
className
|
|
1476
|
+
),
|
|
1477
|
+
...props
|
|
1478
|
+
}
|
|
1479
|
+
);
|
|
1480
|
+
}
|
|
1481
|
+
function AvatarImage({
|
|
1482
|
+
className,
|
|
1483
|
+
...props
|
|
1484
|
+
}) {
|
|
1485
|
+
return /* @__PURE__ */ jsx(
|
|
1486
|
+
AvatarPrimitive.Image,
|
|
1487
|
+
{
|
|
1488
|
+
"data-slot": "avatar-image",
|
|
1489
|
+
className: cn("aspect-square size-full", className),
|
|
1490
|
+
...props
|
|
1491
|
+
}
|
|
1492
|
+
);
|
|
1493
|
+
}
|
|
1494
|
+
function AvatarFallback({
|
|
1495
|
+
className,
|
|
1496
|
+
...props
|
|
1497
|
+
}) {
|
|
1498
|
+
return /* @__PURE__ */ jsx(
|
|
1499
|
+
AvatarPrimitive.Fallback,
|
|
1500
|
+
{
|
|
1501
|
+
"data-slot": "avatar-fallback",
|
|
1502
|
+
className: cn(
|
|
1503
|
+
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
1504
|
+
className
|
|
1505
|
+
),
|
|
1506
|
+
...props
|
|
1507
|
+
}
|
|
1508
|
+
);
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
export { Avatar, AvatarFallback, AvatarImage, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FORM_MIDDLE_GAP_WIDTH, FORM_SIDE_FIELDS_WIDTH, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, Label, NAVBAR_HEIGHT, PAGE_HEADER_HEIGHT, SIDEBAR_COOKIE_NAME, SIDEBAR_WIDTH, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Spinner, Textarea, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn, isConfirm, useCountdown, useDeviceInfo, useParentPathname, useSidebar };
|