@yimingliao/cms 0.0.116 → 0.0.118
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-WU47KNJR.js → chunk-7YMYPMIB.js} +1069 -813
- package/dist/client/index.d.ts +44 -16
- package/dist/client/index.js +549 -350
- package/dist/client/shadcn/index.d.ts +62 -37
- package/dist/client/shadcn/index.js +1 -1
- package/dist/{sidebar-BlYl83Yl.d.ts → sidebar-CBC8_O5A.d.ts} +1 -1
- package/package.json +2 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
import { twMerge } from 'tailwind-merge';
|
|
3
|
-
import * as
|
|
3
|
+
import * as React15 from 'react';
|
|
4
4
|
import { useState, useRef, useCallback, useEffect } from 'react';
|
|
5
5
|
import { usePathname } from 'next/navigation';
|
|
6
6
|
import { UAParser } from 'ua-parser-js';
|
|
7
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
8
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
9
|
import { Slot } from '@radix-ui/react-slot';
|
|
8
10
|
import { cva } from 'class-variance-authority';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
12
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
13
|
+
import { CheckIcon, CircleIcon, ChevronRightIcon, ChevronLeftIcon, MoreHorizontalIcon, ChevronDownIcon, ChevronUpIcon, XIcon, PanelLeftIcon, Loader2Icon } from 'lucide-react';
|
|
11
14
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
15
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
12
16
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
13
17
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
14
18
|
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
|
|
|
19
20
|
// src/client/applications/ui/utils.ts
|
|
20
21
|
var cn = (...inputs) => {
|
|
@@ -84,8 +85,8 @@ function useDeviceInfo() {
|
|
|
84
85
|
}
|
|
85
86
|
var MOBILE_BREAKPOINT = 768;
|
|
86
87
|
var useIsMobile = () => {
|
|
87
|
-
const [isMobile, setIsMobile] =
|
|
88
|
-
|
|
88
|
+
const [isMobile, setIsMobile] = React15.useState();
|
|
89
|
+
React15.useEffect(() => {
|
|
89
90
|
const mql = globalThis.matchMedia(
|
|
90
91
|
`(max-width: ${MOBILE_BREAKPOINT - 1}px)`
|
|
91
92
|
);
|
|
@@ -105,6 +106,51 @@ var SIDEBAR_WIDTH = 288;
|
|
|
105
106
|
var PAGE_HEADER_HEIGHT = 56;
|
|
106
107
|
var FORM_SIDE_FIELDS_WIDTH = 320;
|
|
107
108
|
var FORM_MIDDLE_GAP_WIDTH = 24;
|
|
109
|
+
function Avatar({
|
|
110
|
+
className,
|
|
111
|
+
...props
|
|
112
|
+
}) {
|
|
113
|
+
return /* @__PURE__ */ jsx(
|
|
114
|
+
AvatarPrimitive.Root,
|
|
115
|
+
{
|
|
116
|
+
"data-slot": "avatar",
|
|
117
|
+
className: cn(
|
|
118
|
+
"relative flex size-8 shrink-0 overflow-hidden rounded-full",
|
|
119
|
+
className
|
|
120
|
+
),
|
|
121
|
+
...props
|
|
122
|
+
}
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
function AvatarImage({
|
|
126
|
+
className,
|
|
127
|
+
...props
|
|
128
|
+
}) {
|
|
129
|
+
return /* @__PURE__ */ jsx(
|
|
130
|
+
AvatarPrimitive.Image,
|
|
131
|
+
{
|
|
132
|
+
"data-slot": "avatar-image",
|
|
133
|
+
className: cn("aspect-square size-full", className),
|
|
134
|
+
...props
|
|
135
|
+
}
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
function AvatarFallback({
|
|
139
|
+
className,
|
|
140
|
+
...props
|
|
141
|
+
}) {
|
|
142
|
+
return /* @__PURE__ */ jsx(
|
|
143
|
+
AvatarPrimitive.Fallback,
|
|
144
|
+
{
|
|
145
|
+
"data-slot": "avatar-fallback",
|
|
146
|
+
className: cn(
|
|
147
|
+
"bg-muted flex size-full items-center justify-center rounded-full",
|
|
148
|
+
className
|
|
149
|
+
),
|
|
150
|
+
...props
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
108
154
|
var buttonVariants = cva(
|
|
109
155
|
"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",
|
|
110
156
|
{
|
|
@@ -231,1281 +277,1491 @@ function CardFooter({ className, ...props }) {
|
|
|
231
277
|
}
|
|
232
278
|
);
|
|
233
279
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
type,
|
|
239
|
-
"data-slot": "input",
|
|
240
|
-
className: cn(
|
|
241
|
-
"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",
|
|
242
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
243
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
244
|
-
className
|
|
245
|
-
),
|
|
246
|
-
...props
|
|
247
|
-
}
|
|
248
|
-
);
|
|
280
|
+
function Collapsible({
|
|
281
|
+
...props
|
|
282
|
+
}) {
|
|
283
|
+
return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
249
284
|
}
|
|
250
|
-
function
|
|
285
|
+
function CollapsibleTrigger2({
|
|
286
|
+
...props
|
|
287
|
+
}) {
|
|
251
288
|
return /* @__PURE__ */ jsx(
|
|
252
|
-
|
|
289
|
+
CollapsiblePrimitive.CollapsibleTrigger,
|
|
253
290
|
{
|
|
254
|
-
"data-slot": "
|
|
255
|
-
className: cn(
|
|
256
|
-
// "min-h-16",
|
|
257
|
-
// "field-sizing-content",
|
|
258
|
-
"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",
|
|
259
|
-
className
|
|
260
|
-
),
|
|
291
|
+
"data-slot": "collapsible-trigger",
|
|
261
292
|
...props
|
|
262
293
|
}
|
|
263
294
|
);
|
|
264
295
|
}
|
|
265
|
-
function
|
|
296
|
+
function CollapsibleContent2({
|
|
297
|
+
...props
|
|
298
|
+
}) {
|
|
266
299
|
return /* @__PURE__ */ jsx(
|
|
267
|
-
|
|
300
|
+
CollapsiblePrimitive.CollapsibleContent,
|
|
268
301
|
{
|
|
269
|
-
"data-slot": "
|
|
270
|
-
|
|
271
|
-
className: cn(
|
|
272
|
-
"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",
|
|
273
|
-
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
274
|
-
// Variants based on alignment.
|
|
275
|
-
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
276
|
-
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
277
|
-
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
278
|
-
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
279
|
-
// Focus state.
|
|
280
|
-
"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]",
|
|
281
|
-
// Error state.
|
|
282
|
-
"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",
|
|
283
|
-
className
|
|
284
|
-
),
|
|
302
|
+
"data-slot": "collapsible-content",
|
|
303
|
+
className: "CollapsibleContent",
|
|
285
304
|
...props
|
|
286
305
|
}
|
|
287
306
|
);
|
|
288
307
|
}
|
|
289
|
-
|
|
290
|
-
"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",
|
|
291
|
-
{
|
|
292
|
-
variants: {
|
|
293
|
-
align: {
|
|
294
|
-
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
295
|
-
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
296
|
-
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
297
|
-
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
defaultVariants: {
|
|
301
|
-
align: "inline-start"
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
);
|
|
305
|
-
function InputGroupAddon({
|
|
306
|
-
className,
|
|
307
|
-
align = "inline-start",
|
|
308
|
+
function DropdownMenu({
|
|
308
309
|
...props
|
|
309
310
|
}) {
|
|
310
|
-
return /* @__PURE__ */ jsx(
|
|
311
|
-
"div",
|
|
312
|
-
{
|
|
313
|
-
role: "group",
|
|
314
|
-
"data-slot": "input-group-addon",
|
|
315
|
-
"data-align": align,
|
|
316
|
-
className: cn(inputGroupAddonVariants({ align }), className),
|
|
317
|
-
onClick: (e) => {
|
|
318
|
-
if (e.target.closest("button")) {
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
322
|
-
},
|
|
323
|
-
...props
|
|
324
|
-
}
|
|
325
|
-
);
|
|
311
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
326
312
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
334
|
-
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
335
|
-
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
defaultVariants: {
|
|
339
|
-
size: "xs"
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
);
|
|
343
|
-
function InputGroupButton({
|
|
344
|
-
className,
|
|
345
|
-
type = "button",
|
|
346
|
-
variant = "ghost",
|
|
347
|
-
size = "xs",
|
|
313
|
+
function DropdownMenuPortal({
|
|
314
|
+
...props
|
|
315
|
+
}) {
|
|
316
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
317
|
+
}
|
|
318
|
+
function DropdownMenuTrigger({
|
|
348
319
|
...props
|
|
349
320
|
}) {
|
|
350
321
|
return /* @__PURE__ */ jsx(
|
|
351
|
-
|
|
322
|
+
DropdownMenuPrimitive.Trigger,
|
|
352
323
|
{
|
|
353
|
-
|
|
354
|
-
"data-size": size,
|
|
355
|
-
variant,
|
|
356
|
-
className: cn(inputGroupButtonVariants({ size }), className),
|
|
324
|
+
"data-slot": "dropdown-menu-trigger",
|
|
357
325
|
...props
|
|
358
326
|
}
|
|
359
327
|
);
|
|
360
328
|
}
|
|
361
|
-
function
|
|
362
|
-
|
|
363
|
-
|
|
329
|
+
function DropdownMenuContent({
|
|
330
|
+
className,
|
|
331
|
+
sideOffset = 4,
|
|
332
|
+
...props
|
|
333
|
+
}) {
|
|
334
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
|
|
335
|
+
DropdownMenuPrimitive.Content,
|
|
364
336
|
{
|
|
337
|
+
"data-slot": "dropdown-menu-content",
|
|
338
|
+
sideOffset,
|
|
365
339
|
className: cn(
|
|
366
|
-
"text-
|
|
340
|
+
"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",
|
|
367
341
|
className
|
|
368
342
|
),
|
|
369
343
|
...props
|
|
370
344
|
}
|
|
371
|
-
);
|
|
345
|
+
) });
|
|
372
346
|
}
|
|
373
|
-
function
|
|
347
|
+
function DropdownMenuGroup({
|
|
348
|
+
...props
|
|
349
|
+
}) {
|
|
350
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
351
|
+
}
|
|
352
|
+
function DropdownMenuItem({
|
|
374
353
|
className,
|
|
354
|
+
inset,
|
|
355
|
+
variant = "default",
|
|
375
356
|
...props
|
|
376
357
|
}) {
|
|
377
358
|
return /* @__PURE__ */ jsx(
|
|
378
|
-
|
|
359
|
+
DropdownMenuPrimitive.Item,
|
|
379
360
|
{
|
|
380
|
-
"data-slot": "
|
|
361
|
+
"data-slot": "dropdown-menu-item",
|
|
362
|
+
"data-inset": inset,
|
|
363
|
+
"data-variant": variant,
|
|
381
364
|
className: cn(
|
|
382
|
-
"flex-
|
|
365
|
+
"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",
|
|
383
366
|
className
|
|
384
367
|
),
|
|
385
368
|
...props
|
|
386
369
|
}
|
|
387
370
|
);
|
|
388
371
|
}
|
|
389
|
-
function
|
|
372
|
+
function DropdownMenuCheckboxItem({
|
|
390
373
|
className,
|
|
374
|
+
children,
|
|
375
|
+
checked,
|
|
391
376
|
...props
|
|
392
377
|
}) {
|
|
393
|
-
return
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
"
|
|
399
|
-
className
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
378
|
+
return (
|
|
379
|
+
// @ts-expect-error types too strict
|
|
380
|
+
/* @__PURE__ */ jsxs(
|
|
381
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
382
|
+
{
|
|
383
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
384
|
+
className: cn(
|
|
385
|
+
"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",
|
|
386
|
+
className
|
|
387
|
+
),
|
|
388
|
+
checked,
|
|
389
|
+
...props,
|
|
390
|
+
children: [
|
|
391
|
+
/* @__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" }) }) }),
|
|
392
|
+
children
|
|
393
|
+
]
|
|
394
|
+
}
|
|
395
|
+
)
|
|
403
396
|
);
|
|
404
397
|
}
|
|
405
|
-
function
|
|
398
|
+
function DropdownMenuRadioGroup({
|
|
399
|
+
...props
|
|
400
|
+
}) {
|
|
406
401
|
return /* @__PURE__ */ jsx(
|
|
407
|
-
|
|
402
|
+
DropdownMenuPrimitive.RadioGroup,
|
|
408
403
|
{
|
|
409
|
-
|
|
410
|
-
"aria-label": "Loading",
|
|
411
|
-
className: cn("size-4 animate-spin", className),
|
|
404
|
+
"data-slot": "dropdown-menu-radio-group",
|
|
412
405
|
...props
|
|
413
406
|
}
|
|
414
407
|
);
|
|
415
408
|
}
|
|
416
|
-
function
|
|
417
|
-
|
|
418
|
-
|
|
409
|
+
function DropdownMenuRadioItem({
|
|
410
|
+
className,
|
|
411
|
+
children,
|
|
412
|
+
...props
|
|
413
|
+
}) {
|
|
414
|
+
return /* @__PURE__ */ jsxs(
|
|
415
|
+
DropdownMenuPrimitive.RadioItem,
|
|
419
416
|
{
|
|
420
|
-
"data-slot": "
|
|
417
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
421
418
|
className: cn(
|
|
422
|
-
"flex items-center gap-2
|
|
419
|
+
"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",
|
|
423
420
|
className
|
|
424
421
|
),
|
|
425
|
-
...props
|
|
422
|
+
...props,
|
|
423
|
+
children: [
|
|
424
|
+
/* @__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" }) }) }),
|
|
425
|
+
children
|
|
426
|
+
]
|
|
426
427
|
}
|
|
427
428
|
);
|
|
428
429
|
}
|
|
429
|
-
function
|
|
430
|
+
function DropdownMenuLabel({
|
|
430
431
|
className,
|
|
431
|
-
|
|
432
|
-
decorative = true,
|
|
432
|
+
inset,
|
|
433
433
|
...props
|
|
434
434
|
}) {
|
|
435
435
|
return /* @__PURE__ */ jsx(
|
|
436
|
-
|
|
436
|
+
DropdownMenuPrimitive.Label,
|
|
437
437
|
{
|
|
438
|
-
"data-slot": "
|
|
439
|
-
|
|
440
|
-
orientation,
|
|
438
|
+
"data-slot": "dropdown-menu-label",
|
|
439
|
+
"data-inset": inset,
|
|
441
440
|
className: cn(
|
|
442
|
-
"
|
|
441
|
+
"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
|
|
443
442
|
className
|
|
444
443
|
),
|
|
445
444
|
...props
|
|
446
445
|
}
|
|
447
446
|
);
|
|
448
447
|
}
|
|
449
|
-
function
|
|
450
|
-
|
|
451
|
-
}
|
|
452
|
-
function SheetTrigger({
|
|
448
|
+
function DropdownMenuSeparator({
|
|
449
|
+
className,
|
|
453
450
|
...props
|
|
454
451
|
}) {
|
|
455
|
-
return /* @__PURE__ */ jsx(
|
|
452
|
+
return /* @__PURE__ */ jsx(
|
|
453
|
+
DropdownMenuPrimitive.Separator,
|
|
454
|
+
{
|
|
455
|
+
"data-slot": "dropdown-menu-separator",
|
|
456
|
+
className: cn("bg-border -mx-1 my-1 h-px", className),
|
|
457
|
+
...props
|
|
458
|
+
}
|
|
459
|
+
);
|
|
456
460
|
}
|
|
457
|
-
function
|
|
461
|
+
function DropdownMenuShortcut({
|
|
462
|
+
className,
|
|
458
463
|
...props
|
|
459
464
|
}) {
|
|
460
|
-
return /* @__PURE__ */ jsx(
|
|
465
|
+
return /* @__PURE__ */ jsx(
|
|
466
|
+
"span",
|
|
467
|
+
{
|
|
468
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
469
|
+
className: cn(
|
|
470
|
+
"text-muted-foreground ml-auto text-xs tracking-widest",
|
|
471
|
+
className
|
|
472
|
+
),
|
|
473
|
+
...props
|
|
474
|
+
}
|
|
475
|
+
);
|
|
461
476
|
}
|
|
462
|
-
function
|
|
477
|
+
function DropdownMenuSub({
|
|
463
478
|
...props
|
|
464
479
|
}) {
|
|
465
|
-
return /* @__PURE__ */ jsx(
|
|
480
|
+
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
466
481
|
}
|
|
467
|
-
function
|
|
482
|
+
function DropdownMenuSubTrigger({
|
|
468
483
|
className,
|
|
484
|
+
inset,
|
|
485
|
+
children,
|
|
469
486
|
...props
|
|
470
487
|
}) {
|
|
471
|
-
return /* @__PURE__ */
|
|
472
|
-
|
|
488
|
+
return /* @__PURE__ */ jsxs(
|
|
489
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
473
490
|
{
|
|
474
|
-
"data-slot": "
|
|
491
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
492
|
+
"data-inset": inset,
|
|
475
493
|
className: cn(
|
|
476
|
-
"data-[state=open]:
|
|
494
|
+
"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",
|
|
477
495
|
className
|
|
478
496
|
),
|
|
479
|
-
...props
|
|
497
|
+
...props,
|
|
498
|
+
children: [
|
|
499
|
+
children,
|
|
500
|
+
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
501
|
+
]
|
|
480
502
|
}
|
|
481
503
|
);
|
|
482
504
|
}
|
|
483
|
-
function
|
|
505
|
+
function DropdownMenuSubContent({
|
|
484
506
|
className,
|
|
485
|
-
children,
|
|
486
|
-
side = "right",
|
|
487
507
|
...props
|
|
488
508
|
}) {
|
|
489
|
-
return /* @__PURE__ */
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
"data-
|
|
495
|
-
className
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
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",
|
|
501
|
-
className
|
|
502
|
-
),
|
|
503
|
-
...props,
|
|
504
|
-
children: [
|
|
505
|
-
children,
|
|
506
|
-
/* @__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: [
|
|
507
|
-
/* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
|
|
508
|
-
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
509
|
-
] })
|
|
510
|
-
]
|
|
511
|
-
}
|
|
512
|
-
)
|
|
513
|
-
] });
|
|
509
|
+
return /* @__PURE__ */ jsx(
|
|
510
|
+
DropdownMenuPrimitive.SubContent,
|
|
511
|
+
{
|
|
512
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
513
|
+
className: cn(
|
|
514
|
+
"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",
|
|
515
|
+
className
|
|
516
|
+
),
|
|
517
|
+
...props
|
|
518
|
+
}
|
|
519
|
+
);
|
|
514
520
|
}
|
|
515
|
-
function
|
|
521
|
+
function Input({ className, type, ...props }) {
|
|
516
522
|
return /* @__PURE__ */ jsx(
|
|
517
|
-
"
|
|
523
|
+
"input",
|
|
518
524
|
{
|
|
519
|
-
|
|
520
|
-
|
|
525
|
+
type,
|
|
526
|
+
"data-slot": "input",
|
|
527
|
+
className: cn(
|
|
528
|
+
"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",
|
|
529
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
530
|
+
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
531
|
+
className
|
|
532
|
+
),
|
|
521
533
|
...props
|
|
522
534
|
}
|
|
523
535
|
);
|
|
524
536
|
}
|
|
525
|
-
function
|
|
537
|
+
function Textarea({ className, ...props }) {
|
|
538
|
+
return /* @__PURE__ */ jsx(
|
|
539
|
+
"textarea",
|
|
540
|
+
{
|
|
541
|
+
"data-slot": "textarea",
|
|
542
|
+
className: cn(
|
|
543
|
+
// "min-h-16",
|
|
544
|
+
// "field-sizing-content",
|
|
545
|
+
"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",
|
|
546
|
+
className
|
|
547
|
+
),
|
|
548
|
+
...props
|
|
549
|
+
}
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
function InputGroup({ className, ...props }) {
|
|
526
553
|
return /* @__PURE__ */ jsx(
|
|
527
554
|
"div",
|
|
528
555
|
{
|
|
529
|
-
"data-slot": "
|
|
530
|
-
|
|
556
|
+
"data-slot": "input-group",
|
|
557
|
+
role: "group",
|
|
558
|
+
className: cn(
|
|
559
|
+
"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",
|
|
560
|
+
"h-9 min-w-0 has-[>textarea]:h-auto",
|
|
561
|
+
// Variants based on alignment.
|
|
562
|
+
"has-[>[data-align=inline-start]]:[&>input]:pl-2",
|
|
563
|
+
"has-[>[data-align=inline-end]]:[&>input]:pr-2",
|
|
564
|
+
"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
|
|
565
|
+
"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
|
|
566
|
+
// Focus state.
|
|
567
|
+
"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]",
|
|
568
|
+
// Error state.
|
|
569
|
+
"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",
|
|
570
|
+
className
|
|
571
|
+
),
|
|
531
572
|
...props
|
|
532
573
|
}
|
|
533
574
|
);
|
|
534
575
|
}
|
|
535
|
-
|
|
576
|
+
var inputGroupAddonVariants = cva(
|
|
577
|
+
"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",
|
|
578
|
+
{
|
|
579
|
+
variants: {
|
|
580
|
+
align: {
|
|
581
|
+
"inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
|
|
582
|
+
"inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
|
|
583
|
+
"block-start": "order-first w-full justify-start px-3 pt-3 [.border-b]:pb-3 group-has-[>input]/input-group:pt-2.5",
|
|
584
|
+
"block-end": "order-last w-full justify-start px-3 pb-3 [.border-t]:pt-3 group-has-[>input]/input-group:pb-2.5"
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
defaultVariants: {
|
|
588
|
+
align: "inline-start"
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
function InputGroupAddon({
|
|
536
593
|
className,
|
|
594
|
+
align = "inline-start",
|
|
537
595
|
...props
|
|
538
596
|
}) {
|
|
539
597
|
return /* @__PURE__ */ jsx(
|
|
540
|
-
|
|
598
|
+
"div",
|
|
541
599
|
{
|
|
542
|
-
|
|
543
|
-
|
|
600
|
+
role: "group",
|
|
601
|
+
"data-slot": "input-group-addon",
|
|
602
|
+
"data-align": align,
|
|
603
|
+
className: cn(inputGroupAddonVariants({ align }), className),
|
|
604
|
+
onClick: (e) => {
|
|
605
|
+
if (e.target.closest("button")) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
e.currentTarget.parentElement?.querySelector("input")?.focus();
|
|
609
|
+
},
|
|
544
610
|
...props
|
|
545
611
|
}
|
|
546
612
|
);
|
|
547
613
|
}
|
|
548
|
-
|
|
614
|
+
var inputGroupButtonVariants = cva(
|
|
615
|
+
"text-sm shadow-none flex gap-2 items-center",
|
|
616
|
+
{
|
|
617
|
+
variants: {
|
|
618
|
+
size: {
|
|
619
|
+
xs: "h-6 gap-1 px-2 rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-3.5 has-[>svg]:px-2",
|
|
620
|
+
sm: "h-8 px-2.5 gap-1.5 rounded-md has-[>svg]:px-2.5",
|
|
621
|
+
"icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
|
|
622
|
+
"icon-sm": "size-8 p-0 has-[>svg]:p-0"
|
|
623
|
+
}
|
|
624
|
+
},
|
|
625
|
+
defaultVariants: {
|
|
626
|
+
size: "xs"
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
);
|
|
630
|
+
function InputGroupButton({
|
|
549
631
|
className,
|
|
632
|
+
type = "button",
|
|
633
|
+
variant = "ghost",
|
|
634
|
+
size = "xs",
|
|
550
635
|
...props
|
|
551
636
|
}) {
|
|
552
637
|
return /* @__PURE__ */ jsx(
|
|
553
|
-
|
|
638
|
+
Button,
|
|
554
639
|
{
|
|
555
|
-
|
|
556
|
-
|
|
640
|
+
type,
|
|
641
|
+
"data-size": size,
|
|
642
|
+
variant,
|
|
643
|
+
className: cn(inputGroupButtonVariants({ size }), className),
|
|
557
644
|
...props
|
|
558
645
|
}
|
|
559
646
|
);
|
|
560
647
|
}
|
|
561
|
-
function
|
|
648
|
+
function InputGroupText({ className, ...props }) {
|
|
562
649
|
return /* @__PURE__ */ jsx(
|
|
563
|
-
"
|
|
650
|
+
"span",
|
|
564
651
|
{
|
|
565
|
-
|
|
566
|
-
|
|
652
|
+
className: cn(
|
|
653
|
+
"text-muted-foreground flex items-center gap-2 text-sm [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
|
|
654
|
+
className
|
|
655
|
+
),
|
|
567
656
|
...props
|
|
568
657
|
}
|
|
569
658
|
);
|
|
570
659
|
}
|
|
571
|
-
function
|
|
572
|
-
|
|
660
|
+
function InputGroupInput({
|
|
661
|
+
className,
|
|
573
662
|
...props
|
|
574
663
|
}) {
|
|
575
664
|
return /* @__PURE__ */ jsx(
|
|
576
|
-
|
|
665
|
+
Input,
|
|
577
666
|
{
|
|
578
|
-
"data-slot": "
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
667
|
+
"data-slot": "input-group-control",
|
|
668
|
+
className: cn(
|
|
669
|
+
"flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
670
|
+
className
|
|
671
|
+
),
|
|
672
|
+
...props
|
|
673
|
+
}
|
|
582
674
|
);
|
|
583
675
|
}
|
|
584
|
-
function
|
|
676
|
+
function InputGroupTextarea({
|
|
677
|
+
className,
|
|
585
678
|
...props
|
|
586
679
|
}) {
|
|
587
|
-
return /* @__PURE__ */ jsx(
|
|
680
|
+
return /* @__PURE__ */ jsx(
|
|
681
|
+
Textarea,
|
|
682
|
+
{
|
|
683
|
+
"data-slot": "input-group-control",
|
|
684
|
+
className: cn(
|
|
685
|
+
"flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
|
|
686
|
+
className
|
|
687
|
+
),
|
|
688
|
+
...props
|
|
689
|
+
}
|
|
690
|
+
);
|
|
588
691
|
}
|
|
589
|
-
function
|
|
692
|
+
function Label2({ className, ...props }) {
|
|
693
|
+
return /* @__PURE__ */ jsx(
|
|
694
|
+
LabelPrimitive.Root,
|
|
695
|
+
{
|
|
696
|
+
"data-slot": "label",
|
|
697
|
+
className: cn(
|
|
698
|
+
"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",
|
|
699
|
+
className
|
|
700
|
+
),
|
|
701
|
+
...props
|
|
702
|
+
}
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
function Pagination({ className, ...props }) {
|
|
706
|
+
return /* @__PURE__ */ jsx(
|
|
707
|
+
"nav",
|
|
708
|
+
{
|
|
709
|
+
role: "navigation",
|
|
710
|
+
"aria-label": "pagination",
|
|
711
|
+
"data-slot": "pagination",
|
|
712
|
+
className: cn("mx-auto flex w-full justify-center", className),
|
|
713
|
+
...props
|
|
714
|
+
}
|
|
715
|
+
);
|
|
716
|
+
}
|
|
717
|
+
function PaginationContent({
|
|
718
|
+
className,
|
|
590
719
|
...props
|
|
591
720
|
}) {
|
|
592
|
-
return /* @__PURE__ */ jsx(
|
|
721
|
+
return /* @__PURE__ */ jsx(
|
|
722
|
+
"ul",
|
|
723
|
+
{
|
|
724
|
+
"data-slot": "pagination-content",
|
|
725
|
+
className: cn("flex flex-row items-center gap-1", className),
|
|
726
|
+
...props
|
|
727
|
+
}
|
|
728
|
+
);
|
|
593
729
|
}
|
|
594
|
-
function
|
|
730
|
+
function PaginationItem({ ...props }) {
|
|
731
|
+
return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
|
|
732
|
+
}
|
|
733
|
+
function PaginationLink({
|
|
595
734
|
className,
|
|
596
|
-
|
|
597
|
-
|
|
735
|
+
isActive,
|
|
736
|
+
size = "icon",
|
|
598
737
|
...props
|
|
599
738
|
}) {
|
|
600
|
-
return /* @__PURE__ */ jsx(
|
|
601
|
-
|
|
739
|
+
return /* @__PURE__ */ jsx(
|
|
740
|
+
Button,
|
|
602
741
|
{
|
|
603
|
-
|
|
604
|
-
|
|
742
|
+
variant: "ghost",
|
|
743
|
+
"aria-current": isActive ? "page" : void 0,
|
|
744
|
+
"data-slot": "pagination-link",
|
|
745
|
+
"data-active": isActive,
|
|
605
746
|
className: cn(
|
|
606
|
-
|
|
747
|
+
buttonVariants({
|
|
748
|
+
variant: isActive ? "outline" : "ghost",
|
|
749
|
+
size
|
|
750
|
+
}),
|
|
607
751
|
className
|
|
608
752
|
),
|
|
753
|
+
...props
|
|
754
|
+
}
|
|
755
|
+
);
|
|
756
|
+
}
|
|
757
|
+
function PaginationPrevious({
|
|
758
|
+
className,
|
|
759
|
+
...props
|
|
760
|
+
}) {
|
|
761
|
+
return /* @__PURE__ */ jsx(
|
|
762
|
+
PaginationLink,
|
|
763
|
+
{
|
|
764
|
+
"aria-label": "Go to previous page",
|
|
765
|
+
size: "default",
|
|
766
|
+
className: cn("gap-1 px-2.5 sm:pl-2.5", className),
|
|
767
|
+
...props,
|
|
768
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, {})
|
|
769
|
+
}
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
function PaginationNext({
|
|
773
|
+
className,
|
|
774
|
+
...props
|
|
775
|
+
}) {
|
|
776
|
+
return /* @__PURE__ */ jsx(
|
|
777
|
+
PaginationLink,
|
|
778
|
+
{
|
|
779
|
+
"aria-label": "Go to next page",
|
|
780
|
+
size: "default",
|
|
781
|
+
className: cn("gap-1 px-2.5 sm:pr-2.5", className),
|
|
782
|
+
...props,
|
|
783
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, {})
|
|
784
|
+
}
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
function PaginationEllipsis({
|
|
788
|
+
className,
|
|
789
|
+
...props
|
|
790
|
+
}) {
|
|
791
|
+
return /* @__PURE__ */ jsxs(
|
|
792
|
+
"span",
|
|
793
|
+
{
|
|
794
|
+
"aria-hidden": true,
|
|
795
|
+
"data-slot": "pagination-ellipsis",
|
|
796
|
+
className: cn("flex size-9 items-center justify-center", className),
|
|
609
797
|
...props,
|
|
610
798
|
children: [
|
|
611
|
-
|
|
612
|
-
/* @__PURE__ */ jsx(
|
|
799
|
+
/* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }),
|
|
800
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
|
|
613
801
|
]
|
|
614
802
|
}
|
|
615
|
-
)
|
|
803
|
+
);
|
|
616
804
|
}
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
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;
|
|
805
|
+
function Select({
|
|
806
|
+
...props
|
|
807
|
+
}) {
|
|
808
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
|
|
629
809
|
}
|
|
630
|
-
function
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
810
|
+
function SelectGroup({
|
|
811
|
+
...props
|
|
812
|
+
}) {
|
|
813
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, { "data-slot": "select-group", ...props });
|
|
814
|
+
}
|
|
815
|
+
function SelectValue({
|
|
816
|
+
...props
|
|
817
|
+
}) {
|
|
818
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
819
|
+
}
|
|
820
|
+
function SelectTrigger({
|
|
634
821
|
className,
|
|
635
|
-
|
|
822
|
+
size = "default",
|
|
636
823
|
children,
|
|
637
824
|
...props
|
|
638
825
|
}) {
|
|
639
|
-
|
|
640
|
-
|
|
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",
|
|
826
|
+
return /* @__PURE__ */ jsxs(
|
|
827
|
+
SelectPrimitive.Trigger,
|
|
683
828
|
{
|
|
684
|
-
"data-slot": "
|
|
685
|
-
|
|
686
|
-
"--sidebar-width": SIDEBAR_WIDTH,
|
|
687
|
-
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
688
|
-
...style
|
|
689
|
-
},
|
|
829
|
+
"data-slot": "select-trigger",
|
|
830
|
+
"data-size": size,
|
|
690
831
|
className: cn(
|
|
691
|
-
"
|
|
832
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]: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 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
692
833
|
className
|
|
693
834
|
),
|
|
694
835
|
...props,
|
|
695
|
-
children
|
|
836
|
+
children: [
|
|
837
|
+
children,
|
|
838
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })
|
|
839
|
+
]
|
|
696
840
|
}
|
|
697
|
-
)
|
|
841
|
+
);
|
|
698
842
|
}
|
|
699
|
-
function
|
|
700
|
-
side = "left",
|
|
701
|
-
variant = "sidebar",
|
|
702
|
-
collapsible = "offcanvas",
|
|
843
|
+
function SelectContent({
|
|
703
844
|
className,
|
|
704
845
|
children,
|
|
846
|
+
position = "popper",
|
|
847
|
+
align = "center",
|
|
705
848
|
...props
|
|
706
849
|
}) {
|
|
707
|
-
|
|
708
|
-
|
|
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",
|
|
850
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
851
|
+
SelectPrimitive.Content,
|
|
746
852
|
{
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
853
|
+
"data-slot": "select-content",
|
|
854
|
+
className: cn(
|
|
855
|
+
"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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",
|
|
856
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
857
|
+
className
|
|
858
|
+
),
|
|
859
|
+
position,
|
|
860
|
+
align,
|
|
861
|
+
...props,
|
|
753
862
|
children: [
|
|
863
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
754
864
|
/* @__PURE__ */ jsx(
|
|
755
|
-
|
|
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",
|
|
865
|
+
SelectPrimitive.Viewport,
|
|
768
866
|
{
|
|
769
|
-
"data-slot": "sidebar-container",
|
|
770
867
|
className: cn(
|
|
771
|
-
"
|
|
772
|
-
|
|
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
|
|
868
|
+
"p-1",
|
|
869
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
|
|
776
870
|
),
|
|
777
|
-
|
|
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
|
-
)
|
|
871
|
+
children
|
|
787
872
|
}
|
|
788
|
-
)
|
|
873
|
+
),
|
|
874
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
789
875
|
]
|
|
790
876
|
}
|
|
791
|
-
);
|
|
877
|
+
) });
|
|
792
878
|
}
|
|
793
|
-
function
|
|
879
|
+
function SelectLabel({
|
|
794
880
|
className,
|
|
795
|
-
onClick,
|
|
796
881
|
...props
|
|
797
882
|
}) {
|
|
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
883
|
return /* @__PURE__ */ jsx(
|
|
822
|
-
|
|
884
|
+
SelectPrimitive.Label,
|
|
823
885
|
{
|
|
824
|
-
"data-
|
|
825
|
-
|
|
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
|
-
),
|
|
886
|
+
"data-slot": "select-label",
|
|
887
|
+
className: cn("text-muted-foreground px-2 py-1.5 text-xs", className),
|
|
839
888
|
...props
|
|
840
889
|
}
|
|
841
890
|
);
|
|
842
891
|
}
|
|
843
|
-
function
|
|
844
|
-
|
|
845
|
-
|
|
892
|
+
function SelectItem({
|
|
893
|
+
className,
|
|
894
|
+
children,
|
|
895
|
+
...props
|
|
896
|
+
}) {
|
|
897
|
+
return /* @__PURE__ */ jsxs(
|
|
898
|
+
SelectPrimitive.Item,
|
|
846
899
|
{
|
|
847
|
-
"data-slot": "
|
|
900
|
+
"data-slot": "select-item",
|
|
848
901
|
className: cn(
|
|
849
|
-
"bg-
|
|
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]",
|
|
902
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
852
903
|
className
|
|
853
904
|
),
|
|
854
|
-
...props
|
|
905
|
+
...props,
|
|
906
|
+
children: [
|
|
907
|
+
/* @__PURE__ */ jsx("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
|
|
908
|
+
/* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })
|
|
909
|
+
]
|
|
855
910
|
}
|
|
856
911
|
);
|
|
857
912
|
}
|
|
858
|
-
function
|
|
913
|
+
function SelectSeparator({
|
|
859
914
|
className,
|
|
860
915
|
...props
|
|
861
916
|
}) {
|
|
862
917
|
return /* @__PURE__ */ jsx(
|
|
863
|
-
|
|
918
|
+
SelectPrimitive.Separator,
|
|
864
919
|
{
|
|
865
|
-
"data-slot": "
|
|
866
|
-
"
|
|
867
|
-
className: cn("bg-background h-8 w-full shadow-none", className),
|
|
920
|
+
"data-slot": "select-separator",
|
|
921
|
+
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
868
922
|
...props
|
|
869
923
|
}
|
|
870
924
|
);
|
|
871
925
|
}
|
|
872
|
-
function
|
|
926
|
+
function SelectScrollUpButton({
|
|
927
|
+
className,
|
|
928
|
+
...props
|
|
929
|
+
}) {
|
|
873
930
|
return /* @__PURE__ */ jsx(
|
|
874
|
-
|
|
931
|
+
SelectPrimitive.ScrollUpButton,
|
|
875
932
|
{
|
|
876
|
-
"data-slot": "
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
933
|
+
"data-slot": "select-scroll-up-button",
|
|
934
|
+
className: cn(
|
|
935
|
+
"flex cursor-default items-center justify-center py-1",
|
|
936
|
+
className
|
|
937
|
+
),
|
|
938
|
+
...props,
|
|
939
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
880
940
|
}
|
|
881
941
|
);
|
|
882
942
|
}
|
|
883
|
-
function
|
|
943
|
+
function SelectScrollDownButton({
|
|
944
|
+
className,
|
|
945
|
+
...props
|
|
946
|
+
}) {
|
|
884
947
|
return /* @__PURE__ */ jsx(
|
|
885
|
-
|
|
948
|
+
SelectPrimitive.ScrollDownButton,
|
|
886
949
|
{
|
|
887
|
-
"data-slot": "
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
950
|
+
"data-slot": "select-scroll-down-button",
|
|
951
|
+
className: cn(
|
|
952
|
+
"flex cursor-default items-center justify-center py-1",
|
|
953
|
+
className
|
|
954
|
+
),
|
|
955
|
+
...props,
|
|
956
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
891
957
|
}
|
|
892
958
|
);
|
|
893
959
|
}
|
|
894
|
-
function
|
|
960
|
+
function Separator3({
|
|
895
961
|
className,
|
|
962
|
+
orientation = "horizontal",
|
|
963
|
+
decorative = true,
|
|
896
964
|
...props
|
|
897
965
|
}) {
|
|
898
966
|
return /* @__PURE__ */ jsx(
|
|
899
|
-
|
|
967
|
+
SeparatorPrimitive.Root,
|
|
900
968
|
{
|
|
901
|
-
"data-slot": "
|
|
902
|
-
|
|
903
|
-
|
|
969
|
+
"data-slot": "separator",
|
|
970
|
+
decorative,
|
|
971
|
+
orientation,
|
|
972
|
+
className: cn(
|
|
973
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
|
|
974
|
+
className
|
|
975
|
+
),
|
|
904
976
|
...props
|
|
905
977
|
}
|
|
906
978
|
);
|
|
907
979
|
}
|
|
908
|
-
function
|
|
980
|
+
function Sheet({ ...props }) {
|
|
981
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
982
|
+
}
|
|
983
|
+
function SheetTrigger({
|
|
984
|
+
...props
|
|
985
|
+
}) {
|
|
986
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
|
|
987
|
+
}
|
|
988
|
+
function SheetClose({
|
|
989
|
+
...props
|
|
990
|
+
}) {
|
|
991
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", ...props });
|
|
992
|
+
}
|
|
993
|
+
function SheetPortal({
|
|
994
|
+
...props
|
|
995
|
+
}) {
|
|
996
|
+
return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
997
|
+
}
|
|
998
|
+
function SheetOverlay({
|
|
999
|
+
className,
|
|
1000
|
+
...props
|
|
1001
|
+
}) {
|
|
909
1002
|
return /* @__PURE__ */ jsx(
|
|
910
|
-
|
|
1003
|
+
SheetPrimitive.Overlay,
|
|
911
1004
|
{
|
|
912
|
-
"data-slot": "
|
|
913
|
-
"data-sidebar": "content",
|
|
1005
|
+
"data-slot": "sheet-overlay",
|
|
914
1006
|
className: cn(
|
|
915
|
-
"
|
|
1007
|
+
"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",
|
|
916
1008
|
className
|
|
917
1009
|
),
|
|
918
1010
|
...props
|
|
919
1011
|
}
|
|
920
1012
|
);
|
|
921
1013
|
}
|
|
922
|
-
function
|
|
1014
|
+
function SheetContent({
|
|
1015
|
+
className,
|
|
1016
|
+
children,
|
|
1017
|
+
side = "right",
|
|
1018
|
+
...props
|
|
1019
|
+
}) {
|
|
1020
|
+
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
1021
|
+
/* @__PURE__ */ jsx(SheetOverlay, {}),
|
|
1022
|
+
/* @__PURE__ */ jsxs(
|
|
1023
|
+
SheetPrimitive.Content,
|
|
1024
|
+
{
|
|
1025
|
+
"data-slot": "sheet-content",
|
|
1026
|
+
className: cn(
|
|
1027
|
+
"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",
|
|
1028
|
+
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",
|
|
1029
|
+
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",
|
|
1030
|
+
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",
|
|
1031
|
+
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",
|
|
1032
|
+
className
|
|
1033
|
+
),
|
|
1034
|
+
...props,
|
|
1035
|
+
children: [
|
|
1036
|
+
children,
|
|
1037
|
+
/* @__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: [
|
|
1038
|
+
/* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
|
|
1039
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
1040
|
+
] })
|
|
1041
|
+
]
|
|
1042
|
+
}
|
|
1043
|
+
)
|
|
1044
|
+
] });
|
|
1045
|
+
}
|
|
1046
|
+
function SheetHeader({ className, ...props }) {
|
|
923
1047
|
return /* @__PURE__ */ jsx(
|
|
924
1048
|
"div",
|
|
925
1049
|
{
|
|
926
|
-
"data-slot": "
|
|
927
|
-
"
|
|
928
|
-
className: cn("relative flex w-full min-w-0 flex-col p-3", className),
|
|
1050
|
+
"data-slot": "sheet-header",
|
|
1051
|
+
className: cn("flex flex-col gap-1.5 p-4", className),
|
|
929
1052
|
...props
|
|
930
1053
|
}
|
|
931
1054
|
);
|
|
932
1055
|
}
|
|
933
|
-
function
|
|
934
|
-
className,
|
|
935
|
-
asChild = false,
|
|
936
|
-
...props
|
|
937
|
-
}) {
|
|
938
|
-
const Comp = asChild ? Slot : "div";
|
|
1056
|
+
function SheetFooter({ className, ...props }) {
|
|
939
1057
|
return /* @__PURE__ */ jsx(
|
|
940
|
-
|
|
1058
|
+
"div",
|
|
941
1059
|
{
|
|
942
|
-
"data-slot": "
|
|
943
|
-
|
|
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
|
-
),
|
|
1060
|
+
"data-slot": "sheet-footer",
|
|
1061
|
+
className: cn("mt-auto flex flex-col gap-2 p-4", className),
|
|
949
1062
|
...props
|
|
950
1063
|
}
|
|
951
1064
|
);
|
|
952
1065
|
}
|
|
953
|
-
function
|
|
1066
|
+
function SheetTitle({
|
|
954
1067
|
className,
|
|
955
|
-
asChild = false,
|
|
956
1068
|
...props
|
|
957
1069
|
}) {
|
|
958
|
-
const Comp = asChild ? Slot : "button";
|
|
959
1070
|
return /* @__PURE__ */ jsx(
|
|
960
|
-
|
|
1071
|
+
SheetPrimitive.Title,
|
|
961
1072
|
{
|
|
962
|
-
"data-slot": "
|
|
963
|
-
|
|
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
|
-
),
|
|
1073
|
+
"data-slot": "sheet-title",
|
|
1074
|
+
className: cn("text-foreground font-semibold", className),
|
|
971
1075
|
...props
|
|
972
1076
|
}
|
|
973
1077
|
);
|
|
974
1078
|
}
|
|
975
|
-
function
|
|
1079
|
+
function SheetDescription({
|
|
976
1080
|
className,
|
|
977
1081
|
...props
|
|
978
1082
|
}) {
|
|
979
1083
|
return /* @__PURE__ */ jsx(
|
|
980
|
-
|
|
1084
|
+
SheetPrimitive.Description,
|
|
981
1085
|
{
|
|
982
|
-
"data-slot": "
|
|
983
|
-
|
|
984
|
-
className: cn("w-full text-sm", className),
|
|
1086
|
+
"data-slot": "sheet-description",
|
|
1087
|
+
className: cn("text-muted-foreground text-sm", className),
|
|
985
1088
|
...props
|
|
986
1089
|
}
|
|
987
1090
|
);
|
|
988
1091
|
}
|
|
989
|
-
function
|
|
1092
|
+
function Skeleton({ className, ...props }) {
|
|
990
1093
|
return /* @__PURE__ */ jsx(
|
|
991
|
-
"
|
|
1094
|
+
"div",
|
|
992
1095
|
{
|
|
993
|
-
"data-slot": "
|
|
994
|
-
"
|
|
995
|
-
className: cn("flex w-full min-w-0 flex-col gap-2", className),
|
|
1096
|
+
"data-slot": "skeleton",
|
|
1097
|
+
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
996
1098
|
...props
|
|
997
1099
|
}
|
|
998
1100
|
);
|
|
999
1101
|
}
|
|
1000
|
-
function
|
|
1102
|
+
function TooltipProvider({
|
|
1103
|
+
delayDuration = 0,
|
|
1104
|
+
...props
|
|
1105
|
+
}) {
|
|
1001
1106
|
return /* @__PURE__ */ jsx(
|
|
1002
|
-
|
|
1107
|
+
TooltipPrimitive.Provider,
|
|
1003
1108
|
{
|
|
1004
|
-
"data-slot": "
|
|
1005
|
-
|
|
1006
|
-
className: cn("group/menu-item relative", className),
|
|
1109
|
+
"data-slot": "tooltip-provider",
|
|
1110
|
+
delayDuration,
|
|
1007
1111
|
...props
|
|
1008
1112
|
}
|
|
1009
1113
|
);
|
|
1010
1114
|
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
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,
|
|
1115
|
+
function Tooltip({
|
|
1116
|
+
...props
|
|
1117
|
+
}) {
|
|
1118
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) });
|
|
1119
|
+
}
|
|
1120
|
+
function TooltipTrigger({
|
|
1121
|
+
...props
|
|
1122
|
+
}) {
|
|
1123
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
1124
|
+
}
|
|
1125
|
+
function TooltipContent({
|
|
1038
1126
|
className,
|
|
1127
|
+
sideOffset = 0,
|
|
1128
|
+
children,
|
|
1039
1129
|
...props
|
|
1040
1130
|
}) {
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
const button = /* @__PURE__ */ jsx(
|
|
1044
|
-
Comp,
|
|
1131
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
1132
|
+
TooltipPrimitive.Content,
|
|
1045
1133
|
{
|
|
1046
|
-
"data-slot": "
|
|
1047
|
-
|
|
1048
|
-
"data-size": size,
|
|
1049
|
-
"data-active": isActive,
|
|
1134
|
+
"data-slot": "tooltip-content",
|
|
1135
|
+
sideOffset,
|
|
1050
1136
|
className: cn(
|
|
1051
|
-
|
|
1052
|
-
className
|
|
1053
|
-
"[&>svg]:size-5"
|
|
1137
|
+
"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",
|
|
1138
|
+
className
|
|
1054
1139
|
),
|
|
1055
|
-
...props
|
|
1140
|
+
...props,
|
|
1141
|
+
children: [
|
|
1142
|
+
children,
|
|
1143
|
+
/* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
1144
|
+
]
|
|
1056
1145
|
}
|
|
1057
|
-
);
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1146
|
+
) });
|
|
1147
|
+
}
|
|
1148
|
+
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
1149
|
+
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
1150
|
+
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
1151
|
+
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
1152
|
+
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
1153
|
+
var SidebarContext = React15.createContext(null);
|
|
1154
|
+
function useSidebar() {
|
|
1155
|
+
const context = React15.useContext(SidebarContext);
|
|
1156
|
+
if (!context) {
|
|
1157
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
1065
1158
|
}
|
|
1066
|
-
return
|
|
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
|
-
] });
|
|
1159
|
+
return context;
|
|
1078
1160
|
}
|
|
1079
|
-
function
|
|
1161
|
+
function SidebarProvider({
|
|
1162
|
+
defaultOpen = true,
|
|
1163
|
+
open: openProp,
|
|
1164
|
+
onOpenChange: setOpenProp,
|
|
1080
1165
|
className,
|
|
1081
|
-
|
|
1082
|
-
|
|
1166
|
+
style,
|
|
1167
|
+
children,
|
|
1083
1168
|
...props
|
|
1084
1169
|
}) {
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
|
|
1170
|
+
const isMobile = useIsMobile();
|
|
1171
|
+
const [openMobile, setOpenMobile] = React15.useState(false);
|
|
1172
|
+
const [_open, _setOpen] = React15.useState(defaultOpen);
|
|
1173
|
+
const open = openProp ?? _open;
|
|
1174
|
+
const setOpen = React15.useCallback(
|
|
1175
|
+
(value) => {
|
|
1176
|
+
const openState = typeof value === "function" ? value(open) : value;
|
|
1177
|
+
if (setOpenProp) {
|
|
1178
|
+
setOpenProp(openState);
|
|
1179
|
+
} else {
|
|
1180
|
+
_setOpen(openState);
|
|
1181
|
+
}
|
|
1182
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
1183
|
+
},
|
|
1184
|
+
[setOpenProp, open]
|
|
1185
|
+
);
|
|
1186
|
+
const toggleSidebar = React15.useCallback(() => {
|
|
1187
|
+
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
1188
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
1189
|
+
React15.useEffect(() => {
|
|
1190
|
+
const handleKeyDown = (event) => {
|
|
1191
|
+
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
1192
|
+
event.preventDefault();
|
|
1193
|
+
toggleSidebar();
|
|
1194
|
+
}
|
|
1195
|
+
};
|
|
1196
|
+
globalThis.addEventListener("keydown", handleKeyDown);
|
|
1197
|
+
return () => globalThis.removeEventListener("keydown", handleKeyDown);
|
|
1198
|
+
}, [toggleSidebar]);
|
|
1199
|
+
const state = open ? "expanded" : "collapsed";
|
|
1200
|
+
const contextValue = React15.useMemo(
|
|
1201
|
+
() => ({
|
|
1202
|
+
state,
|
|
1203
|
+
open,
|
|
1204
|
+
setOpen,
|
|
1205
|
+
isMobile,
|
|
1206
|
+
openMobile,
|
|
1207
|
+
setOpenMobile,
|
|
1208
|
+
toggleSidebar
|
|
1209
|
+
}),
|
|
1210
|
+
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
1211
|
+
);
|
|
1212
|
+
return /* @__PURE__ */ jsx(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx(
|
|
1213
|
+
"div",
|
|
1088
1214
|
{
|
|
1089
|
-
"data-slot": "sidebar-
|
|
1090
|
-
|
|
1215
|
+
"data-slot": "sidebar-wrapper",
|
|
1216
|
+
style: {
|
|
1217
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
1218
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
1219
|
+
...style
|
|
1220
|
+
},
|
|
1091
1221
|
className: cn(
|
|
1092
|
-
"
|
|
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",
|
|
1222
|
+
"group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
|
|
1100
1223
|
className
|
|
1101
1224
|
),
|
|
1102
|
-
...props
|
|
1225
|
+
...props,
|
|
1226
|
+
children
|
|
1103
1227
|
}
|
|
1104
|
-
);
|
|
1228
|
+
) }) });
|
|
1105
1229
|
}
|
|
1106
|
-
function
|
|
1230
|
+
function Sidebar({
|
|
1231
|
+
side = "left",
|
|
1232
|
+
variant = "sidebar",
|
|
1233
|
+
collapsible = "offcanvas",
|
|
1107
1234
|
className,
|
|
1235
|
+
children,
|
|
1108
1236
|
...props
|
|
1109
1237
|
}) {
|
|
1110
|
-
|
|
1238
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
1239
|
+
if (collapsible === "none") {
|
|
1240
|
+
return /* @__PURE__ */ jsx(
|
|
1241
|
+
"div",
|
|
1242
|
+
{
|
|
1243
|
+
"data-slot": "sidebar",
|
|
1244
|
+
className: cn(
|
|
1245
|
+
"bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",
|
|
1246
|
+
className
|
|
1247
|
+
),
|
|
1248
|
+
...props,
|
|
1249
|
+
children
|
|
1250
|
+
}
|
|
1251
|
+
);
|
|
1252
|
+
}
|
|
1253
|
+
if (isMobile) {
|
|
1254
|
+
return /* @__PURE__ */ jsx(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs(
|
|
1255
|
+
SheetContent,
|
|
1256
|
+
{
|
|
1257
|
+
"data-sidebar": "sidebar",
|
|
1258
|
+
"data-slot": "sidebar",
|
|
1259
|
+
"data-mobile": "true",
|
|
1260
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
1261
|
+
style: {
|
|
1262
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
1263
|
+
},
|
|
1264
|
+
side,
|
|
1265
|
+
children: [
|
|
1266
|
+
/* @__PURE__ */ jsxs(SheetHeader, { className: "sr-only", children: [
|
|
1267
|
+
/* @__PURE__ */ jsx(SheetTitle, { children: "Sidebar" }),
|
|
1268
|
+
/* @__PURE__ */ jsx(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
1269
|
+
] }),
|
|
1270
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-full w-full flex-col", children })
|
|
1271
|
+
]
|
|
1272
|
+
}
|
|
1273
|
+
) });
|
|
1274
|
+
}
|
|
1275
|
+
return /* @__PURE__ */ jsxs(
|
|
1111
1276
|
"div",
|
|
1112
1277
|
{
|
|
1113
|
-
|
|
1114
|
-
"data-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1278
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
1279
|
+
"data-state": state,
|
|
1280
|
+
"data-collapsible": state === "collapsed" ? collapsible : "",
|
|
1281
|
+
"data-variant": variant,
|
|
1282
|
+
"data-side": side,
|
|
1283
|
+
"data-slot": "sidebar",
|
|
1284
|
+
children: [
|
|
1285
|
+
/* @__PURE__ */ jsx(
|
|
1286
|
+
"div",
|
|
1287
|
+
{
|
|
1288
|
+
"data-slot": "sidebar-gap",
|
|
1289
|
+
className: cn(
|
|
1290
|
+
"relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",
|
|
1291
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
1292
|
+
"group-data-[side=right]:rotate-180",
|
|
1293
|
+
variant === "floating" || variant === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
|
|
1294
|
+
)
|
|
1295
|
+
}
|
|
1296
|
+
),
|
|
1297
|
+
/* @__PURE__ */ jsx(
|
|
1298
|
+
"div",
|
|
1299
|
+
{
|
|
1300
|
+
"data-slot": "sidebar-container",
|
|
1301
|
+
className: cn(
|
|
1302
|
+
"fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
1303
|
+
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)]",
|
|
1304
|
+
// Adjust the padding for floating and inset variants.
|
|
1305
|
+
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",
|
|
1306
|
+
className
|
|
1307
|
+
),
|
|
1308
|
+
...props,
|
|
1309
|
+
children: /* @__PURE__ */ jsx(
|
|
1310
|
+
"div",
|
|
1311
|
+
{
|
|
1312
|
+
"data-sidebar": "sidebar",
|
|
1313
|
+
"data-slot": "sidebar-inner",
|
|
1314
|
+
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",
|
|
1315
|
+
children
|
|
1316
|
+
}
|
|
1317
|
+
)
|
|
1318
|
+
}
|
|
1319
|
+
)
|
|
1320
|
+
]
|
|
1125
1321
|
}
|
|
1126
1322
|
);
|
|
1127
1323
|
}
|
|
1128
|
-
function
|
|
1324
|
+
function SidebarTrigger({
|
|
1129
1325
|
className,
|
|
1130
|
-
|
|
1326
|
+
onClick,
|
|
1131
1327
|
...props
|
|
1132
1328
|
}) {
|
|
1133
|
-
const
|
|
1134
|
-
React11.useEffect(() => {
|
|
1135
|
-
setWidth(`${Math.floor(Math.random() * 40) + 50}%`);
|
|
1136
|
-
}, []);
|
|
1329
|
+
const { toggleSidebar } = useSidebar();
|
|
1137
1330
|
return /* @__PURE__ */ jsxs(
|
|
1138
|
-
|
|
1331
|
+
Button,
|
|
1139
1332
|
{
|
|
1140
|
-
"data-
|
|
1141
|
-
"data-
|
|
1142
|
-
|
|
1333
|
+
"data-sidebar": "trigger",
|
|
1334
|
+
"data-slot": "sidebar-trigger",
|
|
1335
|
+
variant: "ghost",
|
|
1336
|
+
size: "icon",
|
|
1337
|
+
className: cn("size-7", className),
|
|
1338
|
+
onClick: (event) => {
|
|
1339
|
+
onClick?.(event);
|
|
1340
|
+
toggleSidebar();
|
|
1341
|
+
},
|
|
1143
1342
|
...props,
|
|
1144
1343
|
children: [
|
|
1145
|
-
|
|
1146
|
-
|
|
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
|
-
)
|
|
1344
|
+
/* @__PURE__ */ jsx(PanelLeftIcon, {}),
|
|
1345
|
+
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
1162
1346
|
]
|
|
1163
1347
|
}
|
|
1164
1348
|
);
|
|
1165
1349
|
}
|
|
1166
|
-
function
|
|
1350
|
+
function SidebarRail({ className, ...props }) {
|
|
1351
|
+
const { toggleSidebar } = useSidebar();
|
|
1167
1352
|
return /* @__PURE__ */ jsx(
|
|
1168
|
-
"
|
|
1353
|
+
"button",
|
|
1169
1354
|
{
|
|
1170
|
-
"data-
|
|
1171
|
-
"data-
|
|
1355
|
+
"data-sidebar": "rail",
|
|
1356
|
+
"data-slot": "sidebar-rail",
|
|
1357
|
+
"aria-label": "Toggle Sidebar",
|
|
1358
|
+
tabIndex: -1,
|
|
1359
|
+
onClick: toggleSidebar,
|
|
1360
|
+
title: "Toggle Sidebar",
|
|
1172
1361
|
className: cn(
|
|
1173
|
-
"
|
|
1174
|
-
"
|
|
1362
|
+
"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",
|
|
1363
|
+
"in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",
|
|
1364
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
1365
|
+
"hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full",
|
|
1366
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
1367
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
1175
1368
|
className
|
|
1176
1369
|
),
|
|
1177
1370
|
...props
|
|
1178
1371
|
}
|
|
1179
1372
|
);
|
|
1180
1373
|
}
|
|
1181
|
-
function
|
|
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";
|
|
1374
|
+
function SidebarInset({ className, ...props }) {
|
|
1203
1375
|
return /* @__PURE__ */ jsx(
|
|
1204
|
-
|
|
1376
|
+
"main",
|
|
1205
1377
|
{
|
|
1206
|
-
"data-slot": "sidebar-
|
|
1207
|
-
"data-sidebar": "menu-sub-button",
|
|
1208
|
-
"data-size": size,
|
|
1209
|
-
"data-active": isActive,
|
|
1378
|
+
"data-slot": "sidebar-inset",
|
|
1210
1379
|
className: cn(
|
|
1211
|
-
"
|
|
1212
|
-
"data-[
|
|
1213
|
-
|
|
1214
|
-
size === "md" && "text-sm",
|
|
1215
|
-
size === "lg" && "text-bas h-10",
|
|
1216
|
-
"group-data-[collapsible=icon]:hidden",
|
|
1217
|
-
isActive && "font-medium",
|
|
1380
|
+
"bg-background relative flex w-full flex-1 flex-col",
|
|
1381
|
+
"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",
|
|
1382
|
+
"transition-[width]",
|
|
1218
1383
|
className
|
|
1219
1384
|
),
|
|
1220
1385
|
...props
|
|
1221
1386
|
}
|
|
1222
1387
|
);
|
|
1223
1388
|
}
|
|
1224
|
-
function
|
|
1225
|
-
|
|
1226
|
-
}) {
|
|
1227
|
-
return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
1228
|
-
}
|
|
1229
|
-
function CollapsibleTrigger2({
|
|
1389
|
+
function SidebarInput({
|
|
1390
|
+
className,
|
|
1230
1391
|
...props
|
|
1231
1392
|
}) {
|
|
1232
1393
|
return /* @__PURE__ */ jsx(
|
|
1233
|
-
|
|
1394
|
+
Input,
|
|
1234
1395
|
{
|
|
1235
|
-
"data-slot": "
|
|
1396
|
+
"data-slot": "sidebar-input",
|
|
1397
|
+
"data-sidebar": "input",
|
|
1398
|
+
className: cn("bg-background h-8 w-full shadow-none", className),
|
|
1236
1399
|
...props
|
|
1237
1400
|
}
|
|
1238
1401
|
);
|
|
1239
1402
|
}
|
|
1240
|
-
function
|
|
1241
|
-
...props
|
|
1242
|
-
}) {
|
|
1403
|
+
function SidebarHeader({ className, ...props }) {
|
|
1243
1404
|
return /* @__PURE__ */ jsx(
|
|
1244
|
-
|
|
1405
|
+
"div",
|
|
1245
1406
|
{
|
|
1246
|
-
"data-slot": "
|
|
1247
|
-
|
|
1407
|
+
"data-slot": "sidebar-header",
|
|
1408
|
+
"data-sidebar": "header",
|
|
1409
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
1248
1410
|
...props
|
|
1249
1411
|
}
|
|
1250
1412
|
);
|
|
1251
1413
|
}
|
|
1252
|
-
function
|
|
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
|
-
}) {
|
|
1414
|
+
function SidebarFooter({ className, ...props }) {
|
|
1265
1415
|
return /* @__PURE__ */ jsx(
|
|
1266
|
-
|
|
1416
|
+
"div",
|
|
1267
1417
|
{
|
|
1268
|
-
"data-slot": "
|
|
1418
|
+
"data-slot": "sidebar-footer",
|
|
1419
|
+
"data-sidebar": "footer",
|
|
1420
|
+
className: cn("flex flex-col gap-2 p-2", className),
|
|
1269
1421
|
...props
|
|
1270
1422
|
}
|
|
1271
1423
|
);
|
|
1272
1424
|
}
|
|
1273
|
-
function
|
|
1425
|
+
function SidebarSeparator({
|
|
1274
1426
|
className,
|
|
1275
|
-
sideOffset = 4,
|
|
1276
1427
|
...props
|
|
1277
1428
|
}) {
|
|
1278
|
-
return /* @__PURE__ */ jsx(
|
|
1279
|
-
|
|
1429
|
+
return /* @__PURE__ */ jsx(
|
|
1430
|
+
Separator3,
|
|
1280
1431
|
{
|
|
1281
|
-
"data-slot": "
|
|
1282
|
-
|
|
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
|
-
),
|
|
1432
|
+
"data-slot": "sidebar-separator",
|
|
1433
|
+
"data-sidebar": "separator",
|
|
1434
|
+
className: cn("bg-sidebar-border mx-2 w-auto", className),
|
|
1287
1435
|
...props
|
|
1288
1436
|
}
|
|
1289
|
-
)
|
|
1290
|
-
}
|
|
1291
|
-
function DropdownMenuGroup({
|
|
1292
|
-
...props
|
|
1293
|
-
}) {
|
|
1294
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
1437
|
+
);
|
|
1295
1438
|
}
|
|
1296
|
-
function
|
|
1297
|
-
className,
|
|
1298
|
-
inset,
|
|
1299
|
-
variant = "default",
|
|
1300
|
-
...props
|
|
1301
|
-
}) {
|
|
1439
|
+
function SidebarContent({ className, ...props }) {
|
|
1302
1440
|
return /* @__PURE__ */ jsx(
|
|
1303
|
-
|
|
1441
|
+
"div",
|
|
1304
1442
|
{
|
|
1305
|
-
"data-slot": "
|
|
1306
|
-
"data-
|
|
1307
|
-
"data-variant": variant,
|
|
1443
|
+
"data-slot": "sidebar-content",
|
|
1444
|
+
"data-sidebar": "content",
|
|
1308
1445
|
className: cn(
|
|
1309
|
-
"
|
|
1446
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
1310
1447
|
className
|
|
1311
1448
|
),
|
|
1312
1449
|
...props
|
|
1313
1450
|
}
|
|
1314
1451
|
);
|
|
1315
1452
|
}
|
|
1316
|
-
function
|
|
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
|
-
}) {
|
|
1453
|
+
function SidebarGroup({ className, ...props }) {
|
|
1345
1454
|
return /* @__PURE__ */ jsx(
|
|
1346
|
-
|
|
1455
|
+
"div",
|
|
1347
1456
|
{
|
|
1348
|
-
"data-slot": "
|
|
1457
|
+
"data-slot": "sidebar-group",
|
|
1458
|
+
"data-sidebar": "group",
|
|
1459
|
+
className: cn("relative flex w-full min-w-0 flex-col p-3", className),
|
|
1349
1460
|
...props
|
|
1350
1461
|
}
|
|
1351
1462
|
);
|
|
1352
1463
|
}
|
|
1353
|
-
function
|
|
1464
|
+
function SidebarGroupLabel({
|
|
1354
1465
|
className,
|
|
1355
|
-
|
|
1466
|
+
asChild = false,
|
|
1356
1467
|
...props
|
|
1357
1468
|
}) {
|
|
1358
|
-
|
|
1359
|
-
|
|
1469
|
+
const Comp = asChild ? Slot : "div";
|
|
1470
|
+
return /* @__PURE__ */ jsx(
|
|
1471
|
+
Comp,
|
|
1360
1472
|
{
|
|
1361
|
-
"data-slot": "
|
|
1473
|
+
"data-slot": "sidebar-group-label",
|
|
1474
|
+
"data-sidebar": "group-label",
|
|
1362
1475
|
className: cn(
|
|
1363
|
-
"
|
|
1476
|
+
"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",
|
|
1477
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
1364
1478
|
className
|
|
1365
1479
|
),
|
|
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
|
-
]
|
|
1480
|
+
...props
|
|
1371
1481
|
}
|
|
1372
1482
|
);
|
|
1373
1483
|
}
|
|
1374
|
-
function
|
|
1484
|
+
function SidebarGroupAction({
|
|
1375
1485
|
className,
|
|
1376
|
-
|
|
1486
|
+
asChild = false,
|
|
1377
1487
|
...props
|
|
1378
1488
|
}) {
|
|
1489
|
+
const Comp = asChild ? Slot : "button";
|
|
1379
1490
|
return /* @__PURE__ */ jsx(
|
|
1380
|
-
|
|
1491
|
+
Comp,
|
|
1381
1492
|
{
|
|
1382
|
-
"data-slot": "
|
|
1383
|
-
"data-
|
|
1493
|
+
"data-slot": "sidebar-group-action",
|
|
1494
|
+
"data-sidebar": "group-action",
|
|
1384
1495
|
className: cn(
|
|
1385
|
-
"
|
|
1496
|
+
"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",
|
|
1497
|
+
// Increases the hit area of the button on mobile.
|
|
1498
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
1499
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1386
1500
|
className
|
|
1387
1501
|
),
|
|
1388
1502
|
...props
|
|
1389
1503
|
}
|
|
1390
1504
|
);
|
|
1391
1505
|
}
|
|
1392
|
-
function
|
|
1506
|
+
function SidebarGroupContent({
|
|
1393
1507
|
className,
|
|
1394
1508
|
...props
|
|
1395
1509
|
}) {
|
|
1396
1510
|
return /* @__PURE__ */ jsx(
|
|
1397
|
-
|
|
1511
|
+
"div",
|
|
1398
1512
|
{
|
|
1399
|
-
"data-slot": "
|
|
1400
|
-
|
|
1513
|
+
"data-slot": "sidebar-group-content",
|
|
1514
|
+
"data-sidebar": "group-content",
|
|
1515
|
+
className: cn("w-full text-sm", className),
|
|
1401
1516
|
...props
|
|
1402
1517
|
}
|
|
1403
1518
|
);
|
|
1404
1519
|
}
|
|
1405
|
-
function
|
|
1520
|
+
function SidebarMenu({ className, ...props }) {
|
|
1521
|
+
return /* @__PURE__ */ jsx(
|
|
1522
|
+
"ul",
|
|
1523
|
+
{
|
|
1524
|
+
"data-slot": "sidebar-menu",
|
|
1525
|
+
"data-sidebar": "menu",
|
|
1526
|
+
className: cn("flex w-full min-w-0 flex-col gap-2", className),
|
|
1527
|
+
...props
|
|
1528
|
+
}
|
|
1529
|
+
);
|
|
1530
|
+
}
|
|
1531
|
+
function SidebarMenuItem({ className, ...props }) {
|
|
1532
|
+
return /* @__PURE__ */ jsx(
|
|
1533
|
+
"li",
|
|
1534
|
+
{
|
|
1535
|
+
"data-slot": "sidebar-menu-item",
|
|
1536
|
+
"data-sidebar": "menu-item",
|
|
1537
|
+
className: cn("group/menu-item relative", className),
|
|
1538
|
+
...props
|
|
1539
|
+
}
|
|
1540
|
+
);
|
|
1541
|
+
}
|
|
1542
|
+
var sidebarMenuButtonVariants = cva(
|
|
1543
|
+
"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",
|
|
1544
|
+
{
|
|
1545
|
+
variants: {
|
|
1546
|
+
variant: {
|
|
1547
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
1548
|
+
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))]"
|
|
1549
|
+
},
|
|
1550
|
+
size: {
|
|
1551
|
+
default: "h-8 text-sm",
|
|
1552
|
+
sm: "h-7 text-xs",
|
|
1553
|
+
md: "h-10 text-base group-data-[collapsible=icon]:p-0!",
|
|
1554
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
1555
|
+
}
|
|
1556
|
+
},
|
|
1557
|
+
defaultVariants: {
|
|
1558
|
+
variant: "default",
|
|
1559
|
+
size: "default"
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
);
|
|
1563
|
+
function SidebarMenuButton({
|
|
1564
|
+
asChild = false,
|
|
1565
|
+
isActive = false,
|
|
1566
|
+
variant = "default",
|
|
1567
|
+
size = "default",
|
|
1568
|
+
tooltip,
|
|
1406
1569
|
className,
|
|
1407
1570
|
...props
|
|
1408
1571
|
}) {
|
|
1409
|
-
|
|
1410
|
-
|
|
1572
|
+
const Comp = asChild ? Slot : "button";
|
|
1573
|
+
const { isMobile, state } = useSidebar();
|
|
1574
|
+
const button = /* @__PURE__ */ jsx(
|
|
1575
|
+
Comp,
|
|
1411
1576
|
{
|
|
1412
|
-
"data-slot": "
|
|
1577
|
+
"data-slot": "sidebar-menu-button",
|
|
1578
|
+
"data-sidebar": "menu-button",
|
|
1579
|
+
"data-size": size,
|
|
1580
|
+
"data-active": isActive,
|
|
1413
1581
|
className: cn(
|
|
1414
|
-
|
|
1415
|
-
className
|
|
1582
|
+
sidebarMenuButtonVariants({ variant, size }),
|
|
1583
|
+
className,
|
|
1584
|
+
"[&>svg]:size-5"
|
|
1416
1585
|
),
|
|
1417
1586
|
...props
|
|
1418
1587
|
}
|
|
1419
1588
|
);
|
|
1589
|
+
if (!tooltip) {
|
|
1590
|
+
return button;
|
|
1591
|
+
}
|
|
1592
|
+
if (typeof tooltip === "string") {
|
|
1593
|
+
tooltip = {
|
|
1594
|
+
children: tooltip
|
|
1595
|
+
};
|
|
1596
|
+
}
|
|
1597
|
+
return /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
1598
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: button }),
|
|
1599
|
+
/* @__PURE__ */ jsx(
|
|
1600
|
+
TooltipContent,
|
|
1601
|
+
{
|
|
1602
|
+
side: "right",
|
|
1603
|
+
align: "center",
|
|
1604
|
+
hidden: state !== "collapsed" || isMobile,
|
|
1605
|
+
...tooltip
|
|
1606
|
+
}
|
|
1607
|
+
)
|
|
1608
|
+
] });
|
|
1420
1609
|
}
|
|
1421
|
-
function
|
|
1422
|
-
...props
|
|
1423
|
-
}) {
|
|
1424
|
-
return /* @__PURE__ */ jsx(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
1425
|
-
}
|
|
1426
|
-
function DropdownMenuSubTrigger({
|
|
1610
|
+
function SidebarMenuAction({
|
|
1427
1611
|
className,
|
|
1428
|
-
|
|
1429
|
-
|
|
1612
|
+
asChild = false,
|
|
1613
|
+
showOnHover = false,
|
|
1430
1614
|
...props
|
|
1431
1615
|
}) {
|
|
1432
|
-
|
|
1433
|
-
|
|
1616
|
+
const Comp = asChild ? Slot : "button";
|
|
1617
|
+
return /* @__PURE__ */ jsx(
|
|
1618
|
+
Comp,
|
|
1434
1619
|
{
|
|
1435
|
-
"data-slot": "
|
|
1436
|
-
"data-
|
|
1620
|
+
"data-slot": "sidebar-menu-action",
|
|
1621
|
+
"data-sidebar": "menu-action",
|
|
1437
1622
|
className: cn(
|
|
1438
|
-
"
|
|
1623
|
+
"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",
|
|
1624
|
+
// Increases the hit area of the button on mobile.
|
|
1625
|
+
"after:absolute after:-inset-2 md:after:hidden",
|
|
1626
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
1627
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
1628
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
1629
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1630
|
+
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",
|
|
1439
1631
|
className
|
|
1440
1632
|
),
|
|
1441
|
-
...props
|
|
1442
|
-
children: [
|
|
1443
|
-
children,
|
|
1444
|
-
/* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto size-4" })
|
|
1445
|
-
]
|
|
1633
|
+
...props
|
|
1446
1634
|
}
|
|
1447
1635
|
);
|
|
1448
1636
|
}
|
|
1449
|
-
function
|
|
1637
|
+
function SidebarMenuBadge({
|
|
1450
1638
|
className,
|
|
1451
1639
|
...props
|
|
1452
1640
|
}) {
|
|
1453
1641
|
return /* @__PURE__ */ jsx(
|
|
1454
|
-
|
|
1642
|
+
"div",
|
|
1455
1643
|
{
|
|
1456
|
-
"data-slot": "
|
|
1644
|
+
"data-slot": "sidebar-menu-badge",
|
|
1645
|
+
"data-sidebar": "menu-badge",
|
|
1457
1646
|
className: cn(
|
|
1458
|
-
"
|
|
1647
|
+
"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",
|
|
1648
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
1649
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
1650
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
1651
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
1652
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1459
1653
|
className
|
|
1460
1654
|
),
|
|
1461
1655
|
...props
|
|
1462
1656
|
}
|
|
1463
1657
|
);
|
|
1464
1658
|
}
|
|
1465
|
-
function
|
|
1659
|
+
function SidebarMenuSkeleton({
|
|
1466
1660
|
className,
|
|
1661
|
+
showIcon = false,
|
|
1467
1662
|
...props
|
|
1468
1663
|
}) {
|
|
1664
|
+
const [width, setWidth] = React15.useState("0%");
|
|
1665
|
+
React15.useEffect(() => {
|
|
1666
|
+
setWidth(`${Math.floor(Math.random() * 40) + 50}%`);
|
|
1667
|
+
}, []);
|
|
1668
|
+
return /* @__PURE__ */ jsxs(
|
|
1669
|
+
"div",
|
|
1670
|
+
{
|
|
1671
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
1672
|
+
"data-sidebar": "menu-skeleton",
|
|
1673
|
+
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
1674
|
+
...props,
|
|
1675
|
+
children: [
|
|
1676
|
+
showIcon && /* @__PURE__ */ jsx(
|
|
1677
|
+
Skeleton,
|
|
1678
|
+
{
|
|
1679
|
+
className: "size-4 rounded-md",
|
|
1680
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
1681
|
+
}
|
|
1682
|
+
),
|
|
1683
|
+
/* @__PURE__ */ jsx(
|
|
1684
|
+
Skeleton,
|
|
1685
|
+
{
|
|
1686
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
1687
|
+
"data-sidebar": "menu-skeleton-text",
|
|
1688
|
+
style: {
|
|
1689
|
+
"--skeleton-width": width
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
)
|
|
1693
|
+
]
|
|
1694
|
+
}
|
|
1695
|
+
);
|
|
1696
|
+
}
|
|
1697
|
+
function SidebarMenuSub({ className, ...props }) {
|
|
1469
1698
|
return /* @__PURE__ */ jsx(
|
|
1470
|
-
|
|
1699
|
+
"ul",
|
|
1471
1700
|
{
|
|
1472
|
-
"data-slot": "
|
|
1701
|
+
"data-slot": "sidebar-menu-sub",
|
|
1702
|
+
"data-sidebar": "menu-sub",
|
|
1473
1703
|
className: cn(
|
|
1474
|
-
"
|
|
1704
|
+
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-2 border-l px-2.5 py-2",
|
|
1705
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1475
1706
|
className
|
|
1476
1707
|
),
|
|
1477
1708
|
...props
|
|
1478
1709
|
}
|
|
1479
1710
|
);
|
|
1480
1711
|
}
|
|
1481
|
-
function
|
|
1712
|
+
function SidebarMenuSubItem({
|
|
1482
1713
|
className,
|
|
1483
1714
|
...props
|
|
1484
1715
|
}) {
|
|
1485
1716
|
return /* @__PURE__ */ jsx(
|
|
1486
|
-
|
|
1717
|
+
"li",
|
|
1487
1718
|
{
|
|
1488
|
-
"data-slot": "
|
|
1489
|
-
|
|
1719
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
1720
|
+
"data-sidebar": "menu-sub-item",
|
|
1721
|
+
className: cn("group/menu-sub-item relative", className),
|
|
1490
1722
|
...props
|
|
1491
1723
|
}
|
|
1492
1724
|
);
|
|
1493
1725
|
}
|
|
1494
|
-
function
|
|
1726
|
+
function SidebarMenuSubButton({
|
|
1727
|
+
asChild = false,
|
|
1728
|
+
size = "md",
|
|
1729
|
+
isActive = false,
|
|
1495
1730
|
className,
|
|
1496
1731
|
...props
|
|
1497
1732
|
}) {
|
|
1733
|
+
const Comp = asChild ? Slot : "a";
|
|
1498
1734
|
return /* @__PURE__ */ jsx(
|
|
1499
|
-
|
|
1735
|
+
Comp,
|
|
1500
1736
|
{
|
|
1501
|
-
"data-slot": "
|
|
1737
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
1738
|
+
"data-sidebar": "menu-sub-button",
|
|
1739
|
+
"data-size": size,
|
|
1740
|
+
"data-active": isActive,
|
|
1502
1741
|
className: cn(
|
|
1503
|
-
"bg-
|
|
1742
|
+
"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",
|
|
1743
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
1744
|
+
size === "sm" && "text-xs",
|
|
1745
|
+
size === "md" && "text-sm",
|
|
1746
|
+
size === "lg" && "text-bas h-10",
|
|
1747
|
+
"group-data-[collapsible=icon]:hidden",
|
|
1748
|
+
isActive && "font-medium",
|
|
1504
1749
|
className
|
|
1505
1750
|
),
|
|
1506
1751
|
...props
|
|
1507
1752
|
}
|
|
1508
1753
|
);
|
|
1509
1754
|
}
|
|
1755
|
+
function Spinner({ className, ...props }) {
|
|
1756
|
+
return /* @__PURE__ */ jsx(
|
|
1757
|
+
Loader2Icon,
|
|
1758
|
+
{
|
|
1759
|
+
role: "status",
|
|
1760
|
+
"aria-label": "Loading",
|
|
1761
|
+
className: cn("size-4 animate-spin", className),
|
|
1762
|
+
...props
|
|
1763
|
+
}
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1510
1766
|
|
|
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 };
|
|
1767
|
+
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, Label2 as Label, NAVBAR_HEIGHT, PAGE_HEADER_HEIGHT, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, SIDEBAR_COOKIE_NAME, SIDEBAR_WIDTH, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as 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, buttonVariants, cn, isConfirm, useCountdown, useDeviceInfo, useParentPathname, useSidebar };
|