@ai-matrx/design-system 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -31,13 +31,28 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  // src/index.ts
32
32
  var src_exports = {};
33
33
  __export(src_exports, {
34
+ Avatar: () => Avatar,
35
+ AvatarFallback: () => AvatarFallback,
36
+ AvatarImage: () => AvatarImage,
34
37
  Badge: () => Badge,
35
38
  BasicInput: () => BasicInput,
39
+ BasicTextarea: () => BasicTextarea,
36
40
  BottomSheet: () => BottomSheet,
37
41
  BottomSheetBody: () => BottomSheetBody,
38
42
  BottomSheetFooter: () => BottomSheetFooter,
39
43
  BottomSheetHeader: () => BottomSheetHeader,
40
44
  Button: () => Button,
45
+ Card: () => Card,
46
+ CardAction: () => CardAction,
47
+ CardContent: () => CardContent,
48
+ CardDescription: () => CardDescription,
49
+ CardFooter: () => CardFooter,
50
+ CardHeader: () => CardHeader,
51
+ CardTitle: () => CardTitle,
52
+ Checkbox: () => Checkbox,
53
+ Collapsible: () => Collapsible,
54
+ CollapsibleContent: () => CollapsibleContent2,
55
+ CollapsibleTrigger: () => CollapsibleTrigger2,
41
56
  Command: () => Command,
42
57
  CommandDialog: () => CommandDialog,
43
58
  CommandEmpty: () => CommandEmpty,
@@ -47,21 +62,66 @@ __export(src_exports, {
47
62
  CommandList: () => CommandList,
48
63
  CommandSeparator: () => CommandSeparator,
49
64
  CommandShortcut: () => CommandShortcut,
65
+ ContextMenu: () => ContextMenu,
66
+ ContextMenuCheckboxItem: () => ContextMenuCheckboxItem,
67
+ ContextMenuContent: () => ContextMenuContent,
68
+ ContextMenuGroup: () => ContextMenuGroup,
69
+ ContextMenuItem: () => ContextMenuItem,
70
+ ContextMenuLabel: () => ContextMenuLabel,
71
+ ContextMenuPortal: () => ContextMenuPortal,
72
+ ContextMenuRadioGroup: () => ContextMenuRadioGroup,
73
+ ContextMenuRadioItem: () => ContextMenuRadioItem,
74
+ ContextMenuSeparator: () => ContextMenuSeparator,
75
+ ContextMenuShortcut: () => ContextMenuShortcut,
76
+ ContextMenuSub: () => ContextMenuSub,
77
+ ContextMenuSubContent: () => ContextMenuSubContent,
78
+ ContextMenuSubTrigger: () => ContextMenuSubTrigger,
79
+ ContextMenuTrigger: () => ContextMenuTrigger,
50
80
  CreatablePicker: () => CreatablePicker,
51
81
  DEFAULT_SCORE_THRESHOLDS: () => DEFAULT_SCORE_THRESHOLDS,
82
+ Dialog: () => Dialog,
83
+ DialogClose: () => DialogClose,
84
+ DialogContent: () => DialogContent,
85
+ DialogContentPrimitive: () => DialogContentPrimitive,
86
+ DialogDescription: () => DialogDescription,
87
+ DialogFooter: () => DialogFooter,
88
+ DialogHeader: () => DialogHeader,
89
+ DialogOverlay: () => DialogOverlay,
90
+ DialogPortal: () => DialogPortal,
91
+ DialogTitle: () => DialogTitle,
92
+ DialogTrigger: () => DialogTrigger,
93
+ DropdownMenu: () => DropdownMenu,
94
+ DropdownMenuCheckboxItem: () => DropdownMenuCheckboxItem,
95
+ DropdownMenuContent: () => DropdownMenuContent,
96
+ DropdownMenuGroup: () => DropdownMenuGroup,
97
+ DropdownMenuItem: () => DropdownMenuItem,
98
+ DropdownMenuLabel: () => DropdownMenuLabel,
99
+ DropdownMenuPortal: () => DropdownMenuPortal,
100
+ DropdownMenuRadioGroup: () => DropdownMenuRadioGroup,
101
+ DropdownMenuRadioItem: () => DropdownMenuRadioItem,
102
+ DropdownMenuSeparator: () => DropdownMenuSeparator,
103
+ DropdownMenuShortcut: () => DropdownMenuShortcut,
104
+ DropdownMenuSub: () => DropdownMenuSub,
105
+ DropdownMenuSubContent: () => DropdownMenuSubContent,
106
+ DropdownMenuSubTrigger: () => DropdownMenuSubTrigger,
107
+ DropdownMenuTrigger: () => DropdownMenuTrigger,
52
108
  EditableLabel: () => EditableLabel,
53
109
  EnterInput: () => EnterInput,
54
110
  Input: () => Input,
55
111
  InputWithPrefix: () => InputWithPrefix,
56
- Label: () => Label,
112
+ Label: () => Label3,
113
+ MOBILE_BREAKPOINT: () => MOBILE_BREAKPOINT,
57
114
  OverflowToolbar: () => OverflowToolbar,
58
115
  Popover: () => Popover,
59
116
  PopoverAnchor: () => PopoverAnchor,
60
117
  PopoverContent: () => PopoverContent,
61
118
  PopoverTrigger: () => PopoverTrigger,
62
119
  PortalContainerProvider: () => PortalContainerProvider,
120
+ Progress: () => Progress,
63
121
  RadixDialogModalProvider: () => RadixDialogModalProvider,
64
122
  ScoreRing: () => ScoreRing,
123
+ ScrollArea: () => ScrollArea,
124
+ ScrollBar: () => ScrollBar,
65
125
  SegmentedControl: () => SegmentedControl,
66
126
  Select: () => Select,
67
127
  SelectContent: () => SelectContent,
@@ -73,7 +133,7 @@ __export(src_exports, {
73
133
  SelectSeparator: () => SelectSeparator,
74
134
  SelectTrigger: () => SelectTrigger,
75
135
  SelectValue: () => SelectValue,
76
- Separator: () => Separator2,
136
+ Separator: () => Separator4,
77
137
  Sheet: () => Sheet,
78
138
  SheetClose: () => SheetClose,
79
139
  SheetContent: () => SheetContent,
@@ -85,7 +145,23 @@ __export(src_exports, {
85
145
  SheetTitle: () => SheetTitle,
86
146
  SheetTrigger: () => SheetTrigger,
87
147
  Skeleton: () => Skeleton,
148
+ Switch: () => Switch,
88
149
  TabbedBottomSheet: () => TabbedBottomSheet,
150
+ Table: () => Table,
151
+ TableBody: () => TableBody,
152
+ TableCaption: () => TableCaption,
153
+ TableCell: () => TableCell,
154
+ TableFooter: () => TableFooter,
155
+ TableHead: () => TableHead,
156
+ TableHeader: () => TableHeader,
157
+ TableRow: () => TableRow,
158
+ Tabs: () => Tabs,
159
+ TabsContent: () => TabsContent,
160
+ TabsList: () => TabsList,
161
+ TabsTrigger: () => TabsTrigger,
162
+ TabsTriggerCore: () => TabsTriggerCore,
163
+ Textarea: () => Textarea,
164
+ TextareaWithPrefix: () => TextareaWithPrefix,
89
165
  badgeVariants: () => badgeVariants,
90
166
  buttonVariants: () => buttonVariants,
91
167
  cn: () => cn,
@@ -93,9 +169,13 @@ __export(src_exports, {
93
169
  scoreRingColorClasses: () => scoreRingColorClasses,
94
170
  selectTriggerVariants: () => selectTriggerVariants,
95
171
  sheetVariants: () => sheetVariants,
172
+ useCardSize: () => useCardSize,
173
+ useDialogContainer: () => useDialogContainer,
174
+ useIsMobile: () => useIsMobile,
96
175
  usePortalContainer: () => usePortalContainer,
97
176
  useRadixDialogModal: () => useRadixDialogModal,
98
- useScrollFade: () => useScrollFade
177
+ useScrollFade: () => useScrollFade,
178
+ useTableSize: () => useTableSize
99
179
  });
100
180
  module.exports = __toCommonJS(src_exports);
101
181
 
@@ -239,6 +319,37 @@ function CheckIcon(props) {
239
319
  }
240
320
  ) });
241
321
  }
322
+ function DividerHorizontalIcon(props) {
323
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
324
+ "path",
325
+ {
326
+ d: "M2 7.5C2 7.22386 2.22386 7 2.5 7H12.5C12.7761 7 13 7.22386 13 7.5C13 7.77614 12.7761 8 12.5 8H2.5C2.22386 8 2 7.77614 2 7.5Z",
327
+ fill: "currentColor",
328
+ fillRule: "evenodd",
329
+ clipRule: "evenodd"
330
+ }
331
+ ) });
332
+ }
333
+ function DotFilledIcon(props) {
334
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
335
+ "path",
336
+ {
337
+ d: "M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",
338
+ fill: "currentColor"
339
+ }
340
+ ) });
341
+ }
342
+ function RadixChevronRightIcon(props) {
343
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
344
+ "path",
345
+ {
346
+ d: "M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",
347
+ fill: "currentColor",
348
+ fillRule: "evenodd",
349
+ clipRule: "evenodd"
350
+ }
351
+ ) });
352
+ }
242
353
  function RadixChevronDownIcon(props) {
243
354
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...radixProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
244
355
  "path",
@@ -461,56 +572,246 @@ var Button = React3.forwardRef(
461
572
  );
462
573
  Button.displayName = "Button";
463
574
 
575
+ // src/avatar.tsx
576
+ var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"), 1);
577
+ var React4 = __toESM(require("react"), 1);
578
+ var import_jsx_runtime6 = require("react/jsx-runtime");
579
+ var AVATAR_SIZES = {
580
+ sm: "h-8 w-8 text-[11px]",
581
+ md: "h-9 w-9 text-xs",
582
+ lg: "h-10 w-10 text-sm"
583
+ };
584
+ var Avatar = React4.forwardRef(({ className, size = "lg", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
585
+ AvatarPrimitive.Root,
586
+ {
587
+ ref,
588
+ "data-slot": "avatar",
589
+ className: cn(
590
+ "relative flex shrink-0 overflow-hidden rounded-full",
591
+ AVATAR_SIZES[size],
592
+ className
593
+ ),
594
+ ...props
595
+ }
596
+ ));
597
+ Avatar.displayName = AvatarPrimitive.Root.displayName;
598
+ var AvatarImage = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
599
+ AvatarPrimitive.Image,
600
+ {
601
+ ref,
602
+ "data-slot": "avatar-image",
603
+ className: cn("aspect-square h-full w-full", className),
604
+ ...props
605
+ }
606
+ ));
607
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName;
608
+ var AvatarFallback = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
609
+ AvatarPrimitive.Fallback,
610
+ {
611
+ ref,
612
+ "data-slot": "avatar-fallback",
613
+ className: cn(
614
+ "flex h-full w-full items-center justify-center rounded-full bg-muted font-medium text-muted-foreground",
615
+ className
616
+ ),
617
+ ...props
618
+ }
619
+ ));
620
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
621
+
622
+ // src/card.tsx
623
+ var React5 = __toESM(require("react"), 1);
624
+ var import_jsx_runtime7 = require("react/jsx-runtime");
625
+ var CARD_SIZES = {
626
+ sm: {
627
+ root: "rounded-xl border bg-card text-card-foreground shadow",
628
+ pad: "p-2",
629
+ padTopless: "p-2 pt-0"
630
+ },
631
+ md: {
632
+ root: "rounded-lg border bg-card text-card-foreground shadow-sm",
633
+ pad: "p-4",
634
+ padTopless: "p-4 pt-0"
635
+ },
636
+ lg: {
637
+ root: "rounded-lg border bg-card text-card-foreground shadow-sm",
638
+ pad: "p-6",
639
+ padTopless: "p-6 pt-0"
640
+ }
641
+ };
642
+ var CardSizeContext = React5.createContext("md");
643
+ function useCardSize() {
644
+ return React5.useContext(CardSizeContext);
645
+ }
646
+ var Card = React5.forwardRef(
647
+ ({ className, size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardSizeContext.Provider, { value: size, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
648
+ "div",
649
+ {
650
+ ref,
651
+ "data-slot": "card",
652
+ "data-size": size,
653
+ className: cn(CARD_SIZES[size].root, className),
654
+ ...props
655
+ }
656
+ ) })
657
+ );
658
+ Card.displayName = "Card";
659
+ var CardHeader = React5.forwardRef(({ className, ...props }, ref) => {
660
+ const size = useCardSize();
661
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
662
+ "div",
663
+ {
664
+ ref,
665
+ "data-slot": "card-header",
666
+ className: cn(
667
+ "flex flex-col space-y-1.5 rounded-t-[inherit]",
668
+ CARD_SIZES[size].pad,
669
+ className
670
+ ),
671
+ ...props
672
+ }
673
+ );
674
+ });
675
+ CardHeader.displayName = "CardHeader";
676
+ var CardTitle = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
677
+ "h3",
678
+ {
679
+ ref,
680
+ "data-slot": "card-title",
681
+ className: cn("font-semibold leading-none tracking-tight", className),
682
+ ...props
683
+ }
684
+ ));
685
+ CardTitle.displayName = "CardTitle";
686
+ var CardDescription = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
687
+ "p",
688
+ {
689
+ ref,
690
+ "data-slot": "card-description",
691
+ className: cn("text-sm text-muted-foreground", className),
692
+ ...props
693
+ }
694
+ ));
695
+ CardDescription.displayName = "CardDescription";
696
+ var CardAction = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
697
+ "div",
698
+ {
699
+ ref,
700
+ "data-slot": "card-action",
701
+ className: cn("ml-auto self-start", className),
702
+ ...props
703
+ }
704
+ ));
705
+ CardAction.displayName = "CardAction";
706
+ var CardContent = React5.forwardRef(({ className, ...props }, ref) => {
707
+ const size = useCardSize();
708
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
709
+ "div",
710
+ {
711
+ ref,
712
+ "data-slot": "card-content",
713
+ className: cn(CARD_SIZES[size].padTopless, className),
714
+ ...props
715
+ }
716
+ );
717
+ });
718
+ CardContent.displayName = "CardContent";
719
+ var CardFooter = React5.forwardRef(({ className, ...props }, ref) => {
720
+ const size = useCardSize();
721
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
722
+ "div",
723
+ {
724
+ ref,
725
+ "data-slot": "card-footer",
726
+ className: cn(
727
+ "flex items-center rounded-b-[inherit]",
728
+ CARD_SIZES[size].padTopless,
729
+ className
730
+ ),
731
+ ...props
732
+ }
733
+ );
734
+ });
735
+ CardFooter.displayName = "CardFooter";
736
+
737
+ // src/checkbox.tsx
738
+ var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
739
+ var React6 = __toESM(require("react"), 1);
740
+ var import_jsx_runtime8 = require("react/jsx-runtime");
741
+ var CHECKBOX_SIZES = {
742
+ sm: { root: "h-3.5 w-3.5 rounded-xs", glyph: "h-3 w-3" },
743
+ md: { root: "h-4 w-4 rounded-sm", glyph: "h-3.5 w-3.5" }
744
+ };
745
+ var Checkbox = React6.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
746
+ CheckboxPrimitive.Root,
747
+ {
748
+ ref,
749
+ "data-slot": "checkbox",
750
+ className: cn(
751
+ "peer shrink-0 cursor-pointer border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground",
752
+ CHECKBOX_SIZES[size].root,
753
+ className
754
+ ),
755
+ ...props,
756
+ children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
757
+ CheckboxPrimitive.Indicator,
758
+ {
759
+ "data-slot": "checkbox-indicator",
760
+ className: "flex items-center justify-center text-current",
761
+ children: props.checked === "indeterminate" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DividerHorizontalIcon, { className: CHECKBOX_SIZES[size].glyph }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CheckIcon, { className: CHECKBOX_SIZES[size].glyph })
762
+ }
763
+ )
764
+ }
765
+ ));
766
+ Checkbox.displayName = CheckboxPrimitive.Root.displayName;
767
+
768
+ // src/collapsible.tsx
769
+ var CollapsiblePrimitive = __toESM(require("@radix-ui/react-collapsible"), 1);
770
+ var Collapsible = CollapsiblePrimitive.Root;
771
+ var CollapsibleTrigger2 = CollapsiblePrimitive.CollapsibleTrigger;
772
+ var CollapsibleContent2 = CollapsiblePrimitive.CollapsibleContent;
773
+
464
774
  // src/command.tsx
