adminium 1.0.1-patch.1 → 1.0.1-patch.3
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/index.cjs +553 -77
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -26
- package/dist/index.d.ts +56 -26
- package/dist/index.js +531 -72
- package/dist/index.js.map +1 -1
- package/dist/styles/adminium.css +533 -13
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { AlertDialog as AlertDialog$1, Dialog as Dialog$1, Popover as Popover$1, Select as Select$1, Label, ScrollArea as ScrollArea$1 } from 'radix-ui';
|
|
5
4
|
import { cva } from 'class-variance-authority';
|
|
6
5
|
import { ChevronDown, X, Check, Minus, ChevronRight, Circle, ChevronUp, ChevronLeftIcon, ChevronRightIcon, ArrowDown, ArrowUp, ChevronsUpDown, ArrowLeftToLine, ArrowRightToLine, ArrowLeft, ArrowRight, Settings2, PinOff } from 'lucide-react';
|
|
7
6
|
import * as SlotPrimitive2 from '@radix-ui/react-slot';
|
|
8
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
9
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
+
import { AlertDialog as AlertDialog$1, Dialog as Dialog$1, Popover as Popover$1, Avatar as Avatar$1, Select as Select$1, Label, ScrollArea as ScrollArea$1 } from 'radix-ui';
|
|
10
9
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
11
10
|
import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
12
11
|
import * as React from 'react';
|
|
13
|
-
import { createContext, useContext, Fragment as Fragment$1, isValidElement, useRef, useCallback, useEffect } from 'react';
|
|
12
|
+
import { createContext, useContext, Fragment as Fragment$1, isValidElement, useMemo, useRef, useCallback, useEffect } from 'react';
|
|
14
13
|
import { useMotionValue, useSpring, useTransform, AnimatePresence, motion } from 'motion/react';
|
|
15
14
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
16
15
|
import { flexRender } from '@tanstack/react-table';
|
|
17
16
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
18
|
-
import
|
|
17
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
19
18
|
|
|
20
19
|
// src/lib/utils.ts
|
|
21
20
|
function cn(...inputs) {
|
|
@@ -408,6 +407,272 @@ function ButtonArrow({
|
|
|
408
407
|
}
|
|
409
408
|
);
|
|
410
409
|
}
|
|
410
|
+
var alertVariants = cva(
|
|
411
|
+
"flex items-stretch w-full gap-2 group-[.toaster]:w-(--width)",
|
|
412
|
+
{
|
|
413
|
+
variants: {
|
|
414
|
+
variant: {
|
|
415
|
+
secondary: "",
|
|
416
|
+
primary: "",
|
|
417
|
+
destructive: "",
|
|
418
|
+
success: "",
|
|
419
|
+
info: "",
|
|
420
|
+
mono: "",
|
|
421
|
+
warning: ""
|
|
422
|
+
},
|
|
423
|
+
icon: {
|
|
424
|
+
primary: "",
|
|
425
|
+
destructive: "",
|
|
426
|
+
success: "",
|
|
427
|
+
info: "",
|
|
428
|
+
warning: ""
|
|
429
|
+
},
|
|
430
|
+
appearance: {
|
|
431
|
+
solid: "",
|
|
432
|
+
outline: "",
|
|
433
|
+
light: "",
|
|
434
|
+
stroke: "text-foreground"
|
|
435
|
+
},
|
|
436
|
+
size: {
|
|
437
|
+
lg: "rounded-lg p-4 gap-3 text-base [&>[data-slot=alert-icon]>svg]:size-6 *:data-slot=alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-1",
|
|
438
|
+
md: "rounded-lg p-3.5 gap-2.5 text-sm [&>[data-slot=alert-icon]>svg]:size-5 *:data-slot=alert-icon:mt-0 [&_[data-slot=alert-close]]:mt-0.5",
|
|
439
|
+
sm: "rounded-md px-3 py-2.5 gap-2 text-xs [&>[data-slot=alert-icon]>svg]:size-4 *:data-alert-icon:mt-0.5 [&_[data-slot=alert-close]]:mt-0.25 [&_[data-slot=alert-close]_svg]:size-3.5"
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
compoundVariants: [
|
|
443
|
+
/* Solid */
|
|
444
|
+
{
|
|
445
|
+
variant: "secondary",
|
|
446
|
+
appearance: "solid",
|
|
447
|
+
className: "bg-muted text-foreground"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
variant: "primary",
|
|
451
|
+
appearance: "solid",
|
|
452
|
+
className: "bg-primary text-primary-foreground"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
variant: "destructive",
|
|
456
|
+
appearance: "solid",
|
|
457
|
+
className: "bg-destructive text-destructive-foreground"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
variant: "success",
|
|
461
|
+
appearance: "solid",
|
|
462
|
+
className: "bg-[var(--color-success,var(--color-green-500))] text-[var(--color-success-foreground,var(--color-white))]"
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
variant: "info",
|
|
466
|
+
appearance: "solid",
|
|
467
|
+
className: "bg-[var(--color-info,var(--color-violet-600))] text-[var(--color-info-foreground,var(--color-white))]"
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
variant: "warning",
|
|
471
|
+
appearance: "solid",
|
|
472
|
+
className: "bg-[var(--color-warning,var(--color-yellow-500))] text-[var(--color-warning-foreground,var(--color-white))]"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
variant: "mono",
|
|
476
|
+
appearance: "solid",
|
|
477
|
+
className: "bg-zinc-950 text-white dark:bg-zinc-300 dark:text-black *:data-slot-[alert=close]:text-white"
|
|
478
|
+
},
|
|
479
|
+
/* Outline */
|
|
480
|
+
{
|
|
481
|
+
variant: "secondary",
|
|
482
|
+
appearance: "outline",
|
|
483
|
+
className: "border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
variant: "primary",
|
|
487
|
+
appearance: "outline",
|
|
488
|
+
className: "border border-border bg-background text-primary [&_[data-slot=alert-close]]:text-foreground"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
variant: "destructive",
|
|
492
|
+
appearance: "outline",
|
|
493
|
+
className: "border border-border bg-background text-destructive [&_[data-slot=alert-close]]:text-foreground"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
variant: "success",
|
|
497
|
+
appearance: "outline",
|
|
498
|
+
className: "border border-border bg-background text-[var(--color-success,var(--color-green-500))] [&_[data-slot=alert-close]]:text-foreground"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
variant: "info",
|
|
502
|
+
appearance: "outline",
|
|
503
|
+
className: "border border-border bg-background text-[var(--color-info,var(--color-violet-600))] [&_[data-slot=alert-close]]:text-foreground"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
variant: "warning",
|
|
507
|
+
appearance: "outline",
|
|
508
|
+
className: "border border-border bg-background text-[var(--color-warning,var(--color-yellow-500))] [&_[data-slot=alert-close]]:text-foreground"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
variant: "mono",
|
|
512
|
+
appearance: "outline",
|
|
513
|
+
className: "border border-border bg-background text-foreground [&_[data-slot=alert-close]]:text-foreground"
|
|
514
|
+
},
|
|
515
|
+
/* Light */
|
|
516
|
+
{
|
|
517
|
+
variant: "secondary",
|
|
518
|
+
appearance: "light",
|
|
519
|
+
className: "bg-muted border border-border text-foreground"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
variant: "primary",
|
|
523
|
+
appearance: "light",
|
|
524
|
+
className: "text-foreground bg-[var(--color-primary-soft,var(--color-blue-50))] border border-[var(--color-primary-alpha,var(--color-blue-100))] [&_[data-slot=alert-icon]]:text-primary dark:bg-[var(--color-primary-soft,var(--color-blue-950))] dark:border-[var(--color-primary-alpha,var(--color-blue-900))]"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
variant: "destructive",
|
|
528
|
+
appearance: "light",
|
|
529
|
+
className: "bg-[var(--color-destructive-soft,var(--color-red-50))] border border-[var(--color-destructive-alpha,var(--color-red-100))] text-foreground [&_[data-slot=alert-icon]]:text-destructive dark:bg-[var(--color-destructive-soft,var(--color-red-950))] dark:border-[var(--color-destructive-alpha,var(--color-red-900))] "
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
variant: "success",
|
|
533
|
+
appearance: "light",
|
|
534
|
+
className: "bg-[var(--color-success-soft,var(--color-green-50))] border border-[var(--color-success-alpha,var(--color-green-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))] dark:bg-[var(--color-success-soft,var(--color-green-950))] dark:border-[var(--color-success-alpha,var(--color-green-900))]"
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
variant: "info",
|
|
538
|
+
appearance: "light",
|
|
539
|
+
className: "bg-[var(--color-info-soft,var(--color-violet-50))] border border-[var(--color-info-alpha,var(--color-violet-100))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))] dark:bg-[var(--color-info-soft,var(--color-violet-950))] dark:border-[var(--color-info-alpha,var(--color-violet-900))]"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
variant: "warning",
|
|
543
|
+
appearance: "light",
|
|
544
|
+
className: "bg-[var(--color-warning-soft,var(--color-yellow-50))] border border-[var(--color-warning-alpha,var(--color-yellow-200))] text-foreground [&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))] dark:bg-[var(--color-warning-soft,var(--color-yellow-950))] dark:border-[var(--color-warning-alpha,var(--color-yellow-900))]"
|
|
545
|
+
},
|
|
546
|
+
/* Mono */
|
|
547
|
+
{
|
|
548
|
+
variant: "mono",
|
|
549
|
+
icon: "primary",
|
|
550
|
+
className: "[&_[data-slot=alert-icon]]:text-primary"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
variant: "mono",
|
|
554
|
+
icon: "warning",
|
|
555
|
+
className: "[&_[data-slot=alert-icon]]:text-[var(--color-warning-foreground,var(--color-yellow-600))]"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
variant: "mono",
|
|
559
|
+
icon: "success",
|
|
560
|
+
className: "[&_[data-slot=alert-icon]]:text-[var(--color-success-foreground,var(--color-green-600))]"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
variant: "mono",
|
|
564
|
+
icon: "destructive",
|
|
565
|
+
className: "[&_[data-slot=alert-icon]]:text-destructive"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
variant: "mono",
|
|
569
|
+
icon: "info",
|
|
570
|
+
className: "[&_[data-slot=alert-icon]]:text-[var(--color-info-foreground,var(--color-violet-600))]"
|
|
571
|
+
}
|
|
572
|
+
],
|
|
573
|
+
defaultVariants: {
|
|
574
|
+
variant: "secondary",
|
|
575
|
+
appearance: "solid",
|
|
576
|
+
size: "md"
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
);
|
|
580
|
+
function Alert({
|
|
581
|
+
className,
|
|
582
|
+
variant,
|
|
583
|
+
size,
|
|
584
|
+
icon,
|
|
585
|
+
appearance,
|
|
586
|
+
close = false,
|
|
587
|
+
onClose,
|
|
588
|
+
children,
|
|
589
|
+
...props
|
|
590
|
+
}) {
|
|
591
|
+
return /* @__PURE__ */ jsxs(
|
|
592
|
+
"div",
|
|
593
|
+
{
|
|
594
|
+
"data-slot": "alert",
|
|
595
|
+
role: "alert",
|
|
596
|
+
className: cn(
|
|
597
|
+
alertVariants({ variant, size, icon, appearance }),
|
|
598
|
+
className
|
|
599
|
+
),
|
|
600
|
+
...props,
|
|
601
|
+
children: [
|
|
602
|
+
children,
|
|
603
|
+
close && /* @__PURE__ */ jsx(
|
|
604
|
+
Button,
|
|
605
|
+
{
|
|
606
|
+
size: "sm",
|
|
607
|
+
variant: "inverse",
|
|
608
|
+
mode: "icon",
|
|
609
|
+
onClick: onClose,
|
|
610
|
+
"aria-label": "Dismiss",
|
|
611
|
+
"data-slot": "alert-close",
|
|
612
|
+
className: cn("group shrink-0 size-4"),
|
|
613
|
+
children: /* @__PURE__ */ jsx(X, { className: "opacity-60 group-hover:opacity-100 size-4" })
|
|
614
|
+
}
|
|
615
|
+
)
|
|
616
|
+
]
|
|
617
|
+
}
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
function AlertTitle({
|
|
621
|
+
className,
|
|
622
|
+
...props
|
|
623
|
+
}) {
|
|
624
|
+
return /* @__PURE__ */ jsx(
|
|
625
|
+
"div",
|
|
626
|
+
{
|
|
627
|
+
"data-slot": "alert-title",
|
|
628
|
+
className: cn("grow tracking-tight", className),
|
|
629
|
+
...props
|
|
630
|
+
}
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
function AlertIcon({ children, className, ...props }) {
|
|
634
|
+
return /* @__PURE__ */ jsx(
|
|
635
|
+
"div",
|
|
636
|
+
{
|
|
637
|
+
"data-slot": "alert-icon",
|
|
638
|
+
className: cn("shrink-0", className),
|
|
639
|
+
...props,
|
|
640
|
+
children
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
function AlertToolbar({ children, className, ...props }) {
|
|
645
|
+
return /* @__PURE__ */ jsx("div", { "data-slot": "alert-toolbar", className: cn(className), ...props, children });
|
|
646
|
+
}
|
|
647
|
+
function AlertDescription({
|
|
648
|
+
className,
|
|
649
|
+
...props
|
|
650
|
+
}) {
|
|
651
|
+
return /* @__PURE__ */ jsx(
|
|
652
|
+
"div",
|
|
653
|
+
{
|
|
654
|
+
"data-slot": "alert-description",
|
|
655
|
+
className: cn("text-sm [&_p]:leading-relaxed [&_p]:mb-2", className),
|
|
656
|
+
...props
|
|
657
|
+
}
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
function AlertContent({
|
|
661
|
+
className,
|
|
662
|
+
...props
|
|
663
|
+
}) {
|
|
664
|
+
return /* @__PURE__ */ jsx(
|
|
665
|
+
"div",
|
|
666
|
+
{
|
|
667
|
+
"data-slot": "alert-content",
|
|
668
|
+
className: cn(
|
|
669
|
+
"space-y-2 [&_[data-slot=alert-title]]:font-semibold",
|
|
670
|
+
className
|
|
671
|
+
),
|
|
672
|
+
...props
|
|
673
|
+
}
|
|
674
|
+
);
|
|
675
|
+
}
|
|
411
676
|
function AlertDialog({
|
|
412
677
|
...props
|
|
413
678
|
}) {
|
|
@@ -907,6 +1172,94 @@ function SheetDescription({ className, ...props }) {
|
|
|
907
1172
|
}
|
|
908
1173
|
);
|
|
909
1174
|
}
|
|
1175
|
+
var avatarStatusVariants = cva(
|
|
1176
|
+
"flex items-center rounded-full size-2 border-2 border-background",
|
|
1177
|
+
{
|
|
1178
|
+
variants: {
|
|
1179
|
+
variant: {
|
|
1180
|
+
online: "bg-green-600",
|
|
1181
|
+
offline: "bg-zinc-600 dark:bg-zinc-300",
|
|
1182
|
+
busy: "bg-yellow-600",
|
|
1183
|
+
away: "bg-blue-600"
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
defaultVariants: {
|
|
1187
|
+
variant: "online"
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
);
|
|
1191
|
+
function Avatar({
|
|
1192
|
+
className,
|
|
1193
|
+
...props
|
|
1194
|
+
}) {
|
|
1195
|
+
return /* @__PURE__ */ jsx(
|
|
1196
|
+
Avatar$1.Root,
|
|
1197
|
+
{
|
|
1198
|
+
"data-slot": "avatar",
|
|
1199
|
+
className: cn("relative flex shrink-0 size-10", className),
|
|
1200
|
+
...props
|
|
1201
|
+
}
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
function AvatarImage({
|
|
1205
|
+
className,
|
|
1206
|
+
...props
|
|
1207
|
+
}) {
|
|
1208
|
+
return /* @__PURE__ */ jsx("div", { className: cn("relative overflow-hidden rounded-full", className), children: /* @__PURE__ */ jsx(
|
|
1209
|
+
Avatar$1.Image,
|
|
1210
|
+
{
|
|
1211
|
+
"data-slot": "avatar-image",
|
|
1212
|
+
className: cn("aspect-square h-full w-full"),
|
|
1213
|
+
...props
|
|
1214
|
+
}
|
|
1215
|
+
) });
|
|
1216
|
+
}
|
|
1217
|
+
function AvatarFallback({
|
|
1218
|
+
className,
|
|
1219
|
+
...props
|
|
1220
|
+
}) {
|
|
1221
|
+
return /* @__PURE__ */ jsx(
|
|
1222
|
+
Avatar$1.Fallback,
|
|
1223
|
+
{
|
|
1224
|
+
"data-slot": "avatar-fallback",
|
|
1225
|
+
className: cn(
|
|
1226
|
+
"flex h-full w-full items-center justify-center rounded-full border border-border bg-accent text-accent-foreground text-xs",
|
|
1227
|
+
className
|
|
1228
|
+
),
|
|
1229
|
+
...props
|
|
1230
|
+
}
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
function AvatarIndicator({
|
|
1234
|
+
className,
|
|
1235
|
+
...props
|
|
1236
|
+
}) {
|
|
1237
|
+
return /* @__PURE__ */ jsx(
|
|
1238
|
+
"div",
|
|
1239
|
+
{
|
|
1240
|
+
"data-slot": "avatar-indicator",
|
|
1241
|
+
className: cn(
|
|
1242
|
+
"absolute flex size-6 items-center justify-center",
|
|
1243
|
+
className
|
|
1244
|
+
),
|
|
1245
|
+
...props
|
|
1246
|
+
}
|
|
1247
|
+
);
|
|
1248
|
+
}
|
|
1249
|
+
function AvatarStatus({
|
|
1250
|
+
className,
|
|
1251
|
+
variant,
|
|
1252
|
+
...props
|
|
1253
|
+
}) {
|
|
1254
|
+
return /* @__PURE__ */ jsx(
|
|
1255
|
+
"div",
|
|
1256
|
+
{
|
|
1257
|
+
"data-slot": "avatar-status",
|
|
1258
|
+
className: cn(avatarStatusVariants({ variant }), className),
|
|
1259
|
+
...props
|
|
1260
|
+
}
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
910
1263
|
var AvatarGroupContext = React.createContext(
|
|
911
1264
|
null
|
|
912
1265
|
);
|
|
@@ -3367,122 +3720,228 @@ function Label2({
|
|
|
3367
3720
|
}
|
|
3368
3721
|
);
|
|
3369
3722
|
}
|
|
3370
|
-
var
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
throw new Error("useFormField should be used within <FormField>");
|
|
3386
|
-
}
|
|
3387
|
-
const { id } = itemContext;
|
|
3388
|
-
return {
|
|
3389
|
-
id,
|
|
3390
|
-
name: fieldContext.name,
|
|
3391
|
-
formItemId: `${id}-form-item`,
|
|
3392
|
-
formDescriptionId: `${id}-form-item-description`,
|
|
3393
|
-
formMessageId: `${id}-form-item-message`,
|
|
3394
|
-
...fieldState
|
|
3395
|
-
};
|
|
3396
|
-
};
|
|
3397
|
-
var FormItemContext = React.createContext(
|
|
3398
|
-
{}
|
|
3723
|
+
var Separator2 = React.forwardRef(
|
|
3724
|
+
({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3725
|
+
SeparatorPrimitive.Root,
|
|
3726
|
+
{
|
|
3727
|
+
ref,
|
|
3728
|
+
decorative,
|
|
3729
|
+
orientation,
|
|
3730
|
+
className: cn(
|
|
3731
|
+
"shrink-0 bg-border",
|
|
3732
|
+
orientation === "horizontal" ? "h-px w-full" : "h-full w-px",
|
|
3733
|
+
className
|
|
3734
|
+
),
|
|
3735
|
+
...props
|
|
3736
|
+
}
|
|
3737
|
+
)
|
|
3399
3738
|
);
|
|
3400
|
-
|
|
3739
|
+
Separator2.displayName = SeparatorPrimitive.Root.displayName;
|
|
3740
|
+
function FieldSet({ className, ...props }) {
|
|
3741
|
+
return /* @__PURE__ */ jsx(
|
|
3742
|
+
"fieldset",
|
|
3743
|
+
{
|
|
3744
|
+
"data-slot": "field-set",
|
|
3745
|
+
className: cn(
|
|
3746
|
+
"flex flex-col gap-6",
|
|
3747
|
+
"has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
|
|
3748
|
+
className
|
|
3749
|
+
),
|
|
3750
|
+
...props
|
|
3751
|
+
}
|
|
3752
|
+
);
|
|
3753
|
+
}
|
|
3754
|
+
function FieldLegend({
|
|
3401
3755
|
className,
|
|
3756
|
+
variant = "legend",
|
|
3402
3757
|
...props
|
|
3403
3758
|
}) {
|
|
3404
|
-
|
|
3405
|
-
|
|
3759
|
+
return /* @__PURE__ */ jsx(
|
|
3760
|
+
"legend",
|
|
3761
|
+
{
|
|
3762
|
+
"data-slot": "field-legend",
|
|
3763
|
+
"data-variant": variant,
|
|
3764
|
+
className: cn(
|
|
3765
|
+
"mb-3 font-medium",
|
|
3766
|
+
"data-[variant=legend]:text-base",
|
|
3767
|
+
"data-[variant=label]:text-sm",
|
|
3768
|
+
className
|
|
3769
|
+
),
|
|
3770
|
+
...props
|
|
3771
|
+
}
|
|
3772
|
+
);
|
|
3773
|
+
}
|
|
3774
|
+
function FieldGroup({ className, ...props }) {
|
|
3775
|
+
return /* @__PURE__ */ jsx(
|
|
3776
|
+
"div",
|
|
3777
|
+
{
|
|
3778
|
+
"data-slot": "field-group",
|
|
3779
|
+
className: cn(
|
|
3780
|
+
"group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
|
|
3781
|
+
className
|
|
3782
|
+
),
|
|
3783
|
+
...props
|
|
3784
|
+
}
|
|
3785
|
+
);
|
|
3406
3786
|
}
|
|
3407
|
-
|
|
3787
|
+
var fieldVariants = cva(
|
|
3788
|
+
"group/field data-[invalid=true]:text-destructive flex w-full gap-3",
|
|
3789
|
+
{
|
|
3790
|
+
variants: {
|
|
3791
|
+
orientation: {
|
|
3792
|
+
vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
|
|
3793
|
+
horizontal: [
|
|
3794
|
+
"flex-row items-center",
|
|
3795
|
+
"[&>[data-slot=field-label]]:flex-auto",
|
|
3796
|
+
"has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start"
|
|
3797
|
+
],
|
|
3798
|
+
responsive: [
|
|
3799
|
+
"@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
|
|
3800
|
+
"@md/field-group:[&>[data-slot=field-label]]:flex-auto",
|
|
3801
|
+
"@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"
|
|
3802
|
+
]
|
|
3803
|
+
}
|
|
3804
|
+
},
|
|
3805
|
+
defaultVariants: {
|
|
3806
|
+
orientation: "vertical"
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3809
|
+
);
|
|
3810
|
+
function Field({
|
|
3408
3811
|
className,
|
|
3812
|
+
orientation = "vertical",
|
|
3409
3813
|
...props
|
|
3410
3814
|
}) {
|
|
3411
|
-
const { error } = useFormField();
|
|
3412
3815
|
return /* @__PURE__ */ jsx(
|
|
3413
3816
|
"div",
|
|
3414
3817
|
{
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
"data-
|
|
3818
|
+
role: "group",
|
|
3819
|
+
"data-slot": "field",
|
|
3820
|
+
"data-orientation": orientation,
|
|
3821
|
+
className: cn(fieldVariants({ orientation }), className),
|
|
3822
|
+
...props
|
|
3823
|
+
}
|
|
3824
|
+
);
|
|
3825
|
+
}
|
|
3826
|
+
function FieldContent({ className, ...props }) {
|
|
3827
|
+
return /* @__PURE__ */ jsx(
|
|
3828
|
+
"div",
|
|
3829
|
+
{
|
|
3830
|
+
"data-slot": "field-content",
|
|
3831
|
+
className: cn(
|
|
3832
|
+
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
3833
|
+
className
|
|
3834
|
+
),
|
|
3418
3835
|
...props
|
|
3419
3836
|
}
|
|
3420
3837
|
);
|
|
3421
3838
|
}
|
|
3422
|
-
function
|
|
3839
|
+
function FieldLabel({
|
|
3423
3840
|
className,
|
|
3424
3841
|
...props
|
|
3425
3842
|
}) {
|
|
3426
|
-
const { formItemId } = useFormField();
|
|
3427
3843
|
return /* @__PURE__ */ jsx(
|
|
3428
3844
|
Label2,
|
|
3429
3845
|
{
|
|
3430
|
-
"data-slot": "
|
|
3431
|
-
className: cn(
|
|
3432
|
-
|
|
3846
|
+
"data-slot": "field-label",
|
|
3847
|
+
className: cn(
|
|
3848
|
+
"group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
3849
|
+
"has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4",
|
|
3850
|
+
"has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
|
|
3851
|
+
className
|
|
3852
|
+
),
|
|
3433
3853
|
...props
|
|
3434
3854
|
}
|
|
3435
3855
|
);
|
|
3436
3856
|
}
|
|
3437
|
-
function
|
|
3438
|
-
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
3857
|
+
function FieldTitle({ className, ...props }) {
|
|
3439
3858
|
return /* @__PURE__ */ jsx(
|
|
3440
|
-
|
|
3859
|
+
"div",
|
|
3441
3860
|
{
|
|
3442
|
-
"data-slot": "
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3861
|
+
"data-slot": "field-label",
|
|
3862
|
+
className: cn(
|
|
3863
|
+
"flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50",
|
|
3864
|
+
className
|
|
3865
|
+
),
|
|
3866
|
+
...props
|
|
3867
|
+
}
|
|
3868
|
+
);
|
|
3869
|
+
}
|
|
3870
|
+
function FieldDescription({ className, ...props }) {
|
|
3871
|
+
return /* @__PURE__ */ jsx(
|
|
3872
|
+
"p",
|
|
3873
|
+
{
|
|
3874
|
+
"data-slot": "field-description",
|
|
3875
|
+
className: cn(
|
|
3876
|
+
"text-muted-foreground text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
|
|
3877
|
+
"nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5",
|
|
3878
|
+
"[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
|
|
3879
|
+
className
|
|
3880
|
+
),
|
|
3446
3881
|
...props
|
|
3447
3882
|
}
|
|
3448
3883
|
);
|
|
3449
3884
|
}
|
|
3450
|
-
function
|
|
3885
|
+
function FieldSeparator({
|
|
3886
|
+
children,
|
|
3451
3887
|
className,
|
|
3452
3888
|
...props
|
|
3453
3889
|
}) {
|
|
3454
|
-
|
|
3455
|
-
if (error) {
|
|
3456
|
-
return null;
|
|
3457
|
-
}
|
|
3458
|
-
return /* @__PURE__ */ jsx(
|
|
3890
|
+
return /* @__PURE__ */ jsxs(
|
|
3459
3891
|
"div",
|
|
3460
3892
|
{
|
|
3461
|
-
"data-slot": "
|
|
3462
|
-
|
|
3463
|
-
className: cn(
|
|
3464
|
-
|
|
3893
|
+
"data-slot": "field-separator",
|
|
3894
|
+
"data-content": !!children,
|
|
3895
|
+
className: cn(
|
|
3896
|
+
"relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
|
|
3897
|
+
className
|
|
3898
|
+
),
|
|
3899
|
+
...props,
|
|
3900
|
+
children: [
|
|
3901
|
+
/* @__PURE__ */ jsx(Separator2, { className: "absolute inset-0 top-1/2" }),
|
|
3902
|
+
children && /* @__PURE__ */ jsx(
|
|
3903
|
+
"span",
|
|
3904
|
+
{
|
|
3905
|
+
className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2",
|
|
3906
|
+
"data-slot": "field-separator-content",
|
|
3907
|
+
children
|
|
3908
|
+
}
|
|
3909
|
+
)
|
|
3910
|
+
]
|
|
3465
3911
|
}
|
|
3466
3912
|
);
|
|
3467
3913
|
}
|
|
3468
|
-
function
|
|
3914
|
+
function FieldError({
|
|
3469
3915
|
className,
|
|
3470
3916
|
children,
|
|
3917
|
+
errors,
|
|
3471
3918
|
...props
|
|
3472
3919
|
}) {
|
|
3473
|
-
const
|
|
3474
|
-
|
|
3475
|
-
|
|
3920
|
+
const content = useMemo(() => {
|
|
3921
|
+
if (children) {
|
|
3922
|
+
return children;
|
|
3923
|
+
}
|
|
3924
|
+
if (!errors) {
|
|
3925
|
+
return null;
|
|
3926
|
+
}
|
|
3927
|
+
if (errors?.length === 1 && errors[0]?.message) {
|
|
3928
|
+
return errors[0].message;
|
|
3929
|
+
}
|
|
3930
|
+
return /* @__PURE__ */ jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: errors.map(
|
|
3931
|
+
(error, index) => error?.message && /* @__PURE__ */ jsx("li", { children: error.message }, index)
|
|
3932
|
+
) });
|
|
3933
|
+
}, [children, errors]);
|
|
3934
|
+
if (!content) {
|
|
3476
3935
|
return null;
|
|
3477
3936
|
}
|
|
3478
3937
|
return /* @__PURE__ */ jsx(
|
|
3479
3938
|
"div",
|
|
3480
3939
|
{
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
className: cn("-
|
|
3940
|
+
role: "alert",
|
|
3941
|
+
"data-slot": "field-error",
|
|
3942
|
+
className: cn("text-destructive text-sm font-normal", className),
|
|
3484
3943
|
...props,
|
|
3485
|
-
children:
|
|
3944
|
+
children: content
|
|
3486
3945
|
}
|
|
3487
3946
|
);
|
|
3488
3947
|
}
|
|
@@ -3722,6 +4181,6 @@ function useMounted() {
|
|
|
3722
4181
|
return mounted;
|
|
3723
4182
|
}
|
|
3724
4183
|
|
|
3725
|
-
export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AvatarGroup, AvatarGroupItem, AvatarGroupTooltip, Badge, BadgeButton, BadgeDot, Button, ButtonArrow, Card, CardContent, CardDescription, CardFooter, CardHeader, CardHeading, CardTable, CardTitle, CardToolbar, Checkbox, DataGrid, DataGridColumnHeader, DataGridColumnVisibility, DataGridContainer, DataGridPagination, DataGridProvider, DataGridTable, DataGridTableBase, DataGridTableBody, DataGridTableBodyRow, DataGridTableBodyRowCell, DataGridTableBodyRowExpanded, DataGridTableBodyRowSkeleton, DataGridTableBodyRowSkeletonCell, DataGridTableEmpty, DataGridTableHead, DataGridTableHeadRow, DataGridTableHeadRowCell, DataGridTableHeadRowCellResize, DataGridTableLoader, DataGridTableRowSelect, DataGridTableRowSelectAll, DataGridTableRowSpacer, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger,
|
|
4184
|
+
export { Alert, AlertContent, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertIcon, AlertTitle, AlertToolbar, Avatar, AvatarFallback, AvatarGroup, AvatarGroupItem, AvatarGroupTooltip, AvatarImage, AvatarIndicator, AvatarStatus, Badge, BadgeButton, BadgeDot, Button, ButtonArrow, Card, CardContent, CardDescription, CardFooter, CardHeader, CardHeading, CardTable, CardTitle, CardToolbar, Checkbox, DataGrid, DataGridColumnHeader, DataGridColumnVisibility, DataGridContainer, DataGridPagination, DataGridProvider, DataGridTable, DataGridTableBase, DataGridTableBody, DataGridTableBodyRow, DataGridTableBodyRowCell, DataGridTableBodyRowExpanded, DataGridTableBodyRowSkeleton, DataGridTableBodyRowSkeletonCell, DataGridTableEmpty, DataGridTableHead, DataGridTableHeadRow, DataGridTableHeadRowCell, DataGridTableHeadRowCellResize, DataGridTableLoader, DataGridTableRowSelect, DataGridTableRowSelectAll, DataGridTableRowSpacer, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, HoverCard, HoverCardContent, HoverCardTrigger, Icons, Input, InputAddon, InputGroup, InputWrapper, Label2 as Label, Popover, PopoverContent, PopoverTrigger, ScrollArea, ScrollBar, Scrollspy, Select, SelectContent, SelectGroup, SelectIndicator, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator2 as Separator, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, avatarStatusVariants, badgeVariants, buttonVariants, cn, inputAddonVariants, inputVariants, labelVariants, selectTriggerVariants, useCopyToClipboard, useDataGrid, useIsMobile, useMounted };
|
|
3726
4185
|
//# sourceMappingURL=index.js.map
|
|
3727
4186
|
//# sourceMappingURL=index.js.map
|