@ai-matrx/design-system 0.4.2 → 0.5.0
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/CHANGELOG.md +137 -1
- package/README.md +9 -1
- package/dist/index.cjs +1424 -191
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +545 -11
- package/dist/index.d.ts +545 -11
- package/dist/index.js +1442 -209
- package/dist/index.js.map +1 -1
- package/dist/styles.css +43 -0
- package/dist/tokens.css +10 -0
- package/package.json +18 -9
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: () =>
|
|
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: () =>
|
|
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,50 +572,237 @@ 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 = "sm", ...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
|
|
777
|
+
var React9 = __toESM(require("react"), 1);
|
|
468
778
|
|
|
469
779
|
// src/portal-container.tsx
|
|
470
|
-
var
|
|
471
|
-
var
|
|
472
|
-
var PortalContainerContext =
|
|
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,
|
|
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 =
|
|
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/
|
|
490
|
-
var
|
|
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] =
|
|
506
|
-
const [hasMounted, setHasMounted] =
|
|
507
|
-
|
|
803
|
+
const [isMobile, setIsMobile] = React8.useState(false);
|
|
804
|
+
const [hasMounted, setHasMounted] = React8.useState(false);
|
|
805
|
+
React8.useEffect(() => {
|
|
508
806
|
setHasMounted(true);
|
|
509
807
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
510
808
|
const onChange = () => {
|
|
@@ -519,21 +817,36 @@ function useIsMobile() {
|
|
|
519
817
|
}
|
|
520
818
|
return isMobile;
|
|
521
819
|
}
|
|
820
|
+
|
|
821
|
+
// src/command.tsx
|
|
822
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
823
|
+
var Command = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
824
|
+
import_cmdk.Command,
|
|
825
|
+
{
|
|
826
|
+
ref,
|
|
827
|
+
className: cn(
|
|
828
|
+
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
829
|
+
className
|
|
830
|
+
),
|
|
831
|
+
...props
|
|
832
|
+
}
|
|
833
|
+
));
|
|
834
|
+
Command.displayName = import_cmdk.Command.displayName;
|
|
522
835
|
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
836
|
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
837
|
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 =
|
|
838
|
+
var CommandDialogContent = React9.forwardRef(({ className, children, container, ...props }, ref) => {
|
|
526
839
|
const isMobile = useIsMobile();
|
|
527
840
|
const isModal = useRadixDialogModal();
|
|
528
841
|
const portalContainer = usePortalContainer(container);
|
|
529
|
-
return /* @__PURE__ */ (0,
|
|
530
|
-
isModal ? /* @__PURE__ */ (0,
|
|
842
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogPrimitive.Portal, { container: portalContainer, children: [
|
|
843
|
+
isModal ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
531
844
|
DialogPrimitive.Overlay,
|
|
532
845
|
{
|
|
533
846
|
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
847
|
}
|
|
535
848
|
) : null,
|
|
536
|
-
/* @__PURE__ */ (0,
|
|
849
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
537
850
|
DialogPrimitive.Content,
|
|
538
851
|
{
|
|
539
852
|
ref,
|
|
@@ -548,9 +861,9 @@ var CommandDialogContent = React5.forwardRef(({ className, children, container,
|
|
|
548
861
|
...props,
|
|
549
862
|
children: [
|
|
550
863
|
children,
|
|
551
|
-
/* @__PURE__ */ (0,
|
|
552
|
-
/* @__PURE__ */ (0,
|
|
553
|
-
/* @__PURE__ */ (0,
|
|
864
|
+
/* @__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: [
|
|
865
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(XIcon, { className: "h-4 w-4" }),
|
|
866
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "sr-only", children: "Close" })
|
|
554
867
|
] })
|
|
555
868
|
]
|
|
556
869
|
}
|
|
@@ -564,21 +877,21 @@ var CommandDialog = ({
|
|
|
564
877
|
...props
|
|
565
878
|
}) => {
|
|
566
879
|
const modal = props.modal ?? true;
|
|
567
|
-
return /* @__PURE__ */ (0,
|
|
880
|
+
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
881
|
CommandDialogContent,
|
|
569
882
|
{
|
|
570
883
|
className: "overflow-hidden p-0",
|
|
571
884
|
...container !== void 0 ? { container } : {},
|
|
572
885
|
children: [
|
|
573
|
-
/* @__PURE__ */ (0,
|
|
574
|
-
/* @__PURE__ */ (0,
|
|
886
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(DialogPrimitive.Title, { className: "sr-only" }),
|
|
887
|
+
/* @__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
888
|
]
|
|
576
889
|
}
|
|
577
890
|
) }) });
|
|
578
891
|
};
|
|
579
|
-
var CommandInput =
|
|
580
|
-
/* @__PURE__ */ (0,
|
|
581
|
-
/* @__PURE__ */ (0,
|
|
892
|
+
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: [
|
|
893
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MagnifyingGlassIcon, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
894
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
582
895
|
import_cmdk.Command.Input,
|
|
583
896
|
{
|
|
584
897
|
ref,
|
|
@@ -591,7 +904,7 @@ var CommandInput = React5.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
591
904
|
)
|
|
592
905
|
] }));
|
|
593
906
|
CommandInput.displayName = import_cmdk.Command.Input.displayName;
|
|
594
|
-
var CommandList =
|
|
907
|
+
var CommandList = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
595
908
|
import_cmdk.Command.List,
|
|
596
909
|
{
|
|
597
910
|
ref,
|
|
@@ -600,7 +913,7 @@ var CommandList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
600
913
|
}
|
|
601
914
|
));
|
|
602
915
|
CommandList.displayName = import_cmdk.Command.List.displayName;
|
|
603
|
-
var CommandEmpty =
|
|
916
|
+
var CommandEmpty = React9.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
604
917
|
import_cmdk.Command.Empty,
|
|
605
918
|
{
|
|
606
919
|
ref,
|
|
@@ -609,7 +922,7 @@ var CommandEmpty = React5.forwardRef((props, ref) => /* @__PURE__ */ (0, import_
|
|
|
609
922
|
}
|
|
610
923
|
));
|
|
611
924
|
CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
|
|
612
|
-
var CommandGroup =
|
|
925
|
+
var CommandGroup = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
613
926
|
import_cmdk.Command.Group,
|
|
614
927
|
{
|
|
615
928
|
ref,
|
|
@@ -621,7 +934,7 @@ var CommandGroup = React5.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
621
934
|
}
|
|
622
935
|
));
|
|
623
936
|
CommandGroup.displayName = import_cmdk.Command.Group.displayName;
|
|
624
|
-
var CommandSeparator =
|
|
937
|
+
var CommandSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
625
938
|
import_cmdk.Command.Separator,
|
|
626
939
|
{
|
|
627
940
|
ref,
|
|
@@ -630,7 +943,7 @@ var CommandSeparator = React5.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
630
943
|
}
|
|
631
944
|
));
|
|
632
945
|
CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
|
|
633
|
-
var CommandItem =
|
|
946
|
+
var CommandItem = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
634
947
|
import_cmdk.Command.Item,
|
|
635
948
|
{
|
|
636
949
|
ref,
|
|
@@ -646,7 +959,7 @@ var CommandShortcut = ({
|
|
|
646
959
|
className,
|
|
647
960
|
...props
|
|
648
961
|
}) => {
|
|
649
|
-
return /* @__PURE__ */ (0,
|
|
962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
650
963
|
"span",
|
|
651
964
|
{
|
|
652
965
|
className: cn(
|
|
@@ -659,20 +972,155 @@ var CommandShortcut = ({
|
|
|
659
972
|
};
|
|
660
973
|
CommandShortcut.displayName = "CommandShortcut";
|
|
661
974
|
|
|
975
|
+
// src/context-menu.tsx
|
|
976
|
+
var ContextMenuPrimitive = __toESM(require("@radix-ui/react-context-menu"), 1);
|
|
977
|
+
var React10 = __toESM(require("react"), 1);
|
|
978
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
979
|
+
var ContextMenu = ContextMenuPrimitive.Root;
|
|
980
|
+
var ContextMenuTrigger = ContextMenuPrimitive.Trigger;
|
|
981
|
+
var ContextMenuGroup = ContextMenuPrimitive.Group;
|
|
982
|
+
var ContextMenuPortal = ContextMenuPrimitive.Portal;
|
|
983
|
+
var ContextMenuSub = ContextMenuPrimitive.Sub;
|
|
984
|
+
var ContextMenuRadioGroup = ContextMenuPrimitive.RadioGroup;
|
|
985
|
+
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";
|
|
986
|
+
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";
|
|
987
|
+
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";
|
|
988
|
+
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";
|
|
989
|
+
var ContextMenuSubTrigger = React10.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
990
|
+
ContextMenuPrimitive.SubTrigger,
|
|
991
|
+
{
|
|
992
|
+
ref,
|
|
993
|
+
"data-slot": "context-menu-sub-trigger",
|
|
994
|
+
className: cn(
|
|
995
|
+
"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",
|
|
996
|
+
inset && "pl-8",
|
|
997
|
+
className
|
|
998
|
+
),
|
|
999
|
+
...props,
|
|
1000
|
+
children: [
|
|
1001
|
+
children,
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
1003
|
+
]
|
|
1004
|
+
}
|
|
1005
|
+
));
|
|
1006
|
+
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
1007
|
+
var ContextMenuSubContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1008
|
+
ContextMenuPrimitive.SubContent,
|
|
1009
|
+
{
|
|
1010
|
+
ref,
|
|
1011
|
+
"data-slot": "context-menu-sub-content",
|
|
1012
|
+
className: cn(SURFACE_CLASS, "shadow-lg", MOTION_CLASS, className),
|
|
1013
|
+
...props
|
|
1014
|
+
}
|
|
1015
|
+
));
|
|
1016
|
+
ContextMenuSubContent.displayName = ContextMenuPrimitive.SubContent.displayName;
|
|
1017
|
+
var ContextMenuContent = React10.forwardRef(({ className, container, ...props }, ref) => {
|
|
1018
|
+
const portalContainer = usePortalContainer(container);
|
|
1019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ContextMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1020
|
+
ContextMenuPrimitive.Content,
|
|
1021
|
+
{
|
|
1022
|
+
ref,
|
|
1023
|
+
"data-slot": "context-menu-content",
|
|
1024
|
+
className: cn(SURFACE_CLASS, "shadow-md", MOTION_CLASS, className),
|
|
1025
|
+
...props
|
|
1026
|
+
}
|
|
1027
|
+
) });
|
|
1028
|
+
});
|
|
1029
|
+
ContextMenuContent.displayName = ContextMenuPrimitive.Content.displayName;
|
|
1030
|
+
var ContextMenuItem = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1031
|
+
ContextMenuPrimitive.Item,
|
|
1032
|
+
{
|
|
1033
|
+
ref,
|
|
1034
|
+
"data-slot": "context-menu-item",
|
|
1035
|
+
className: cn(
|
|
1036
|
+
ITEM_CLASS,
|
|
1037
|
+
"gap-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
1038
|
+
inset && "pl-8",
|
|
1039
|
+
className
|
|
1040
|
+
),
|
|
1041
|
+
...props
|
|
1042
|
+
}
|
|
1043
|
+
));
|
|
1044
|
+
ContextMenuItem.displayName = ContextMenuPrimitive.Item.displayName;
|
|
1045
|
+
var ContextMenuCheckboxItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1046
|
+
ContextMenuPrimitive.CheckboxItem,
|
|
1047
|
+
{
|
|
1048
|
+
ref,
|
|
1049
|
+
"data-slot": "context-menu-checkbox-item",
|
|
1050
|
+
className: cn(INDICATOR_ITEM_CLASS, className),
|
|
1051
|
+
...props,
|
|
1052
|
+
children: [
|
|
1053
|
+
/* @__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" }) }) }),
|
|
1054
|
+
children
|
|
1055
|
+
]
|
|
1056
|
+
}
|
|
1057
|
+
));
|
|
1058
|
+
ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName;
|
|
1059
|
+
var ContextMenuRadioItem = React10.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1060
|
+
ContextMenuPrimitive.RadioItem,
|
|
1061
|
+
{
|
|
1062
|
+
ref,
|
|
1063
|
+
"data-slot": "context-menu-radio-item",
|
|
1064
|
+
className: cn(INDICATOR_ITEM_CLASS, className),
|
|
1065
|
+
...props,
|
|
1066
|
+
children: [
|
|
1067
|
+
/* @__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" }) }) }),
|
|
1068
|
+
children
|
|
1069
|
+
]
|
|
1070
|
+
}
|
|
1071
|
+
));
|
|
1072
|
+
ContextMenuRadioItem.displayName = ContextMenuPrimitive.RadioItem.displayName;
|
|
1073
|
+
var ContextMenuLabel = React10.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1074
|
+
ContextMenuPrimitive.Label,
|
|
1075
|
+
{
|
|
1076
|
+
ref,
|
|
1077
|
+
"data-slot": "context-menu-label",
|
|
1078
|
+
className: cn(
|
|
1079
|
+
"px-2 py-1.5 text-sm font-semibold text-foreground",
|
|
1080
|
+
inset && "pl-8",
|
|
1081
|
+
className
|
|
1082
|
+
),
|
|
1083
|
+
...props
|
|
1084
|
+
}
|
|
1085
|
+
));
|
|
1086
|
+
ContextMenuLabel.displayName = ContextMenuPrimitive.Label.displayName;
|
|
1087
|
+
var ContextMenuSeparator = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1088
|
+
ContextMenuPrimitive.Separator,
|
|
1089
|
+
{
|
|
1090
|
+
ref,
|
|
1091
|
+
"data-slot": "context-menu-separator",
|
|
1092
|
+
className: cn("-mx-1 my-1 h-px bg-border", className),
|
|
1093
|
+
...props
|
|
1094
|
+
}
|
|
1095
|
+
));
|
|
1096
|
+
ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
1097
|
+
var ContextMenuShortcut = ({
|
|
1098
|
+
className,
|
|
1099
|
+
...props
|
|
1100
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1101
|
+
"span",
|
|
1102
|
+
{
|
|
1103
|
+
"data-slot": "context-menu-shortcut",
|
|
1104
|
+
className: cn("ml-auto text-xs tracking-widest text-muted-foreground", className),
|
|
1105
|
+
...props
|
|
1106
|
+
}
|
|
1107
|
+
);
|
|
1108
|
+
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
1109
|
+
|
|
662
1110
|
// src/creatable-picker.tsx
|
|
663
1111
|
var import_react = require("react");
|
|
664
1112
|
|
|
665
1113
|
// src/popover.tsx
|
|
666
1114
|
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
|
|
667
|
-
var
|
|
668
|
-
var
|
|
1115
|
+
var React11 = __toESM(require("react"), 1);
|
|
1116
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
669
1117
|
var Popover = PopoverPrimitive.Root;
|
|
670
1118
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
671
1119
|
var PopoverAnchor = PopoverPrimitive.Anchor;
|
|
672
|
-
var PopoverContent =
|
|
1120
|
+
var PopoverContent = React11.forwardRef(
|
|
673
1121
|
({ className, align = "center", sideOffset = 4, container, ...props }, ref) => {
|
|
674
1122
|
const portalContainer = usePortalContainer(container);
|
|
675
|
-
return /* @__PURE__ */ (0,
|
|
1123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
676
1124
|
PopoverPrimitive.Content,
|
|
677
1125
|
{
|
|
678
1126
|
ref,
|
|
@@ -696,7 +1144,7 @@ var PopoverContent = React6.forwardRef(
|
|
|
696
1144
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
697
1145
|
|
|
698
1146
|
// src/creatable-picker.tsx
|
|
699
|
-
var
|
|
1147
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
700
1148
|
function article(noun) {
|
|
701
1149
|
return /^[aeiou]/i.test(noun.trim()) ? `an ${noun}` : `a ${noun}`;
|
|
702
1150
|
}
|
|
@@ -771,8 +1219,8 @@ function CreatablePicker({
|
|
|
771
1219
|
setBusy(false);
|
|
772
1220
|
}
|
|
773
1221
|
};
|
|
774
|
-
return /* @__PURE__ */ (0,
|
|
775
|
-
/* @__PURE__ */ (0,
|
|
1222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Popover, { open, onOpenChange: (next) => next ? setOpen(true) : close(), children: [
|
|
1223
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PopoverTrigger, { asChild: true, disabled, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
776
1224
|
"button",
|
|
777
1225
|
{
|
|
778
1226
|
type: "button",
|
|
@@ -786,12 +1234,12 @@ function CreatablePicker({
|
|
|
786
1234
|
triggerClassName
|
|
787
1235
|
),
|
|
788
1236
|
children: [
|
|
789
|
-
/* @__PURE__ */ (0,
|
|
790
|
-
/* @__PURE__ */ (0,
|
|
1237
|
+
/* @__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 }) }),
|
|
1238
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChevronsUpDownIcon, { className: "size-3.5 shrink-0 opacity-50" })
|
|
791
1239
|
]
|
|
792
1240
|
}
|
|
793
1241
|
) }),
|
|
794
|
-
/* @__PURE__ */ (0,
|
|
1242
|
+
/* @__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
1243
|
Command,
|
|
796
1244
|
{
|
|
797
1245
|
filter: (itemValue, search, keywords) => {
|
|
@@ -799,7 +1247,7 @@ function CreatablePicker({
|
|
|
799
1247
|
return haystack.includes(search.toLowerCase()) ? 1 : 0;
|
|
800
1248
|
},
|
|
801
1249
|
children: [
|
|
802
|
-
/* @__PURE__ */ (0,
|
|
1250
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
803
1251
|
CommandInput,
|
|
804
1252
|
{
|
|
805
1253
|
ref: inputRef,
|
|
@@ -811,13 +1259,13 @@ function CreatablePicker({
|
|
|
811
1259
|
placeholder: searchPlaceholder ?? `Search or add ${article(noun)}\u2026`
|
|
812
1260
|
}
|
|
813
1261
|
),
|
|
814
|
-
/* @__PURE__ */ (0,
|
|
815
|
-
/* @__PURE__ */ (0,
|
|
816
|
-
groups.map((group) => /* @__PURE__ */ (0,
|
|
1262
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(CommandList, { children: [
|
|
1263
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandEmpty, { children: emptyLabel }),
|
|
1264
|
+
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
817
1265
|
CommandGroup,
|
|
818
1266
|
{
|
|
819
1267
|
...group.heading === void 0 ? {} : { heading: group.heading },
|
|
820
|
-
children: group.options.map((option) => /* @__PURE__ */ (0,
|
|
1268
|
+
children: group.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
821
1269
|
CommandItem,
|
|
822
1270
|
{
|
|
823
1271
|
value: option.label,
|
|
@@ -828,7 +1276,7 @@ function CreatablePicker({
|
|
|
828
1276
|
},
|
|
829
1277
|
className: "gap-2 text-xs",
|
|
830
1278
|
children: [
|
|
831
|
-
/* @__PURE__ */ (0,
|
|
1279
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
832
1280
|
LucideCheckIcon,
|
|
833
1281
|
{
|
|
834
1282
|
className: cn(
|
|
@@ -837,8 +1285,8 @@ function CreatablePicker({
|
|
|
837
1285
|
)
|
|
838
1286
|
}
|
|
839
1287
|
),
|
|
840
|
-
/* @__PURE__ */ (0,
|
|
841
|
-
option.hint ? /* @__PURE__ */ (0,
|
|
1288
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 flex-1 truncate", children: option.render ?? option.label }),
|
|
1289
|
+
option.hint ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "shrink-0 text-[10px] text-muted-foreground", children: option.hint }) : null
|
|
842
1290
|
]
|
|
843
1291
|
},
|
|
844
1292
|
option.value
|
|
@@ -847,9 +1295,9 @@ function CreatablePicker({
|
|
|
847
1295
|
group.heading ?? "__ungrouped__"
|
|
848
1296
|
))
|
|
849
1297
|
] }),
|
|
850
|
-
canCreate ? /* @__PURE__ */ (0,
|
|
851
|
-
createExtra && typed && !exactMatch ? /* @__PURE__ */ (0,
|
|
852
|
-
/* @__PURE__ */ (0,
|
|
1298
|
+
canCreate ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-1 border-t border-border p-1", children: [
|
|
1299
|
+
createExtra && typed && !exactMatch ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "px-1 pt-0.5", children: typeof createExtra === "function" ? createExtra(typed) : createExtra }) : null,
|
|
1300
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
853
1301
|
"button",
|
|
854
1302
|
{
|
|
855
1303
|
type: "button",
|
|
@@ -857,22 +1305,22 @@ function CreatablePicker({
|
|
|
857
1305
|
onClick: () => void create(typed),
|
|
858
1306
|
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
1307
|
children: [
|
|
860
|
-
busy ? /* @__PURE__ */ (0,
|
|
861
|
-
/* @__PURE__ */ (0,
|
|
1308
|
+
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" }),
|
|
1309
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 truncate", children: typed && !exactMatch ? `Create \u201C${typed}\u201D` : `Add ${article(noun)}\u2026` })
|
|
862
1310
|
]
|
|
863
1311
|
}
|
|
864
1312
|
),
|
|
865
|
-
needsName ? /* @__PURE__ */ (0,
|
|
1313
|
+
needsName ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "px-2 pb-0.5 text-[11px] leading-snug text-muted-foreground", children: [
|
|
866
1314
|
"Type the name of the ",
|
|
867
1315
|
noun,
|
|
868
1316
|
" you want to add \u2014 then this creates it."
|
|
869
1317
|
] }) : null
|
|
870
1318
|
] }) : null,
|
|
871
|
-
footerActions?.length || manageAction ? /* @__PURE__ */ (0,
|
|
1319
|
+
footerActions?.length || manageAction ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-0.5 border-t border-border p-1", children: [
|
|
872
1320
|
footerActions?.map((action) => {
|
|
873
1321
|
const Icon2 = action.icon;
|
|
874
|
-
return /* @__PURE__ */ (0,
|
|
875
|
-
/* @__PURE__ */ (0,
|
|
1322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
|
|
1323
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
876
1324
|
"button",
|
|
877
1325
|
{
|
|
878
1326
|
type: "button",
|
|
@@ -882,15 +1330,15 @@ function CreatablePicker({
|
|
|
882
1330
|
},
|
|
883
1331
|
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
1332
|
children: [
|
|
885
|
-
Icon2 ? /* @__PURE__ */ (0,
|
|
886
|
-
/* @__PURE__ */ (0,
|
|
1333
|
+
Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon2, { className: "size-3.5 shrink-0" }) : null,
|
|
1334
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 truncate", children: action.label })
|
|
887
1335
|
]
|
|
888
1336
|
}
|
|
889
1337
|
),
|
|
890
|
-
action.note ? /* @__PURE__ */ (0,
|
|
1338
|
+
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
1339
|
] }, action.label);
|
|
892
1340
|
}),
|
|
893
|
-
manageAction ? /* @__PURE__ */ (0,
|
|
1341
|
+
manageAction ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
894
1342
|
"a",
|
|
895
1343
|
{
|
|
896
1344
|
href: manageAction.href,
|
|
@@ -899,18 +1347,18 @@ function CreatablePicker({
|
|
|
899
1347
|
onClick: close,
|
|
900
1348
|
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
1349
|
children: [
|
|
902
|
-
/* @__PURE__ */ (0,
|
|
903
|
-
/* @__PURE__ */ (0,
|
|
1350
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ExternalLinkIcon, { className: "size-3.5 shrink-0" }),
|
|
1351
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 truncate", children: manageAction.label })
|
|
904
1352
|
]
|
|
905
1353
|
}
|
|
906
1354
|
) : null
|
|
907
1355
|
] }) : null,
|
|
908
|
-
lockedNote ? /* @__PURE__ */ (0,
|
|
909
|
-
/* @__PURE__ */ (0,
|
|
910
|
-
/* @__PURE__ */ (0,
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
1356
|
+
lockedNote ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "space-y-1 border-t border-border p-2", children: [
|
|
1357
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "flex gap-1.5 text-[11px] leading-snug text-muted-foreground", children: [
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(LockIcon, { className: "mt-px size-3 shrink-0" }),
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: lockedNote })
|
|
912
1360
|
] }),
|
|
913
|
-
lockedAction ? /* @__PURE__ */ (0,
|
|
1361
|
+
lockedAction ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
914
1362
|
"button",
|
|
915
1363
|
{
|
|
916
1364
|
type: "button",
|
|
@@ -920,8 +1368,8 @@ function CreatablePicker({
|
|
|
920
1368
|
},
|
|
921
1369
|
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
1370
|
children: [
|
|
923
|
-
/* @__PURE__ */ (0,
|
|
924
|
-
/* @__PURE__ */ (0,
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PlusIcon, { className: "size-3.5 shrink-0" }),
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "min-w-0 truncate", children: lockedAction.label })
|
|
925
1373
|
]
|
|
926
1374
|
}
|
|
927
1375
|
) : null
|
|
@@ -932,9 +1380,326 @@ function CreatablePicker({
|
|
|
932
1380
|
] });
|
|
933
1381
|
}
|
|
934
1382
|
|
|
1383
|
+
// src/dialog.tsx
|
|
1384
|
+
var DialogPrimitive2 = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1385
|
+
var VisuallyHidden2 = __toESM(require("@radix-ui/react-visually-hidden"), 1);
|
|
1386
|
+
var import_react_tree = require("@ai-matrx/kit/react-tree");
|
|
1387
|
+
var React12 = __toESM(require("react"), 1);
|
|
1388
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1389
|
+
var Dialog = ({
|
|
1390
|
+
children,
|
|
1391
|
+
...props
|
|
1392
|
+
}) => {
|
|
1393
|
+
const modal = props.modal ?? true;
|
|
1394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive2.Root, { ...props, modal, children }) });
|
|
1395
|
+
};
|
|
1396
|
+
Dialog.displayName = "Dialog";
|
|
1397
|
+
var DialogTrigger = DialogPrimitive2.Trigger;
|
|
1398
|
+
var DialogClose = DialogPrimitive2.Close;
|
|
1399
|
+
var DialogPortal = ({
|
|
1400
|
+
container,
|
|
1401
|
+
...props
|
|
1402
|
+
}) => {
|
|
1403
|
+
const resolved = usePortalContainer(container);
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive2.Portal, { container: resolved ?? null, ...props });
|
|
1405
|
+
};
|
|
1406
|
+
DialogPortal.displayName = "DialogPortal";
|
|
1407
|
+
var DialogContainerContext = React12.createContext(null);
|
|
1408
|
+
var useDialogContainer = () => React12.useContext(DialogContainerContext);
|
|
1409
|
+
var DialogOverlay = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1410
|
+
DialogPrimitive2.Overlay,
|
|
1411
|
+
{
|
|
1412
|
+
ref,
|
|
1413
|
+
"data-slot": "dialog-overlay",
|
|
1414
|
+
className: cn(
|
|
1415
|
+
// Page context behind the modal stays readable; separation comes from a
|
|
1416
|
+
// light token scrim, not a blur.
|
|
1417
|
+
"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",
|
|
1418
|
+
className
|
|
1419
|
+
),
|
|
1420
|
+
...props
|
|
1421
|
+
}
|
|
1422
|
+
));
|
|
1423
|
+
DialogOverlay.displayName = DialogPrimitive2.Overlay.displayName;
|
|
1424
|
+
var DialogContentPrimitive = React12.forwardRef((props, ref) => {
|
|
1425
|
+
const isModal = useRadixDialogModal();
|
|
1426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1427
|
+
DialogPrimitive2.Content,
|
|
1428
|
+
{
|
|
1429
|
+
...props,
|
|
1430
|
+
ref,
|
|
1431
|
+
"aria-modal": isModal || void 0
|
|
1432
|
+
}
|
|
1433
|
+
);
|
|
1434
|
+
});
|
|
1435
|
+
DialogContentPrimitive.displayName = "DialogContentPrimitive";
|
|
1436
|
+
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";
|
|
1437
|
+
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";
|
|
1438
|
+
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";
|
|
1439
|
+
var DialogContent = React12.forwardRef(
|
|
1440
|
+
({
|
|
1441
|
+
className,
|
|
1442
|
+
children,
|
|
1443
|
+
mobileSheet = true,
|
|
1444
|
+
showCloseButton = true,
|
|
1445
|
+
container,
|
|
1446
|
+
...props
|
|
1447
|
+
}, ref) => {
|
|
1448
|
+
const isMobile = useIsMobile();
|
|
1449
|
+
const isModal = useRadixDialogModal();
|
|
1450
|
+
const injectedContainer = usePortalContainer(container);
|
|
1451
|
+
const asSheet = mobileSheet && isMobile;
|
|
1452
|
+
const [containerEl, setContainerEl] = React12.useState(
|
|
1453
|
+
null
|
|
1454
|
+
);
|
|
1455
|
+
const mergedRef = React12.useCallback(
|
|
1456
|
+
(node) => {
|
|
1457
|
+
setContainerEl(node);
|
|
1458
|
+
if (typeof ref === "function") ref(node);
|
|
1459
|
+
else if (ref)
|
|
1460
|
+
ref.current = node;
|
|
1461
|
+
},
|
|
1462
|
+
[ref]
|
|
1463
|
+
);
|
|
1464
|
+
const hasTitle = (0, import_react_tree.treeContainsComponent)(children, DialogTitle) || (0, import_react_tree.treeContainsComponent)(children, DialogPrimitive2.Title);
|
|
1465
|
+
const hasDescription = (0, import_react_tree.treeContainsComponent)(children, DialogDescription) || (0, import_react_tree.treeContainsComponent)(children, DialogPrimitive2.Description);
|
|
1466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(DialogPortal, { container, children: [
|
|
1467
|
+
isModal ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogOverlay, {}) : null,
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1469
|
+
DialogContentPrimitive,
|
|
1470
|
+
{
|
|
1471
|
+
ref: mergedRef,
|
|
1472
|
+
"data-slot": "dialog-content",
|
|
1473
|
+
className: cn(
|
|
1474
|
+
asSheet ? DIALOG_MOBILE_SHEET_CLASSES2 : DIALOG_DESKTOP_CLASSES2,
|
|
1475
|
+
className,
|
|
1476
|
+
asSheet && DIALOG_MOBILE_SHEET_OVERRIDE2,
|
|
1477
|
+
// A non-modal dialog is the coexistence contract for content that
|
|
1478
|
+
// can sit beside a host's floating window manager (which starts at
|
|
1479
|
+
// z=1000); staying below that boundary makes a newly focused window
|
|
1480
|
+
// usable without coupling the two systems.
|
|
1481
|
+
!isModal && "z-[900]"
|
|
1482
|
+
),
|
|
1483
|
+
...hasDescription ? {} : { "aria-describedby": void 0 },
|
|
1484
|
+
...props,
|
|
1485
|
+
children: [
|
|
1486
|
+
hasTitle ? null : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(VisuallyHidden2.Root, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogPrimitive2.Title, { children: "Dialog" }) }),
|
|
1487
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DialogContainerContext.Provider, { value: containerEl, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1488
|
+
PortalContainerProvider,
|
|
1489
|
+
{
|
|
1490
|
+
container: containerEl ?? injectedContainer ?? null,
|
|
1491
|
+
children
|
|
1492
|
+
}
|
|
1493
|
+
) }),
|
|
1494
|
+
showCloseButton ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1495
|
+
DialogPrimitive2.Close,
|
|
1496
|
+
{
|
|
1497
|
+
"data-slot": "dialog-close",
|
|
1498
|
+
"aria-label": "Close",
|
|
1499
|
+
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",
|
|
1500
|
+
children: [
|
|
1501
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(XIcon, { className: "h-4 w-4" }),
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1503
|
+
]
|
|
1504
|
+
}
|
|
1505
|
+
) : null
|
|
1506
|
+
]
|
|
1507
|
+
}
|
|
1508
|
+
)
|
|
1509
|
+
] });
|
|
1510
|
+
}
|
|
1511
|
+
);
|
|
1512
|
+
DialogContent.displayName = DialogPrimitive2.Content.displayName;
|
|
1513
|
+
var DialogHeader = ({
|
|
1514
|
+
className,
|
|
1515
|
+
...props
|
|
1516
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1517
|
+
"div",
|
|
1518
|
+
{
|
|
1519
|
+
"data-slot": "dialog-header",
|
|
1520
|
+
className: cn(
|
|
1521
|
+
// DialogContent owns an absolute close control. Reserve its hit area in
|
|
1522
|
+
// every header so trailing actions never render underneath it.
|
|
1523
|
+
"flex flex-col space-y-1.5 pr-12 text-center sm:text-left",
|
|
1524
|
+
className
|
|
1525
|
+
),
|
|
1526
|
+
...props
|
|
1527
|
+
}
|
|
1528
|
+
);
|
|
1529
|
+
DialogHeader.displayName = "DialogHeader";
|
|
1530
|
+
var DialogFooter = ({
|
|
1531
|
+
className,
|
|
1532
|
+
...props
|
|
1533
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1534
|
+
"div",
|
|
1535
|
+
{
|
|
1536
|
+
"data-slot": "dialog-footer",
|
|
1537
|
+
className: cn(
|
|
1538
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
1539
|
+
"sticky bottom-0 z-10 bg-background pt-3",
|
|
1540
|
+
"mx-[calc(var(--dialog-pad,0px)*-1)] mb-[calc(var(--dialog-pad,0px)*-1)] px-[var(--dialog-pad,0px)] pb-[var(--dialog-pad,0px)]",
|
|
1541
|
+
className
|
|
1542
|
+
),
|
|
1543
|
+
...props
|
|
1544
|
+
}
|
|
1545
|
+
);
|
|
1546
|
+
DialogFooter.displayName = "DialogFooter";
|
|
1547
|
+
var DialogTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1548
|
+
DialogPrimitive2.Title,
|
|
1549
|
+
{
|
|
1550
|
+
ref,
|
|
1551
|
+
"data-slot": "dialog-title",
|
|
1552
|
+
className: cn("text-lg font-semibold leading-none tracking-tight", className),
|
|
1553
|
+
...props
|
|
1554
|
+
}
|
|
1555
|
+
));
|
|
1556
|
+
DialogTitle.displayName = DialogPrimitive2.Title.displayName;
|
|
1557
|
+
var DialogDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1558
|
+
DialogPrimitive2.Description,
|
|
1559
|
+
{
|
|
1560
|
+
ref,
|
|
1561
|
+
"data-slot": "dialog-description",
|
|
1562
|
+
className: cn("text-sm text-muted-foreground", className),
|
|
1563
|
+
...props
|
|
1564
|
+
}
|
|
1565
|
+
));
|
|
1566
|
+
DialogDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
1567
|
+
|
|
1568
|
+
// src/dropdown-menu.tsx
|
|
1569
|
+
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"), 1);
|
|
1570
|
+
var React13 = __toESM(require("react"), 1);
|
|
1571
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1572
|
+
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
1573
|
+
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
1574
|
+
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
1575
|
+
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
1576
|
+
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
1577
|
+
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
1578
|
+
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";
|
|
1579
|
+
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";
|
|
1580
|
+
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";
|
|
1581
|
+
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";
|
|
1582
|
+
var DropdownMenuSubTrigger = React13.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1583
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
1584
|
+
{
|
|
1585
|
+
ref,
|
|
1586
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
1587
|
+
className: cn(
|
|
1588
|
+
"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",
|
|
1589
|
+
inset && "pl-8",
|
|
1590
|
+
className
|
|
1591
|
+
),
|
|
1592
|
+
...props,
|
|
1593
|
+
children: [
|
|
1594
|
+
children,
|
|
1595
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
1596
|
+
]
|
|
1597
|
+
}
|
|
1598
|
+
));
|
|
1599
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1600
|
+
var DropdownMenuSubContent = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1601
|
+
DropdownMenuPrimitive.SubContent,
|
|
1602
|
+
{
|
|
1603
|
+
ref,
|
|
1604
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
1605
|
+
className: cn(MENU_SURFACE_CLASS, "shadow-lg", MENU_MOTION_CLASS, className),
|
|
1606
|
+
...props
|
|
1607
|
+
}
|
|
1608
|
+
));
|
|
1609
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1610
|
+
var DropdownMenuContent = React13.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
1611
|
+
const portalContainer = usePortalContainer(container);
|
|
1612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1613
|
+
DropdownMenuPrimitive.Content,
|
|
1614
|
+
{
|
|
1615
|
+
ref,
|
|
1616
|
+
"data-slot": "dropdown-menu-content",
|
|
1617
|
+
sideOffset,
|
|
1618
|
+
className: cn(
|
|
1619
|
+
MENU_SURFACE_CLASS,
|
|
1620
|
+
"shadow-md",
|
|
1621
|
+
MENU_MOTION_CLASS,
|
|
1622
|
+
className
|
|
1623
|
+
),
|
|
1624
|
+
...props
|
|
1625
|
+
}
|
|
1626
|
+
) });
|
|
1627
|
+
});
|
|
1628
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
1629
|
+
var DropdownMenuItem = React13.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1630
|
+
DropdownMenuPrimitive.Item,
|
|
1631
|
+
{
|
|
1632
|
+
ref,
|
|
1633
|
+
"data-slot": "dropdown-menu-item",
|
|
1634
|
+
className: cn(MENU_ITEM_CLASS, inset && "pl-8", className),
|
|
1635
|
+
...props
|
|
1636
|
+
}
|
|
1637
|
+
));
|
|
1638
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
1639
|
+
var DropdownMenuCheckboxItem = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1640
|
+
DropdownMenuPrimitive.CheckboxItem,
|
|
1641
|
+
{
|
|
1642
|
+
ref,
|
|
1643
|
+
"data-slot": "dropdown-menu-checkbox-item",
|
|
1644
|
+
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
1645
|
+
...props,
|
|
1646
|
+
children: [
|
|
1647
|
+
/* @__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" }) }) }),
|
|
1648
|
+
children
|
|
1649
|
+
]
|
|
1650
|
+
}
|
|
1651
|
+
));
|
|
1652
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
1653
|
+
var DropdownMenuRadioItem = React13.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1654
|
+
DropdownMenuPrimitive.RadioItem,
|
|
1655
|
+
{
|
|
1656
|
+
ref,
|
|
1657
|
+
"data-slot": "dropdown-menu-radio-item",
|
|
1658
|
+
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
1659
|
+
...props,
|
|
1660
|
+
children: [
|
|
1661
|
+
/* @__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" }) }) }),
|
|
1662
|
+
children
|
|
1663
|
+
]
|
|
1664
|
+
}
|
|
1665
|
+
));
|
|
1666
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
1667
|
+
var DropdownMenuLabel = React13.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1668
|
+
DropdownMenuPrimitive.Label,
|
|
1669
|
+
{
|
|
1670
|
+
ref,
|
|
1671
|
+
"data-slot": "dropdown-menu-label",
|
|
1672
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
1673
|
+
...props
|
|
1674
|
+
}
|
|
1675
|
+
));
|
|
1676
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
1677
|
+
var DropdownMenuSeparator = React13.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1678
|
+
DropdownMenuPrimitive.Separator,
|
|
1679
|
+
{
|
|
1680
|
+
ref,
|
|
1681
|
+
"data-slot": "dropdown-menu-separator",
|
|
1682
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
1683
|
+
...props
|
|
1684
|
+
}
|
|
1685
|
+
));
|
|
1686
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
1687
|
+
var DropdownMenuShortcut = ({
|
|
1688
|
+
className,
|
|
1689
|
+
...props
|
|
1690
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1691
|
+
"span",
|
|
1692
|
+
{
|
|
1693
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
1694
|
+
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
1695
|
+
...props
|
|
1696
|
+
}
|
|
1697
|
+
);
|
|
1698
|
+
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
1699
|
+
|
|
935
1700
|
// src/editable-label.tsx
|
|
936
1701
|
var import_react2 = require("react");
|
|
937
|
-
var
|
|
1702
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
938
1703
|
function EditableLabel({
|
|
939
1704
|
value,
|
|
940
1705
|
onCommit,
|
|
@@ -1041,8 +1806,8 @@ function EditableLabel({
|
|
|
1041
1806
|
setEditing
|
|
1042
1807
|
]);
|
|
1043
1808
|
if (editing) {
|
|
1044
|
-
return /* @__PURE__ */ (0,
|
|
1045
|
-
/* @__PURE__ */ (0,
|
|
1809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { className: cn("relative flex min-w-0 flex-1 items-center", className), children: [
|
|
1810
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1046
1811
|
"input",
|
|
1047
1812
|
{
|
|
1048
1813
|
ref: inputRef,
|
|
@@ -1082,12 +1847,12 @@ function EditableLabel({
|
|
|
1082
1847
|
)
|
|
1083
1848
|
}
|
|
1084
1849
|
),
|
|
1085
|
-
busy && /* @__PURE__ */ (0,
|
|
1086
|
-
error && /* @__PURE__ */ (0,
|
|
1850
|
+
busy && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Loader2Icon, { className: "absolute right-1 h-3.5 w-3.5 animate-spin text-muted-foreground" }),
|
|
1851
|
+
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
1852
|
] });
|
|
1088
1853
|
}
|
|
1089
1854
|
if (controlled) return null;
|
|
1090
|
-
return /* @__PURE__ */ (0,
|
|
1855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1091
1856
|
"button",
|
|
1092
1857
|
{
|
|
1093
1858
|
type: "button",
|
|
@@ -1121,11 +1886,11 @@ function EditableLabel({
|
|
|
1121
1886
|
}
|
|
1122
1887
|
|
|
1123
1888
|
// src/input.tsx
|
|
1124
|
-
var
|
|
1125
|
-
var
|
|
1889
|
+
var React14 = __toESM(require("react"), 1);
|
|
1890
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1126
1891
|
var getVariantStyles = (variant = "default") => {
|
|
1127
1892
|
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
|
|
1893
|
+
file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground
|
|
1129
1894
|
focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-ring
|
|
1130
1895
|
disabled:cursor-not-allowed disabled:opacity-50
|
|
1131
1896
|
dark:shadow-none
|
|
@@ -1150,9 +1915,9 @@ var getVariantStyles = (variant = "default") => {
|
|
|
1150
1915
|
return baseStyles;
|
|
1151
1916
|
}
|
|
1152
1917
|
};
|
|
1153
|
-
var Input =
|
|
1918
|
+
var Input = React14.forwardRef(
|
|
1154
1919
|
({ className, type, variant = "default", ...props }, ref) => {
|
|
1155
|
-
return /* @__PURE__ */ (0,
|
|
1920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1156
1921
|
"input",
|
|
1157
1922
|
{
|
|
1158
1923
|
type,
|
|
@@ -1164,7 +1929,7 @@ var Input = React7.forwardRef(
|
|
|
1164
1929
|
}
|
|
1165
1930
|
);
|
|
1166
1931
|
Input.displayName = "Input";
|
|
1167
|
-
var EnterInput =
|
|
1932
|
+
var EnterInput = React14.forwardRef(
|
|
1168
1933
|
({ onEnter, ...props }, ref) => {
|
|
1169
1934
|
const handleKeyDown = (e) => {
|
|
1170
1935
|
if (e.key === "Enter" && onEnter) {
|
|
@@ -1172,7 +1937,7 @@ var EnterInput = React7.forwardRef(
|
|
|
1172
1937
|
onEnter();
|
|
1173
1938
|
}
|
|
1174
1939
|
};
|
|
1175
|
-
return /* @__PURE__ */ (0,
|
|
1940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1176
1941
|
Input,
|
|
1177
1942
|
{
|
|
1178
1943
|
...props,
|
|
@@ -1188,16 +1953,16 @@ var EnterInput = React7.forwardRef(
|
|
|
1188
1953
|
}
|
|
1189
1954
|
);
|
|
1190
1955
|
EnterInput.displayName = "EnterInput";
|
|
1191
|
-
var BasicInput =
|
|
1956
|
+
var BasicInput = React14.forwardRef(
|
|
1192
1957
|
// `variant` is accepted (prop-compatible with Input) but intentionally
|
|
1193
1958
|
// unused — and destructured so it never leaks onto the DOM element.
|
|
1194
1959
|
({ className, type, variant: _variant = "default", ...props }, ref) => {
|
|
1195
|
-
return /* @__PURE__ */ (0,
|
|
1960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1196
1961
|
"input",
|
|
1197
1962
|
{
|
|
1198
1963
|
type,
|
|
1199
1964
|
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",
|
|
1965
|
+
"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
1966
|
className
|
|
1202
1967
|
),
|
|
1203
1968
|
ref,
|
|
@@ -1207,10 +1972,10 @@ var BasicInput = React7.forwardRef(
|
|
|
1207
1972
|
}
|
|
1208
1973
|
);
|
|
1209
1974
|
BasicInput.displayName = "BasicInput";
|
|
1210
|
-
var InputWithPrefix =
|
|
1211
|
-
return /* @__PURE__ */ (0,
|
|
1212
|
-
prefix && /* @__PURE__ */ (0,
|
|
1213
|
-
/* @__PURE__ */ (0,
|
|
1975
|
+
var InputWithPrefix = React14.forwardRef(({ prefix, className, wrapperClassName, ...props }, ref) => {
|
|
1976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: cn("relative", wrapperClassName), children: [
|
|
1977
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground", children: prefix }),
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1214
1979
|
Input,
|
|
1215
1980
|
{
|
|
1216
1981
|
ref,
|
|
@@ -1224,9 +1989,9 @@ InputWithPrefix.displayName = "InputWithPrefix";
|
|
|
1224
1989
|
|
|
1225
1990
|
// src/label.tsx
|
|
1226
1991
|
var LabelPrimitive = __toESM(require("@radix-ui/react-label"), 1);
|
|
1227
|
-
var
|
|
1228
|
-
var
|
|
1229
|
-
var
|
|
1992
|
+
var React15 = __toESM(require("react"), 1);
|
|
1993
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1994
|
+
var Label3 = React15.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1230
1995
|
LabelPrimitive.Root,
|
|
1231
1996
|
{
|
|
1232
1997
|
ref,
|
|
@@ -1237,11 +2002,11 @@ var Label = React8.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1237
2002
|
...props
|
|
1238
2003
|
}
|
|
1239
2004
|
));
|
|
1240
|
-
|
|
2005
|
+
Label3.displayName = LabelPrimitive.Root.displayName;
|
|
1241
2006
|
|
|
1242
2007
|
// src/overflow-toolbar.tsx
|
|
1243
2008
|
var import_react3 = require("react");
|
|
1244
|
-
var
|
|
2009
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1245
2010
|
var GAP_PX = 6;
|
|
1246
2011
|
var TONE = {
|
|
1247
2012
|
default: "border border-border bg-background hover:bg-accent text-foreground",
|
|
@@ -1263,16 +2028,16 @@ function ToolbarButton({
|
|
|
1263
2028
|
action.hideLabel && !action.running ? "w-7 justify-center px-0" : "px-2",
|
|
1264
2029
|
TONE[tone]
|
|
1265
2030
|
);
|
|
1266
|
-
const inner = /* @__PURE__ */ (0,
|
|
1267
|
-
/* @__PURE__ */ (0,
|
|
2031
|
+
const inner = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2032
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1268
2033
|
Icon2,
|
|
1269
2034
|
{
|
|
1270
2035
|
className: cn("w-3.5 h-3.5 shrink-0", action.running && "animate-spin")
|
|
1271
2036
|
}
|
|
1272
2037
|
),
|
|
1273
|
-
showLabel && /* @__PURE__ */ (0,
|
|
2038
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { children: text })
|
|
1274
2039
|
] });
|
|
1275
|
-
const control = action.href && !action.disabled ? /* @__PURE__ */ (0,
|
|
2040
|
+
const control = action.href && !action.disabled ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1276
2041
|
"a",
|
|
1277
2042
|
{
|
|
1278
2043
|
href: action.href,
|
|
@@ -1282,7 +2047,7 @@ function ToolbarButton({
|
|
|
1282
2047
|
"aria-label": action.label,
|
|
1283
2048
|
children: inner
|
|
1284
2049
|
}
|
|
1285
|
-
) : /* @__PURE__ */ (0,
|
|
2050
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1286
2051
|
"button",
|
|
1287
2052
|
{
|
|
1288
2053
|
type: "button",
|
|
@@ -1294,12 +2059,12 @@ function ToolbarButton({
|
|
|
1294
2059
|
}
|
|
1295
2060
|
);
|
|
1296
2061
|
if (enableTooltip && action.hideLabel && renderTooltip) {
|
|
1297
|
-
return /* @__PURE__ */ (0,
|
|
2062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: renderTooltip(control, action.label) });
|
|
1298
2063
|
}
|
|
1299
2064
|
return control;
|
|
1300
2065
|
}
|
|
1301
2066
|
function OverflowTrigger({ ariaLabel }) {
|
|
1302
|
-
return /* @__PURE__ */ (0,
|
|
2067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1303
2068
|
"button",
|
|
1304
2069
|
{
|
|
1305
2070
|
type: "button",
|
|
@@ -1310,7 +2075,7 @@ function OverflowTrigger({ ariaLabel }) {
|
|
|
1310
2075
|
"inline-flex items-center justify-center h-7 w-7 rounded-md transition-colors",
|
|
1311
2076
|
"border border-border bg-background hover:bg-accent text-foreground"
|
|
1312
2077
|
),
|
|
1313
|
-
children: /* @__PURE__ */ (0,
|
|
2078
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(MoreHorizontalIcon, { className: "w-3.5 h-3.5" })
|
|
1314
2079
|
}
|
|
1315
2080
|
);
|
|
1316
2081
|
}
|
|
@@ -1370,22 +2135,22 @@ function OverflowToolbar({
|
|
|
1370
2135
|
}, [signature, leading != null]);
|
|
1371
2136
|
const shown = visibleActions.slice(0, visibleCount);
|
|
1372
2137
|
const hidden = visibleActions.slice(visibleCount);
|
|
1373
|
-
return /* @__PURE__ */ (0,
|
|
1374
|
-
/* @__PURE__ */ (0,
|
|
2138
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { ref: containerRef, className: cn("relative min-w-0", className), children: [
|
|
2139
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1375
2140
|
"div",
|
|
1376
2141
|
{
|
|
1377
2142
|
ref: ghostRef,
|
|
1378
2143
|
"aria-hidden": true,
|
|
1379
2144
|
className: "pointer-events-none absolute left-0 top-0 flex items-center gap-1.5 opacity-0",
|
|
1380
2145
|
children: [
|
|
1381
|
-
visibleActions.map((a) => /* @__PURE__ */ (0,
|
|
1382
|
-
/* @__PURE__ */ (0,
|
|
2146
|
+
visibleActions.map((a) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToolbarButton, { action: a }, a.id)),
|
|
2147
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OverflowTrigger, { ariaLabel: overflowAriaLabel })
|
|
1383
2148
|
]
|
|
1384
2149
|
}
|
|
1385
2150
|
),
|
|
1386
|
-
/* @__PURE__ */ (0,
|
|
1387
|
-
leading != null && /* @__PURE__ */ (0,
|
|
1388
|
-
shown.map((a) => /* @__PURE__ */ (0,
|
|
2151
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [
|
|
2152
|
+
leading != null && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { ref: leadingRef, className: "shrink-0", children: leading }),
|
|
2153
|
+
shown.map((a) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1389
2154
|
ToolbarButton,
|
|
1390
2155
|
{
|
|
1391
2156
|
action: a,
|
|
@@ -1396,14 +2161,118 @@ function OverflowToolbar({
|
|
|
1396
2161
|
)),
|
|
1397
2162
|
hidden.length > 0 && renderOverflowMenu({
|
|
1398
2163
|
actions: hidden,
|
|
1399
|
-
trigger: /* @__PURE__ */ (0,
|
|
2164
|
+
trigger: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OverflowTrigger, { ariaLabel: overflowAriaLabel })
|
|
1400
2165
|
})
|
|
1401
2166
|
] })
|
|
1402
2167
|
] });
|
|
1403
2168
|
}
|
|
1404
2169
|
|
|
2170
|
+
// src/progress.tsx
|
|
2171
|
+
var ProgressPrimitive = __toESM(require("@radix-ui/react-progress"), 1);
|
|
2172
|
+
var React17 = __toESM(require("react"), 1);
|
|
2173
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2174
|
+
var PROGRESS_TONES = {
|
|
2175
|
+
default: "bg-primary",
|
|
2176
|
+
success: "bg-success",
|
|
2177
|
+
warning: "bg-warning",
|
|
2178
|
+
destructive: "bg-destructive"
|
|
2179
|
+
};
|
|
2180
|
+
var Progress = React17.forwardRef(({ className, tone = "default", indicatorClassName, ...props }, ref) => {
|
|
2181
|
+
const { value, max } = props;
|
|
2182
|
+
const ceiling = max ?? 100;
|
|
2183
|
+
const isIndeterminate = value === null || value === void 0;
|
|
2184
|
+
const pct = isIndeterminate ? 0 : Math.min(100, Math.max(0, value / ceiling * 100));
|
|
2185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2186
|
+
ProgressPrimitive.Root,
|
|
2187
|
+
{
|
|
2188
|
+
ref,
|
|
2189
|
+
"data-slot": "progress",
|
|
2190
|
+
className: cn(
|
|
2191
|
+
"relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
|
|
2192
|
+
className
|
|
2193
|
+
),
|
|
2194
|
+
...props,
|
|
2195
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2196
|
+
ProgressPrimitive.Indicator,
|
|
2197
|
+
{
|
|
2198
|
+
"data-slot": "progress-indicator",
|
|
2199
|
+
className: cn(
|
|
2200
|
+
"h-full w-full flex-1 transition-all",
|
|
2201
|
+
PROGRESS_TONES[tone],
|
|
2202
|
+
isIndeterminate && "matrx-progress-indeterminate",
|
|
2203
|
+
indicatorClassName
|
|
2204
|
+
),
|
|
2205
|
+
style: isIndeterminate ? void 0 : { transform: `translateX(-${100 - pct}%)` }
|
|
2206
|
+
}
|
|
2207
|
+
)
|
|
2208
|
+
}
|
|
2209
|
+
);
|
|
2210
|
+
});
|
|
2211
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
2212
|
+
|
|
2213
|
+
// src/scroll-area.tsx
|
|
2214
|
+
var ScrollAreaPrimitive = __toESM(require("@radix-ui/react-scroll-area"), 1);
|
|
2215
|
+
var React18 = __toESM(require("react"), 1);
|
|
2216
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2217
|
+
var ScrollArea = React18.forwardRef(
|
|
2218
|
+
({
|
|
2219
|
+
className,
|
|
2220
|
+
children,
|
|
2221
|
+
viewportClassName,
|
|
2222
|
+
viewportRef,
|
|
2223
|
+
scrollBarClassName,
|
|
2224
|
+
orientation = "vertical",
|
|
2225
|
+
...props
|
|
2226
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2227
|
+
ScrollAreaPrimitive.Root,
|
|
2228
|
+
{
|
|
2229
|
+
ref,
|
|
2230
|
+
"data-slot": "scroll-area",
|
|
2231
|
+
className: cn("relative overflow-hidden", className),
|
|
2232
|
+
...props,
|
|
2233
|
+
children: [
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2235
|
+
ScrollAreaPrimitive.Viewport,
|
|
2236
|
+
{
|
|
2237
|
+
ref: viewportRef,
|
|
2238
|
+
"data-slot": "scroll-area-viewport",
|
|
2239
|
+
className: cn("h-full w-full rounded-[inherit]", viewportClassName),
|
|
2240
|
+
children
|
|
2241
|
+
}
|
|
2242
|
+
),
|
|
2243
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScrollBar, { orientation, className: scrollBarClassName }),
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ScrollAreaPrimitive.Corner, {})
|
|
2245
|
+
]
|
|
2246
|
+
}
|
|
2247
|
+
)
|
|
2248
|
+
);
|
|
2249
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
2250
|
+
var ScrollBar = React18.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2251
|
+
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
2252
|
+
{
|
|
2253
|
+
ref,
|
|
2254
|
+
"data-slot": "scroll-area-scrollbar",
|
|
2255
|
+
orientation,
|
|
2256
|
+
className: cn(
|
|
2257
|
+
"flex touch-none select-none transition-colors",
|
|
2258
|
+
orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
|
|
2259
|
+
orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
|
|
2260
|
+
className
|
|
2261
|
+
),
|
|
2262
|
+
...props,
|
|
2263
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2264
|
+
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
2265
|
+
{
|
|
2266
|
+
"data-slot": "scroll-area-thumb",
|
|
2267
|
+
className: "relative flex-1 rounded-full bg-border"
|
|
2268
|
+
}
|
|
2269
|
+
)
|
|
2270
|
+
}
|
|
2271
|
+
));
|
|
2272
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
2273
|
+
|
|
1405
2274
|
// src/score-ring.tsx
|
|
1406
|
-
var
|
|
2275
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1407
2276
|
var DEFAULT_SCORE_THRESHOLDS = {
|
|
1408
2277
|
good: 75,
|
|
1409
2278
|
warning: 50
|
|
@@ -1434,7 +2303,7 @@ function ScoreRing({
|
|
|
1434
2303
|
const circumference = 2 * Math.PI * radius;
|
|
1435
2304
|
const boundedPct = pct === null ? 0 : Math.max(0, Math.min(100, pct));
|
|
1436
2305
|
const dashOffset = circumference * (1 - boundedPct / 100);
|
|
1437
|
-
return /* @__PURE__ */ (0,
|
|
2306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1438
2307
|
"div",
|
|
1439
2308
|
{
|
|
1440
2309
|
className: cn(
|
|
@@ -1445,8 +2314,8 @@ function ScoreRing({
|
|
|
1445
2314
|
role: "img",
|
|
1446
2315
|
"aria-label": `${label ?? "Score"}: ${pct === null ? "not available" : `${pct} out of 100`}`,
|
|
1447
2316
|
children: [
|
|
1448
|
-
/* @__PURE__ */ (0,
|
|
1449
|
-
/* @__PURE__ */ (0,
|
|
2317
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("svg", { viewBox: "0 0 100 100", className: "h-full w-full -rotate-90", children: [
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1450
2319
|
"circle",
|
|
1451
2320
|
{
|
|
1452
2321
|
cx: "50",
|
|
@@ -1457,7 +2326,7 @@ function ScoreRing({
|
|
|
1457
2326
|
fill: "none"
|
|
1458
2327
|
}
|
|
1459
2328
|
),
|
|
1460
|
-
pct !== null ? /* @__PURE__ */ (0,
|
|
2329
|
+
pct !== null ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1461
2330
|
"circle",
|
|
1462
2331
|
{
|
|
1463
2332
|
cx: "50",
|
|
@@ -1476,8 +2345,8 @@ function ScoreRing({
|
|
|
1476
2345
|
}
|
|
1477
2346
|
) : null
|
|
1478
2347
|
] }),
|
|
1479
|
-
/* @__PURE__ */ (0,
|
|
1480
|
-
/* @__PURE__ */ (0,
|
|
2348
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "absolute flex flex-col items-center justify-center", children: [
|
|
2349
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1481
2350
|
"span",
|
|
1482
2351
|
{
|
|
1483
2352
|
className: cn(
|
|
@@ -1487,7 +2356,7 @@ function ScoreRing({
|
|
|
1487
2356
|
children: pct === null ? "\u2014" : `${pct}${suffix}`
|
|
1488
2357
|
}
|
|
1489
2358
|
),
|
|
1490
|
-
label ? /* @__PURE__ */ (0,
|
|
2359
|
+
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
2360
|
] })
|
|
1492
2361
|
]
|
|
1493
2362
|
}
|
|
@@ -1495,7 +2364,7 @@ function ScoreRing({
|
|
|
1495
2364
|
}
|
|
1496
2365
|
|
|
1497
2366
|
// src/segmented-control.tsx
|
|
1498
|
-
var
|
|
2367
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1499
2368
|
function SegmentedControl({
|
|
1500
2369
|
value,
|
|
1501
2370
|
onValueChange,
|
|
@@ -1510,7 +2379,7 @@ function SegmentedControl({
|
|
|
1510
2379
|
md: "h-9 text-sm",
|
|
1511
2380
|
lg: "h-10 text-base"
|
|
1512
2381
|
};
|
|
1513
|
-
return /* @__PURE__ */ (0,
|
|
2382
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1514
2383
|
"div",
|
|
1515
2384
|
{
|
|
1516
2385
|
className: cn(
|
|
@@ -1521,7 +2390,7 @@ function SegmentedControl({
|
|
|
1521
2390
|
role: "tablist",
|
|
1522
2391
|
children: data.map((option) => {
|
|
1523
2392
|
const isActive = value === option.value;
|
|
1524
|
-
return /* @__PURE__ */ (0,
|
|
2393
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1525
2394
|
"button",
|
|
1526
2395
|
{
|
|
1527
2396
|
type: "button",
|
|
@@ -1548,8 +2417,8 @@ function SegmentedControl({
|
|
|
1548
2417
|
// src/select.tsx
|
|
1549
2418
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
1550
2419
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1551
|
-
var
|
|
1552
|
-
var
|
|
2420
|
+
var React19 = __toESM(require("react"), 1);
|
|
2421
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1553
2422
|
var Select = SelectPrimitive.Root;
|
|
1554
2423
|
var SelectGroup = SelectPrimitive.Group;
|
|
1555
2424
|
var SelectValue = SelectPrimitive.Value;
|
|
@@ -1568,7 +2437,7 @@ var selectTriggerVariants = (0, import_class_variance_authority3.cva)(
|
|
|
1568
2437
|
}
|
|
1569
2438
|
}
|
|
1570
2439
|
);
|
|
1571
|
-
var SelectTrigger =
|
|
2440
|
+
var SelectTrigger = React19.forwardRef(({ className, children, hideArrow = false, size, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1572
2441
|
SelectPrimitive.Trigger,
|
|
1573
2442
|
{
|
|
1574
2443
|
ref,
|
|
@@ -1576,12 +2445,12 @@ var SelectTrigger = React10.forwardRef(({ className, children, hideArrow = false
|
|
|
1576
2445
|
...props,
|
|
1577
2446
|
children: [
|
|
1578
2447
|
children,
|
|
1579
|
-
!hideArrow && /* @__PURE__ */ (0,
|
|
2448
|
+
!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
2449
|
]
|
|
1581
2450
|
}
|
|
1582
2451
|
));
|
|
1583
2452
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
1584
|
-
var SelectScrollUpButton =
|
|
2453
|
+
var SelectScrollUpButton = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1585
2454
|
SelectPrimitive.ScrollUpButton,
|
|
1586
2455
|
{
|
|
1587
2456
|
ref,
|
|
@@ -1590,11 +2459,11 @@ var SelectScrollUpButton = React10.forwardRef(({ className, ...props }, ref) =>
|
|
|
1590
2459
|
className
|
|
1591
2460
|
),
|
|
1592
2461
|
...props,
|
|
1593
|
-
children: /* @__PURE__ */ (0,
|
|
2462
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadixChevronUpIcon, {})
|
|
1594
2463
|
}
|
|
1595
2464
|
));
|
|
1596
2465
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
1597
|
-
var SelectScrollDownButton =
|
|
2466
|
+
var SelectScrollDownButton = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1598
2467
|
SelectPrimitive.ScrollDownButton,
|
|
1599
2468
|
{
|
|
1600
2469
|
ref,
|
|
@@ -1603,13 +2472,13 @@ var SelectScrollDownButton = React10.forwardRef(({ className, ...props }, ref) =
|
|
|
1603
2472
|
className
|
|
1604
2473
|
),
|
|
1605
2474
|
...props,
|
|
1606
|
-
children: /* @__PURE__ */ (0,
|
|
2475
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RadixChevronDownIcon, {})
|
|
1607
2476
|
}
|
|
1608
2477
|
));
|
|
1609
2478
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
1610
|
-
var SelectContent =
|
|
2479
|
+
var SelectContent = React19.forwardRef(({ className, children, position = "popper", container, ...props }, ref) => {
|
|
1611
2480
|
const portalContainer = usePortalContainer(container);
|
|
1612
|
-
return /* @__PURE__ */ (0,
|
|
2481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1613
2482
|
SelectPrimitive.Content,
|
|
1614
2483
|
{
|
|
1615
2484
|
ref,
|
|
@@ -1621,8 +2490,8 @@ var SelectContent = React10.forwardRef(({ className, children, position = "poppe
|
|
|
1621
2490
|
position,
|
|
1622
2491
|
...props,
|
|
1623
2492
|
children: [
|
|
1624
|
-
/* @__PURE__ */ (0,
|
|
1625
|
-
/* @__PURE__ */ (0,
|
|
2493
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollUpButton, {}),
|
|
2494
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1626
2495
|
SelectPrimitive.Viewport,
|
|
1627
2496
|
{
|
|
1628
2497
|
className: cn(
|
|
@@ -1632,13 +2501,13 @@ var SelectContent = React10.forwardRef(({ className, children, position = "poppe
|
|
|
1632
2501
|
children
|
|
1633
2502
|
}
|
|
1634
2503
|
),
|
|
1635
|
-
/* @__PURE__ */ (0,
|
|
2504
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectScrollDownButton, {})
|
|
1636
2505
|
]
|
|
1637
2506
|
}
|
|
1638
2507
|
) });
|
|
1639
2508
|
});
|
|
1640
2509
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
1641
|
-
var SelectLabel =
|
|
2510
|
+
var SelectLabel = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1642
2511
|
SelectPrimitive.Label,
|
|
1643
2512
|
{
|
|
1644
2513
|
ref,
|
|
@@ -1647,7 +2516,7 @@ var SelectLabel = React10.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1647
2516
|
}
|
|
1648
2517
|
));
|
|
1649
2518
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
1650
|
-
var SelectItem =
|
|
2519
|
+
var SelectItem = React19.forwardRef(({ className, children, description, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
1651
2520
|
SelectPrimitive.Item,
|
|
1652
2521
|
{
|
|
1653
2522
|
ref,
|
|
@@ -1658,14 +2527,14 @@ var SelectItem = React10.forwardRef(({ className, children, description, ...prop
|
|
|
1658
2527
|
),
|
|
1659
2528
|
...props,
|
|
1660
2529
|
children: [
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1662
|
-
/* @__PURE__ */ (0,
|
|
1663
|
-
description ? /* @__PURE__ */ (0,
|
|
2530
|
+
/* @__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" }) }) }),
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(SelectPrimitive.ItemText, { children }),
|
|
2532
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "block text-xs leading-snug text-muted-foreground", children: description }) : null
|
|
1664
2533
|
]
|
|
1665
2534
|
}
|
|
1666
2535
|
));
|
|
1667
2536
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
1668
|
-
var SelectSeparator =
|
|
2537
|
+
var SelectSeparator = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1669
2538
|
SelectPrimitive.Separator,
|
|
1670
2539
|
{
|
|
1671
2540
|
ref,
|
|
@@ -1677,9 +2546,9 @@ SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
|
|
|
1677
2546
|
|
|
1678
2547
|
// src/separator.tsx
|
|
1679
2548
|
var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
|
|
1680
|
-
var
|
|
1681
|
-
var
|
|
1682
|
-
var
|
|
2549
|
+
var React20 = __toESM(require("react"), 1);
|
|
2550
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2551
|
+
var Separator4 = React20.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1683
2552
|
SeparatorPrimitive.Root,
|
|
1684
2553
|
{
|
|
1685
2554
|
ref,
|
|
@@ -1693,17 +2562,17 @@ var Separator2 = React11.forwardRef(({ className, orientation = "horizontal", de
|
|
|
1693
2562
|
...props
|
|
1694
2563
|
}
|
|
1695
2564
|
));
|
|
1696
|
-
|
|
2565
|
+
Separator4.displayName = SeparatorPrimitive.Root.displayName;
|
|
1697
2566
|
|
|
1698
2567
|
// src/sheet.tsx
|
|
1699
2568
|
var SheetPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
1700
|
-
var
|
|
2569
|
+
var import_react_tree2 = require("@ai-matrx/kit/react-tree");
|
|
1701
2570
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
1702
|
-
var
|
|
1703
|
-
var
|
|
1704
|
-
var SheetContentBase =
|
|
2571
|
+
var React21 = __toESM(require("react"), 1);
|
|
2572
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2573
|
+
var SheetContentBase = React21.forwardRef(({ ...props }, ref) => {
|
|
1705
2574
|
const isModal = useRadixDialogModal();
|
|
1706
|
-
return /* @__PURE__ */ (0,
|
|
2575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1707
2576
|
SheetPrimitive.Content,
|
|
1708
2577
|
{
|
|
1709
2578
|
...props,
|
|
@@ -1713,15 +2582,15 @@ var SheetContentBase = React12.forwardRef(({ ...props }, ref) => {
|
|
|
1713
2582
|
);
|
|
1714
2583
|
});
|
|
1715
2584
|
SheetContentBase.displayName = "SheetContentBase";
|
|
1716
|
-
var Sheet =
|
|
2585
|
+
var Sheet = React21.forwardRef(({ children, ...props }, _ref) => {
|
|
1717
2586
|
const modal = props.modal ?? true;
|
|
1718
|
-
return /* @__PURE__ */ (0,
|
|
2587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(RadixDialogModalProvider, { modal, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SheetPrimitive.Root, { ...props, modal, children }) });
|
|
1719
2588
|
});
|
|
1720
2589
|
Sheet.displayName = "Sheet";
|
|
1721
2590
|
var SheetTrigger = SheetPrimitive.Trigger;
|
|
1722
2591
|
var SheetClose = SheetPrimitive.Close;
|
|
1723
2592
|
var SheetPortal = SheetPrimitive.Portal;
|
|
1724
|
-
var SheetOverlay =
|
|
2593
|
+
var SheetOverlay = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1725
2594
|
SheetPrimitive.Overlay,
|
|
1726
2595
|
{
|
|
1727
2596
|
className: cn(
|
|
@@ -1750,7 +2619,7 @@ var sheetVariants = (0, import_class_variance_authority4.cva)(
|
|
|
1750
2619
|
}
|
|
1751
2620
|
}
|
|
1752
2621
|
);
|
|
1753
|
-
var SheetDescription =
|
|
2622
|
+
var SheetDescription = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1754
2623
|
SheetPrimitive.Description,
|
|
1755
2624
|
{
|
|
1756
2625
|
ref,
|
|
@@ -1759,7 +2628,7 @@ var SheetDescription = React12.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
1759
2628
|
}
|
|
1760
2629
|
));
|
|
1761
2630
|
SheetDescription.displayName = SheetPrimitive.Description.displayName;
|
|
1762
|
-
var SheetContent =
|
|
2631
|
+
var SheetContent = React21.forwardRef(
|
|
1763
2632
|
({
|
|
1764
2633
|
side = "right",
|
|
1765
2634
|
className,
|
|
@@ -1769,10 +2638,10 @@ var SheetContent = React12.forwardRef(
|
|
|
1769
2638
|
overlayClassName,
|
|
1770
2639
|
...props
|
|
1771
2640
|
}, ref) => {
|
|
1772
|
-
const hasDescription = (0,
|
|
1773
|
-
return /* @__PURE__ */ (0,
|
|
1774
|
-
!hideOverlay && /* @__PURE__ */ (0,
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
2641
|
+
const hasDescription = (0, import_react_tree2.treeContainsComponent)(children, SheetDescription) || (0, import_react_tree2.treeContainsComponent)(children, SheetPrimitive.Description);
|
|
2642
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(SheetPortal, { children: [
|
|
2643
|
+
!hideOverlay && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(SheetOverlay, { className: overlayClassName }),
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
1776
2645
|
SheetContentBase,
|
|
1777
2646
|
{
|
|
1778
2647
|
ref,
|
|
@@ -1780,9 +2649,9 @@ var SheetContent = React12.forwardRef(
|
|
|
1780
2649
|
...hasDescription ? {} : { "aria-describedby": void 0 },
|
|
1781
2650
|
...props,
|
|
1782
2651
|
children: [
|
|
1783
|
-
!hideCloseButton && /* @__PURE__ */ (0,
|
|
1784
|
-
/* @__PURE__ */ (0,
|
|
1785
|
-
/* @__PURE__ */ (0,
|
|
2652
|
+
!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: [
|
|
2653
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Cross2Icon, { className: "h-4 w-4" }),
|
|
2654
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "sr-only", children: "Close" })
|
|
1786
2655
|
] }),
|
|
1787
2656
|
children
|
|
1788
2657
|
]
|
|
@@ -1795,7 +2664,7 @@ SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
|
1795
2664
|
var SheetHeader = ({
|
|
1796
2665
|
className,
|
|
1797
2666
|
...props
|
|
1798
|
-
}) => /* @__PURE__ */ (0,
|
|
2667
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1799
2668
|
"div",
|
|
1800
2669
|
{
|
|
1801
2670
|
className: cn(
|
|
@@ -1809,7 +2678,7 @@ SheetHeader.displayName = "SheetHeader";
|
|
|
1809
2678
|
var SheetFooter = ({
|
|
1810
2679
|
className,
|
|
1811
2680
|
...props
|
|
1812
|
-
}) => /* @__PURE__ */ (0,
|
|
2681
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1813
2682
|
"div",
|
|
1814
2683
|
{
|
|
1815
2684
|
className: cn(
|
|
@@ -1820,7 +2689,7 @@ var SheetFooter = ({
|
|
|
1820
2689
|
}
|
|
1821
2690
|
);
|
|
1822
2691
|
SheetFooter.displayName = "SheetFooter";
|
|
1823
|
-
var SheetTitle =
|
|
2692
|
+
var SheetTitle = React21.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1824
2693
|
SheetPrimitive.Title,
|
|
1825
2694
|
{
|
|
1826
2695
|
ref,
|
|
@@ -1831,12 +2700,12 @@ var SheetTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
1831
2700
|
SheetTitle.displayName = SheetPrimitive.Title.displayName;
|
|
1832
2701
|
|
|
1833
2702
|
// src/skeleton.tsx
|
|
1834
|
-
var
|
|
2703
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1835
2704
|
function Skeleton({
|
|
1836
2705
|
className,
|
|
1837
2706
|
...props
|
|
1838
2707
|
}) {
|
|
1839
|
-
return /* @__PURE__ */ (0,
|
|
2708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1840
2709
|
"div",
|
|
1841
2710
|
{
|
|
1842
2711
|
className: cn("animate-pulse rounded-md bg-primary/10", className),
|
|
@@ -1845,9 +2714,48 @@ function Skeleton({
|
|
|
1845
2714
|
);
|
|
1846
2715
|
}
|
|
1847
2716
|
|
|
2717
|
+
// src/switch.tsx
|
|
2718
|
+
var SwitchPrimitives = __toESM(require("@radix-ui/react-switch"), 1);
|
|
2719
|
+
var React22 = __toESM(require("react"), 1);
|
|
2720
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2721
|
+
var SWITCH_SIZES = {
|
|
2722
|
+
sm: {
|
|
2723
|
+
root: "h-4 w-9 border-border data-[state=unchecked]:bg-input",
|
|
2724
|
+
thumb: "h-4 w-4 border border-primary data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
2725
|
+
},
|
|
2726
|
+
md: {
|
|
2727
|
+
root: "h-5 w-9 border-transparent data-[state=unchecked]:bg-input",
|
|
2728
|
+
thumb: "h-4 w-4 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0"
|
|
2729
|
+
}
|
|
2730
|
+
};
|
|
2731
|
+
var Switch = React22.forwardRef(({ className, size = "md", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2732
|
+
SwitchPrimitives.Root,
|
|
2733
|
+
{
|
|
2734
|
+
ref,
|
|
2735
|
+
"data-slot": "switch",
|
|
2736
|
+
className: cn(
|
|
2737
|
+
"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",
|
|
2738
|
+
SWITCH_SIZES[size].root,
|
|
2739
|
+
className
|
|
2740
|
+
),
|
|
2741
|
+
...props,
|
|
2742
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2743
|
+
SwitchPrimitives.Thumb,
|
|
2744
|
+
{
|
|
2745
|
+
"data-slot": "switch-thumb",
|
|
2746
|
+
className: cn(
|
|
2747
|
+
"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
2748
|
+
SWITCH_SIZES[size].thumb
|
|
2749
|
+
)
|
|
2750
|
+
}
|
|
2751
|
+
)
|
|
2752
|
+
}
|
|
2753
|
+
));
|
|
2754
|
+
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
2755
|
+
|
|
1848
2756
|
// src/tabbed-bottom-sheet.tsx
|
|
1849
2757
|
var import_react4 = require("react");
|
|
1850
|
-
var
|
|
2758
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1851
2759
|
function TabbedBottomSheet({
|
|
1852
2760
|
open,
|
|
1853
2761
|
onOpenChange,
|
|
@@ -1861,15 +2769,15 @@ function TabbedBottomSheet({
|
|
|
1861
2769
|
if (open) setSelectedTabId(null);
|
|
1862
2770
|
}
|
|
1863
2771
|
const selectedTab = selectedTabId ? tabs.find((tab) => tab.id === selectedTabId) : null;
|
|
1864
|
-
return /* @__PURE__ */ (0,
|
|
2772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1865
2773
|
BottomSheet,
|
|
1866
2774
|
{
|
|
1867
2775
|
open,
|
|
1868
2776
|
onOpenChange,
|
|
1869
2777
|
title,
|
|
1870
2778
|
size: "full",
|
|
1871
|
-
children: /* @__PURE__ */ (0,
|
|
1872
|
-
/* @__PURE__ */ (0,
|
|
2779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "matrx-mobile-sheet flex min-h-0 flex-1 flex-col", children: [
|
|
2780
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1873
2781
|
BottomSheetHeader,
|
|
1874
2782
|
{
|
|
1875
2783
|
title: selectedTab ? selectedTab.label : title,
|
|
@@ -1877,19 +2785,19 @@ function TabbedBottomSheet({
|
|
|
1877
2785
|
onBack: () => setSelectedTabId(null)
|
|
1878
2786
|
}
|
|
1879
2787
|
),
|
|
1880
|
-
selectedTab ? /* @__PURE__ */ (0,
|
|
2788
|
+
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
2789
|
const Icon2 = tab.icon;
|
|
1882
|
-
return /* @__PURE__ */ (0,
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1883
2791
|
"button",
|
|
1884
2792
|
{
|
|
1885
2793
|
type: "button",
|
|
1886
2794
|
onClick: () => setSelectedTabId(tab.id),
|
|
1887
2795
|
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
2796
|
children: [
|
|
1889
|
-
Icon2 ? /* @__PURE__ */ (0,
|
|
1890
|
-
/* @__PURE__ */ (0,
|
|
2797
|
+
Icon2 ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Icon2, { className: "h-5 w-5 shrink-0 text-muted-foreground" }) : null,
|
|
2798
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "min-w-0 flex-1 text-base text-foreground", children: tab.label }),
|
|
1891
2799
|
tab.trailing,
|
|
1892
|
-
/* @__PURE__ */ (0,
|
|
2800
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ChevronRightIcon, { className: "h-5 w-5 shrink-0 text-muted-foreground" })
|
|
1893
2801
|
]
|
|
1894
2802
|
}
|
|
1895
2803
|
) }, tab.id);
|
|
@@ -1899,6 +2807,331 @@ function TabbedBottomSheet({
|
|
|
1899
2807
|
);
|
|
1900
2808
|
}
|
|
1901
2809
|
|
|
2810
|
+
// src/table.tsx
|
|
2811
|
+
var React23 = __toESM(require("react"), 1);
|
|
2812
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2813
|
+
var TABLE_SIZES = {
|
|
2814
|
+
sm: { head: "px-2", cell: "p-2" },
|
|
2815
|
+
md: { head: "px-3", cell: "p-3" }
|
|
2816
|
+
};
|
|
2817
|
+
var TableSizeContext = React23.createContext("sm");
|
|
2818
|
+
function useTableSize() {
|
|
2819
|
+
return React23.useContext(TableSizeContext);
|
|
2820
|
+
}
|
|
2821
|
+
var Table = React23.forwardRef(
|
|
2822
|
+
({ className, size = "sm", wrap = true, wrapperClassName, ...props }, ref) => {
|
|
2823
|
+
const table = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2824
|
+
"table",
|
|
2825
|
+
{
|
|
2826
|
+
ref,
|
|
2827
|
+
"data-slot": "table",
|
|
2828
|
+
"data-size": size,
|
|
2829
|
+
className: cn("w-full caption-bottom text-sm", className),
|
|
2830
|
+
...props
|
|
2831
|
+
}
|
|
2832
|
+
);
|
|
2833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TableSizeContext.Provider, { value: size, children: wrap ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2834
|
+
"div",
|
|
2835
|
+
{
|
|
2836
|
+
"data-slot": "table-wrapper",
|
|
2837
|
+
className: cn("relative w-full overflow-auto", wrapperClassName),
|
|
2838
|
+
children: table
|
|
2839
|
+
}
|
|
2840
|
+
) : table });
|
|
2841
|
+
}
|
|
2842
|
+
);
|
|
2843
|
+
Table.displayName = "Table";
|
|
2844
|
+
var TableHeader = React23.forwardRef(({ className, sticky = false, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2845
|
+
"thead",
|
|
2846
|
+
{
|
|
2847
|
+
ref,
|
|
2848
|
+
"data-slot": "table-header",
|
|
2849
|
+
className: cn(
|
|
2850
|
+
"[&_tr]:border-b",
|
|
2851
|
+
sticky && "sticky top-0 z-10 bg-background",
|
|
2852
|
+
className
|
|
2853
|
+
),
|
|
2854
|
+
...props
|
|
2855
|
+
}
|
|
2856
|
+
));
|
|
2857
|
+
TableHeader.displayName = "TableHeader";
|
|
2858
|
+
var TableBody = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2859
|
+
"tbody",
|
|
2860
|
+
{
|
|
2861
|
+
ref,
|
|
2862
|
+
"data-slot": "table-body",
|
|
2863
|
+
className: cn("[&_tr:last-child]:border-0", className),
|
|
2864
|
+
...props
|
|
2865
|
+
}
|
|
2866
|
+
));
|
|
2867
|
+
TableBody.displayName = "TableBody";
|
|
2868
|
+
var TableFooter = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2869
|
+
"tfoot",
|
|
2870
|
+
{
|
|
2871
|
+
ref,
|
|
2872
|
+
"data-slot": "table-footer",
|
|
2873
|
+
className: cn(
|
|
2874
|
+
"border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
|
|
2875
|
+
className
|
|
2876
|
+
),
|
|
2877
|
+
...props
|
|
2878
|
+
}
|
|
2879
|
+
));
|
|
2880
|
+
TableFooter.displayName = "TableFooter";
|
|
2881
|
+
var TableRow = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2882
|
+
"tr",
|
|
2883
|
+
{
|
|
2884
|
+
ref,
|
|
2885
|
+
"data-slot": "table-row",
|
|
2886
|
+
className: cn(
|
|
2887
|
+
"border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
|
|
2888
|
+
className
|
|
2889
|
+
),
|
|
2890
|
+
...props
|
|
2891
|
+
}
|
|
2892
|
+
));
|
|
2893
|
+
TableRow.displayName = "TableRow";
|
|
2894
|
+
var TableHead = React23.forwardRef(({ className, ...props }, ref) => {
|
|
2895
|
+
const size = useTableSize();
|
|
2896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2897
|
+
"th",
|
|
2898
|
+
{
|
|
2899
|
+
ref,
|
|
2900
|
+
"data-slot": "table-head",
|
|
2901
|
+
className: cn(
|
|
2902
|
+
"h-10 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
2903
|
+
TABLE_SIZES[size].head,
|
|
2904
|
+
className
|
|
2905
|
+
),
|
|
2906
|
+
...props
|
|
2907
|
+
}
|
|
2908
|
+
);
|
|
2909
|
+
});
|
|
2910
|
+
TableHead.displayName = "TableHead";
|
|
2911
|
+
var TableCell = React23.forwardRef(({ className, ...props }, ref) => {
|
|
2912
|
+
const size = useTableSize();
|
|
2913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2914
|
+
"td",
|
|
2915
|
+
{
|
|
2916
|
+
ref,
|
|
2917
|
+
"data-slot": "table-cell",
|
|
2918
|
+
className: cn(
|
|
2919
|
+
"align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
|
|
2920
|
+
TABLE_SIZES[size].cell,
|
|
2921
|
+
className
|
|
2922
|
+
),
|
|
2923
|
+
...props
|
|
2924
|
+
}
|
|
2925
|
+
);
|
|
2926
|
+
});
|
|
2927
|
+
TableCell.displayName = "TableCell";
|
|
2928
|
+
var TableCaption = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2929
|
+
"caption",
|
|
2930
|
+
{
|
|
2931
|
+
ref,
|
|
2932
|
+
"data-slot": "table-caption",
|
|
2933
|
+
className: cn("mt-4 text-sm text-muted-foreground", className),
|
|
2934
|
+
...props
|
|
2935
|
+
}
|
|
2936
|
+
));
|
|
2937
|
+
TableCaption.displayName = "TableCaption";
|
|
2938
|
+
|
|
2939
|
+
// src/tabs.tsx
|
|
2940
|
+
var TabsPrimitive = __toESM(require("@radix-ui/react-tabs"), 1);
|
|
2941
|
+
var React24 = __toESM(require("react"), 1);
|
|
2942
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2943
|
+
var Tabs = TabsPrimitive.Root;
|
|
2944
|
+
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";
|
|
2945
|
+
var TabsList = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2946
|
+
TabsPrimitive.List,
|
|
2947
|
+
{
|
|
2948
|
+
ref,
|
|
2949
|
+
"data-slot": "tabs-list",
|
|
2950
|
+
className: cn(
|
|
2951
|
+
"inline-flex h-9 items-center justify-center gap-1 rounded-lg bg-muted p-1 text-muted-foreground",
|
|
2952
|
+
className
|
|
2953
|
+
),
|
|
2954
|
+
...props
|
|
2955
|
+
}
|
|
2956
|
+
));
|
|
2957
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
2958
|
+
var TabsTrigger = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2959
|
+
TabsPrimitive.Trigger,
|
|
2960
|
+
{
|
|
2961
|
+
ref,
|
|
2962
|
+
"data-slot": "tabs-trigger",
|
|
2963
|
+
className: cn(
|
|
2964
|
+
TABS_TRIGGER_BASE,
|
|
2965
|
+
"text-muted-foreground hover:text-foreground",
|
|
2966
|
+
className
|
|
2967
|
+
),
|
|
2968
|
+
...props
|
|
2969
|
+
}
|
|
2970
|
+
));
|
|
2971
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
2972
|
+
var TabsTriggerCore = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2973
|
+
TabsPrimitive.Trigger,
|
|
2974
|
+
{
|
|
2975
|
+
ref,
|
|
2976
|
+
"data-slot": "tabs-trigger",
|
|
2977
|
+
className: cn(TABS_TRIGGER_BASE, className),
|
|
2978
|
+
...props
|
|
2979
|
+
}
|
|
2980
|
+
));
|
|
2981
|
+
TabsTriggerCore.displayName = TabsPrimitive.Trigger.displayName;
|
|
2982
|
+
var TabsContent = React24.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2983
|
+
TabsPrimitive.Content,
|
|
2984
|
+
{
|
|
2985
|
+
ref,
|
|
2986
|
+
"data-slot": "tabs-content",
|
|
2987
|
+
className: cn(
|
|
2988
|
+
"data-[state=inactive]:hidden",
|
|
2989
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
2990
|
+
className
|
|
2991
|
+
),
|
|
2992
|
+
...props
|
|
2993
|
+
}
|
|
2994
|
+
));
|
|
2995
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
2996
|
+
|
|
2997
|
+
// src/textarea.tsx
|
|
2998
|
+
var React25 = __toESM(require("react"), 1);
|
|
2999
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3000
|
+
var FILL_HEIGHT_REGEX = /(?:^|\s)(h-full|h-dvh|flex-1|grow)(?:\s|$)/;
|
|
3001
|
+
var FILL_WIDTH_REGEX = /(?:^|\s)(w-full|w-screen)(?:\s|$)/;
|
|
3002
|
+
function getStretchClasses(className) {
|
|
3003
|
+
if (!className) return void 0;
|
|
3004
|
+
const fills = [];
|
|
3005
|
+
if (FILL_HEIGHT_REGEX.test(className)) fills.push("h-full min-h-0");
|
|
3006
|
+
if (FILL_WIDTH_REGEX.test(className)) fills.push("w-full");
|
|
3007
|
+
return fills.length ? fills.join(" ") : void 0;
|
|
3008
|
+
}
|
|
3009
|
+
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";
|
|
3010
|
+
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";
|
|
3011
|
+
function useAutoGrow(ref, value, autoGrow = false, minHeight, maxHeight) {
|
|
3012
|
+
React25.useEffect(() => {
|
|
3013
|
+
if (!autoGrow || !ref.current) return;
|
|
3014
|
+
const textarea = ref.current;
|
|
3015
|
+
textarea.style.height = "auto";
|
|
3016
|
+
let newHeight = textarea.scrollHeight;
|
|
3017
|
+
if (minHeight) newHeight = Math.max(newHeight, minHeight);
|
|
3018
|
+
if (maxHeight && newHeight >= maxHeight) {
|
|
3019
|
+
textarea.style.height = `${maxHeight}px`;
|
|
3020
|
+
textarea.style.overflowY = "auto";
|
|
3021
|
+
} else {
|
|
3022
|
+
textarea.style.height = `${newHeight}px`;
|
|
3023
|
+
textarea.style.overflowY = "hidden";
|
|
3024
|
+
}
|
|
3025
|
+
}, [value, autoGrow, minHeight, maxHeight, ref]);
|
|
3026
|
+
}
|
|
3027
|
+
function useMergedTextareaRef(forwarded) {
|
|
3028
|
+
const internal = React25.useRef(null);
|
|
3029
|
+
const callback = React25.useCallback(
|
|
3030
|
+
(node) => {
|
|
3031
|
+
internal.current = node;
|
|
3032
|
+
if (typeof forwarded === "function") forwarded(node);
|
|
3033
|
+
else if (forwarded) forwarded.current = node;
|
|
3034
|
+
},
|
|
3035
|
+
[forwarded]
|
|
3036
|
+
);
|
|
3037
|
+
return { ref: internal, callback };
|
|
3038
|
+
}
|
|
3039
|
+
function boxStyle(minHeight, maxHeight) {
|
|
3040
|
+
if (minHeight === void 0 && maxHeight === void 0) return void 0;
|
|
3041
|
+
return {
|
|
3042
|
+
minHeight: minHeight ? `${minHeight}px` : void 0,
|
|
3043
|
+
maxHeight: maxHeight ? `${maxHeight}px` : void 0
|
|
3044
|
+
};
|
|
3045
|
+
}
|
|
3046
|
+
var Textarea = React25.forwardRef(
|
|
3047
|
+
({ className, autoGrow, minHeight, maxHeight, wrapperClassName, ...props }, forwarded) => {
|
|
3048
|
+
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3049
|
+
const stretchClasses = getStretchClasses(className);
|
|
3050
|
+
const needsWrapper = Boolean(wrapperClassName || stretchClasses);
|
|
3051
|
+
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
3052
|
+
const textarea = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3053
|
+
"textarea",
|
|
3054
|
+
{
|
|
3055
|
+
ref: callback,
|
|
3056
|
+
"data-slot": "textarea",
|
|
3057
|
+
className: cn(
|
|
3058
|
+
TEXTAREA_ELEVATED_CLASS,
|
|
3059
|
+
autoGrow && "resize-none",
|
|
3060
|
+
stretchClasses,
|
|
3061
|
+
className
|
|
3062
|
+
),
|
|
3063
|
+
style: boxStyle(minHeight, maxHeight),
|
|
3064
|
+
...props
|
|
3065
|
+
}
|
|
3066
|
+
);
|
|
3067
|
+
if (!needsWrapper) return textarea;
|
|
3068
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn(stretchClasses, wrapperClassName), children: textarea });
|
|
3069
|
+
}
|
|
3070
|
+
);
|
|
3071
|
+
Textarea.displayName = "Textarea";
|
|
3072
|
+
var BasicTextarea = React25.forwardRef(
|
|
3073
|
+
({ className, autoGrow, minHeight, maxHeight, ...props }, forwarded) => {
|
|
3074
|
+
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3075
|
+
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
3076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3077
|
+
"textarea",
|
|
3078
|
+
{
|
|
3079
|
+
ref: callback,
|
|
3080
|
+
"data-slot": "textarea",
|
|
3081
|
+
className: cn(
|
|
3082
|
+
TEXTAREA_CONTROL_CLASS,
|
|
3083
|
+
"h-auto min-h-[60px]",
|
|
3084
|
+
autoGrow && "resize-none",
|
|
3085
|
+
className
|
|
3086
|
+
),
|
|
3087
|
+
style: boxStyle(minHeight, maxHeight),
|
|
3088
|
+
...props
|
|
3089
|
+
}
|
|
3090
|
+
);
|
|
3091
|
+
}
|
|
3092
|
+
);
|
|
3093
|
+
BasicTextarea.displayName = "BasicTextarea";
|
|
3094
|
+
var TextareaWithPrefix = React25.forwardRef(
|
|
3095
|
+
({
|
|
3096
|
+
prefix,
|
|
3097
|
+
className,
|
|
3098
|
+
wrapperClassName,
|
|
3099
|
+
autoGrow,
|
|
3100
|
+
minHeight,
|
|
3101
|
+
maxHeight,
|
|
3102
|
+
...props
|
|
3103
|
+
}, forwarded) => {
|
|
3104
|
+
const { ref, callback } = useMergedTextareaRef(forwarded);
|
|
3105
|
+
useAutoGrow(ref, props.value, autoGrow, minHeight, maxHeight);
|
|
3106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3107
|
+
"div",
|
|
3108
|
+
{
|
|
3109
|
+
className: cn("relative", getStretchClasses(className), wrapperClassName),
|
|
3110
|
+
children: [
|
|
3111
|
+
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,
|
|
3112
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
3113
|
+
"textarea",
|
|
3114
|
+
{
|
|
3115
|
+
ref: callback,
|
|
3116
|
+
"data-slot": "textarea",
|
|
3117
|
+
className: cn(
|
|
3118
|
+
TEXTAREA_CONTROL_CLASS,
|
|
3119
|
+
"resize-y",
|
|
3120
|
+
prefix && "pl-10",
|
|
3121
|
+
autoGrow && "resize-none",
|
|
3122
|
+
className
|
|
3123
|
+
),
|
|
3124
|
+
style: boxStyle(minHeight, maxHeight),
|
|
3125
|
+
...props
|
|
3126
|
+
}
|
|
3127
|
+
)
|
|
3128
|
+
]
|
|
3129
|
+
}
|
|
3130
|
+
);
|
|
3131
|
+
}
|
|
3132
|
+
);
|
|
3133
|
+
TextareaWithPrefix.displayName = "TextareaWithPrefix";
|
|
3134
|
+
|
|
1902
3135
|
// src/use-scroll-fade.ts
|
|
1903
3136
|
var import_react5 = require("react");
|
|
1904
3137
|
var EPSILON = 2;
|