465
775
  var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
466
776
  var import_cmdk = require("cmdk");
467
- var React5 = __toESM(require("react"), 1);
777
+ var React9 = __toESM(require("react"), 1);
468
778
 
469
779
  // src/portal-container.tsx
470
- var React4 = __toESM(require("react"), 1);
471
- var import_jsx_runtime6 = require("react/jsx-runtime");
472
- var PortalContainerContext = React4.createContext(
780
+ var React7 = __toESM(require("react"), 1);
781
+ var import_jsx_runtime9 = require("react/jsx-runtime");
782
+ var PortalContainerContext = React7.createContext(
473
783
  void 0
474
784
  );
475
785
  function PortalContainerProvider({
476
786
  container,
477
787
  children
478
788
  }) {
479
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PortalContainerContext.Provider, { value: container ?? void 0, children });
789
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PortalContainerContext.Provider, { value: container ?? void 0, children });
480
790
  }
481
791
  function usePortalContainer(explicit) {
482
- const injected = React4.useContext(PortalContainerContext);
792
+ const injected = React7.useContext(PortalContainerContext);
483
793
  if (explicit !== void 0) {
484
794
  return explicit ?? void 0;
485
795
  }
486
796
  return injected ?? void 0;
487
797
  }
488
798
 
489
- // src/command.tsx
490
- var import_jsx_runtime7 = require("react/jsx-runtime");
491
- var Command = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
492
- import_cmdk.Command,
493
- {
494
- ref,
495
- className: cn(
496
- "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
497
- className
498
- ),
499
- ...props
500
- }
501
- ));
502
- Command.displayName = import_cmdk.Command.displayName;
799
+ // src/use-is-mobile.ts
800
+ var React8 = __toESM(require("react"), 1);
503
801
  var MOBILE_BREAKPOINT = 768;
504
802
  function useIsMobile() {
505
- const [isMobile, setIsMobile] = React5.useState(false);
506
- const [hasMounted, setHasMounted] = React5.useState(false);
507
- React5.useEffect(() => {
803
+ const [isMobile, setIsMobile] = React8.useState(false);
804
+ const [hasMounted, setHasMounted] = React8.useState(false);
805
+ React8.useEffect(() => {
508
806
  setHasMounted(true);
509
- const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
510
807
  const onChange = () => {
511
808
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
512
809
  };
513
810
  onChange();
811
+ if (typeof window.matchMedia !== "function") {
812
+ return void 0;
813
+ }
814
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
514
815
  mql.addEventListener("change", onChange);
515
816
  return () => mql.removeEventListener("change", onChange);
516
817
  }, []);
@@ -519,21 +820,36 @@ function useIsMobile() {
519
820
  }
520
821
  return isMobile;
521
822
  }
823
+
824
+ // src/command.tsx
825
+ var import_jsx_runtime10 = require("react/jsx-runtime");
826
+ var Command = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
827
+ import_cmdk.Command,
828
+ {
829
+ ref,
830
+ className: cn(
831
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
832
+ className
833
+ ),
834
+ ...props
835
+ }
836
+ ));
837
+ Command.displayName = import_cmdk.Command.displayName;
522
838
  var DIALOG_DESKTOP_CLASSES = "fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg";
523
839
  var DIALOG_MOBILE_SHEET_CLASSES = "fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full duration-200 rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain 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]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom";
524
840
  var DIALOG_MOBILE_SHEET_OVERRIDE = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
525
- var CommandDialogContent = React5.forwardRef(({ className, children, container, ...props }, ref) => {
841
+ var CommandDialogContent = React9.forwardRef(({ className, children, container, ...props }, ref) => {
526
842
  const isMobile = useIsMobile();
527
843
  const isModal = useRadixDialogModal();
528
844
  const portalContainer = usePortalContainer(container);
529
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogPrimitive.Portal, { container: portalContainer, children: [
530
- isModal ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
845
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogPrimitive.Portal, { container: portalContainer, children: [
846
+ isModal ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
531
847
  DialogPrimitive.Overlay,
532
848
  {
533
849
  className: "fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
534
850
  }
535
851
  ) : null,
536
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
852
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
537
853
  DialogPrimitive.Content,
538
854
  {
539
855
  ref,
@@ -548,9 +864,9 @@ var CommandDialogContent = React5.forwardRef(({ className, children, container,
548
864
  ...props,
549
865
  children: [
550
866
  children,
551
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogPrimitive.Close, { className: "absolute right-2 top-4 flex h-10 w-10 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4", children: [
552
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(XIcon, { className: "h-4 w-4" }),
553
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "sr-only", children: "Close" })
867
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogPrimitive.Close, { className: "absolute right-2 top-4 flex h-10 w-10 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4", children: [
868
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(XIcon, { className: "h-4 w-4" }),
869
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Close" })
554
870
  ] })
555
871
  ]
556
872
  }
@@ -564,21 +880,21 @@ var CommandDialog = ({
564
880
  ...props
565
881
  }) => {
566
882
  const modal = props.modal ?? true;
567
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogPrimitive.Root, { ...props, modal, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
883
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogPrimitive.Root, { ...props, modal, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
568
884
  CommandDialogContent,
569
885
  {
570
886
  className: "overflow-hidden p-0",
571
887
  ...container !== void 0 ? { container } : {},
572
888
  children: [
573
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogPrimitive.Title, { className: "sr-only" }),
574
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
889
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogPrimitive.Title, { className: "sr-only" }),
890
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Command, { className: "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children })
575
891
  ]
576
892
  }
577
893
  ) }) });
578
894
  };
579
- var CommandInput = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
580
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
581
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
895
+ var CommandInput = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
896
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
897
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
582
898
  import_cmdk.Command.Input,
583
899
  {
584
900
  ref,
@@ -591,7 +907,7 @@ var CommandInput = React5.forwardRef(({ className, ...props }, ref) => /* @__PUR
591
907
  )
592
908
  ] }));
593
909
  CommandInput.displayName = import_cmdk.Command.Input.displayName;
594
- var CommandList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
910
+ var CommandList = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
595
911
  import_cmdk.Command.List,
596
912
  {
597
913
  ref,
@@ -600,7 +916,7 @@ var CommandList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
600
916
  }
601
917
  ));
602
918
  CommandList.displayName = import_cmdk.Command.List.displayName;
603
- var CommandEmpty = React5.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
919
+ var CommandEmpty = React9.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
604
920
  import_cmdk.Command.Empty,
605
921
  {
606
922
  ref,
@@ -609,7 +925,7 @@ var CommandEmpty = React5.forwardRef((props, ref) => /* @__PURE__ */ (0, import_
609
925
  }
610
926
  ));
611
927
  CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
612
- var CommandGroup = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
928
+ var CommandGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
613
929
  import_cmdk.Command.Group,
614
930
  {
615
931
  ref,
@@ -621,7 +937,7 @@ var CommandGroup = React5.forwardRef(({ className, ...props }, ref) => /* @__PUR
621
937
  }
622
938
  ));
623
939
  CommandGroup.displayName = import_cmdk.Command.Group.displayName;
624
- var CommandSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
940
+ var CommandSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
625
941
  import_cmdk.Command.Separator,
626
942
  {
627
943
  ref,
@@ -630,7 +946,7 @@ var CommandSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @_
630
946
  }
631
947
  ));
632
948
  CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
633
- var CommandItem = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
949
+ var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
634
950
  import_cmdk.Command.Item,
635
951
  {
636
952
  ref,
@@ -646,7 +962,7 @@ var CommandShortcut = ({
646
962
  className,
647
963
  ...props
648
964
  }) => {
649
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
965
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
650
966
  "span",
651
967
  {
652
968
  className: cn(
@@ -659,20 +975,155 @@ var CommandShortcut = ({
659
975
  };
660
976
  CommandShortcut.displayName = "CommandShortcut";
661
977
 
978
+ // src/context-menu.tsx
979
+ var ContextMenuPrimitive = __toESM(require("@radix-ui/react-context-menu"), 1);
980
+ var React10 = __toESM(require("react"), 1);
981
+ var import_jsx_runtime11 = require("react/jsx-runtime");
982
+ var ContextMenu = ContextMenuPrimitive.Root;
983
+ var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
984
+ var ContextMenuGroup = ContextMenuPrimitive.Group;
985
+ var ContextMenuPortal = ContextMenuPrimitive.Portal;
986
+ var ContextMenuSub = ContextMenuPrimitive.Sub;
987
+ var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
988
+ var SURFACE_CLASS = "z-50 min-w-[8rem] max-h-[var(--radix-context-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
989
+ var MOTION_CLASS = "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";
990
+ var ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
991
+ var INDICATOR_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
992
+ var ContextMenuSubTrigger = React10.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
993
+ ContextMenuPrimitive.SubTrigger,
994
+ {
995
+ ref,
996
+ "data-slot": "context-menu-sub-trigger",
997
+ className: cn(
998
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",
999
+ inset && "pl-8",
1000
+ className
1001
+ ),
1002
+ ...props,
1003
+ children: [
1004
+ children,
1005
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
1006
+ ]
1007
+ }
1008
+ ));
1009
+ ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
1010
+ var ContextMenuSubContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1011
+ ContextMenuPrimitive.SubContent,
1012
+ {
1013
+ ref,
1014
+ "data-slot": "context-menu-sub-content",
1015
+ className: cn(SURFACE_CLASS, "shadow-lg", MOTION_CLASS, className),
1016
+ ...props
1017
+ }
1018
+ ));
1019
+ ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
1020
+ var ContextMenuContent = React10.forwardRef(({ className, container, ...props }, ref) => {
1021
+ const portalContainer = usePortalContainer(container);
1022
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ContextMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1023
+ ContextMenuPrimitive.Content,
1024
+ {
1025
+ ref,
1026
+ "data-slot": "context-menu-content",
1027
+ className: cn(SURFACE_CLASS, "shadow-md", MOTION_CLASS, className),
1028
+ ...props
1029
+ }
1030
+ ) });
1031
+ });
1032
+ ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
1033
+ var ContextMenuItem = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1034
+ ContextMenuPrimitive.Item,
1035
+ {
1036
+ ref,
1037
+ "data-slot": "context-menu-item",
1038
+ className: cn(
1039
+ ITEM_CLASS,
1040
+ "gap-2 [&>svg]:size-4 [&>svg]:shrink-0",
1041
+ inset && "pl-8",
1042
+ className
1043
+ ),
1044
+ ...props
1045
+ }
1046
+ ));
1047
+ ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
1048
+ var ContextMenuCheckboxItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1049
+ ContextMenuPrimitive.CheckboxItem,
1050
+ {
1051
+ ref,
1052
+ "data-slot": "context-menu-checkbox-item",
1053
+ className: cn(INDICATOR_ITEM_CLASS, className),
1054
+ ...props,
1055
+ children: [
1056
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
1057
+ children
1058
+ ]
1059
+ }
1060
+ ));
1061
+ ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
1062
+ var ContextMenuRadioItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1063
+ ContextMenuPrimitive.RadioItem,
1064
+ {
1065
+ ref,
1066
+ "data-slot": "context-menu-radio-item",
1067
+ className: cn(INDICATOR_ITEM_CLASS, className),
1068
+ ...props,
1069
+ children: [
1070
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
1071
+ children
1072
+ ]
1073
+ }
1074
+ ));
1075
+ ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
1076
+ var ContextMenuLabel = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1077
+ ContextMenuPrimitive.Label,
1078
+ {
1079
+ ref,
1080
+ "data-slot": "context-menu-label",
1081
+ className: cn(
1082
+ "px-2 py-1.5 text-sm font-semibold text-foreground",
1083
+ inset && "pl-8",
1084
+ className
1085
+ ),
1086
+ ...props
1087
+ }
1088
+ ));
1089
+ ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
1090
+ var ContextMenuSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1091
+ ContextMenuPrimitive.Separator,
1092
+ {
1093
+ ref,
1094
+ "data-slot": "context-menu-separator",
1095
+ className: cn("-mx-1 my-1 h-px bg-border", className),
1096
+ ...props
1097
+ }
1098
+ ));
1099
+ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
1100
+ var ContextMenuShortcut = ({
1101
+ className,
1102
+ ...props
1103
+ }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1104
+ "span",
1105
+ {
1106
+ "data-slot": "context-menu-shortcut",
1107
+ className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
1108
+ ...props
1109
+ }
1110
+ );
1111
+ ContextMenuShortcut.displayName = "ContextMenuShortcut";
1112
+
662
1113
  // src/creatable-picker.tsx
663
1114
  var import_react = require("react");
664
1115
 
665
1116
  // src/popover.tsx
666
1117
  var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
667
- var React6 = __toESM(require("react"), 1);
668
- var import_jsx_runtime8 = require("react/jsx-runtime");
1118
+ var React11 = __toESM(require("react"), 1);
1119
+ var import_jsx_runtime12 = require("react/jsx-runtime");
669
1120
  var Popover = PopoverPrimitive.Root;
670
1121
  var PopoverTrigger = PopoverPrimitive.Trigger;
671
1122
  var PopoverAnchor = PopoverPrimitive.Anchor;
672
- var PopoverContent = React6.forwardRef(
1123
+ var PopoverContent = React11.forwardRef(
673
1124
  ({ className, align = "center", sideOffset = 4, container, ...props }, ref) => {
674
1125
  const portalContainer = usePortalContainer(container);
675
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1126
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
676
1127
  PopoverPrimitive.Content,
677
1128
  {
678
1129
  ref,
@@ -696,7 +1147,7 @@ var PopoverContent = React6.forwardRef(
696
1147
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
697
1148
 
698
1149
  // src/creatable-picker.tsx
699
- var import_jsx_runtime9 = require("react/jsx-runtime");
1150
+ var import_jsx_runtime13 = require("react/jsx-runtime");
700
1151
  function article(noun) {
701
1152
  return /^[aeiou]/i.test(noun.trim()) ? `an ${noun}` : `a ${noun}`;
702
1153
  }
@@ -771,8 +1222,8 @@ function CreatablePicker({
771
1222
  setBusy(false);
772
1223
  }
773
1224
  };
774
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Popover, { open, onOpenChange: (next) => next ? setOpen(true) : close(), children: [
775
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1225
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Popover, { open, onOpenChange: (next) => next ? setOpen(true) : close(), children: [
1226
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
776
1227
  "button",
777
1228
  {
778
1229
  type: "button",
@@ -786,12 +1237,12 @@ function CreatablePicker({
786
1237
  triggerClassName
787
1238
  ),
788
1239
  children: [
789
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 flex-1 truncate", children: selected ? renderSelected ?? selected.render ?? selected.label : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-muted-foreground", children: loading ? "Loading\u2026" : placeholder }) }),
790
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ChevronsUpDownIcon, { className: "size-3.5 shrink-0 opacity-50" })
1240
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 flex-1 truncate", children: selected ? renderSelected ?? selected.render ?? selected.label : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-muted-foreground", children: loading ? "Loading\u2026" : placeholder }) }),
1241
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChevronsUpDownIcon, { className: "size-3.5 shrink-0 opacity-50" })
791
1242
  ]
792
1243
  }
793
1244
  ) }),
794
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopoverContent, { align: "start", className: "w-[--radix-popover-trigger-width] min-w-56 p-0", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1245
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverContent, { align: "start", className: "w-[--radix-popover-trigger-width] min-w-56 p-0", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
795
1246
  Command,
796
1247
  {
797
1248
  filter: (itemValue, search, keywords) => {
@@ -799,7 +1250,7 @@ function CreatablePicker({
799
1250
  return haystack.includes(search.toLowerCase()) ? 1 : 0;
800
1251
  },
801
1252
  children: [
802
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1253
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
803
1254
  CommandInput,
804
1255
  {
805
1256
  ref: inputRef,
@@ -811,13 +1262,13 @@ function CreatablePicker({
811
1262
  placeholder: searchPlaceholder ?? `Search or add ${article(noun)}\u2026`
812
1263
  }
813
1264
  ),
814
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(CommandList, { children: [
815
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CommandEmpty, { children: emptyLabel }),
816
- groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1265
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(CommandList, { children: [
1266
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandEmpty, { children: emptyLabel }),
1267
+ groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
817
1268
  CommandGroup,
818
1269
  {
819
1270
  ...group.heading === void 0 ? {} : { heading: group.heading },
820
- children: group.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1271
+ children: group.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
821
1272
  CommandItem,
822
1273
  {
823
1274
  value: option.label,
@@ -828,7 +1279,7 @@ function CreatablePicker({
828
1279
  },
829
1280
  className: "gap-2 text-xs",
830
1281
  children: [
831
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1282
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
832
1283
  LucideCheckIcon,
833
1284
  {
834
1285
  className: cn(
@@ -837,8 +1288,8 @@ function CreatablePicker({
837
1288
  )
838
1289
  }
839
1290
  ),
840
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 flex-1 truncate", children: option.render ?? option.label }),
841
- option.hint ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: option.hint }) : null
1291
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 flex-1 truncate", children: option.render ?? option.label }),
1292
+ option.hint ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: option.hint }) : null
842
1293
  ]
843
1294
  },
844
1295
  option.value
@@ -847,9 +1298,9 @@ function CreatablePicker({
847
1298
  group.heading ?? "__ungrouped__"
848
1299
  ))
849
1300
  ] }),
850
- canCreate ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-1 border-t border-border p-1", children: [
851
- createExtra && typed && !exactMatch ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "px-1 pt-0.5", children: typeof createExtra === "function" ? createExtra(typed) : createExtra }) : null,
852
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1301
+ canCreate ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-1 border-t border-border p-1", children: [
1302
+ createExtra && typed && !exactMatch ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "px-1 pt-0.5", children: typeof createExtra === "function" ? createExtra(typed) : createExtra }) : null,
1303
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
853
1304
  "button",
854
1305
  {
855
1306
  type: "button",
@@ -857,22 +1308,22 @@ function CreatablePicker({
857
1308
  onClick: () => void create(typed),
858
1309
  className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50",
859
1310
  children: [
860
- busy ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Loader2Icon, { className: "size-3.5 shrink-0 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PlusIcon, { className: "size-3.5 shrink-0" }),
861
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 truncate", children: typed && !exactMatch ? `Create \u201C${typed}\u201D` : `Add ${article(noun)}\u2026` })
1311
+ busy ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Loader2Icon, { className: "size-3.5 shrink-0 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PlusIcon, { className: "size-3.5 shrink-0" }),
1312
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 truncate", children: typed && !exactMatch ? `Create \u201C${typed}\u201D` : `Add ${article(noun)}\u2026` })
862
1313
  ]
863
1314
  }
864
1315
  ),
865
- needsName ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "px-2 pb-0.5 text-[11px] leading-snug text-muted-foreground", children: [
1316
+ needsName ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "px-2 pb-0.5 text-[11px] leading-snug text-muted-foreground", children: [
866
1317
  "Type the name of the ",
867
1318
  noun,
868
1319
  " you want to add \u2014 then this creates it."
869
1320
  ] }) : null
870
1321
  ] }) : null,
871
- footerActions?.length || manageAction ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-0.5 border-t border-border p-1", children: [
1322
+ footerActions?.length || manageAction ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-0.5 border-t border-border p-1", children: [
872
1323
  footerActions?.map((action) => {
873
1324
  const Icon2 = action.icon;
874
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
875
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1325
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
1326
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
876
1327
  "button",
877
1328
  {
878
1329
  type: "button",
@@ -882,15 +1333,15 @@ function CreatablePicker({
882
1333
  },
883
1334
  className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
884
1335
  children: [
885
- Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Icon2, { className: "size-3.5 shrink-0" }) : null,
886
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 truncate", children: action.label })
1336
+ Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon2, { className: "size-3.5 shrink-0" }) : null,
1337
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 truncate", children: action.label })
887
1338
  ]
888
1339
  }
889
1340
  ),
890
- action.note ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "px-2 pb-1 text-[10px] leading-snug text-muted-foreground", children: action.note }) : null
1341
+ action.note ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "px-2 pb-1 text-[10px] leading-snug text-muted-foreground", children: action.note }) : null
891
1342
  ] }, action.label);
892
1343
  }),
893
- manageAction ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1344
+ manageAction ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
894
1345
  "a",
895
1346
  {
896
1347
  href: manageAction.href,
@@ -899,18 +1350,18 @@ function CreatablePicker({
899
1350
  onClick: close,
900
1351
  className: "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
901
1352
  children: [
902
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ExternalLinkIcon, { className: "size-3.5 shrink-0" }),
903
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 truncate", children: manageAction.label })
1353
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ExternalLinkIcon, { className: "size-3.5 shrink-0" }),
1354
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 truncate", children: manageAction.label })
904
1355
  ]
905
1356
  }
906
1357
  ) : null
907
1358
  ] }) : null,
908
- lockedNote ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-1 border-t border-border p-2", children: [
909
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "flex gap-1.5 text-[11px] leading-snug text-muted-foreground", children: [
910
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(LockIcon, { className: "mt-px size-3 shrink-0" }),
911
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: lockedNote })
1359
+ lockedNote ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-1 border-t border-border p-2", children: [
1360
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "flex gap-1.5 text-[11px] leading-snug text-muted-foreground", children: [
1361
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LockIcon, { className: "mt-px size-3 shrink-0" }),
1362
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: lockedNote })
912
1363
  ] }),
913
- lockedAction ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1364
+ lockedAction ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
914
1365
  "button",
915
1366
  {
916
1367
  type: "button",
@@ -920,8 +1371,8 @@ function CreatablePicker({
920
1371
  },
921
1372
  className: "flex w-full items-center gap-2 rounded-sm px-1 py-1 text-left text-xs font-medium text-primary transition-colors hover:bg-accent",
922
1373
  children: [
923
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PlusIcon, { className: "size-3.5 shrink-0" }),
924
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "min-w-0 truncate", children: lockedAction.label })
1374
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PlusIcon, { className: "size-3.5 shrink-0" }),
1375
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 truncate", children: lockedAction.label })
925
1376
  ]
926
1377
  }
927
1378
  ) : null
@@ -932,9 +1383,326 @@ function CreatablePicker({
932
1383
  ] });
933
1384
  }
934
1385
 
1386
+ // src/dialog.tsx
1387
+ var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"), 1);
1388
+ var VisuallyHidden2 = __toESM(require("@radix-ui/react-visually-hidden"), 1);
1389
+ var import_react_tree = require("@ai-matrx/kit/react-tree");
1390
+ var React12 = __toESM(require("react"), 1);
1391
+ var import_jsx_runtime14 = require("react/jsx-runtime");
1392
+ var Dialog = ({
1393
+ children,
1394
+ ...props
1395
+ }) => {
1396
+ const modal = props.modal ?? true;
1397
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive2.Root, { ...props, modal, children }) });
1398
+ };
1399
+ Dialog.displayName = "Dialog";
1400
+ var DialogTrigger = DialogPrimitive2.Trigger;
1401
+ var DialogClose = DialogPrimitive2.Close;
1402
+ var DialogPortal = ({
1403
+ container,
1404
+ ...props
1405
+ }) => {
1406
+ const resolved = usePortalContainer(container);
1407
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive2.Portal, { container: resolved ?? null, ...props });
1408
+ };
1409
+ DialogPortal.displayName = "DialogPortal";
1410
+ var DialogContainerContext = React12.createContext(null);
1411
+ var useDialogContainer = () => React12.useContext(DialogContainerContext);
1412
+ var DialogOverlay = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1413
+ DialogPrimitive2.Overlay,
1414
+ {
1415
+ ref,
1416
+ "data-slot": "dialog-overlay",
1417
+ className: cn(
1418
+ // Page context behind the modal stays readable; separation comes from a
1419
+ // light token scrim, not a blur.
1420
+ "fixed inset-0 z-[10000] bg-[var(--matrx-overlay-scrim-soft)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
1421
+ className
1422
+ ),
1423
+ ...props
1424
+ }
1425
+ ));
1426
+ DialogOverlay.displayName = DialogPrimitive2.Overlay.displayName;
1427
+ var DialogContentPrimitive = React12.forwardRef((props, ref) => {
1428
+ const isModal = useRadixDialogModal();
1429
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1430
+ DialogPrimitive2.Content,
1431
+ {
1432
+ ...props,
1433
+ ref,
1434
+ "aria-modal": isModal || void 0
1435
+ }
1436
+ );
1437
+ });
1438
+ DialogContentPrimitive.displayName = "DialogContentPrimitive";
1439
+ var DIALOG_DESKTOP_CLASSES2 = "fixed left-[50%] top-[50%] z-[10000] grid min-w-0 w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 max-h-[85dvh] overflow-y-auto overscroll-contain [--dialog-pad:1.5rem] overflow-x-clip border bg-background p-6 shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg";
1440
+ var DIALOG_MOBILE_SHEET_CLASSES2 = "matrx-mobile-sheet fixed inset-x-0 bottom-0 left-0 right-0 top-auto z-[10000] flex min-w-0 flex-col w-full max-w-full max-h-[90dvh] translate-x-0 translate-y-0 gap-4 [--dialog-pad:1rem] overflow-x-clip border-t bg-background p-4 pb-safe shadow-lg [overflow-wrap:anywhere] [&>*]:min-w-0 [&>*]:max-w-full duration-200 rounded-t-2xl rounded-b-none overflow-y-auto overscroll-contain 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]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom";
1441
+ var DIALOG_MOBILE_SHEET_OVERRIDE2 = "inset-x-0 bottom-0 left-0 right-0 top-auto translate-x-0 translate-y-0 w-full max-w-full max-h-[90dvh] rounded-b-none rounded-t-2xl overflow-y-auto";
1442
+ var DialogContent = React12.forwardRef(
1443
+ ({
1444
+ className,
1445
+ children,
1446
+ mobileSheet = true,
1447
+ showCloseButton = true,
1448
+ container,
1449
+ ...props
1450
+ }, ref) => {
1451
+ const isMobile = useIsMobile();
1452
+ const isModal = useRadixDialogModal();
1453
+ const injectedContainer = usePortalContainer(container);
1454
+ const asSheet = mobileSheet && isMobile;
1455
+ const [containerEl, setContainerEl] = React12.useState(
1456
+ null
1457
+ );
1458
+ const mergedRef = React12.useCallback(
1459
+ (node) => {
1460
+ setContainerEl(node);
1461
+ if (typeof ref === "function") ref(node);
1462
+ else if (ref)
1463
+ ref.current = node;
1464
+ },
1465
+ [ref]
1466
+ );
1467
+ const hasTitle = (0, import_react_tree.treeContainsComponent)(children, DialogTitle) || (0, import_react_tree.treeContainsComponent)(children, DialogPrimitive2.Title);
1468
+ const hasDescription = (0, import_react_tree.treeContainsComponent)(children, DialogDescription) || (0, import_react_tree.treeContainsComponent)(children, DialogPrimitive2.Description);
1469
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(DialogPortal, { container, children: [
1470
+ isModal ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogOverlay, {}) : null,
1471
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1472
+ DialogContentPrimitive,
1473
+ {
1474
+ ref: mergedRef,
1475
+ "data-slot": "dialog-content",
1476
+ className: cn(
1477
+ asSheet ? DIALOG_MOBILE_SHEET_CLASSES2 : DIALOG_DESKTOP_CLASSES2,
1478
+ className,
1479
+ asSheet && DIALOG_MOBILE_SHEET_OVERRIDE2,
1480
+ // A non-modal dialog is the coexistence contract for content that
1481
+ // can sit beside a host's floating window manager (which starts at
1482
+ // z=1000); staying below that boundary makes a newly focused window
1483
+ // usable without coupling the two systems.
1484
+ !isModal && "z-[900]"
1485
+ ),
1486
+ ...hasDescription ? {} : { "aria-describedby": void 0 },
1487
+ ...props,
1488
+ children: [
1489
+ hasTitle ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(VisuallyHidden2.Root, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive2.Title, { children: "Dialog" }) }),
1490
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogContainerContext.Provider, { value: containerEl, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1491
+ PortalContainerProvider,
1492
+ {
1493
+ container: containerEl ?? injectedContainer ?? null,
1494
+ children
1495
+ }
1496
+ ) }),
1497
+ showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1498
+ DialogPrimitive2.Close,
1499
+ {
1500
+ "data-slot": "dialog-close",
1501
+ "aria-label": "Close",
1502
+ className: "absolute right-2 top-4 flex h-11 w-11 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground sm:right-4 lg:h-10 lg:w-10",
1503
+ children: [
1504
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(XIcon, { className: "h-4 w-4" }),
1505
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Close" })
1506
+ ]
1507
+ }
1508
+ ) : null
1509
+ ]
1510
+ }
1511
+ )
1512
+ ] });
1513
+ }
1514
+ );
1515
+ DialogContent.displayName = DialogPrimitive2.Content.displayName;
1516
+ var DialogHeader = ({
1517
+ className,
1518
+ ...props
1519
+ }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1520
+ "div",
1521
+ {
1522
+ "data-slot": "dialog-header",
1523
+ className: cn(
1524
+ // DialogContent owns an absolute close control. Reserve its hit area in
1525
+ // every header so trailing actions never render underneath it.
1526
+ "flex flex-col space-y-1.5 pr-12 text-center sm:text-left",
1527
+ className
1528
+ ),
1529
+ ...props
1530
+ }
1531
+ );
1532
+ DialogHeader.displayName = "DialogHeader";
1533
+ var DialogFooter = ({
1534
+ className,
1535
+ ...props
1536
+ }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1537
+ "div",
1538
+ {
1539
+ "data-slot": "dialog-footer",
1540
+ className: cn(
1541
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
1542
+ "sticky bottom-0 z-10 bg-background pt-3",
1543
+ "mx-[calc(var(--dialog-pad,0px)*-1)] mb-[calc(var(--dialog-pad,0px)*-1)] px-[var(--dialog-pad,0px)] pb-[var(--dialog-pad,0px)]",
1544
+ className
1545
+ ),
1546
+ ...props
1547
+ }
1548
+ );
1549
+ DialogFooter.displayName = "DialogFooter";
1550
+ var DialogTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1551
+ DialogPrimitive2.Title,
1552
+ {
1553
+ ref,
1554
+ "data-slot": "dialog-title",
1555
+ className: cn("text-lg font-semibold leading-none tracking-tight", className),
1556
+ ...props
1557
+ }
1558
+ ));
1559
+ DialogTitle.displayName = DialogPrimitive2.Title.displayName;
1560
+ var DialogDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1561
+ DialogPrimitive2.Description,
1562
+ {
1563
+ ref,
1564
+ "data-slot": "dialog-description",
1565
+ className: cn("text-sm text-muted-foreground", className),
1566
+ ...props
1567
+ }
1568
+ ));
1569
+ DialogDescription.displayName = DialogPrimitive2.Description.displayName;
1570
+
1571
+ // src/dropdown-menu.tsx
1572
+ var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
1573
+ var React13 = __toESM(require("react"), 1);
1574
+ var import_jsx_runtime15 = require("react/jsx-runtime");
1575
+ var DropdownMenu = DropdownMenuPrimitive.Root;
1576
+ var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
1577
+ var DropdownMenuGroup = DropdownMenuPrimitive.Group;
1578
+ var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
1579
+ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
1580
+ var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
1581
+ var MENU_SURFACE_CLASS = "z-[10001] min-w-[8rem] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto overflow-x-hidden overscroll-contain rounded-md border bg-popover p-1 text-popover-foreground";
1582
+ var MENU_MOTION_CLASS = "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";
1583
+ var MENU_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
1584
+ var MENU_INDICATOR_ITEM_CLASS = "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50";
1585
+ var DropdownMenuSubTrigger = React13.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1586
+ DropdownMenuPrimitive.SubTrigger,
1587
+ {
1588
+ ref,
1589
+ "data-slot": "dropdown-menu-sub-trigger",
1590
+ className: cn(
1591
+ "flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
1592
+ inset && "pl-8",
1593
+ className
1594
+ ),
1595
+ ...props,
1596
+ children: [
1597
+ children,
1598
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
1599
+ ]
1600
+ }
1601
+ ));
1602
+ DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
1603
+ var DropdownMenuSubContent = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1604
+ DropdownMenuPrimitive.SubContent,
1605
+ {
1606
+ ref,
1607
+ "data-slot": "dropdown-menu-sub-content",
1608
+ className: cn(MENU_SURFACE_CLASS, "shadow-lg", MENU_MOTION_CLASS, className),
1609
+ ...props
1610
+ }
1611
+ ));
1612
+ DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
1613
+ var DropdownMenuContent = React13.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
1614
+ const portalContainer = usePortalContainer(container);
1615
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1616
+ DropdownMenuPrimitive.Content,
1617
+ {
1618
+ ref,
1619
+ "data-slot": "dropdown-menu-content",
1620
+ sideOffset,
1621
+ className: cn(
1622
+ MENU_SURFACE_CLASS,
1623
+ "shadow-md",
1624
+ MENU_MOTION_CLASS,
1625
+ className
1626
+ ),
1627
+ ...props
1628
+ }
1629
+ ) });
1630
+ });
1631
+ DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
1632
+ var DropdownMenuItem = React13.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1633
+ DropdownMenuPrimitive.Item,
1634
+ {
1635
+ ref,
1636
+ "data-slot": "dropdown-menu-item",
1637
+ className: cn(MENU_ITEM_CLASS, inset && "pl-8", className),
1638
+ ...props
1639
+ }
1640
+ ));
1641
+ DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
1642
+ var DropdownMenuCheckboxItem = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1643
+ DropdownMenuPrimitive.CheckboxItem,
1644
+ {
1645
+ ref,
1646
+ "data-slot": "dropdown-menu-checkbox-item",
1647
+ className: cn(MENU_INDICATOR_ITEM_CLASS, className),
1648
+ ...props,
1649
+ children: [
1650
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
1651
+ children
1652
+ ]
1653
+ }
1654
+ ));
1655
+ DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
1656
+ var DropdownMenuRadioItem = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
1657
+ DropdownMenuPrimitive.RadioItem,
1658
+ {
1659
+ ref,
1660
+ "data-slot": "dropdown-menu-radio-item",
1661
+ className: cn(MENU_INDICATOR_ITEM_CLASS, className),
1662
+ ...props,
1663
+ children: [
1664
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
1665
+ children
1666
+ ]
1667
+ }
1668
+ ));
1669
+ DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
1670
+ var DropdownMenuLabel = React13.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1671
+ DropdownMenuPrimitive.Label,
1672
+ {
1673
+ ref,
1674
+ "data-slot": "dropdown-menu-label",
1675
+ className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
1676
+ ...props
1677
+ }
1678
+ ));
1679
+ DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
1680
+ var DropdownMenuSeparator = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1681
+ DropdownMenuPrimitive.Separator,
1682
+ {
1683
+ ref,
1684
+ "data-slot": "dropdown-menu-separator",
1685
+ className: cn("-mx-1 my-1 h-px bg-muted", className),
1686
+ ...props
1687
+ }
1688
+ ));
1689
+ DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
1690
+ var DropdownMenuShortcut = ({
1691
+ className,
1692
+ ...props
1693
+ }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1694
+ "span",
1695
+ {
1696
+ "data-slot": "dropdown-menu-shortcut",
1697
+ className: cn("ml-auto text-xs tracking-widest opacity-60", className),
1698
+ ...props
1699
+ }
1700
+ );
1701
+ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
1702
+
935
1703
  // src/editable-label.tsx
936
1704
  var import_react2 = require("react");
937
- var import_jsx_runtime10 = require("react/jsx-runtime");
1705
+ var import_jsx_runtime16 = require("react/jsx-runtime");
938
1706
  function EditableLabel({
939
1707
  value,
940
1708
  onCommit,
@@ -1041,8 +1809,8 @@ function EditableLabel({
1041
1809
  setEditing
1042
1810
  ]);
1043
1811
  if (editing) {
1044
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: cn("relative flex min-w-0 flex-1 items-center", className), children: [
1045
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1812
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: cn("relative flex min-w-0 flex-1 items-center", className), children: [
1813
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1046
1814
  "input",
1047
1815
  {
1048
1816
  ref: inputRef,
@@ -1082,12 +1850,12 @@ function EditableLabel({
1082
1850
  )
1083
1851
  }
1084
1852
  ),
1085
- busy && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Loader2Icon, { className: "absolute right-1 h-3.5 w-3.5 animate-spin text-muted-foreground" }),
1086
- error && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "absolute left-0 top-full mt-0.5 whitespace-nowrap text-xs text-destructive", children: error })
1853
+ busy && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Loader2Icon, { className: "absolute right-1 h-3.5 w-3.5 animate-spin text-muted-foreground" }),
1854
+ error && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "absolute left-0 top-full mt-0.5 whitespace-nowrap text-xs text-destructive", children: error })
1087
1855
  ] });
1088
1856
  }
1089
1857
  if (controlled) return null;
1090
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1858
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1091
1859
  "button",
1092
1860
  {
1093
1861
  type: "button",
@@ -1121,11 +1889,11 @@ function EditableLabel({
1121
1889
  }
1122
1890
 
1123
1891
  // src/input.tsx
1124
- var React7 = __toESM(require("react"), 1);
1125
- var import_jsx_runtime11 = require("react/jsx-runtime");
1892
+ var React14 = __toESM(require("react"), 1);
1893
+ var import_jsx_runtime17 = require("react/jsx-runtime");
1126
1894
  var getVariantStyles = (variant = "default") => {
1127
1895
  const baseStyles = `flex h-10 w-full border border-border bg-background text-foreground shadow-input rounded-md px-3 py-2 text-sm file:border-0 file:bg-transparent
1128
- file:text-sm file:font-medium placeholder:text-muted-foreground
1896
+ file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground
1129
1897
  focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring
1130
1898
  disabled:cursor-not-allowed disabled:opacity-50
1131
1899
  dark:shadow-none
@@ -1150,9 +1918,9 @@ var getVariantStyles = (variant = "default") => {
1150
1918
  return baseStyles;
1151
1919
  }
1152
1920
  };
1153
- var Input = React7.forwardRef(
1921
+ var Input = React14.forwardRef(
1154
1922
  ({ className, type, variant = "default", ...props }, ref) => {
1155
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1923
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1156
1924
  "input",
1157
1925
  {
1158
1926
  type,
@@ -1164,7 +1932,7 @@ var Input = React7.forwardRef(
1164
1932
  }
1165
1933
  );
1166
1934
  Input.displayName = "Input";
1167
- var EnterInput = React7.forwardRef(
1935
+ var EnterInput = React14.forwardRef(
1168
1936
  ({ onEnter, ...props }, ref) => {
1169
1937
  const handleKeyDown = (e) => {
1170
1938
  if (e.key === "Enter" && onEnter) {
@@ -1172,7 +1940,7 @@ var EnterInput = React7.forwardRef(
1172
1940
  onEnter();
1173
1941
  }
1174
1942
  };
1175
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1943
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1176
1944
  Input,
1177
1945
  {
1178
1946
  ...props,
@@ -1188,16 +1956,16 @@ var EnterInput = React7.forwardRef(
1188
1956
  }
1189
1957
  );
1190
1958
  EnterInput.displayName = "EnterInput";
1191
- var BasicInput = React7.forwardRef(
1959
+ var BasicInput = React14.forwardRef(
1192
1960
  // `variant` is accepted (prop-compatible with Input) but intentionally
1193
1961
  // unused — and destructured so it never leaks onto the DOM element.
1194
1962
  ({ className, type, variant: _variant = "default", ...props }, ref) => {
1195
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1963
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1196
1964
  "input",
1197
1965
  {
1198
1966
  type,
1199
1967
  className: cn(
1200
- "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1968
+ "flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
1201
1969
  className
1202
1970
  ),
1203
1971
  ref,
@@ -1207,10 +1975,10 @@ var BasicInput = React7.forwardRef(
1207
1975
  }
1208
1976
  );
1209
1977
  BasicInput.displayName = "BasicInput";
1210
- var InputWithPrefix = React7.forwardRef(({ prefix, className, wrapperClassName, ...props }, ref) => {
1211
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cn("relative", wrapperClassName), children: [
1212
- prefix && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
1213
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1978
+ var InputWithPrefix = React14.forwardRef(({ prefix, className, wrapperClassName, ...props }, ref) => {
1979
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("relative", wrapperClassName), children: [
1980
+ prefix && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
1981
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1214
1982
  Input,
1215
1983
  {
1216
1984
  ref,
@@ -1224,9 +1992,9 @@ InputWithPrefix.displayName = "InputWithPrefix";
1224
1992
 
1225
1993
  // src/label.tsx
1226
1994
  var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
1227
- var React8 = __toESM(require("react"), 1);
1228
- var import_jsx_runtime12 = require("react/jsx-runtime");
1229
- var Label = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1995
+ var React15 = __toESM(require("react"), 1);
1996
+ var import_jsx_runtime18 = require("react/jsx-runtime");
1997
+ var Label3 = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
1230
1998
  LabelPrimitive.Root,
1231
1999
  {
1232
2000
  ref,
@@ -1237,11 +2005,11 @@ var Label = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
1237
2005
  ...props
1238
2006
  }
1239
2007
  ));
1240
- Label.displayName = LabelPrimitive.Root.displayName;
2008
+ Label3.displayName = LabelPrimitive.Root.displayName;
1241
2009
 
1242
2010
  // src/overflow-toolbar.tsx
1243
2011
  var import_react3 = require("react");
1244
- var import_jsx_runtime13 = require("react/jsx-runtime");
2012
+ var import_jsx_runtime19 = require("react/jsx-runtime");
1245
2013
  var GAP_PX = 6;
1246
2014
  var TONE = {
1247
2015
  default: "border border-border bg-background hover:bg-accent text-foreground",
@@ -1263,16 +2031,16 @@ function ToolbarButton({
1263
2031
  action.hideLabel && !action.running ? "w-7 justify-center px-0" : "px-2",
1264
2032
  TONE[tone]
1265
2033
  );
1266
- const inner = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
1267
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2034
+ const inner = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
2035
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1268
2036
  Icon2,
1269
2037
  {
1270
2038
  className: cn("w-3.5 h-3.5 shrink-0", action.running && "animate-spin")
1271
2039
  }
1272
2040
  ),
1273
- showLabel && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: text })
2041
+ showLabel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: text })
1274
2042
  ] });
1275
- const control = action.href && !action.disabled ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2043
+ const control = action.href && !action.disabled ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1276
2044
  "a",
1277
2045
  {
1278
2046
  href: action.href,
@@ -1282,7 +2050,7 @@ function ToolbarButton({
1282
2050
  "aria-label": action.label,
1283
2051
  children: inner
1284
2052
  }
1285
- ) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2053
+ ) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1286
2054
  "button",
1287
2055
  {
1288
2056
  type: "button",
@@ -1294,12 +2062,12 @@ function ToolbarButton({
1294
2062
  }
1295
2063
  );
1296
2064
  if (enableTooltip && action.hideLabel && renderTooltip) {
1297
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, { children: renderTooltip(control, action.label) });
2065
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: renderTooltip(control, action.label) });
1298
2066
  }
1299
2067
  return control;
1300
2068
  }
1301
2069
  function OverflowTrigger({ ariaLabel }) {
1302
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2070
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1303
2071
  "button",
1304
2072
  {
1305
2073
  type: "button",
@@ -1310,7 +2078,7 @@ function OverflowTrigger({ ariaLabel }) {
1310
2078
  "inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors",
1311
2079
  "border border-border bg-background hover:bg-accent text-foreground"
1312
2080
  ),
1313
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(MoreHorizontalIcon, { className: "w-3.5 h-3.5" })
2081
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MoreHorizontalIcon, { className: "w-3.5 h-3.5" })
1314
2082
  }
1315
2083
  );
1316
2084
  }
@@ -1370,22 +2138,22 @@ function OverflowToolbar({
1370
2138
  }, [signature, leading != null]);
1371
2139
  const shown = visibleActions.slice(0, visibleCount);
1372
2140
  const hidden = visibleActions.slice(visibleCount);
1373
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { ref: containerRef, className: cn("relative min-w-0", className), children: [
1374
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2141
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: containerRef, className: cn("relative min-w-0", className), children: [
2142
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1375
2143
  "div",
1376
2144
  {
1377
2145
  ref: ghostRef,
1378
2146
  "aria-hidden": true,
1379
2147
  className: "pointer-events-none absolute left-0 top-0 flex items-center gap-1.5 opacity-0",
1380
2148
  children: [
1381
- visibleActions.map((a) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ToolbarButton, { action: a }, a.id)),
1382
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OverflowTrigger, { ariaLabel: overflowAriaLabel })
2149
+ visibleActions.map((a) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToolbarButton, { action: a }, a.id)),
2150
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OverflowTrigger, { ariaLabel: overflowAriaLabel })
1383
2151
  ]
1384
2152
  }
1385
2153
  ),
1386
- /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [
1387
- leading != null && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { ref: leadingRef, className: "shrink-0", children: leading }),
1388
- shown.map((a) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2154
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [
2155
+ leading != null && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { ref: leadingRef, className: "shrink-0", children: leading }),
2156
+ shown.map((a) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1389
2157
  ToolbarButton,
1390
2158
  {
1391
2159
  action: a,
@@ -1396,14 +2164,118 @@ function OverflowToolbar({
1396
2164
  )),
1397
2165
  hidden.length > 0 && renderOverflowMenu({
1398
2166
  actions: hidden,
1399
- trigger: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(OverflowTrigger, { ariaLabel: overflowAriaLabel })
2167
+ trigger: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OverflowTrigger, { ariaLabel: overflowAriaLabel })
1400
2168
  })
1401
2169
  ] })
1402
2170
  ] });
1403
2171
  }
1404
2172
 
2173
+ // src/progress.tsx
2174
+ var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
2175
+ var React17 = __toESM(require("react"), 1);
2176
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2177
+ var PROGRESS_TONES = {
2178
+ default: "bg-primary",
2179
+ success: "bg-success",
2180
+ warning: "bg-warning",
2181
+ destructive: "bg-destructive"
2182
+ };
2183
+ var Progress = React17.forwardRef(({ className, tone = "default", indicatorClassName, ...props }, ref) => {
2184
+ const { value, max } = props;
2185
+ const ceiling = max ?? 100;
2186
+ const isIndeterminate = value === null || value === void 0;
2187
+ const pct = isIndeterminate ? 0 : Math.min(100, Math.max(0, value / ceiling * 100));
2188
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2189
+ ProgressPrimitive.Root,
2190
+ {
2191
+ ref,
2192
+ "data-slot": "progress",
2193
+ className: cn(
2194
+ "relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
2195
+ className
2196
+ ),
2197
+ ...props,
2198
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2199
+ ProgressPrimitive.Indicator,
2200
+ {
2201
+ "data-slot": "progress-indicator",
2202
+ className: cn(
2203
+ "h-full w-full flex-1 transition-all",
2204
+ PROGRESS_TONES[tone],
2205
+ isIndeterminate && "matrx-progress-indeterminate",
2206
+ indicatorClassName
2207
+ ),
2208
+ style: isIndeterminate ? void 0 : { transform: `translateX(-${100 - pct}%)` }
2209
+ }
2210
+ )
2211
+ }
2212
+ );
2213
+ });
2214
+ Progress.displayName = ProgressPrimitive.Root.displayName;
2215
+
2216
+ // src/scroll-area.tsx
2217
+ var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
2218
+ var React18 = __toESM(require("react"), 1);
2219
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2220
+ var ScrollArea = React18.forwardRef(
2221
+ ({
2222
+ className,
2223
+ children,
2224
+ viewportClassName,
2225
+ viewportRef,
2226
+ scrollBarClassName,
2227
+ orientation = "vertical",
2228
+ ...props
2229
+ }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2230
+ ScrollAreaPrimitive.Root,
2231
+ {
2232
+ ref,
2233
+ "data-slot": "scroll-area",
2234
+ className: cn("relative overflow-hidden", className),
2235
+ ...props,
2236
+ children: [
2237
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2238
+ ScrollAreaPrimitive.Viewport,
2239
+ {
2240
+ ref: viewportRef,
2241
+ "data-slot": "scroll-area-viewport",
2242
+ className: cn("h-full w-full rounded-[inherit]", viewportClassName),
2243
+ children
2244
+ }
2245
+ ),
2246
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScrollBar, { orientation, className: scrollBarClassName }),
2247
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScrollAreaPrimitive.Corner, {})
2248
+ ]
2249
+ }
2250
+ )
2251
+ );
2252
+ ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
2253
+ var ScrollBar = React18.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2254
+ ScrollAreaPrimitive.ScrollAreaScrollbar,
2255
+ {
2256
+ ref,
2257
+ "data-slot": "scroll-area-scrollbar",
2258
+ orientation,
2259
+ className: cn(
2260
+ "flex touch-none select-none transition-colors",
2261
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
2262
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
2263
+ className
2264
+ ),
2265
+ ...props,
2266
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
2267
+ ScrollAreaPrimitive.ScrollAreaThumb,
2268
+ {
2269
+ "data-slot": "scroll-area-thumb",
2270
+ className: "relative flex-1 rounded-full bg-border"
2271
+ }
2272
+ )
2273
+ }
2274
+ ));
2275
+ ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
2276
+
1405
2277
  // src/score-ring.tsx
1406
- var import_jsx_runtime14 = require("react/jsx-runtime");
2278
+ var import_jsx_runtime22 = require("react/jsx-runtime");
1407
2279
  var DEFAULT_SCORE_THRESHOLDS = {
1408
2280
  good: 75,
1409
2281
  warning: 50
@@ -1434,7 +2306,7 @@ function ScoreRing({
1434
2306
  const circumference = 2 * Math.PI * radius;
1435
2307
  const boundedPct = pct === null ? 0 : Math.max(0, Math.min(100, pct));
1436
2308
  const dashOffset = circumference * (1 - boundedPct / 100);
1437
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2309
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
1438
2310
  "div",
1439
2311
  {
1440
2312
  className: cn(
@@ -1445,8 +2317,8 @@ function ScoreRing({
1445
2317
  role: "img",
1446
2318
  "aria-label": `${label ?? "Score"}: ${pct === null ? "not available" : `${pct} out of 100`}`,
1447
2319
  children: [
1448
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full w-full -rotate-90", children: [
1449
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2320
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full w-full -rotate-90", children: [
2321
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1450
2322
  "circle",
1451
2323
  {
1452
2324
  cx: "50",
@@ -1457,7 +2329,7 @@ function ScoreRing({
1457
2329
  fill: "none"
1458
2330
  }
1459
2331
  ),
1460
- pct !== null ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2332
+ pct !== null ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1461
2333
  "circle",
1462
2334
  {
1463
2335
  cx: "50",
@@ -1476,8 +2348,8 @@ function ScoreRing({
1476
2348
  }
1477
2349
  ) : null
1478
2350
  ] }),
1479
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "absolute flex flex-col items-center justify-center", children: [
1480
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2351
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "absolute flex flex-col items-center justify-center", children: [
2352
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1481
2353
  "span",
1482
2354
  {
1483
2355
  className: cn(
@@ -1487,7 +2359,7 @@ function ScoreRing({
1487
2359
  children: pct === null ? "\u2014" : `${pct}${suffix}`
1488
2360
  }
1489
2361
  ),
1490
- label ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "max-w-[74px] truncate text-[9px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }) : null
2362
+ label ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "max-w-[74px] truncate text-[9px] font-semibold uppercase tracking-wide text-muted-foreground", children: label }) : null
1491
2363
  ] })
1492
2364
  ]
1493
2365
  }
@@ -1495,7 +2367,7 @@ function ScoreRing({
1495
2367
  }
1496
2368
 
1497
2369
  // src/segmented-control.tsx
1498
- var import_jsx_runtime15 = require("react/jsx-runtime");
2370
+ var import_jsx_runtime23 = require("react/jsx-runtime");
1499
2371
  function SegmentedControl({
1500
2372
  value,
1501
2373
  onValueChange,
@@ -1510,7 +2382,7 @@ function SegmentedControl({
1510
2382
  md: "h-9 text-sm",
1511
2383
  lg: "h-10 text-base"
1512
2384
  };
1513
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2385
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1514
2386
  "div",
1515
2387
  {
1516
2388
  className: cn(
@@ -1521,7 +2393,7 @@ function SegmentedControl({
1521
2393
  role: "tablist",
1522
2394
  children: data.map((option) => {
1523
2395
  const isActive = value === option.value;
1524
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2396
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1525
2397
  "button",
1526
2398
  {
1527
2399
  type: "button",
@@ -1548,8 +2420,8 @@ function SegmentedControl({
1548
2420
  // src/select.tsx
1549
2421
  var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
1550
2422
  var import_class_variance_authority3 = require("class-variance-authority");
1551
- var React10 = __toESM(require("react"), 1);
1552
- var import_jsx_runtime16 = require("react/jsx-runtime");
2423
+ var React19 = __toESM(require("react"), 1);
2424
+ var import_jsx_runtime24 = require("react/jsx-runtime");
1553
2425
  var Select = SelectPrimitive.Root;
1554
2426
  var SelectGroup = SelectPrimitive.Group;
1555
2427
  var SelectValue = SelectPrimitive.Value;
@@ -1568,7 +2440,7 @@ var selectTriggerVariants = (0, import_class_variance_authority3.cva)(
1568
2440
  }
1569
2441
  }
1570
2442
  );
1571
- var SelectTrigger = React10.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2443
+ var SelectTrigger = React19.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1572
2444
  SelectPrimitive.Trigger,
1573
2445
  {
1574
2446
  ref,
@@ -1576,12 +2448,12 @@ var SelectTrigger = React10.forwardRef(({ className, children, hideArrow = false
1576
2448
  ...props,
1577
2449
  children: [
1578
2450
  children,
1579
- !hideArrow && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(RadixChevronDownIcon, { className: "h-4 w-4 opacity-50" }) })
2451
+ !hideArrow && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadixChevronDownIcon, { className: "h-4 w-4 opacity-50" }) })
1580
2452
  ]
1581
2453
  }
1582
2454
  ));
1583
2455
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
1584
- var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2456
+ var SelectScrollUpButton = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1585
2457
  SelectPrimitive.ScrollUpButton,
1586
2458
  {
1587
2459
  ref,
@@ -1590,11 +2462,11 @@ var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) =>
1590
2462
  className
1591
2463
  ),
1592
2464
  ...props,
1593
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(RadixChevronUpIcon, {})
2465
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadixChevronUpIcon, {})
1594
2466
  }
1595
2467
  ));
1596
2468
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
1597
- var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2469
+ var SelectScrollDownButton = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1598
2470
  SelectPrimitive.ScrollDownButton,
1599
2471
  {
1600
2472
  ref,
@@ -1603,13 +2475,13 @@ var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) =
1603
2475
  className
1604
2476
  ),
1605
2477
  ...props,
1606
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(RadixChevronDownIcon, {})
2478
+ children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadixChevronDownIcon, {})
1607
2479
  }
1608
2480
  ));
1609
2481
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
1610
- var SelectContent = React10.forwardRef(({ className, children, position = "popper", container, ...props }, ref) => {
2482
+ var SelectContent = React19.forwardRef(({ className, children, position = "popper", container, ...props }, ref) => {
1611
2483
  const portalContainer = usePortalContainer(container);
1612
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2484
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1613
2485
  SelectPrimitive.Content,
1614
2486
  {
1615
2487
  ref,
@@ -1621,8 +2493,8 @@ var SelectContent = React10.forwardRef(({ className, children, position = "poppe
1621
2493
  position,
1622
2494
  ...props,
1623
2495
  children: [
1624
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectScrollUpButton, {}),
1625
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2496
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollUpButton, {}),
2497
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1626
2498
  SelectPrimitive.Viewport,
1627
2499
  {
1628
2500
  className: cn(
@@ -1632,13 +2504,13 @@ var SelectContent = React10.forwardRef(({ className, children, position = "poppe
1632
2504
  children
1633
2505
  }
1634
2506
  ),
1635
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectScrollDownButton, {})
2507
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollDownButton, {})
1636
2508
  ]
1637
2509
  }
1638
2510
  ) });
1639
2511
  });
1640
2512
  SelectContent.displayName = SelectPrimitive.Content.displayName;
1641
- var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2513
+ var SelectLabel = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1642
2514
  SelectPrimitive.Label,
1643
2515
  {
1644
2516
  ref,
@@ -1647,7 +2519,7 @@ var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
1647
2519
  }
1648
2520
  ));
1649
2521
  SelectLabel.displayName = SelectPrimitive.Label.displayName;
1650
- var SelectItem = React10.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2522
+ var SelectItem = React19.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
1651
2523
  SelectPrimitive.Item,
1652
2524
  {
1653
2525
  ref,
@@ -1658,14 +2530,14 @@ var SelectItem = React10.forwardRef(({ className, children, description, ...prop
1658
2530
  ),
1659
2531
  ...props,
1660
2532
  children: [
1661
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
1662
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SelectPrimitive.ItemText, { children }),
1663
- description ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "block text-xs leading-snug text-muted-foreground", children: description }) : null
2533
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CheckIcon, { className: "h-4 w-4" }) }) }),
2534
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemText, { children }),
2535
+ description ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "block text-xs leading-snug text-muted-foreground", children: description }) : null
1664
2536
  ]
1665
2537
  }
1666
2538
  ));
1667
2539
  SelectItem.displayName = SelectPrimitive.Item.displayName;
1668
- var SelectSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2540
+ var SelectSeparator = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1669
2541
  SelectPrimitive.Separator,
1670
2542
  {
1671
2543
  ref,
@@ -1677,9 +2549,9 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
1677
2549
 
1678
2550
  // src/separator.tsx
1679
2551
  var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
1680
- var React11 = __toESM(require("react"), 1);
1681
- var import_jsx_runtime17 = require("react/jsx-runtime");
1682
- var Separator2 = React11.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2552
+ var React20 = __toESM(require("react"), 1);
2553
+ var import_jsx_runtime25 = require("react/jsx-runtime");
2554
+ var Separator4 = React20.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
1683
2555
  SeparatorPrimitive.Root,
1684
2556
  {
1685
2557
  ref,
@@ -1693,17 +2565,17 @@ var Separator2 = React11.forwardRef(({ className, orientation = "horizontal", de
1693
2565
  ...props
1694
2566
  }
1695
2567
  ));
1696
- Separator2.displayName = SeparatorPrimitive.Root.displayName;
2568
+ Separator4.displayName = SeparatorPrimitive.Root.displayName;
1697
2569
 
1698
2570
  // src/sheet.tsx
1699
2571
  var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
1700
- var import_react_tree = require("@ai-matrx/kit/react-tree");
2572
+ var import_react_tree2 = require("@ai-matrx/kit/react-tree");
1701
2573
  var import_class_variance_authority4 = require("class-variance-authority");
1702
- var React12 = __toESM(require("react"), 1);
1703
- var import_jsx_runtime18 = require("react/jsx-runtime");
1704
- var SheetContentBase = React12.forwardRef(({ ...props }, ref) => {
2574
+ var React21 = __toESM(require("react"), 1);
2575
+ var import_jsx_runtime26 = require("react/jsx-runtime");
2576
+ var SheetContentBase = React21.forwardRef(({ ...props }, ref) => {
1705
2577
  const isModal = useRadixDialogModal();
1706
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2578
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1707
2579
  SheetPrimitive.Content,
1708
2580
  {
1709
2581
  ...props,
@@ -1713,15 +2585,15 @@ var SheetContentBase = React12.forwardRef(({ ...props }, ref) => {
1713
2585
  );
1714
2586
  });
1715
2587
  SheetContentBase.displayName = "SheetContentBase";
1716
- var Sheet = React12.forwardRef(({ children, ...props }, _ref) => {
2588
+ var Sheet = React21.forwardRef(({ children, ...props }, _ref) => {
1717
2589
  const modal = props.modal ?? true;
1718
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SheetPrimitive.Root, { ...props, modal, children }) });
2590
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SheetPrimitive.Root, { ...props, modal, children }) });
1719
2591
  });
1720
2592
  Sheet.displayName = "Sheet";
1721
2593
  var SheetTrigger = SheetPrimitive.Trigger;
1722
2594
  var SheetClose = SheetPrimitive.Close;
1723
2595
  var SheetPortal = SheetPrimitive.Portal;
1724
- var SheetOverlay = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2596
+ var SheetOverlay = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1725
2597
  SheetPrimitive.Overlay,
1726
2598
  {
1727
2599
  className: cn(
@@ -1750,7 +2622,7 @@ var sheetVariants = (0, import_class_variance_authority4.cva)(
1750
2622
  }
1751
2623
  }
1752
2624
  );
1753
- var SheetDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2625
+ var SheetDescription = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1754
2626
  SheetPrimitive.Description,
1755
2627
  {
1756
2628
  ref,
@@ -1759,7 +2631,7 @@ var SheetDescription = React12.forwardRef(({ className, ...props }, ref) => /* @
1759
2631
  }
1760
2632
  ));
1761
2633
  SheetDescription.displayName = SheetPrimitive.Description.displayName;
1762
- var SheetContent = React12.forwardRef(
2634
+ var SheetContent = React21.forwardRef(
1763
2635
  ({
1764
2636
  side = "right",
1765
2637
  className,
@@ -1769,10 +2641,10 @@ var SheetContent = React12.forwardRef(
1769
2641
  overlayClassName,
1770
2642
  ...props
1771
2643
  }, ref) => {
1772
- const hasDescription = (0, import_react_tree.treeContainsComponent)(children, SheetDescription) || (0, import_react_tree.treeContainsComponent)(children, SheetPrimitive.Description);
1773
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SheetPortal, { children: [
1774
- !hideOverlay && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(SheetOverlay, { className: overlayClassName }),
1775
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2644
+ const hasDescription = (0, import_react_tree2.treeContainsComponent)(children, SheetDescription) || (0, import_react_tree2.treeContainsComponent)(children, SheetPrimitive.Description);
2645
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(SheetPortal, { children: [
2646
+ !hideOverlay && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SheetOverlay, { className: overlayClassName }),
2647
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
1776
2648
  SheetContentBase,
1777
2649
  {
1778
2650
  ref,
@@ -1780,9 +2652,9 @@ var SheetContent = React12.forwardRef(
1780
2652
  ...hasDescription ? {} : { "aria-describedby": void 0 },
1781
2653
  ...props,
1782
2654
  children: [
1783
- !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
1784
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Cross2Icon, { className: "h-4 w-4" }),
1785
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "sr-only", children: "Close" })
2655
+ !hideCloseButton && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary", children: [
2656
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Cross2Icon, { className: "h-4 w-4" }),
2657
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sr-only", children: "Close" })
1786
2658
  ] }),
1787
2659
  children
1788
2660
  ]
@@ -1795,7 +2667,7 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
1795
2667
  var SheetHeader = ({
1796
2668
  className,
1797
2669
  ...props
1798
- }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2670
+ }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1799
2671
  "div",
1800
2672
  {
1801
2673
  className: cn(
@@ -1809,7 +2681,7 @@ SheetHeader.displayName = "SheetHeader";
1809
2681
  var SheetFooter = ({
1810
2682
  className,
1811
2683
  ...props
1812
- }) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2684
+ }) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1813
2685
  "div",
1814
2686
  {
1815
2687
  className: cn(
@@ -1820,7 +2692,7 @@ var SheetFooter = ({
1820
2692
  }
1821
2693
  );
1822
2694
  SheetFooter.displayName = "SheetFooter";
1823
- var SheetTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2695
+ var SheetTitle = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
1824
2696
  SheetPrimitive.Title,
1825
2697
  {
1826
2698
  ref,
@@ -1831,12 +2703,12 @@ var SheetTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE
1831
2703
  SheetTitle.displayName = SheetPrimitive.Title.displayName;
1832
2704
 
1833
2705
  // src/skeleton.tsx
1834
- var import_jsx_runtime19 = require("react/jsx-runtime");
2706
+ var import_jsx_runtime27 = require("react/jsx-runtime");
1835
2707
  function Skeleton({
1836
2708
  className,
1837
2709
  ...props
1838
2710
  }) {
1839
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2711
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
1840
2712
  "div",
1841
2713
  {
1842
2714
  className: cn("animate-pulse rounded-md bg-primary/10", className),
@@ -1845,9 +2717,48 @@ function Skeleton({
1845
2717
  );
1846
2718
  }
1847
2719
 
2720
+ // src/switch.tsx
2721
+ var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
2722
+ var React22 = __toESM(require("react"), 1);
2723
+ var import_jsx_runtime28 = require("react/jsx-runtime");
2724
+ var SWITCH_SIZES = {
2725
+ sm: {
2726
+ root: "h-4 w-9 border-border data-[state=unchecked]:bg-input",
2727
+ thumb: "h-4 w-4 border border-primary data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
2728
+ },
2729
+ md: {
2730
+ root: "h-5 w-9 border-transparent data-[state=unchecked]:bg-input",
2731
+ thumb: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
2732
+ }
2733
+ };
2734
+ var Switch = React22.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2735
+ SwitchPrimitives.Root,
2736
+ {
2737
+ ref,
2738
+ "data-slot": "switch",
2739
+ className: cn(
2740
+ "peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary",
2741
+ SWITCH_SIZES[size].root,
2742
+ className
2743
+ ),
2744
+ ...props,
2745
+ children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
2746
+ SwitchPrimitives.Thumb,
2747
+ {
2748
+ "data-slot": "switch-thumb",
2749
+ className: cn(
2750
+ "pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",
2751
+ SWITCH_SIZES[size].thumb
2752
+ )
2753
+ }
2754
+ )
2755
+ }
2756
+ ));
2757
+ Switch.displayName = SwitchPrimitives.Root.displayName;
2758
+
1848
2759
  // src/tabbed-bottom-sheet.tsx
1849
2760
  var import_react4 = require("react");
1850
- var import_jsx_runtime20 = require("react/jsx-runtime");
2761
+ var import_jsx_runtime29 = require("react/jsx-runtime");
1851
2762
  function TabbedBottomSheet({
1852
2763
  open,
1853
2764
  onOpenChange,
@@ -1861,15 +2772,15 @@ function TabbedBottomSheet({
1861
2772
  if (open) setSelectedTabId(null);
1862
2773
  }
1863
2774
  const selectedTab = selectedTabId ? tabs.find((tab) => tab.id === selectedTabId) : null;
1864
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2775
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1865
2776
  BottomSheet,
1866
2777
  {
1867
2778
  open,
1868
2779
  onOpenChange,
1869
2780
  title,
1870
2781
  size: "full",
1871
- children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "matrx-mobile-sheet flex min-h-0 flex-1 flex-col", children: [
1872
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
2782
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "matrx-mobile-sheet flex min-h-0 flex-1 flex-col", children: [
2783
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
1873
2784
  BottomSheetHeader,
1874
2785
  {
1875
2786
  title: selectedTab ? selectedTab.label : title,
@@ -1877,19 +2788,19 @@ function TabbedBottomSheet({
1877
2788
  onBack: () => setSelectedTabId(null)
1878
2789
  }
1879
2790
  ),
1880
- selectedTab ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden pb-safe", children: selectedTab.content }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(BottomSheetBody, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { className: "divide-y divide-border", children: tabs.map((tab) => {
2791
+ selectedTab ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden pb-safe", children: selectedTab.content }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(BottomSheetBody, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("ul", { className: "divide-y divide-border", children: tabs.map((tab) => {
1881
2792
  const Icon2 = tab.icon;
1882
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2793
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
1883
2794
  "button",
1884
2795
  {
1885
2796
  type: "button",
1886
2797
  onClick: () => setSelectedTabId(tab.id),
1887
2798
  className: "flex w-full items-center gap-3 px-4 py-3.5 text-left transition-colors hover:bg-muted/60 active:bg-muted",
1888
2799
  children: [
1889
- Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Icon2, { className: "h-5 w-5 shrink-0 text-muted-foreground" }) : null,
1890
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "min-w-0 flex-1 text-base text-foreground", children: tab.label }),
2800
+ Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon2, { className: "h-5 w-5 shrink-0 text-muted-foreground" }) : null,
2801
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "min-w-0 flex-1 text-base text-foreground", children: tab.label }),
1891
2802
  tab.trailing,
1892
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ChevronRightIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" })
2803
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronRightIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" })
1893
2804
  ]
1894
2805
  }
1895
2806
  ) }, tab.id);
@@ -1899,6 +2810,331 @@ function TabbedBottomSheet({
1899
2810
  );
1900
2811
  }
1901
2812
 
2813
+ // src/table.tsx
2814
+ var React23 = __toESM(require("react"), 1);
2815
+ var import_jsx_runtime30 = require("react/jsx-runtime");
2816
+ var TABLE_SIZES = {
2817
+ sm: { head: "px-2", cell: "p-2" },
2818
+ md: { head: "px-3", cell: "p-3" }
2819
+ };
2820
+ var TableSizeContext = React23.createContext("md");
2821
+ function useTableSize() {
2822
+ return React23.useContext(TableSizeContext);
2823
+ }
2824
+ var Table = React23.forwardRef(
2825
+ ({ className, size = "md", wrap = true, wrapperClassName, ...props }, ref) => {
2826
+ const table = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2827
+ "table",
2828
+ {
2829
+ ref,
2830
+ "data-slot": "table",
2831
+ "data-size": size,
2832
+ className: cn("w-full caption-bottom text-sm", className),
2833
+ ...props
2834
+ }
2835
+ );
2836
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableSizeContext.Provider, { value: size, children: wrap ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2837
+ "div",
2838
+ {
2839
+ "data-slot": "table-wrapper",
2840
+ className: cn("relative w-full overflow-auto", wrapperClassName),
2841
+ children: table
2842
+ }
2843
+ ) : table });
2844
+ }
2845
+ );
2846
+ Table.displayName = "Table";
2847
+ var TableHeader = React23.forwardRef(({ className, sticky = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2848
+ "thead",
2849
+ {
2850
+ ref,
2851
+ "data-slot": "table-header",
2852
+ className: cn(
2853
+ "[&_tr]:border-b",
2854
+ sticky && "sticky top-0 z-10 bg-background",
2855
+ className
2856
+ ),
2857
+ ...props
2858
+ }
2859
+ ));
2860
+ TableHeader.displayName = "TableHeader";
2861
+ var TableBody = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2862
+ "tbody",
2863
+ {
2864
+ ref,
2865
+ "data-slot": "table-body",
2866
+ className: cn("[&_tr:last-child]:border-0", className),
2867
+ ...props
2868
+ }
2869
+ ));
2870
+ TableBody.displayName = "TableBody";
2871
+ var TableFooter = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2872
+ "tfoot",
2873
+ {
2874
+ ref,
2875
+ "data-slot": "table-footer",
2876
+ className: cn(
2877
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
2878
+ className
2879
+ ),
2880
+ ...props
2881
+ }
2882
+ ));
2883
+ TableFooter.displayName = "TableFooter";
2884
+ var TableRow = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2885
+ "tr",
2886
+ {
2887
+ ref,
2888
+ "data-slot": "table-row",
2889
+ className: cn(
2890
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
2891
+ className
2892
+ ),
2893
+ ...props
2894
+ }
2895
+ ));
2896
+ TableRow.displayName = "TableRow";
2897
+ var TableHead = React23.forwardRef(({ className, ...props }, ref) => {
2898
+ const size = useTableSize();
2899
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2900
+ "th",
2901
+ {
2902
+ ref,
2903
+ "data-slot": "table-head",
2904
+ className: cn(
2905
+ "h-10 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
2906
+ TABLE_SIZES[size].head,
2907
+ className
2908
+ ),
2909
+ ...props
2910
+ }
2911
+ );
2912
+ });
2913
+ TableHead.displayName = "TableHead";
2914
+ var TableCell = React23.forwardRef(({ className, ...props }, ref) => {
2915
+ const size = useTableSize();
2916
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2917
+ "td",
2918
+ {
2919
+ ref,
2920
+ "data-slot": "table-cell",
2921
+ className: cn(
2922
+ "align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
2923
+ TABLE_SIZES[size].cell,
2924
+ className
2925
+ ),
2926
+ ...props
2927
+ }
2928
+ );
2929
+ });
2930
+ TableCell.displayName = "TableCell";
2931
+ var TableCaption = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
2932
+ "caption",
2933
+ {
2934
+ ref,
2935
+ "data-slot": "table-caption",
2936
+ className: cn("mt-4 text-sm text-muted-foreground", className),
2937
+ ...props
2938
+ }
2939
+ ));
2940
+ TableCaption.displayName = "TableCaption";
2941
+
2942
+ // src/tabs.tsx
2943
+ var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
2944
+ var React24 = __toESM(require("react"), 1);
2945
+ var import_jsx_runtime31 = require("react/jsx-runtime");
2946
+ var Tabs = TabsPrimitive.Root;
2947
+ var TABS_TRIGGER_BASE = "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm";
2948
+ var TabsList = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2949
+ TabsPrimitive.List,
2950
+ {
2951
+ ref,
2952
+ "data-slot": "tabs-list",
2953
+ className: cn(
2954
+ "inline-flex h-9 items-center justify-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground",
2955
+ className
2956
+ ),
2957
+ ...props
2958
+ }
2959
+ ));
2960
+ TabsList.displayName = TabsPrimitive.List.displayName;
2961
+ var TabsTrigger = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2962
+ TabsPrimitive.Trigger,
2963
+ {
2964
+ ref,
2965
+ "data-slot": "tabs-trigger",
2966
+ className: cn(
2967
+ TABS_TRIGGER_BASE,
2968
+ "text-muted-foreground hover:text-foreground",
2969
+ className
2970
+ ),
2971
+ ...props
2972
+ }
2973
+ ));
2974
+ TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
2975
+ var TabsTriggerCore = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2976
+ TabsPrimitive.Trigger,
2977
+ {
2978
+ ref,
2979
+ "data-slot": "tabs-trigger",
2980
+ className: cn(TABS_TRIGGER_BASE, className),
2981
+ ...props
2982
+ }
2983
+ ));
2984
+ TabsTriggerCore.displayName = TabsPrimitive.Trigger.displayName;
2985
+ var TabsContent = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
2986
+ TabsPrimitive.Content,
2987
+ {
2988
+ ref,
2989
+ "data-slot": "tabs-content",
2990
+ className: cn(
2991
+ "data-[state=inactive]:hidden",
2992
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
2993
+ className
2994
+ ),
2995
+ ...props
2996
+ }
2997
+ ));
2998
+ TabsContent.displayName = TabsPrimitive.Content.displayName;
2999
+
3000
+ // src/textarea.tsx
3001
+ var React25 = __toESM(require("react"), 1);
3002
+ var import_jsx_runtime32 = require("react/jsx-runtime");
3003
+ var FILL_HEIGHT_REGEX = /(?:^|\s)(h-full|h-dvh|flex-1|grow)(?:\s|$)/;
3004
+ var FILL_WIDTH_REGEX = /(?:^|\s)(w-full|w-screen)(?:\s|$)/;
3005
+ function getStretchClasses(className) {
3006
+ if (!className) return void 0;
3007
+ const fills = [];
3008
+ if (FILL_HEIGHT_REGEX.test(className)) fills.push("h-full min-h-0");
3009
+ if (FILL_WIDTH_REGEX.test(className)) fills.push("w-full");
3010
+ return fills.length ? fills.join(" ") : void 0;
3011
+ }
3012
+ var TEXTAREA_ELEVATED_CLASS = "flex h-auto w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground shadow-textarea transition duration-400 placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
3013
+ var TEXTAREA_CONTROL_CLASS = "flex w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm text-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";
3014
+ function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
3015
+ React25.useEffect(() => {
3016
+ if (!autoGrow || !ref.current) return;
3017
+ const textarea = ref.current;
3018
+ textarea.style.height = "auto";
3019
+ let newHeight = textarea.scrollHeight;
3020
+ if (minHeight) newHeight = Math.max(newHeight, minHeight);
3021
+ if (maxHeight && newHeight >= maxHeight) {
3022
+ textarea.style.height = `${maxHeight}px`;
3023
+ textarea.style.overflowY = "auto";
3024
+ } else {
3025
+ textarea.style.height = `${newHeight}px`;
3026
+ textarea.style.overflowY = "hidden";
3027
+ }
3028
+ }, [value, autoGrow, minHeight, maxHeight, ref]);
3029
+ }
3030
+ function useMergedTextareaRef(forwarded) {
3031
+ const internal = React25.useRef(null);
3032
+ const callback = React25.useCallback(
3033
+ (node) => {
3034
+ internal.current = node;
3035
+ if (typeof forwarded === "function") forwarded(node);
3036
+ else if (forwarded) forwarded.current = node;
3037
+ },
3038
+ [forwarded]
3039
+ );
3040
+ return { ref: internal, callback };
3041
+ }
3042
+ function boxStyle(minHeight, maxHeight) {
3043
+ if (minHeight === void 0 && maxHeight === void 0) return void 0;
3044
+ return {
3045
+ minHeight: minHeight ? `${minHeight}px` : void 0,
3046
+ maxHeight: maxHeight ? `${maxHeight}px` : void 0
3047
+ };
3048
+ }
3049
+ var Textarea = React25.forwardRef(
3050
+ ({ className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props }, forwarded) => {
3051
+ const { ref, callback } = useMergedTextareaRef(forwarded);
3052
+ const stretchClasses = getStretchClasses(className);
3053
+ const needsWrapper = Boolean(wrapperClassName || stretchClasses);
3054
+ useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
3055
+ const textarea = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3056
+ "textarea",
3057
+ {
3058
+ ref: callback,
3059
+ "data-slot": "textarea",
3060
+ className: cn(
3061
+ TEXTAREA_ELEVATED_CLASS,
3062
+ autoGrow && "resize-none",
3063
+ stretchClasses,
3064
+ className
3065
+ ),
3066
+ style: boxStyle(minHeight, maxHeight),
3067
+ ...props
3068
+ }
3069
+ );
3070
+ if (!needsWrapper) return textarea;
3071
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn(stretchClasses, wrapperClassName), children: textarea });
3072
+ }
3073
+ );
3074
+ Textarea.displayName = "Textarea";
3075
+ var BasicTextarea = React25.forwardRef(
3076
+ ({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {
3077
+ const { ref, callback } = useMergedTextareaRef(forwarded);
3078
+ useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
3079
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3080
+ "textarea",
3081
+ {
3082
+ ref: callback,
3083
+ "data-slot": "textarea",
3084
+ className: cn(
3085
+ TEXTAREA_CONTROL_CLASS,
3086
+ "h-auto min-h-[60px]",
3087
+ autoGrow && "resize-none",
3088
+ className
3089
+ ),
3090
+ style: boxStyle(minHeight, maxHeight),
3091
+ ...props
3092
+ }
3093
+ );
3094
+ }
3095
+ );
3096
+ BasicTextarea.displayName = "BasicTextarea";
3097
+ var TextareaWithPrefix = React25.forwardRef(
3098
+ ({
3099
+ prefix,
3100
+ className,
3101
+ wrapperClassName,
3102
+ autoGrow,
3103
+ minHeight,
3104
+ maxHeight,
3105
+ ...props
3106
+ }, forwarded) => {
3107
+ const { ref, callback } = useMergedTextareaRef(forwarded);
3108
+ useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
3109
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
3110
+ "div",
3111
+ {
3112
+ className: cn("relative", getStretchClasses(className), wrapperClassName),
3113
+ children: [
3114
+ prefix ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "pointer-events-none absolute left-3 top-3 z-10 text-muted-foreground", children: prefix }) : null,
3115
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
3116
+ "textarea",
3117
+ {
3118
+ ref: callback,
3119
+ "data-slot": "textarea",
3120
+ className: cn(
3121
+ TEXTAREA_CONTROL_CLASS,
3122
+ "resize-y",
3123
+ prefix && "pl-10",
3124
+ autoGrow && "resize-none",
3125
+ className
3126
+ ),
3127
+ style: boxStyle(minHeight, maxHeight),
3128
+ ...props
3129
+ }
3130
+ )
3131
+ ]
3132
+ }
3133
+ );
3134
+ }
3135
+ );
3136
+ TextareaWithPrefix.displayName = "TextareaWithPrefix";
3137
+
1902
3138
  // src/use-scroll-fade.ts
1903
3139
  var import_react5 = require("react");
1904
3140
  var EPSILON = 2;