@moontra/moonui 3.4.0 → 4.1.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/dist/index.d.mts +34 -19
- package/dist/index.d.ts +34 -19
- package/dist/index.global.js +355 -42
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +539 -387
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +505 -354
- package/dist/index.mjs.map +1 -1
- package/dist/lib/theme.global.js +14 -1
- package/dist/lib/theme.global.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/__tests__/alert.test.tsx +5 -5
- package/src/components/ui/__tests__/avatar.test.tsx +12 -12
- package/src/components/ui/__tests__/badge.test.tsx +17 -1
- package/src/components/ui/__tests__/label.test.tsx +3 -2
- package/src/components/ui/__tests__/select.test.tsx +24 -2
- package/src/components/ui/__tests__/switch.test.tsx +36 -3
- package/src/components/ui/__tests__/tags-input.test.tsx +163 -0
- package/src/components/ui/alert.tsx +5 -2
- package/src/components/ui/aspect-ratio.tsx +9 -3
- package/src/components/ui/avatar.tsx +18 -6
- package/src/components/ui/badge.tsx +18 -11
- package/src/components/ui/button.tsx +3 -0
- package/src/components/ui/date-picker.tsx +38 -19
- package/src/components/ui/file-upload.tsx +4 -0
- package/src/components/ui/index.ts +22 -0
- package/src/components/ui/input-otp.tsx +5 -0
- package/src/components/ui/input.tsx +7 -2
- package/src/components/ui/label.tsx +6 -3
- package/src/components/ui/select.tsx +59 -23
- package/src/components/ui/simple-editor.tsx +18 -3
- package/src/components/ui/switch.tsx +108 -51
- package/src/components/ui/tags-input.tsx +86 -14
- package/src/components/ui/textarea.tsx +8 -4
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var React24 = require('react');
|
|
6
6
|
var AccordionPrimitive = require('@radix-ui/react-accordion');
|
|
7
7
|
var lucideReact = require('lucide-react');
|
|
8
8
|
var clsx = require('clsx');
|
|
@@ -52,7 +52,7 @@ function _interopNamespace(e) {
|
|
|
52
52
|
return Object.freeze(n);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
var
|
|
55
|
+
var React24__namespace = /*#__PURE__*/_interopNamespace(React24);
|
|
56
56
|
var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
|
|
57
57
|
var AvatarPrimitive__namespace = /*#__PURE__*/_interopNamespace(AvatarPrimitive);
|
|
58
58
|
var useEmblaCarousel__default = /*#__PURE__*/_interopDefault(useEmblaCarousel);
|
|
@@ -76,7 +76,7 @@ function cn(...inputs) {
|
|
|
76
76
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
77
77
|
}
|
|
78
78
|
var Accordion = AccordionPrimitive__namespace.Root;
|
|
79
|
-
var AccordionItem =
|
|
79
|
+
var AccordionItem = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
80
80
|
AccordionPrimitive__namespace.Item,
|
|
81
81
|
{
|
|
82
82
|
ref,
|
|
@@ -85,7 +85,7 @@ var AccordionItem = React10__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
85
85
|
}
|
|
86
86
|
));
|
|
87
87
|
AccordionItem.displayName = "AccordionItem";
|
|
88
|
-
var AccordionTrigger =
|
|
88
|
+
var AccordionTrigger = React24__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { className: "flex", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
89
89
|
AccordionPrimitive__namespace.Trigger,
|
|
90
90
|
{
|
|
91
91
|
ref,
|
|
@@ -103,7 +103,7 @@ var AccordionTrigger = React10__namespace.forwardRef(({ className, children, ...
|
|
|
103
103
|
}
|
|
104
104
|
) }));
|
|
105
105
|
AccordionTrigger.displayName = AccordionPrimitive__namespace.Trigger.displayName;
|
|
106
|
-
var AccordionContent =
|
|
106
|
+
var AccordionContent = React24__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
107
107
|
AccordionPrimitive__namespace.Content,
|
|
108
108
|
{
|
|
109
109
|
ref,
|
|
@@ -127,7 +127,10 @@ var alertVariants = classVarianceAuthority.cva(
|
|
|
127
127
|
success: "bg-success/10 text-success border-success/30",
|
|
128
128
|
warning: "bg-warning/10 text-warning border-warning/30",
|
|
129
129
|
error: "bg-destructive/10 text-destructive border-destructive/30",
|
|
130
|
-
info
|
|
130
|
+
// `--info` token'ı (tokens.css) blue-500 ile birebir aynı değeri
|
|
131
|
+
// taşır → görsel değişiklik yok, ancak varyant artık temaya ve
|
|
132
|
+
// karanlık moda duyarlı. Kardeş varyantlarla simetrik.
|
|
133
|
+
info: "bg-info/10 text-info border-info/30"
|
|
131
134
|
},
|
|
132
135
|
size: {
|
|
133
136
|
sm: "py-2 text-xs",
|
|
@@ -153,7 +156,7 @@ var alertVariants = classVarianceAuthority.cva(
|
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
);
|
|
156
|
-
var Alert =
|
|
159
|
+
var Alert = React24__namespace.forwardRef(
|
|
157
160
|
({
|
|
158
161
|
className,
|
|
159
162
|
variant = "default",
|
|
@@ -165,7 +168,7 @@ var Alert = React10__namespace.forwardRef(
|
|
|
165
168
|
children,
|
|
166
169
|
...props
|
|
167
170
|
}, ref) => {
|
|
168
|
-
const Icon2 =
|
|
171
|
+
const Icon2 = React24__namespace.useMemo(() => {
|
|
169
172
|
switch (variant) {
|
|
170
173
|
case "success":
|
|
171
174
|
return lucideReact.Check;
|
|
@@ -203,7 +206,7 @@ var Alert = React10__namespace.forwardRef(
|
|
|
203
206
|
{
|
|
204
207
|
onClick: onClose,
|
|
205
208
|
className: "absolute right-3 top-3 inline-flex h-6 w-6 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100",
|
|
206
|
-
"aria-label": "
|
|
209
|
+
"aria-label": "Close alert",
|
|
207
210
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
|
|
208
211
|
}
|
|
209
212
|
)
|
|
@@ -213,7 +216,7 @@ var Alert = React10__namespace.forwardRef(
|
|
|
213
216
|
}
|
|
214
217
|
);
|
|
215
218
|
Alert.displayName = "Alert";
|
|
216
|
-
var AlertTitle =
|
|
219
|
+
var AlertTitle = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
217
220
|
"h5",
|
|
218
221
|
{
|
|
219
222
|
ref,
|
|
@@ -226,7 +229,7 @@ var AlertTitle = React10__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
226
229
|
}
|
|
227
230
|
));
|
|
228
231
|
AlertTitle.displayName = "AlertTitle";
|
|
229
|
-
var AlertDescription =
|
|
232
|
+
var AlertDescription = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
230
233
|
"div",
|
|
231
234
|
{
|
|
232
235
|
ref,
|
|
@@ -243,11 +246,15 @@ var aspectRatioVariants = classVarianceAuthority.cva(
|
|
|
243
246
|
"relative overflow-hidden",
|
|
244
247
|
{
|
|
245
248
|
variants: {
|
|
249
|
+
// `variant` yalnız yüzey/kenarlık eksenini yönetir. Önceden her varyant
|
|
250
|
+
// ayrıca `rounded-md` taşıyordu ve `radius` ekseniyle çakışıyordu
|
|
251
|
+
// (aynı anda iki `rounded-*` sınıfı üretiliyordu). Köşe yuvarlaması artık
|
|
252
|
+
// TEK kaynaktan: `radius`.
|
|
246
253
|
variant: {
|
|
247
|
-
default: "
|
|
254
|
+
default: "bg-muted/10",
|
|
248
255
|
ghost: "bg-transparent",
|
|
249
|
-
outline: "
|
|
250
|
-
card: "
|
|
256
|
+
outline: "border border-border",
|
|
257
|
+
card: "bg-card shadow-sm"
|
|
251
258
|
},
|
|
252
259
|
radius: {
|
|
253
260
|
none: "rounded-none",
|
|
@@ -258,11 +265,13 @@ var aspectRatioVariants = classVarianceAuthority.cva(
|
|
|
258
265
|
}
|
|
259
266
|
},
|
|
260
267
|
defaultVariants: {
|
|
261
|
-
variant: "default"
|
|
268
|
+
variant: "default",
|
|
269
|
+
// Önceki davranış korunur: her varyant `rounded-md` taşıyordu.
|
|
270
|
+
radius: "md"
|
|
262
271
|
}
|
|
263
272
|
}
|
|
264
273
|
);
|
|
265
|
-
var AspectRatio =
|
|
274
|
+
var AspectRatio = React24__namespace.forwardRef(({ className, variant, radius, ratio = 16 / 9, style, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
266
275
|
"div",
|
|
267
276
|
{
|
|
268
277
|
ref,
|
|
@@ -311,7 +320,7 @@ var avatarVariants = classVarianceAuthority.cva(
|
|
|
311
320
|
}
|
|
312
321
|
}
|
|
313
322
|
);
|
|
314
|
-
var Avatar =
|
|
323
|
+
var Avatar = React24__namespace.forwardRef(({ className, size, radius, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
315
324
|
AvatarPrimitive__namespace.Root,
|
|
316
325
|
{
|
|
317
326
|
ref,
|
|
@@ -320,7 +329,7 @@ var Avatar = React10__namespace.forwardRef(({ className, size, radius, variant,
|
|
|
320
329
|
}
|
|
321
330
|
));
|
|
322
331
|
Avatar.displayName = AvatarPrimitive__namespace.Root.displayName;
|
|
323
|
-
var AvatarImage =
|
|
332
|
+
var AvatarImage = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
324
333
|
AvatarPrimitive__namespace.Image,
|
|
325
334
|
{
|
|
326
335
|
ref,
|
|
@@ -329,7 +338,7 @@ var AvatarImage = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
329
338
|
}
|
|
330
339
|
));
|
|
331
340
|
AvatarImage.displayName = AvatarPrimitive__namespace.Image.displayName;
|
|
332
|
-
var AvatarFallback =
|
|
341
|
+
var AvatarFallback = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
333
342
|
AvatarPrimitive__namespace.Fallback,
|
|
334
343
|
{
|
|
335
344
|
ref,
|
|
@@ -341,10 +350,11 @@ var AvatarFallback = React10__namespace.forwardRef(({ className, ...props }, ref
|
|
|
341
350
|
}
|
|
342
351
|
));
|
|
343
352
|
AvatarFallback.displayName = AvatarPrimitive__namespace.Fallback.displayName;
|
|
344
|
-
var AvatarGroup =
|
|
345
|
-
({ className,
|
|
346
|
-
const
|
|
347
|
-
const
|
|
353
|
+
var AvatarGroup = React24__namespace.forwardRef(
|
|
354
|
+
({ className, max, children, overlapOffset = -8, ...props }, ref) => {
|
|
355
|
+
const childrenArray = React24__namespace.Children.toArray(children);
|
|
356
|
+
const visibleAvatars = max ? childrenArray.slice(0, max) : childrenArray;
|
|
357
|
+
const remainingCount = max ? Math.max(0, childrenArray.length - max) : 0;
|
|
348
358
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
349
359
|
"div",
|
|
350
360
|
{
|
|
@@ -393,11 +403,15 @@ var badgeVariants = classVarianceAuthority.cva(
|
|
|
393
403
|
{
|
|
394
404
|
variants: {
|
|
395
405
|
variant: {
|
|
406
|
+
// KIRICI (issue #261): önceden ham `gray-900`/`white` kullanılıyordu;
|
|
407
|
+
// aynı varyant pro pakette token'lıydı → free ve pro `primary` için
|
|
408
|
+
// farklı renk üretiyordu. Artık token'a bağlı (tema/karanlık moda duyarlı).
|
|
409
|
+
// `primary` VARSAYILAN varyant olduğu için görünür bir renk değişimidir.
|
|
396
410
|
primary: [
|
|
397
|
-
"border-transparent bg-
|
|
398
|
-
"hover:bg-
|
|
399
|
-
"focus-visible:ring-
|
|
400
|
-
"dark:bg-
|
|
411
|
+
"border-transparent bg-primary text-primary-foreground",
|
|
412
|
+
"hover:bg-primary/90",
|
|
413
|
+
"focus-visible:ring-primary/30 dark:focus-visible:ring-primary/40",
|
|
414
|
+
"dark:bg-primary/90 dark:shadow-inner dark:shadow-primary/10"
|
|
401
415
|
],
|
|
402
416
|
secondary: [
|
|
403
417
|
"border-transparent bg-secondary text-secondary-foreground",
|
|
@@ -469,7 +483,7 @@ var badgeVariants = classVarianceAuthority.cva(
|
|
|
469
483
|
}
|
|
470
484
|
}
|
|
471
485
|
);
|
|
472
|
-
|
|
486
|
+
var Badge = React24__namespace.forwardRef(({
|
|
473
487
|
className,
|
|
474
488
|
variant,
|
|
475
489
|
size,
|
|
@@ -483,7 +497,7 @@ function Badge({
|
|
|
483
497
|
noAutoSpacing,
|
|
484
498
|
children,
|
|
485
499
|
...props
|
|
486
|
-
}) {
|
|
500
|
+
}, ref) => {
|
|
487
501
|
let autoLeftIcon = leftIcon;
|
|
488
502
|
let autoChildren = children;
|
|
489
503
|
if (variant === "pro") {
|
|
@@ -501,6 +515,7 @@ function Badge({
|
|
|
501
515
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
502
516
|
"div",
|
|
503
517
|
{
|
|
518
|
+
ref,
|
|
504
519
|
className: cn(
|
|
505
520
|
"moonui-theme",
|
|
506
521
|
badgeVariants({ variant, size, radius }),
|
|
@@ -552,7 +567,8 @@ function Badge({
|
|
|
552
567
|
]
|
|
553
568
|
}
|
|
554
569
|
);
|
|
555
|
-
}
|
|
570
|
+
});
|
|
571
|
+
Badge.displayName = "Badge";
|
|
556
572
|
var breadcrumbVariants = classVarianceAuthority.cva(
|
|
557
573
|
"flex items-center gap-1.5 text-sm",
|
|
558
574
|
{
|
|
@@ -574,7 +590,7 @@ var breadcrumbVariants = classVarianceAuthority.cva(
|
|
|
574
590
|
}
|
|
575
591
|
}
|
|
576
592
|
);
|
|
577
|
-
var Breadcrumb =
|
|
593
|
+
var Breadcrumb = React24__namespace.forwardRef(
|
|
578
594
|
({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
579
595
|
"nav",
|
|
580
596
|
{
|
|
@@ -586,9 +602,9 @@ var Breadcrumb = React10__namespace.forwardRef(
|
|
|
586
602
|
)
|
|
587
603
|
);
|
|
588
604
|
Breadcrumb.displayName = "Breadcrumb";
|
|
589
|
-
var BreadcrumbList =
|
|
605
|
+
var BreadcrumbList = React24__namespace.forwardRef(
|
|
590
606
|
({ className, collapsed, collapsedWidth = 3, ...props }, ref) => {
|
|
591
|
-
const childrenArray =
|
|
607
|
+
const childrenArray = React24__namespace.Children.toArray(props.children).filter(Boolean);
|
|
592
608
|
const childCount = childrenArray.length;
|
|
593
609
|
if (collapsed && childCount > collapsedWidth) {
|
|
594
610
|
const firstItem = childrenArray[0];
|
|
@@ -624,9 +640,9 @@ var BreadcrumbList = React10__namespace.forwardRef(
|
|
|
624
640
|
}
|
|
625
641
|
);
|
|
626
642
|
BreadcrumbList.displayName = "BreadcrumbList";
|
|
627
|
-
var BreadcrumbItem =
|
|
643
|
+
var BreadcrumbItem = React24__namespace.forwardRef(
|
|
628
644
|
({ className, isCurrent, href, asChild = false, ...props }, ref) => {
|
|
629
|
-
const Comp = asChild ?
|
|
645
|
+
const Comp = asChild ? React24__namespace.Fragment : href ? "a" : "span";
|
|
630
646
|
const itemProps = asChild ? {} : href ? { href } : {};
|
|
631
647
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
632
648
|
"li",
|
|
@@ -683,7 +699,7 @@ var BreadcrumbEllipsis = ({
|
|
|
683
699
|
}
|
|
684
700
|
);
|
|
685
701
|
BreadcrumbEllipsis.displayName = "BreadcrumbEllipsis";
|
|
686
|
-
var BreadcrumbLink =
|
|
702
|
+
var BreadcrumbLink = React24__namespace.forwardRef(
|
|
687
703
|
({ className, href, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
688
704
|
"a",
|
|
689
705
|
{
|
|
@@ -698,7 +714,7 @@ var BreadcrumbLink = React10__namespace.forwardRef(
|
|
|
698
714
|
)
|
|
699
715
|
);
|
|
700
716
|
BreadcrumbLink.displayName = "BreadcrumbLink";
|
|
701
|
-
var BreadcrumbPage =
|
|
717
|
+
var BreadcrumbPage = React24__namespace.forwardRef(
|
|
702
718
|
({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
703
719
|
"span",
|
|
704
720
|
{
|
|
@@ -861,7 +877,7 @@ var buttonVariants = classVarianceAuthority.cva(
|
|
|
861
877
|
}
|
|
862
878
|
}
|
|
863
879
|
);
|
|
864
|
-
var Button =
|
|
880
|
+
var Button = React24__namespace.forwardRef(
|
|
865
881
|
({
|
|
866
882
|
className,
|
|
867
883
|
variant,
|
|
@@ -883,6 +899,7 @@ var Button = React10__namespace.forwardRef(
|
|
|
883
899
|
className: cn("moonui-theme", buttonVariants({ variant, size, rounded, fullWidth, className })),
|
|
884
900
|
ref,
|
|
885
901
|
disabled: disabled || loading,
|
|
902
|
+
"aria-busy": loading || void 0,
|
|
886
903
|
"data-loading": loading ? "" : void 0,
|
|
887
904
|
...props,
|
|
888
905
|
children: [
|
|
@@ -1075,7 +1092,7 @@ var cardVariants = classVarianceAuthority.cva(
|
|
|
1075
1092
|
}
|
|
1076
1093
|
}
|
|
1077
1094
|
);
|
|
1078
|
-
var Card =
|
|
1095
|
+
var Card = React24__namespace.forwardRef(
|
|
1079
1096
|
({ className, variant, size, radius, interactive, microInteraction = "lift", ...props }, ref) => {
|
|
1080
1097
|
if (interactive && microInteraction !== "none") {
|
|
1081
1098
|
const interactionProps = {
|
|
@@ -1103,7 +1120,7 @@ var Card = React10__namespace.forwardRef(
|
|
|
1103
1120
|
}
|
|
1104
1121
|
);
|
|
1105
1122
|
Card.displayName = "Card";
|
|
1106
|
-
var CardHeader =
|
|
1123
|
+
var CardHeader = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1107
1124
|
"div",
|
|
1108
1125
|
{
|
|
1109
1126
|
ref,
|
|
@@ -1112,7 +1129,7 @@ var CardHeader = React10__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1112
1129
|
}
|
|
1113
1130
|
));
|
|
1114
1131
|
CardHeader.displayName = "CardHeader";
|
|
1115
|
-
var CardTitle =
|
|
1132
|
+
var CardTitle = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1116
1133
|
"h3",
|
|
1117
1134
|
{
|
|
1118
1135
|
ref,
|
|
@@ -1121,7 +1138,7 @@ var CardTitle = React10__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
1121
1138
|
}
|
|
1122
1139
|
));
|
|
1123
1140
|
CardTitle.displayName = "CardTitle";
|
|
1124
|
-
var CardDescription =
|
|
1141
|
+
var CardDescription = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1125
1142
|
"p",
|
|
1126
1143
|
{
|
|
1127
1144
|
ref,
|
|
@@ -1130,9 +1147,9 @@ var CardDescription = React10__namespace.forwardRef(({ className, ...props }, re
|
|
|
1130
1147
|
}
|
|
1131
1148
|
));
|
|
1132
1149
|
CardDescription.displayName = "CardDescription";
|
|
1133
|
-
var CardContent =
|
|
1150
|
+
var CardContent = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("moonui-theme", "p-6 pt-0", className), ...props }));
|
|
1134
1151
|
CardContent.displayName = "CardContent";
|
|
1135
|
-
var CardFooter =
|
|
1152
|
+
var CardFooter = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1136
1153
|
"div",
|
|
1137
1154
|
{
|
|
1138
1155
|
ref,
|
|
@@ -1153,7 +1170,7 @@ function Calendar({
|
|
|
1153
1170
|
defaultMonth,
|
|
1154
1171
|
...props
|
|
1155
1172
|
}) {
|
|
1156
|
-
const [currentMonth, setCurrentMonth] =
|
|
1173
|
+
const [currentMonth, setCurrentMonth] = React24__namespace.useState(
|
|
1157
1174
|
defaultMonth || selected && selected || /* @__PURE__ */ new Date()
|
|
1158
1175
|
);
|
|
1159
1176
|
const weekDays = [
|
|
@@ -1367,9 +1384,9 @@ var formatCardNumber = (value, cardType) => {
|
|
|
1367
1384
|
}
|
|
1368
1385
|
return formatted;
|
|
1369
1386
|
};
|
|
1370
|
-
var CardNumberInput =
|
|
1387
|
+
var CardNumberInput = React24__namespace.forwardRef(
|
|
1371
1388
|
({ className, value = "", onChange, showIcon = true, size, ...props }, ref) => {
|
|
1372
|
-
const [cardType, setCardType] =
|
|
1389
|
+
const [cardType, setCardType] = React24__namespace.useState("unknown");
|
|
1373
1390
|
const handleChange = (e) => {
|
|
1374
1391
|
const rawValue = e.target.value.replace(/\D/g, "");
|
|
1375
1392
|
const detectedType = getCardType(rawValue);
|
|
@@ -1400,7 +1417,7 @@ var CardNumberInput = React10__namespace.forwardRef(
|
|
|
1400
1417
|
}
|
|
1401
1418
|
);
|
|
1402
1419
|
CardNumberInput.displayName = "CardNumberInput";
|
|
1403
|
-
var CardExpiryInput =
|
|
1420
|
+
var CardExpiryInput = React24__namespace.forwardRef(
|
|
1404
1421
|
({ className, value = "", onChange, size, ...props }, ref) => {
|
|
1405
1422
|
const handleChange = (e) => {
|
|
1406
1423
|
let rawValue = e.target.value.replace(/\D/g, "");
|
|
@@ -1438,7 +1455,7 @@ var CardExpiryInput = React10__namespace.forwardRef(
|
|
|
1438
1455
|
}
|
|
1439
1456
|
);
|
|
1440
1457
|
CardExpiryInput.displayName = "CardExpiryInput";
|
|
1441
|
-
var CardCVCInput =
|
|
1458
|
+
var CardCVCInput = React24__namespace.forwardRef(
|
|
1442
1459
|
({ className, value = "", onChange, cardType = "unknown", size, ...props }, ref) => {
|
|
1443
1460
|
const maxLength = cardType === "amex" ? 4 : 3;
|
|
1444
1461
|
const handleChange = (e) => {
|
|
@@ -1463,7 +1480,7 @@ var CardCVCInput = React10__namespace.forwardRef(
|
|
|
1463
1480
|
}
|
|
1464
1481
|
);
|
|
1465
1482
|
CardCVCInput.displayName = "CardCVCInput";
|
|
1466
|
-
var CardZipInput =
|
|
1483
|
+
var CardZipInput = React24__namespace.forwardRef(
|
|
1467
1484
|
({ className, value = "", onChange, format: format4 = "US", size, ...props }, ref) => {
|
|
1468
1485
|
const handleChange = (e) => {
|
|
1469
1486
|
let rawValue = e.target.value;
|
|
@@ -1514,15 +1531,15 @@ var CardZipInput = React10__namespace.forwardRef(
|
|
|
1514
1531
|
}
|
|
1515
1532
|
);
|
|
1516
1533
|
CardZipInput.displayName = "CardZipInput";
|
|
1517
|
-
var CarouselContext =
|
|
1534
|
+
var CarouselContext = React24__namespace.createContext(null);
|
|
1518
1535
|
function useCarousel() {
|
|
1519
|
-
const context =
|
|
1536
|
+
const context = React24__namespace.useContext(CarouselContext);
|
|
1520
1537
|
if (!context) {
|
|
1521
1538
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1522
1539
|
}
|
|
1523
1540
|
return context;
|
|
1524
1541
|
}
|
|
1525
|
-
var Carousel =
|
|
1542
|
+
var Carousel = React24__namespace.forwardRef(
|
|
1526
1543
|
({
|
|
1527
1544
|
orientation = "horizontal",
|
|
1528
1545
|
opts,
|
|
@@ -1540,21 +1557,21 @@ var Carousel = React10__namespace.forwardRef(
|
|
|
1540
1557
|
},
|
|
1541
1558
|
plugins
|
|
1542
1559
|
);
|
|
1543
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1544
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1545
|
-
const onSelect =
|
|
1560
|
+
const [canScrollPrev, setCanScrollPrev] = React24__namespace.useState(false);
|
|
1561
|
+
const [canScrollNext, setCanScrollNext] = React24__namespace.useState(false);
|
|
1562
|
+
const onSelect = React24__namespace.useCallback((emblaApi) => {
|
|
1546
1563
|
if (!emblaApi)
|
|
1547
1564
|
return;
|
|
1548
1565
|
setCanScrollPrev(emblaApi.canScrollPrev());
|
|
1549
1566
|
setCanScrollNext(emblaApi.canScrollNext());
|
|
1550
1567
|
}, []);
|
|
1551
|
-
const scrollPrev =
|
|
1568
|
+
const scrollPrev = React24__namespace.useCallback(() => {
|
|
1552
1569
|
api?.scrollPrev();
|
|
1553
1570
|
}, [api]);
|
|
1554
|
-
const scrollNext =
|
|
1571
|
+
const scrollNext = React24__namespace.useCallback(() => {
|
|
1555
1572
|
api?.scrollNext();
|
|
1556
1573
|
}, [api]);
|
|
1557
|
-
const handleKeyDown =
|
|
1574
|
+
const handleKeyDown = React24__namespace.useCallback(
|
|
1558
1575
|
(event) => {
|
|
1559
1576
|
const prevKey = resolvedOrientation === "horizontal" ? "ArrowLeft" : "ArrowUp";
|
|
1560
1577
|
const nextKey = resolvedOrientation === "horizontal" ? "ArrowRight" : "ArrowDown";
|
|
@@ -1568,12 +1585,12 @@ var Carousel = React10__namespace.forwardRef(
|
|
|
1568
1585
|
},
|
|
1569
1586
|
[resolvedOrientation, scrollPrev, scrollNext]
|
|
1570
1587
|
);
|
|
1571
|
-
|
|
1588
|
+
React24__namespace.useEffect(() => {
|
|
1572
1589
|
if (!api || !setApi)
|
|
1573
1590
|
return;
|
|
1574
1591
|
setApi(api);
|
|
1575
1592
|
}, [api, setApi]);
|
|
1576
|
-
|
|
1593
|
+
React24__namespace.useEffect(() => {
|
|
1577
1594
|
if (!api)
|
|
1578
1595
|
return;
|
|
1579
1596
|
onSelect(api);
|
|
@@ -1625,7 +1642,7 @@ var carouselContentVariants = classVarianceAuthority.cva("flex", {
|
|
|
1625
1642
|
orientation: "horizontal"
|
|
1626
1643
|
}
|
|
1627
1644
|
});
|
|
1628
|
-
var CarouselContent =
|
|
1645
|
+
var CarouselContent = React24__namespace.forwardRef(
|
|
1629
1646
|
({ className, ...props }, ref) => {
|
|
1630
1647
|
const { carouselRef, orientation } = useCarousel();
|
|
1631
1648
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref: carouselRef, className: "overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1650,7 +1667,7 @@ var carouselItemVariants = classVarianceAuthority.cva("min-w-0 shrink-0 grow-0 b
|
|
|
1650
1667
|
orientation: "horizontal"
|
|
1651
1668
|
}
|
|
1652
1669
|
});
|
|
1653
|
-
var CarouselItem =
|
|
1670
|
+
var CarouselItem = React24__namespace.forwardRef(
|
|
1654
1671
|
({ className, ...props }, ref) => {
|
|
1655
1672
|
const { orientation } = useCarousel();
|
|
1656
1673
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1666,7 +1683,7 @@ var CarouselItem = React10__namespace.forwardRef(
|
|
|
1666
1683
|
}
|
|
1667
1684
|
);
|
|
1668
1685
|
CarouselItem.displayName = "CarouselItem";
|
|
1669
|
-
var CarouselPrevious =
|
|
1686
|
+
var CarouselPrevious = React24__namespace.forwardRef(({ className, variant = "outline", size = "icon-sm", ...props }, ref) => {
|
|
1670
1687
|
const { orientation, scrollPrev, canScrollPrev } = useCarousel();
|
|
1671
1688
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1672
1689
|
Button,
|
|
@@ -1691,7 +1708,7 @@ var CarouselPrevious = React10__namespace.forwardRef(({ className, variant = "ou
|
|
|
1691
1708
|
);
|
|
1692
1709
|
});
|
|
1693
1710
|
CarouselPrevious.displayName = "CarouselPrevious";
|
|
1694
|
-
var CarouselNext =
|
|
1711
|
+
var CarouselNext = React24__namespace.forwardRef(({ className, variant = "outline", size = "icon-sm", ...props }, ref) => {
|
|
1695
1712
|
const { orientation, scrollNext, canScrollNext } = useCarousel();
|
|
1696
1713
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1697
1714
|
Button,
|
|
@@ -1754,7 +1771,7 @@ var checkboxVariants = classVarianceAuthority.cva(
|
|
|
1754
1771
|
}
|
|
1755
1772
|
}
|
|
1756
1773
|
);
|
|
1757
|
-
var Checkbox =
|
|
1774
|
+
var Checkbox = React24__namespace.forwardRef(({
|
|
1758
1775
|
className,
|
|
1759
1776
|
variant,
|
|
1760
1777
|
size,
|
|
@@ -1787,7 +1804,7 @@ var Checkbox = React10__namespace.forwardRef(({
|
|
|
1787
1804
|
);
|
|
1788
1805
|
});
|
|
1789
1806
|
Checkbox.displayName = CheckboxPrimitive__namespace.Root.displayName;
|
|
1790
|
-
var CheckboxGroup =
|
|
1807
|
+
var CheckboxGroup = React24__namespace.forwardRef(
|
|
1791
1808
|
({ className, orientation = "vertical", spacing = "1rem", children, ...props }, ref) => {
|
|
1792
1809
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1793
1810
|
"div",
|
|
@@ -1807,7 +1824,7 @@ var CheckboxGroup = React10__namespace.forwardRef(
|
|
|
1807
1824
|
}
|
|
1808
1825
|
);
|
|
1809
1826
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
1810
|
-
var CheckboxLabel =
|
|
1827
|
+
var CheckboxLabel = React24__namespace.forwardRef(
|
|
1811
1828
|
({ className, htmlFor, children, position = "end", disabled = false, ...props }, ref) => {
|
|
1812
1829
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1813
1830
|
"label",
|
|
@@ -1827,14 +1844,14 @@ var CheckboxLabel = React10__namespace.forwardRef(
|
|
|
1827
1844
|
}
|
|
1828
1845
|
);
|
|
1829
1846
|
CheckboxLabel.displayName = "CheckboxLabel";
|
|
1830
|
-
var CheckboxWithLabel =
|
|
1847
|
+
var CheckboxWithLabel = React24__namespace.forwardRef(({
|
|
1831
1848
|
id,
|
|
1832
1849
|
label,
|
|
1833
1850
|
labelPosition = "end",
|
|
1834
1851
|
labelClassName,
|
|
1835
1852
|
...checkboxProps
|
|
1836
1853
|
}, ref) => {
|
|
1837
|
-
const generatedId =
|
|
1854
|
+
const generatedId = React24__namespace.useId();
|
|
1838
1855
|
const checkboxId = id || generatedId;
|
|
1839
1856
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
1840
1857
|
labelPosition === "start" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1884,7 +1901,7 @@ var collapsibleTriggerVariants = classVarianceAuthority.cva(
|
|
|
1884
1901
|
}
|
|
1885
1902
|
}
|
|
1886
1903
|
);
|
|
1887
|
-
var CollapsibleTrigger =
|
|
1904
|
+
var CollapsibleTrigger = React24__namespace.forwardRef(({ className, children, variant, size, asChild, ...props }, ref) => {
|
|
1888
1905
|
if (asChild) {
|
|
1889
1906
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1890
1907
|
CollapsiblePrimitive__namespace.Trigger,
|
|
@@ -1933,7 +1950,7 @@ var collapsibleContentVariants = classVarianceAuthority.cva(
|
|
|
1933
1950
|
}
|
|
1934
1951
|
}
|
|
1935
1952
|
);
|
|
1936
|
-
var CollapsibleContent =
|
|
1953
|
+
var CollapsibleContent = React24__namespace.forwardRef(({ className, children, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1937
1954
|
CollapsiblePrimitive__namespace.Content,
|
|
1938
1955
|
{
|
|
1939
1956
|
ref,
|
|
@@ -2016,7 +2033,7 @@ var inputVariants = classVarianceAuthority.cva(
|
|
|
2016
2033
|
}
|
|
2017
2034
|
}
|
|
2018
2035
|
);
|
|
2019
|
-
var Input =
|
|
2036
|
+
var Input = React24__namespace.forwardRef(
|
|
2020
2037
|
({
|
|
2021
2038
|
className,
|
|
2022
2039
|
wrapperClassName,
|
|
@@ -2043,8 +2060,10 @@ var Input = React10__namespace.forwardRef(
|
|
|
2043
2060
|
placeholder,
|
|
2044
2061
|
...props
|
|
2045
2062
|
}, ref) => {
|
|
2046
|
-
const
|
|
2047
|
-
const
|
|
2063
|
+
const reactId = React24__namespace.useId();
|
|
2064
|
+
const fieldId = props.id || reactId;
|
|
2065
|
+
const [isFocused, setIsFocused] = React24__namespace.useState(false);
|
|
2066
|
+
const [internalValue, setInternalValue] = React24__namespace.useState(value || defaultValue || "");
|
|
2048
2067
|
const hasValue = internalValue !== "" && internalValue !== null && internalValue !== void 0;
|
|
2049
2068
|
const isLabelActive = isFocused || hasValue;
|
|
2050
2069
|
const handleFocus = (e) => {
|
|
@@ -2059,7 +2078,7 @@ var Input = React10__namespace.forwardRef(
|
|
|
2059
2078
|
setInternalValue(e.target.value);
|
|
2060
2079
|
onChange?.(e);
|
|
2061
2080
|
};
|
|
2062
|
-
|
|
2081
|
+
React24__namespace.useEffect(() => {
|
|
2063
2082
|
if (value !== void 0) {
|
|
2064
2083
|
setInternalValue(value);
|
|
2065
2084
|
}
|
|
@@ -2108,7 +2127,7 @@ var Input = React10__namespace.forwardRef(
|
|
|
2108
2127
|
"data-error": !!error ? "" : void 0,
|
|
2109
2128
|
"data-success": !!success ? "" : void 0,
|
|
2110
2129
|
"aria-invalid": !!error || !!isError || void 0,
|
|
2111
|
-
"aria-describedby": error ? `${
|
|
2130
|
+
"aria-describedby": error ? `${fieldId}-error` : success ? `${fieldId}-success` : void 0,
|
|
2112
2131
|
value,
|
|
2113
2132
|
defaultValue,
|
|
2114
2133
|
onChange: handleChange,
|
|
@@ -2132,7 +2151,7 @@ var Input = React10__namespace.forwardRef(
|
|
|
2132
2151
|
messageType === "normal" && "text-muted-foreground",
|
|
2133
2152
|
messageClassName
|
|
2134
2153
|
),
|
|
2135
|
-
id: error ? `${
|
|
2154
|
+
id: error ? `${fieldId}-error` : success ? `${fieldId}-success` : void 0,
|
|
2136
2155
|
children: error || success || ""
|
|
2137
2156
|
}
|
|
2138
2157
|
)
|
|
@@ -2141,9 +2160,9 @@ var Input = React10__namespace.forwardRef(
|
|
|
2141
2160
|
);
|
|
2142
2161
|
Input.displayName = "Input";
|
|
2143
2162
|
var labelVariants = classVarianceAuthority.cva(
|
|
2144
|
-
"text-sm font-medium leading-none text-
|
|
2163
|
+
"text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70 dark:peer-disabled:opacity-60 transition-colors duration-200"
|
|
2145
2164
|
);
|
|
2146
|
-
var Label =
|
|
2165
|
+
var Label = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2147
2166
|
LabelPrimitive__namespace.Root,
|
|
2148
2167
|
{
|
|
2149
2168
|
ref,
|
|
@@ -2204,7 +2223,7 @@ var popoverContentVariants = classVarianceAuthority.cva(
|
|
|
2204
2223
|
var Popover = PopoverPrimitive__namespace.Root;
|
|
2205
2224
|
var PopoverTrigger = PopoverPrimitive__namespace.Trigger;
|
|
2206
2225
|
var PopoverAnchor = PopoverPrimitive__namespace.Anchor;
|
|
2207
|
-
var PopoverContent =
|
|
2226
|
+
var PopoverContent = React24__namespace.forwardRef(({
|
|
2208
2227
|
className,
|
|
2209
2228
|
variant,
|
|
2210
2229
|
size,
|
|
@@ -2272,7 +2291,7 @@ var PopoverFooter = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
2272
2291
|
}
|
|
2273
2292
|
);
|
|
2274
2293
|
PopoverFooter.displayName = "PopoverFooter";
|
|
2275
|
-
var Tabs =
|
|
2294
|
+
var Tabs = React24__namespace.forwardRef(({ vertical = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2276
2295
|
TabsPrimitive__namespace.Root,
|
|
2277
2296
|
{
|
|
2278
2297
|
ref,
|
|
@@ -2313,7 +2332,7 @@ var tabsListVariants = classVarianceAuthority.cva(
|
|
|
2313
2332
|
}
|
|
2314
2333
|
}
|
|
2315
2334
|
);
|
|
2316
|
-
var TabsList =
|
|
2335
|
+
var TabsList = React24__namespace.forwardRef(({ className, variant, orientation, fullWidth, scrollable, ...props }, ref) => {
|
|
2317
2336
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2318
2337
|
TabsPrimitive__namespace.List,
|
|
2319
2338
|
{
|
|
@@ -2356,7 +2375,7 @@ var tabsTriggerVariants = classVarianceAuthority.cva(
|
|
|
2356
2375
|
}
|
|
2357
2376
|
}
|
|
2358
2377
|
);
|
|
2359
|
-
var TabsTrigger =
|
|
2378
|
+
var TabsTrigger = React24__namespace.forwardRef(({
|
|
2360
2379
|
className,
|
|
2361
2380
|
variant,
|
|
2362
2381
|
size,
|
|
@@ -2388,7 +2407,7 @@ var TabsTrigger = React10__namespace.forwardRef(({
|
|
|
2388
2407
|
}
|
|
2389
2408
|
));
|
|
2390
2409
|
TabsTrigger.displayName = TabsPrimitive__namespace.Trigger.displayName;
|
|
2391
|
-
var TabsContent =
|
|
2410
|
+
var TabsContent = React24__namespace.forwardRef(({ className, animated = false, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2392
2411
|
TabsPrimitive__namespace.Content,
|
|
2393
2412
|
{
|
|
2394
2413
|
ref,
|
|
@@ -2482,7 +2501,7 @@ var sliderThumbVariants = classVarianceAuthority.cva(
|
|
|
2482
2501
|
}
|
|
2483
2502
|
}
|
|
2484
2503
|
);
|
|
2485
|
-
var Slider =
|
|
2504
|
+
var Slider = React24__namespace.forwardRef(({
|
|
2486
2505
|
className,
|
|
2487
2506
|
size,
|
|
2488
2507
|
trackVariant,
|
|
@@ -2498,10 +2517,10 @@ var Slider = React10__namespace.forwardRef(({
|
|
|
2498
2517
|
disabled,
|
|
2499
2518
|
...props
|
|
2500
2519
|
}, ref) => {
|
|
2501
|
-
const [sliderValue, setSliderValue] =
|
|
2520
|
+
const [sliderValue, setSliderValue] = React24__namespace.useState(
|
|
2502
2521
|
value || defaultValue || [0]
|
|
2503
2522
|
);
|
|
2504
|
-
|
|
2523
|
+
React24__namespace.useEffect(() => {
|
|
2505
2524
|
if (value !== void 0) {
|
|
2506
2525
|
setSliderValue(value);
|
|
2507
2526
|
}
|
|
@@ -2516,7 +2535,7 @@ var Slider = React10__namespace.forwardRef(({
|
|
|
2516
2535
|
const calculateThumbPercent = (value2, min2, max2) => {
|
|
2517
2536
|
return (value2 - min2) / (max2 - min2) * 100;
|
|
2518
2537
|
};
|
|
2519
|
-
const trackRef =
|
|
2538
|
+
const trackRef = React24__namespace.useRef(null);
|
|
2520
2539
|
const min = props.min || 0;
|
|
2521
2540
|
const max = props.max || 100;
|
|
2522
2541
|
const step = props.step || 1;
|
|
@@ -2828,14 +2847,14 @@ function ColorPicker({
|
|
|
2828
2847
|
disabled,
|
|
2829
2848
|
...props
|
|
2830
2849
|
}) {
|
|
2831
|
-
const [open, setOpen] =
|
|
2832
|
-
const [color, setColor] =
|
|
2833
|
-
const [opacity, setOpacity] =
|
|
2834
|
-
const [copied, setCopied] =
|
|
2835
|
-
const [inputValue, setInputValue] =
|
|
2836
|
-
const hsl =
|
|
2837
|
-
const rgb =
|
|
2838
|
-
|
|
2850
|
+
const [open, setOpen] = React24__namespace.useState(false);
|
|
2851
|
+
const [color, setColor] = React24__namespace.useState(value);
|
|
2852
|
+
const [opacity, setOpacity] = React24__namespace.useState(100);
|
|
2853
|
+
const [copied, setCopied] = React24__namespace.useState(false);
|
|
2854
|
+
const [inputValue, setInputValue] = React24__namespace.useState(value);
|
|
2855
|
+
const hsl = React24__namespace.useMemo(() => hexToHsl(color) || { h: 0, s: 0, l: 0 }, [color]);
|
|
2856
|
+
const rgb = React24__namespace.useMemo(() => hexToRgb(color) || { r: 0, g: 0, b: 0 }, [color]);
|
|
2857
|
+
React24__namespace.useEffect(() => {
|
|
2839
2858
|
setColor(value);
|
|
2840
2859
|
setInputValue(value);
|
|
2841
2860
|
}, [value]);
|
|
@@ -3230,7 +3249,7 @@ function GradientPicker({
|
|
|
3230
3249
|
onChange,
|
|
3231
3250
|
className
|
|
3232
3251
|
}) {
|
|
3233
|
-
const [gradient, setGradient] =
|
|
3252
|
+
const [gradient, setGradient] = React24__namespace.useState(value);
|
|
3234
3253
|
const handleChange = (field, newValue) => {
|
|
3235
3254
|
const newGradient = { ...gradient, [field]: newValue };
|
|
3236
3255
|
setGradient(newGradient);
|
|
@@ -3316,7 +3335,7 @@ var overlayVariants = classVarianceAuthority.cva(
|
|
|
3316
3335
|
}
|
|
3317
3336
|
}
|
|
3318
3337
|
);
|
|
3319
|
-
var DialogOverlay =
|
|
3338
|
+
var DialogOverlay = React24__namespace.forwardRef(({ className, variant, animation, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3320
3339
|
DialogPrimitive__namespace.Overlay,
|
|
3321
3340
|
{
|
|
3322
3341
|
ref,
|
|
@@ -3375,7 +3394,7 @@ var dialogContentVariants = classVarianceAuthority.cva(
|
|
|
3375
3394
|
}
|
|
3376
3395
|
}
|
|
3377
3396
|
);
|
|
3378
|
-
var DialogContent =
|
|
3397
|
+
var DialogContent = React24__namespace.forwardRef(
|
|
3379
3398
|
({
|
|
3380
3399
|
className,
|
|
3381
3400
|
children,
|
|
@@ -3488,7 +3507,7 @@ var DialogFooter = ({
|
|
|
3488
3507
|
}
|
|
3489
3508
|
);
|
|
3490
3509
|
DialogFooter.displayName = "DialogFooter";
|
|
3491
|
-
var DialogTitle =
|
|
3510
|
+
var DialogTitle = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3492
3511
|
DialogPrimitive__namespace.Title,
|
|
3493
3512
|
{
|
|
3494
3513
|
ref,
|
|
@@ -3500,7 +3519,7 @@ var DialogTitle = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
3500
3519
|
}
|
|
3501
3520
|
));
|
|
3502
3521
|
DialogTitle.displayName = DialogPrimitive__namespace.Title.displayName;
|
|
3503
|
-
var DialogDescription =
|
|
3522
|
+
var DialogDescription = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3504
3523
|
DialogPrimitive__namespace.Description,
|
|
3505
3524
|
{
|
|
3506
3525
|
ref,
|
|
@@ -3512,7 +3531,7 @@ var DialogDescription = React10__namespace.forwardRef(({ className, ...props },
|
|
|
3512
3531
|
}
|
|
3513
3532
|
));
|
|
3514
3533
|
DialogDescription.displayName = DialogPrimitive__namespace.Description.displayName;
|
|
3515
|
-
var DialogForm =
|
|
3534
|
+
var DialogForm = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3516
3535
|
"form",
|
|
3517
3536
|
{
|
|
3518
3537
|
ref,
|
|
@@ -3542,7 +3561,7 @@ var commandVariants = classVarianceAuthority.cva(
|
|
|
3542
3561
|
}
|
|
3543
3562
|
}
|
|
3544
3563
|
);
|
|
3545
|
-
var Command =
|
|
3564
|
+
var Command = React24__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3546
3565
|
cmdk.Command,
|
|
3547
3566
|
{
|
|
3548
3567
|
ref,
|
|
@@ -3564,7 +3583,7 @@ var CommandDialog = ({
|
|
|
3564
3583
|
), children })
|
|
3565
3584
|
] }) });
|
|
3566
3585
|
};
|
|
3567
|
-
var CommandInput =
|
|
3586
|
+
var CommandInput = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
3568
3587
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
3569
3588
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3570
3589
|
cmdk.Command.Input,
|
|
@@ -3579,7 +3598,7 @@ var CommandInput = React10__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
3579
3598
|
)
|
|
3580
3599
|
] }));
|
|
3581
3600
|
CommandInput.displayName = cmdk.Command.Input.displayName;
|
|
3582
|
-
var CommandList =
|
|
3601
|
+
var CommandList = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3583
3602
|
cmdk.Command.List,
|
|
3584
3603
|
{
|
|
3585
3604
|
ref,
|
|
@@ -3588,7 +3607,7 @@ var CommandList = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
3588
3607
|
}
|
|
3589
3608
|
));
|
|
3590
3609
|
CommandList.displayName = cmdk.Command.List.displayName;
|
|
3591
|
-
var CommandEmpty =
|
|
3610
|
+
var CommandEmpty = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3592
3611
|
cmdk.Command.Empty,
|
|
3593
3612
|
{
|
|
3594
3613
|
ref,
|
|
@@ -3597,7 +3616,7 @@ var CommandEmpty = React10__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
3597
3616
|
}
|
|
3598
3617
|
));
|
|
3599
3618
|
CommandEmpty.displayName = cmdk.Command.Empty.displayName;
|
|
3600
|
-
var CommandGroup =
|
|
3619
|
+
var CommandGroup = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3601
3620
|
cmdk.Command.Group,
|
|
3602
3621
|
{
|
|
3603
3622
|
ref,
|
|
@@ -3609,7 +3628,7 @@ var CommandGroup = React10__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
3609
3628
|
}
|
|
3610
3629
|
));
|
|
3611
3630
|
CommandGroup.displayName = cmdk.Command.Group.displayName;
|
|
3612
|
-
var CommandSeparator =
|
|
3631
|
+
var CommandSeparator = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3613
3632
|
cmdk.Command.Separator,
|
|
3614
3633
|
{
|
|
3615
3634
|
ref,
|
|
@@ -3618,7 +3637,7 @@ var CommandSeparator = React10__namespace.forwardRef(({ className, ...props }, r
|
|
|
3618
3637
|
}
|
|
3619
3638
|
));
|
|
3620
3639
|
CommandSeparator.displayName = cmdk.Command.Separator.displayName;
|
|
3621
|
-
var CommandItem =
|
|
3640
|
+
var CommandItem = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3622
3641
|
cmdk.Command.Item,
|
|
3623
3642
|
{
|
|
3624
3643
|
ref,
|
|
@@ -3669,7 +3688,7 @@ var tableVariants = classVarianceAuthority.cva(
|
|
|
3669
3688
|
}
|
|
3670
3689
|
}
|
|
3671
3690
|
);
|
|
3672
|
-
var Table =
|
|
3691
|
+
var Table = React24__namespace.forwardRef(({
|
|
3673
3692
|
className,
|
|
3674
3693
|
variant,
|
|
3675
3694
|
size,
|
|
@@ -3686,11 +3705,11 @@ var Table = React10__namespace.forwardRef(({
|
|
|
3686
3705
|
...props
|
|
3687
3706
|
}, ref) => {
|
|
3688
3707
|
const striped = variant === "striped";
|
|
3689
|
-
const childrenWithProps =
|
|
3690
|
-
if (
|
|
3708
|
+
const childrenWithProps = React24__namespace.Children.map(props.children, (child) => {
|
|
3709
|
+
if (React24__namespace.isValidElement(child)) {
|
|
3691
3710
|
if (child.type === "tbody") {
|
|
3692
3711
|
const tbodyProps = child.props;
|
|
3693
|
-
return
|
|
3712
|
+
return React24__namespace.cloneElement(child, {
|
|
3694
3713
|
className: cn(tbodyProps.className, striped && "even:[&>tr]:bg-muted/50")
|
|
3695
3714
|
});
|
|
3696
3715
|
}
|
|
@@ -3715,10 +3734,10 @@ var Table = React10__namespace.forwardRef(({
|
|
|
3715
3734
|
] });
|
|
3716
3735
|
});
|
|
3717
3736
|
Table.displayName = "Table";
|
|
3718
|
-
var TableHeader =
|
|
3737
|
+
var TableHeader = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("thead", { ref, className: cn("moonui-theme", "[&_tr]:border-b", className), ...props }));
|
|
3719
3738
|
TableHeader.displayName = "TableHeader";
|
|
3720
|
-
var TableBody =
|
|
3721
|
-
const hasChildren =
|
|
3739
|
+
var TableBody = React24__namespace.forwardRef(({ className, emptyContent, emptyMessage = "No data available", children, ...props }, ref) => {
|
|
3740
|
+
const hasChildren = React24__namespace.Children.count(children) > 0;
|
|
3722
3741
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3723
3742
|
"tbody",
|
|
3724
3743
|
{
|
|
@@ -3730,7 +3749,7 @@ var TableBody = React10__namespace.forwardRef(({ className, emptyContent, emptyM
|
|
|
3730
3749
|
);
|
|
3731
3750
|
});
|
|
3732
3751
|
TableBody.displayName = "TableBody";
|
|
3733
|
-
var TableFooter =
|
|
3752
|
+
var TableFooter = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3734
3753
|
"tfoot",
|
|
3735
3754
|
{
|
|
3736
3755
|
ref,
|
|
@@ -3739,7 +3758,7 @@ var TableFooter = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
3739
3758
|
}
|
|
3740
3759
|
));
|
|
3741
3760
|
TableFooter.displayName = "TableFooter";
|
|
3742
|
-
var TableRow =
|
|
3761
|
+
var TableRow = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3743
3762
|
"tr",
|
|
3744
3763
|
{
|
|
3745
3764
|
ref,
|
|
@@ -3751,7 +3770,7 @@ var TableRow = React10__namespace.forwardRef(({ className, ...props }, ref) => /
|
|
|
3751
3770
|
}
|
|
3752
3771
|
));
|
|
3753
3772
|
TableRow.displayName = "TableRow";
|
|
3754
|
-
var TableHead =
|
|
3773
|
+
var TableHead = React24__namespace.forwardRef(
|
|
3755
3774
|
({ className, sortable, sorted, onSort, align = "left", children, ...props }, ref) => {
|
|
3756
3775
|
const renderSortIcon = () => {
|
|
3757
3776
|
if (!sortable)
|
|
@@ -3839,7 +3858,7 @@ var TableHead = React10__namespace.forwardRef(
|
|
|
3839
3858
|
}
|
|
3840
3859
|
);
|
|
3841
3860
|
TableHead.displayName = "TableHead";
|
|
3842
|
-
var TableCell =
|
|
3861
|
+
var TableCell = React24__namespace.forwardRef(({ className, align = "left", ...props }, ref) => {
|
|
3843
3862
|
const alignmentClass = {
|
|
3844
3863
|
left: "text-left",
|
|
3845
3864
|
center: "text-center",
|
|
@@ -3855,7 +3874,7 @@ var TableCell = React10__namespace.forwardRef(({ className, align = "left", ...p
|
|
|
3855
3874
|
);
|
|
3856
3875
|
});
|
|
3857
3876
|
TableCell.displayName = "TableCell";
|
|
3858
|
-
var TableCaption =
|
|
3877
|
+
var TableCaption = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3859
3878
|
"caption",
|
|
3860
3879
|
{
|
|
3861
3880
|
ref,
|
|
@@ -3875,8 +3894,8 @@ function DataTableBasic({
|
|
|
3875
3894
|
emptyMessage = "No results found.",
|
|
3876
3895
|
className
|
|
3877
3896
|
}) {
|
|
3878
|
-
const [sorting, setSorting] =
|
|
3879
|
-
const [globalFilter, setGlobalFilter] =
|
|
3897
|
+
const [sorting, setSorting] = React24__namespace.useState([]);
|
|
3898
|
+
const [globalFilter, setGlobalFilter] = React24__namespace.useState("");
|
|
3880
3899
|
const table = reactTable.useReactTable({
|
|
3881
3900
|
data,
|
|
3882
3901
|
columns,
|
|
@@ -4039,7 +4058,7 @@ var datePickerVariants = classVarianceAuthority.cva(
|
|
|
4039
4058
|
}
|
|
4040
4059
|
}
|
|
4041
4060
|
);
|
|
4042
|
-
|
|
4061
|
+
var DatePicker = React24__namespace.forwardRef(function DatePicker2({
|
|
4043
4062
|
className,
|
|
4044
4063
|
variant,
|
|
4045
4064
|
size,
|
|
@@ -4061,10 +4080,10 @@ function DatePicker({
|
|
|
4061
4080
|
calendarProps,
|
|
4062
4081
|
disabled,
|
|
4063
4082
|
...props
|
|
4064
|
-
}) {
|
|
4065
|
-
const [open, setOpen] =
|
|
4066
|
-
const [internalDate, setInternalDate] =
|
|
4067
|
-
|
|
4083
|
+
}, ref) {
|
|
4084
|
+
const [open, setOpen] = React24__namespace.useState(false);
|
|
4085
|
+
const [internalDate, setInternalDate] = React24__namespace.useState(value);
|
|
4086
|
+
React24__namespace.useEffect(() => {
|
|
4068
4087
|
setInternalDate(value);
|
|
4069
4088
|
}, [value]);
|
|
4070
4089
|
const handleSelect = (date) => {
|
|
@@ -4096,7 +4115,7 @@ function DatePicker({
|
|
|
4096
4115
|
};
|
|
4097
4116
|
const displayValue = internalDate && dateFns.isValid(internalDate) ? dateFns.format(internalDate, formatString) : null;
|
|
4098
4117
|
const iconElement = icon || /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { className: "h-4 w-4" });
|
|
4099
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "moonui-theme", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
4118
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: "moonui-theme", children: /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
4100
4119
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4101
4120
|
Button,
|
|
4102
4121
|
{
|
|
@@ -4173,7 +4192,7 @@ function DatePicker({
|
|
|
4173
4192
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4174
4193
|
PopoverContent,
|
|
4175
4194
|
{
|
|
4176
|
-
className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-
|
|
4195
|
+
className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-border bg-background/95 backdrop-blur-sm !z-[9999]",
|
|
4177
4196
|
align: "start",
|
|
4178
4197
|
sideOffset: 12,
|
|
4179
4198
|
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4210,8 +4229,9 @@ function DatePicker({
|
|
|
4210
4229
|
}
|
|
4211
4230
|
)
|
|
4212
4231
|
] }) });
|
|
4213
|
-
}
|
|
4214
|
-
|
|
4232
|
+
});
|
|
4233
|
+
DatePicker.displayName = "DatePicker";
|
|
4234
|
+
var DateRangePicker = React24__namespace.forwardRef(function DateRangePicker2({
|
|
4215
4235
|
className,
|
|
4216
4236
|
value,
|
|
4217
4237
|
onChange,
|
|
@@ -4219,10 +4239,10 @@ function DateRangePicker({
|
|
|
4219
4239
|
formatString = "LLL dd, y",
|
|
4220
4240
|
separator = " - ",
|
|
4221
4241
|
...props
|
|
4222
|
-
}) {
|
|
4223
|
-
const [open, setOpen] =
|
|
4224
|
-
const [internalRange, setInternalRange] =
|
|
4225
|
-
|
|
4242
|
+
}, ref) {
|
|
4243
|
+
const [open, setOpen] = React24__namespace.useState(false);
|
|
4244
|
+
const [internalRange, setInternalRange] = React24__namespace.useState(value);
|
|
4245
|
+
React24__namespace.useEffect(() => {
|
|
4226
4246
|
setInternalRange(value);
|
|
4227
4247
|
}, [value]);
|
|
4228
4248
|
const handleSelect = (range) => {
|
|
@@ -4232,7 +4252,7 @@ function DateRangePicker({
|
|
|
4232
4252
|
setOpen(false);
|
|
4233
4253
|
}
|
|
4234
4254
|
};
|
|
4235
|
-
const displayValue =
|
|
4255
|
+
const displayValue = React24__namespace.useMemo(() => {
|
|
4236
4256
|
if (!internalRange?.from)
|
|
4237
4257
|
return null;
|
|
4238
4258
|
if (!internalRange?.to) {
|
|
@@ -4247,6 +4267,7 @@ function DateRangePicker({
|
|
|
4247
4267
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4248
4268
|
Button,
|
|
4249
4269
|
{
|
|
4270
|
+
ref,
|
|
4250
4271
|
variant: props.variant === "ghost" ? "ghost" : "outline",
|
|
4251
4272
|
className: cn(
|
|
4252
4273
|
datePickerVariants({
|
|
@@ -4264,7 +4285,7 @@ function DateRangePicker({
|
|
|
4264
4285
|
]
|
|
4265
4286
|
}
|
|
4266
4287
|
) }),
|
|
4267
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0 shadow-2xl rounded-2xl border border-
|
|
4288
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0 shadow-2xl rounded-2xl border border-border bg-background/95 backdrop-blur-sm !z-[9999]", align: "start", sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4268
4289
|
Calendar,
|
|
4269
4290
|
{
|
|
4270
4291
|
mode: "range",
|
|
@@ -4277,8 +4298,9 @@ function DateRangePicker({
|
|
|
4277
4298
|
}
|
|
4278
4299
|
) })
|
|
4279
4300
|
] });
|
|
4280
|
-
}
|
|
4281
|
-
|
|
4301
|
+
});
|
|
4302
|
+
DateRangePicker.displayName = "DateRangePicker";
|
|
4303
|
+
var DateTimePicker = React24__namespace.forwardRef(function DateTimePicker2({
|
|
4282
4304
|
value,
|
|
4283
4305
|
onChange,
|
|
4284
4306
|
formatString = "PPP p",
|
|
@@ -4286,9 +4308,9 @@ function DateTimePicker({
|
|
|
4286
4308
|
timeFormat = "24",
|
|
4287
4309
|
timeInterval = 15,
|
|
4288
4310
|
...props
|
|
4289
|
-
}) {
|
|
4290
|
-
const [date, setDate] =
|
|
4291
|
-
const [time, setTime] =
|
|
4311
|
+
}, ref) {
|
|
4312
|
+
const [date, setDate] = React24__namespace.useState(value);
|
|
4313
|
+
const [time, setTime] = React24__namespace.useState(
|
|
4292
4314
|
value ? dateFns.format(value, timeFormat === "24" ? "HH:mm" : "hh:mm a") : "00:00"
|
|
4293
4315
|
);
|
|
4294
4316
|
const handleDateChange = (newDate) => {
|
|
@@ -4313,7 +4335,7 @@ function DateTimePicker({
|
|
|
4313
4335
|
onChange?.(newDate);
|
|
4314
4336
|
}
|
|
4315
4337
|
};
|
|
4316
|
-
const timeOptions =
|
|
4338
|
+
const timeOptions = React24__namespace.useMemo(() => {
|
|
4317
4339
|
const options = [];
|
|
4318
4340
|
for (let h = 0; h < 24; h++) {
|
|
4319
4341
|
for (let m = 0; m < 60; m += timeInterval) {
|
|
@@ -4332,7 +4354,7 @@ function DateTimePicker({
|
|
|
4332
4354
|
}
|
|
4333
4355
|
return options;
|
|
4334
4356
|
}, [timeFormat, timeInterval]);
|
|
4335
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
4357
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: "flex flex-col gap-2", children: [
|
|
4336
4358
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4337
4359
|
DatePicker,
|
|
4338
4360
|
{
|
|
@@ -4365,16 +4387,17 @@ function DateTimePicker({
|
|
|
4365
4387
|
}
|
|
4366
4388
|
)
|
|
4367
4389
|
] });
|
|
4368
|
-
}
|
|
4369
|
-
|
|
4390
|
+
});
|
|
4391
|
+
DateTimePicker.displayName = "DateTimePicker";
|
|
4392
|
+
var MonthPicker = React24__namespace.forwardRef(function MonthPicker2({
|
|
4370
4393
|
value,
|
|
4371
4394
|
onChange,
|
|
4372
4395
|
placeholder = "Pick a month",
|
|
4373
4396
|
formatString = "MMMM yyyy",
|
|
4374
4397
|
...props
|
|
4375
|
-
}) {
|
|
4376
|
-
const [open, setOpen] =
|
|
4377
|
-
const [viewDate, setViewDate] =
|
|
4398
|
+
}, ref) {
|
|
4399
|
+
const [open, setOpen] = React24__namespace.useState(false);
|
|
4400
|
+
const [viewDate, setViewDate] = React24__namespace.useState(value || /* @__PURE__ */ new Date());
|
|
4378
4401
|
const months = [
|
|
4379
4402
|
"January",
|
|
4380
4403
|
"February",
|
|
@@ -4405,6 +4428,7 @@ function MonthPicker({
|
|
|
4405
4428
|
/* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4406
4429
|
Button,
|
|
4407
4430
|
{
|
|
4431
|
+
ref,
|
|
4408
4432
|
variant: props.variant === "default" ? "outline" : props.variant || "outline",
|
|
4409
4433
|
className: cn(
|
|
4410
4434
|
datePickerVariants({
|
|
@@ -4422,13 +4446,14 @@ function MonthPicker({
|
|
|
4422
4446
|
]
|
|
4423
4447
|
}
|
|
4424
4448
|
) }),
|
|
4425
|
-
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0 shadow-2xl border border-
|
|
4449
|
+
/* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0 shadow-2xl border border-border bg-background !z-[9999]", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3", children: [
|
|
4426
4450
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
|
|
4427
4451
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4428
4452
|
Button,
|
|
4429
4453
|
{
|
|
4430
4454
|
variant: "outline",
|
|
4431
4455
|
size: "icon",
|
|
4456
|
+
"aria-label": `Previous year, ${viewDate.getFullYear() - 1}`,
|
|
4432
4457
|
onClick: () => handleYearChange(-1),
|
|
4433
4458
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronLeft, { className: "h-4 w-4" })
|
|
4434
4459
|
}
|
|
@@ -4439,6 +4464,7 @@ function MonthPicker({
|
|
|
4439
4464
|
{
|
|
4440
4465
|
variant: "outline",
|
|
4441
4466
|
size: "icon",
|
|
4467
|
+
"aria-label": `Next year, ${viewDate.getFullYear() + 1}`,
|
|
4442
4468
|
onClick: () => handleYearChange(1),
|
|
4443
4469
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "h-4 w-4" })
|
|
4444
4470
|
}
|
|
@@ -4457,7 +4483,8 @@ function MonthPicker({
|
|
|
4457
4483
|
)) })
|
|
4458
4484
|
] }) })
|
|
4459
4485
|
] });
|
|
4460
|
-
}
|
|
4486
|
+
});
|
|
4487
|
+
MonthPicker.displayName = "MonthPicker";
|
|
4461
4488
|
function DraggableList({
|
|
4462
4489
|
items,
|
|
4463
4490
|
onReorder,
|
|
@@ -4466,7 +4493,7 @@ function DraggableList({
|
|
|
4466
4493
|
className,
|
|
4467
4494
|
disabled = false
|
|
4468
4495
|
}) {
|
|
4469
|
-
const [draggedIndex, setDraggedIndex] =
|
|
4496
|
+
const [draggedIndex, setDraggedIndex] = React24__namespace.useState(null);
|
|
4470
4497
|
const handleDragStart = (e, index) => {
|
|
4471
4498
|
if (disabled)
|
|
4472
4499
|
return;
|
|
@@ -4518,7 +4545,7 @@ var DropdownMenuGroup = DropdownMenuPrimitive__namespace.Group;
|
|
|
4518
4545
|
var DropdownMenuPortal = DropdownMenuPrimitive__namespace.Portal;
|
|
4519
4546
|
var DropdownMenuSub = DropdownMenuPrimitive__namespace.Sub;
|
|
4520
4547
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive__namespace.RadioGroup;
|
|
4521
|
-
var DropdownMenuSubTrigger =
|
|
4548
|
+
var DropdownMenuSubTrigger = React24__namespace.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4522
4549
|
DropdownMenuPrimitive__namespace.SubTrigger,
|
|
4523
4550
|
{
|
|
4524
4551
|
ref,
|
|
@@ -4535,7 +4562,7 @@ var DropdownMenuSubTrigger = React10__namespace.forwardRef(({ className, inset,
|
|
|
4535
4562
|
}
|
|
4536
4563
|
));
|
|
4537
4564
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive__namespace.SubTrigger.displayName;
|
|
4538
|
-
var DropdownMenuSubContent =
|
|
4565
|
+
var DropdownMenuSubContent = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4539
4566
|
DropdownMenuPrimitive__namespace.SubContent,
|
|
4540
4567
|
{
|
|
4541
4568
|
ref,
|
|
@@ -4547,7 +4574,7 @@ var DropdownMenuSubContent = React10__namespace.forwardRef(({ className, ...prop
|
|
|
4547
4574
|
}
|
|
4548
4575
|
));
|
|
4549
4576
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive__namespace.SubContent.displayName;
|
|
4550
|
-
var DropdownMenuContent =
|
|
4577
|
+
var DropdownMenuContent = React24__namespace.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(DropdownMenuPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4551
4578
|
DropdownMenuPrimitive__namespace.Content,
|
|
4552
4579
|
{
|
|
4553
4580
|
ref,
|
|
@@ -4560,7 +4587,7 @@ var DropdownMenuContent = React10__namespace.forwardRef(({ className, sideOffset
|
|
|
4560
4587
|
}
|
|
4561
4588
|
) }));
|
|
4562
4589
|
DropdownMenuContent.displayName = DropdownMenuPrimitive__namespace.Content.displayName;
|
|
4563
|
-
var DropdownMenuItem =
|
|
4590
|
+
var DropdownMenuItem = React24__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4564
4591
|
DropdownMenuPrimitive__namespace.Item,
|
|
4565
4592
|
{
|
|
4566
4593
|
ref,
|
|
@@ -4573,7 +4600,7 @@ var DropdownMenuItem = React10__namespace.forwardRef(({ className, inset, ...pro
|
|
|
4573
4600
|
}
|
|
4574
4601
|
));
|
|
4575
4602
|
DropdownMenuItem.displayName = DropdownMenuPrimitive__namespace.Item.displayName;
|
|
4576
|
-
var DropdownMenuCheckboxItem =
|
|
4603
|
+
var DropdownMenuCheckboxItem = React24__namespace.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4577
4604
|
DropdownMenuPrimitive__namespace.CheckboxItem,
|
|
4578
4605
|
{
|
|
4579
4606
|
ref,
|
|
@@ -4590,7 +4617,7 @@ var DropdownMenuCheckboxItem = React10__namespace.forwardRef(({ className, child
|
|
|
4590
4617
|
}
|
|
4591
4618
|
));
|
|
4592
4619
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive__namespace.CheckboxItem.displayName;
|
|
4593
|
-
var DropdownMenuRadioItem =
|
|
4620
|
+
var DropdownMenuRadioItem = React24__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4594
4621
|
DropdownMenuPrimitive__namespace.RadioItem,
|
|
4595
4622
|
{
|
|
4596
4623
|
ref,
|
|
@@ -4606,7 +4633,7 @@ var DropdownMenuRadioItem = React10__namespace.forwardRef(({ className, children
|
|
|
4606
4633
|
}
|
|
4607
4634
|
));
|
|
4608
4635
|
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive__namespace.RadioItem.displayName;
|
|
4609
|
-
var DropdownMenuLabel =
|
|
4636
|
+
var DropdownMenuLabel = React24__namespace.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4610
4637
|
DropdownMenuPrimitive__namespace.Label,
|
|
4611
4638
|
{
|
|
4612
4639
|
ref,
|
|
@@ -4619,7 +4646,7 @@ var DropdownMenuLabel = React10__namespace.forwardRef(({ className, inset, ...pr
|
|
|
4619
4646
|
}
|
|
4620
4647
|
));
|
|
4621
4648
|
DropdownMenuLabel.displayName = DropdownMenuPrimitive__namespace.Label.displayName;
|
|
4622
|
-
var DropdownMenuSeparator =
|
|
4649
|
+
var DropdownMenuSeparator = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4623
4650
|
DropdownMenuPrimitive__namespace.Separator,
|
|
4624
4651
|
{
|
|
4625
4652
|
ref,
|
|
@@ -4708,7 +4735,7 @@ var progressIndicatorVariants = classVarianceAuthority.cva(
|
|
|
4708
4735
|
}
|
|
4709
4736
|
}
|
|
4710
4737
|
);
|
|
4711
|
-
var Progress =
|
|
4738
|
+
var Progress = React24__namespace.forwardRef(({
|
|
4712
4739
|
className,
|
|
4713
4740
|
value = 0,
|
|
4714
4741
|
variant,
|
|
@@ -4837,7 +4864,7 @@ var FileItem = ({
|
|
|
4837
4864
|
}
|
|
4838
4865
|
);
|
|
4839
4866
|
};
|
|
4840
|
-
var FileUpload =
|
|
4867
|
+
var FileUpload = React24__namespace.default.forwardRef(
|
|
4841
4868
|
({
|
|
4842
4869
|
accept = "*",
|
|
4843
4870
|
multiple = true,
|
|
@@ -4851,9 +4878,9 @@ var FileUpload = React10__namespace.default.forwardRef(
|
|
|
4851
4878
|
children,
|
|
4852
4879
|
...props
|
|
4853
4880
|
}, ref) => {
|
|
4854
|
-
const [uploadedFiles, setUploadedFiles] =
|
|
4855
|
-
const [isDragOver, setIsDragOver] =
|
|
4856
|
-
const [error, setError] =
|
|
4881
|
+
const [uploadedFiles, setUploadedFiles] = React24.useState([]);
|
|
4882
|
+
const [isDragOver, setIsDragOver] = React24.useState(false);
|
|
4883
|
+
const [error, setError] = React24.useState(null);
|
|
4857
4884
|
const validateFile = (file) => {
|
|
4858
4885
|
if (file.size > maxSize) {
|
|
4859
4886
|
return `File size exceeds ${formatFileSize(maxSize)}`;
|
|
@@ -4869,7 +4896,7 @@ var FileUpload = React10__namespace.default.forwardRef(
|
|
|
4869
4896
|
}
|
|
4870
4897
|
return null;
|
|
4871
4898
|
};
|
|
4872
|
-
const processFiles =
|
|
4899
|
+
const processFiles = React24.useCallback(async (files) => {
|
|
4873
4900
|
const fileArray = Array.from(files);
|
|
4874
4901
|
setError(null);
|
|
4875
4902
|
if (uploadedFiles.length + fileArray.length > maxFiles) {
|
|
@@ -4932,7 +4959,7 @@ var FileUpload = React10__namespace.default.forwardRef(
|
|
|
4932
4959
|
}
|
|
4933
4960
|
}
|
|
4934
4961
|
}, [uploadedFiles.length, maxFiles, maxSize, accept, onUpload]);
|
|
4935
|
-
const handleDrop =
|
|
4962
|
+
const handleDrop = React24.useCallback((e) => {
|
|
4936
4963
|
e.preventDefault();
|
|
4937
4964
|
setIsDragOver(false);
|
|
4938
4965
|
if (disabled)
|
|
@@ -4942,24 +4969,24 @@ var FileUpload = React10__namespace.default.forwardRef(
|
|
|
4942
4969
|
processFiles(files);
|
|
4943
4970
|
}
|
|
4944
4971
|
}, [processFiles, disabled]);
|
|
4945
|
-
const handleDragOver =
|
|
4972
|
+
const handleDragOver = React24.useCallback((e) => {
|
|
4946
4973
|
e.preventDefault();
|
|
4947
4974
|
if (!disabled) {
|
|
4948
4975
|
setIsDragOver(true);
|
|
4949
4976
|
}
|
|
4950
4977
|
}, [disabled]);
|
|
4951
|
-
const handleDragLeave =
|
|
4978
|
+
const handleDragLeave = React24.useCallback((e) => {
|
|
4952
4979
|
e.preventDefault();
|
|
4953
4980
|
setIsDragOver(false);
|
|
4954
4981
|
}, []);
|
|
4955
|
-
const handleFileSelect =
|
|
4982
|
+
const handleFileSelect = React24.useCallback((e) => {
|
|
4956
4983
|
const files = e.target.files;
|
|
4957
4984
|
if (files && files.length > 0) {
|
|
4958
4985
|
processFiles(files);
|
|
4959
4986
|
}
|
|
4960
4987
|
e.target.value = "";
|
|
4961
4988
|
}, [processFiles]);
|
|
4962
|
-
const removeFile =
|
|
4989
|
+
const removeFile = React24.useCallback((fileId) => {
|
|
4963
4990
|
setUploadedFiles((prev) => {
|
|
4964
4991
|
const fileToRemove = prev.find((f) => f.id === fileId);
|
|
4965
4992
|
if (fileToRemove?.preview) {
|
|
@@ -4997,6 +5024,7 @@ var FileUpload = React10__namespace.default.forwardRef(
|
|
|
4997
5024
|
multiple,
|
|
4998
5025
|
disabled,
|
|
4999
5026
|
onChange: handleFileSelect,
|
|
5027
|
+
"aria-label": multiple ? "Choose files to upload" : "Choose a file to upload",
|
|
5000
5028
|
className: "absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
|
5001
5029
|
}
|
|
5002
5030
|
),
|
|
@@ -5059,7 +5087,7 @@ var FileUpload = React10__namespace.default.forwardRef(
|
|
|
5059
5087
|
}
|
|
5060
5088
|
);
|
|
5061
5089
|
FileUpload.displayName = "FileUpload";
|
|
5062
|
-
var GestureDrawer =
|
|
5090
|
+
var GestureDrawer = React24__namespace.default.forwardRef(
|
|
5063
5091
|
({
|
|
5064
5092
|
children,
|
|
5065
5093
|
isOpen,
|
|
@@ -5181,9 +5209,9 @@ function GitHubStars({
|
|
|
5181
5209
|
showWatchers = false,
|
|
5182
5210
|
repoUrl = "https://github.com/moonui/moonui"
|
|
5183
5211
|
}) {
|
|
5184
|
-
const [stats, setStats] =
|
|
5185
|
-
const [isLoading, setIsLoading] =
|
|
5186
|
-
|
|
5212
|
+
const [stats, setStats] = React24.useState(null);
|
|
5213
|
+
const [isLoading, setIsLoading] = React24.useState(true);
|
|
5214
|
+
React24.useEffect(() => {
|
|
5187
5215
|
const fetchStats = async () => {
|
|
5188
5216
|
try {
|
|
5189
5217
|
const response = await fetch("/api/github-stars");
|
|
@@ -5282,9 +5310,9 @@ function GitHubStarButton({
|
|
|
5282
5310
|
size = "md",
|
|
5283
5311
|
repoUrl = "https://github.com/moonui/moonui"
|
|
5284
5312
|
}) {
|
|
5285
|
-
const [stars, setStars] =
|
|
5286
|
-
const [isLoading, setIsLoading] =
|
|
5287
|
-
|
|
5313
|
+
const [stars, setStars] = React24.useState(null);
|
|
5314
|
+
const [isLoading, setIsLoading] = React24.useState(true);
|
|
5315
|
+
React24.useEffect(() => {
|
|
5288
5316
|
const fetchStats = async () => {
|
|
5289
5317
|
try {
|
|
5290
5318
|
const response = await fetch("/api/github-stars");
|
|
@@ -5330,10 +5358,11 @@ function GitHubStarButton({
|
|
|
5330
5358
|
}
|
|
5331
5359
|
);
|
|
5332
5360
|
}
|
|
5333
|
-
var InputOTP =
|
|
5361
|
+
var InputOTP = React24__namespace.forwardRef(({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5334
5362
|
inputOtp.OTPInput,
|
|
5335
5363
|
{
|
|
5336
5364
|
ref,
|
|
5365
|
+
"aria-label": "One-time password",
|
|
5337
5366
|
containerClassName: cn(
|
|
5338
5367
|
"moonui-theme",
|
|
5339
5368
|
"flex items-center gap-2 has-[:disabled]:opacity-50",
|
|
@@ -5344,7 +5373,7 @@ var InputOTP = React10__namespace.forwardRef(({ className, containerClassName, .
|
|
|
5344
5373
|
}
|
|
5345
5374
|
));
|
|
5346
5375
|
InputOTP.displayName = "InputOTP";
|
|
5347
|
-
var InputOTPGroup =
|
|
5376
|
+
var InputOTPGroup = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("flex items-center", className), ...props }));
|
|
5348
5377
|
InputOTPGroup.displayName = "InputOTPGroup";
|
|
5349
5378
|
var inputOTPSlotVariants = classVarianceAuthority.cva(
|
|
5350
5379
|
[
|
|
@@ -5366,9 +5395,9 @@ var inputOTPSlotVariants = classVarianceAuthority.cva(
|
|
|
5366
5395
|
}
|
|
5367
5396
|
}
|
|
5368
5397
|
);
|
|
5369
|
-
var InputOTPSlot =
|
|
5398
|
+
var InputOTPSlot = React24__namespace.forwardRef(
|
|
5370
5399
|
({ index, className, ...props }, ref) => {
|
|
5371
|
-
const inputOTPContext =
|
|
5400
|
+
const inputOTPContext = React24__namespace.useContext(inputOtp.OTPInputContext);
|
|
5372
5401
|
const slot = inputOTPContext?.slots?.[index];
|
|
5373
5402
|
const char = slot?.char;
|
|
5374
5403
|
const hasFakeCaret = slot?.hasFakeCaret;
|
|
@@ -5390,7 +5419,7 @@ var InputOTPSlot = React10__namespace.forwardRef(
|
|
|
5390
5419
|
}
|
|
5391
5420
|
);
|
|
5392
5421
|
InputOTPSlot.displayName = "InputOTPSlot";
|
|
5393
|
-
var InputOTPSeparator =
|
|
5422
|
+
var InputOTPSeparator = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5394
5423
|
"div",
|
|
5395
5424
|
{
|
|
5396
5425
|
ref,
|
|
@@ -5408,8 +5437,8 @@ function LockedComponent({
|
|
|
5408
5437
|
showPreview = true,
|
|
5409
5438
|
previewDuration = 2e3
|
|
5410
5439
|
}) {
|
|
5411
|
-
const [isPreviewActive, setIsPreviewActive] =
|
|
5412
|
-
const [previewTimeout, setPreviewTimeout] =
|
|
5440
|
+
const [isPreviewActive, setIsPreviewActive] = React24.useState(false);
|
|
5441
|
+
const [previewTimeout, setPreviewTimeout] = React24.useState(null);
|
|
5413
5442
|
const handleMouseEnter = () => {
|
|
5414
5443
|
if (!showPreview)
|
|
5415
5444
|
return;
|
|
@@ -5506,13 +5535,13 @@ function ProComponentWrapper({
|
|
|
5506
5535
|
fallback,
|
|
5507
5536
|
requireCLI = true
|
|
5508
5537
|
}) {
|
|
5509
|
-
const [authState, setAuthState] =
|
|
5538
|
+
const [authState, setAuthState] = React24.useState({
|
|
5510
5539
|
isAuthenticated: false,
|
|
5511
5540
|
deviceValid: false,
|
|
5512
5541
|
hasProAccess: false,
|
|
5513
5542
|
loading: true
|
|
5514
5543
|
});
|
|
5515
|
-
|
|
5544
|
+
React24.useEffect(() => {
|
|
5516
5545
|
const isDevelopment2 = () => {
|
|
5517
5546
|
const checks = {
|
|
5518
5547
|
nodeEnv: process.env.NODE_ENV === "development",
|
|
@@ -5689,7 +5718,7 @@ function MoonLogo({
|
|
|
5689
5718
|
showText = true,
|
|
5690
5719
|
...props
|
|
5691
5720
|
}) {
|
|
5692
|
-
const logoId =
|
|
5721
|
+
const logoId = React24__namespace.useId();
|
|
5693
5722
|
const gradientId = `moon-gradient-${logoId}`;
|
|
5694
5723
|
const maskId = `moon-mask-${logoId}`;
|
|
5695
5724
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("flex items-center gap-2", className), children: [
|
|
@@ -5771,7 +5800,7 @@ var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
|
5771
5800
|
}
|
|
5772
5801
|
);
|
|
5773
5802
|
Pagination.displayName = "Pagination";
|
|
5774
|
-
var PaginationContent =
|
|
5803
|
+
var PaginationContent = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5775
5804
|
"ul",
|
|
5776
5805
|
{
|
|
5777
5806
|
ref,
|
|
@@ -5780,7 +5809,7 @@ var PaginationContent = React10__namespace.forwardRef(({ className, ...props },
|
|
|
5780
5809
|
}
|
|
5781
5810
|
));
|
|
5782
5811
|
PaginationContent.displayName = "PaginationContent";
|
|
5783
|
-
var PaginationItem =
|
|
5812
|
+
var PaginationItem = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("li", { ref, className: cn("moonui-theme", "", className), ...props }));
|
|
5784
5813
|
PaginationItem.displayName = "PaginationItem";
|
|
5785
5814
|
var PaginationLink = ({
|
|
5786
5815
|
className,
|
|
@@ -5856,41 +5885,62 @@ var Select = SelectPrimitive__namespace.Root;
|
|
|
5856
5885
|
Select.displayName = "Select";
|
|
5857
5886
|
var SelectGroup = SelectPrimitive__namespace.Group;
|
|
5858
5887
|
var SelectValue = SelectPrimitive__namespace.Value;
|
|
5859
|
-
var
|
|
5888
|
+
var selectTriggerVariants = classVarianceAuthority.cva(
|
|
5889
|
+
[
|
|
5890
|
+
"flex w-full items-center justify-between gap-1 rounded-md transition-all duration-200",
|
|
5891
|
+
"disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
5892
|
+
"focus-visible:outline-none text-foreground"
|
|
5893
|
+
],
|
|
5894
|
+
{
|
|
5895
|
+
variants: {
|
|
5896
|
+
variant: {
|
|
5897
|
+
standard: "border border-input bg-background hover:border-ring focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:border-primary",
|
|
5898
|
+
outline: "border border-input bg-transparent hover:border-ring focus-visible:ring-2 focus-visible:ring-primary/30 focus-visible:border-primary",
|
|
5899
|
+
ghost: "border-none bg-muted hover:bg-muted/80 focus-visible:ring-2 focus-visible:ring-primary/30",
|
|
5900
|
+
underline: "border-t-0 border-l-0 border-r-0 border-b border-input rounded-none px-0 bg-transparent hover:border-ring focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary"
|
|
5901
|
+
},
|
|
5902
|
+
size: {
|
|
5903
|
+
sm: "h-8 text-xs px-2",
|
|
5904
|
+
md: "h-10 text-sm px-3",
|
|
5905
|
+
lg: "h-12 text-base px-4"
|
|
5906
|
+
},
|
|
5907
|
+
state: {
|
|
5908
|
+
none: "",
|
|
5909
|
+
error: "border-error focus-visible:ring-error/30 focus-visible:border-error",
|
|
5910
|
+
success: "border-success focus-visible:ring-success/30 focus-visible:border-success"
|
|
5911
|
+
}
|
|
5912
|
+
},
|
|
5913
|
+
defaultVariants: {
|
|
5914
|
+
variant: "standard",
|
|
5915
|
+
size: "md",
|
|
5916
|
+
state: "none"
|
|
5917
|
+
}
|
|
5918
|
+
}
|
|
5919
|
+
);
|
|
5920
|
+
var SelectTrigger = React24__namespace.forwardRef(({ className, children, variant, size, error, success, loading, leftIcon, rightIcon, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5860
5921
|
SelectPrimitive__namespace.Trigger,
|
|
5861
5922
|
{
|
|
5862
5923
|
ref,
|
|
5863
5924
|
className: cn(
|
|
5864
|
-
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
error && "border-error focus-visible:ring-error/30 focus-visible:border-error",
|
|
5870
|
-
/* Success state */
|
|
5871
|
-
success && "border-success focus-visible:ring-success/30 focus-visible:border-success",
|
|
5872
|
-
/* Size variants */
|
|
5873
|
-
size === "sm" && "h-8 text-xs px-2",
|
|
5874
|
-
size === "md" && "h-10 text-sm px-3",
|
|
5875
|
-
size === "lg" && "h-12 text-base px-4",
|
|
5876
|
-
/* Visual variants */
|
|
5877
|
-
variant === "standard" && "border border-gray-300 dark:border-gray-700 bg-background dark:bg-gray-800/80 dark:shadow-inner dark:shadow-gray-950/10 dark:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80",
|
|
5878
|
-
variant === "outline" && "border border-gray-300 dark:border-gray-700 bg-transparent dark:text-gray-200 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80",
|
|
5879
|
-
variant === "ghost" && "border-none bg-gray-100 dark:bg-gray-800 dark:shadow-inner dark:shadow-gray-950/10 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-700 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20",
|
|
5880
|
-
variant === "underline" && "border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 dark:text-gray-200 dark:bg-transparent hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary/80",
|
|
5925
|
+
selectTriggerVariants({
|
|
5926
|
+
variant,
|
|
5927
|
+
size,
|
|
5928
|
+
state: error ? "error" : success ? "success" : "none"
|
|
5929
|
+
}),
|
|
5881
5930
|
className
|
|
5882
5931
|
),
|
|
5883
5932
|
...props,
|
|
5884
5933
|
disabled: props.disabled || loading,
|
|
5934
|
+
"aria-invalid": error ? true : void 0,
|
|
5885
5935
|
"data-error": error ? true : void 0,
|
|
5886
5936
|
"data-success": success ? true : void 0,
|
|
5887
5937
|
"data-loading": loading ? true : void 0,
|
|
5888
5938
|
children: [
|
|
5889
5939
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center flex-1 gap-2", children: [
|
|
5890
|
-
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center text-
|
|
5940
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center justify-center text-muted-foreground", children: leftIcon }),
|
|
5891
5941
|
loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
5892
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground
|
|
5893
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground
|
|
5942
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }),
|
|
5943
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "Loading..." })
|
|
5894
5944
|
] }) : children
|
|
5895
5945
|
] }),
|
|
5896
5946
|
!loading && /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Icon, { asChild: true, children: rightIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-60", children: rightIcon }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 opacity-60 transition-transform duration-200 ease-out group-data-[state=open]:rotate-180" }) })
|
|
@@ -5898,7 +5948,7 @@ var SelectTrigger = React10__namespace.forwardRef(({ className, children, varian
|
|
|
5898
5948
|
}
|
|
5899
5949
|
));
|
|
5900
5950
|
SelectTrigger.displayName = SelectPrimitive__namespace.Trigger.displayName;
|
|
5901
|
-
var SelectScrollUpButton =
|
|
5951
|
+
var SelectScrollUpButton = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5902
5952
|
SelectPrimitive__namespace.ScrollUpButton,
|
|
5903
5953
|
{
|
|
5904
5954
|
ref,
|
|
@@ -5911,7 +5961,7 @@ var SelectScrollUpButton = React10__namespace.forwardRef(({ className, ...props
|
|
|
5911
5961
|
}
|
|
5912
5962
|
));
|
|
5913
5963
|
SelectScrollUpButton.displayName = SelectPrimitive__namespace.ScrollUpButton.displayName;
|
|
5914
|
-
var SelectScrollDownButton =
|
|
5964
|
+
var SelectScrollDownButton = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5915
5965
|
SelectPrimitive__namespace.ScrollDownButton,
|
|
5916
5966
|
{
|
|
5917
5967
|
ref,
|
|
@@ -5924,7 +5974,7 @@ var SelectScrollDownButton = React10__namespace.forwardRef(({ className, ...prop
|
|
|
5924
5974
|
}
|
|
5925
5975
|
));
|
|
5926
5976
|
SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
|
|
5927
|
-
var SelectContent =
|
|
5977
|
+
var SelectContent = React24__namespace.forwardRef(({ className, children, position = "popper", side = "bottom", sideOffset = 4, align = "start", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5928
5978
|
SelectPrimitive__namespace.Content,
|
|
5929
5979
|
{
|
|
5930
5980
|
ref,
|
|
@@ -5965,7 +6015,7 @@ var SelectContent = React10__namespace.forwardRef(({ className, children, positi
|
|
|
5965
6015
|
}
|
|
5966
6016
|
) }));
|
|
5967
6017
|
SelectContent.displayName = SelectPrimitive__namespace.Content.displayName;
|
|
5968
|
-
var SelectLabel =
|
|
6018
|
+
var SelectLabel = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5969
6019
|
SelectPrimitive__namespace.Label,
|
|
5970
6020
|
{
|
|
5971
6021
|
ref,
|
|
@@ -5974,7 +6024,7 @@ var SelectLabel = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
5974
6024
|
}
|
|
5975
6025
|
));
|
|
5976
6026
|
SelectLabel.displayName = SelectPrimitive__namespace.Label.displayName;
|
|
5977
|
-
var SelectItem =
|
|
6027
|
+
var SelectItem = React24__namespace.forwardRef(({ className, children, variant = "default", size = "md", rightIcon, customIndicator, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5978
6028
|
SelectPrimitive__namespace.Item,
|
|
5979
6029
|
{
|
|
5980
6030
|
ref,
|
|
@@ -6004,7 +6054,7 @@ var SelectItem = React10__namespace.forwardRef(({ className, children, variant =
|
|
|
6004
6054
|
}
|
|
6005
6055
|
));
|
|
6006
6056
|
SelectItem.displayName = SelectPrimitive__namespace.Item.displayName;
|
|
6007
|
-
var SelectSeparator =
|
|
6057
|
+
var SelectSeparator = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6008
6058
|
SelectPrimitive__namespace.Separator,
|
|
6009
6059
|
{
|
|
6010
6060
|
ref,
|
|
@@ -6086,7 +6136,7 @@ var getMaxLength = (countryCode) => {
|
|
|
6086
6136
|
return 15;
|
|
6087
6137
|
}
|
|
6088
6138
|
};
|
|
6089
|
-
var PhoneInput =
|
|
6139
|
+
var PhoneInput = React24__namespace.forwardRef(
|
|
6090
6140
|
({
|
|
6091
6141
|
className,
|
|
6092
6142
|
value = "",
|
|
@@ -6098,8 +6148,8 @@ var PhoneInput = React10__namespace.forwardRef(
|
|
|
6098
6148
|
size,
|
|
6099
6149
|
...props
|
|
6100
6150
|
}, ref) => {
|
|
6101
|
-
const [countryCode, setCountryCode] =
|
|
6102
|
-
const [phoneNumber, setPhoneNumber] =
|
|
6151
|
+
const [countryCode, setCountryCode] = React24__namespace.useState(defaultCountry);
|
|
6152
|
+
const [phoneNumber, setPhoneNumber] = React24__namespace.useState(value);
|
|
6103
6153
|
const selectedCountry = countries.find((c) => c.code === countryCode) || countries[0];
|
|
6104
6154
|
const handlePhoneChange = (e) => {
|
|
6105
6155
|
const rawValue = e.target.value.replace(/\D/g, "");
|
|
@@ -6170,15 +6220,15 @@ var radioGroupItemVariants = classVarianceAuthority.cva(
|
|
|
6170
6220
|
}
|
|
6171
6221
|
}
|
|
6172
6222
|
);
|
|
6173
|
-
var RadioGroupContext =
|
|
6174
|
-
var RadioGroup2 =
|
|
6223
|
+
var RadioGroupContext = React24__namespace.createContext({});
|
|
6224
|
+
var RadioGroup2 = React24__namespace.forwardRef(
|
|
6175
6225
|
({ className, value, defaultValue, onValueChange, disabled, name, ...props }, ref) => {
|
|
6176
|
-
const [internalValue, setInternalValue] =
|
|
6226
|
+
const [internalValue, setInternalValue] = React24__namespace.useState(
|
|
6177
6227
|
defaultValue
|
|
6178
6228
|
);
|
|
6179
6229
|
const isControlled = value !== void 0;
|
|
6180
6230
|
const currentValue = isControlled ? value : internalValue;
|
|
6181
|
-
const handleValueChange =
|
|
6231
|
+
const handleValueChange = React24__namespace.useCallback(
|
|
6182
6232
|
(next) => {
|
|
6183
6233
|
if (!isControlled) {
|
|
6184
6234
|
setInternalValue(next);
|
|
@@ -6210,9 +6260,9 @@ var RadioGroup2 = React10__namespace.forwardRef(
|
|
|
6210
6260
|
}
|
|
6211
6261
|
);
|
|
6212
6262
|
RadioGroup2.displayName = "RadioGroup";
|
|
6213
|
-
var RadioGroupItem =
|
|
6214
|
-
const radioGroup =
|
|
6215
|
-
const generatedId =
|
|
6263
|
+
var RadioGroupItem = React24__namespace.forwardRef(({ className, variant, size, indicator, id, value, disabled, ...props }, ref) => {
|
|
6264
|
+
const radioGroup = React24__namespace.useContext(RadioGroupContext);
|
|
6265
|
+
const generatedId = React24__namespace.useId();
|
|
6216
6266
|
const radioId = id || generatedId;
|
|
6217
6267
|
const isChecked = radioGroup.value === value;
|
|
6218
6268
|
const handleChange = (e) => {
|
|
@@ -6265,7 +6315,7 @@ var RadioGroupItem = React10__namespace.forwardRef(({ className, variant, size,
|
|
|
6265
6315
|
] });
|
|
6266
6316
|
});
|
|
6267
6317
|
RadioGroupItem.displayName = "RadioGroupItem";
|
|
6268
|
-
var RadioLabel =
|
|
6318
|
+
var RadioLabel = React24__namespace.forwardRef(
|
|
6269
6319
|
({ className, htmlFor, children, disabled = false, ...props }, ref) => {
|
|
6270
6320
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6271
6321
|
"label",
|
|
@@ -6284,13 +6334,13 @@ var RadioLabel = React10__namespace.forwardRef(
|
|
|
6284
6334
|
}
|
|
6285
6335
|
);
|
|
6286
6336
|
RadioLabel.displayName = "RadioLabel";
|
|
6287
|
-
var RadioItemWithLabel =
|
|
6337
|
+
var RadioItemWithLabel = React24__namespace.forwardRef(({
|
|
6288
6338
|
id,
|
|
6289
6339
|
label,
|
|
6290
6340
|
labelClassName,
|
|
6291
6341
|
...radioProps
|
|
6292
6342
|
}, ref) => {
|
|
6293
|
-
const generatedId =
|
|
6343
|
+
const generatedId = React24__namespace.useId();
|
|
6294
6344
|
const radioId = id || generatedId;
|
|
6295
6345
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
6296
6346
|
/* @__PURE__ */ jsxRuntime.jsx(RadioGroupItem, { ref, id: radioId, ...radioProps }),
|
|
@@ -6367,7 +6417,7 @@ function RichTextEditor({
|
|
|
6367
6417
|
)
|
|
6368
6418
|
] });
|
|
6369
6419
|
}
|
|
6370
|
-
var ScrollArea =
|
|
6420
|
+
var ScrollArea = React24__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6371
6421
|
ScrollAreaPrimitive__namespace.Root,
|
|
6372
6422
|
{
|
|
6373
6423
|
ref,
|
|
@@ -6381,7 +6431,7 @@ var ScrollArea = React10__namespace.forwardRef(({ className, children, ...props
|
|
|
6381
6431
|
}
|
|
6382
6432
|
));
|
|
6383
6433
|
ScrollArea.displayName = ScrollAreaPrimitive__namespace.Root.displayName;
|
|
6384
|
-
var ScrollBar =
|
|
6434
|
+
var ScrollBar = React24__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6385
6435
|
ScrollAreaPrimitive__namespace.ScrollAreaScrollbar,
|
|
6386
6436
|
{
|
|
6387
6437
|
ref,
|
|
@@ -6435,7 +6485,7 @@ var defaultTransition = {
|
|
|
6435
6485
|
ease: [0.25, 0.46, 0.45, 0.94]
|
|
6436
6486
|
// Custom cubic-bezier for smooth motion
|
|
6437
6487
|
};
|
|
6438
|
-
var ScrollReveal =
|
|
6488
|
+
var ScrollReveal = React24__namespace.forwardRef(
|
|
6439
6489
|
({
|
|
6440
6490
|
children,
|
|
6441
6491
|
direction = "up",
|
|
@@ -6456,17 +6506,17 @@ var ScrollReveal = React10__namespace.forwardRef(
|
|
|
6456
6506
|
viewport
|
|
6457
6507
|
}, ref) => {
|
|
6458
6508
|
const shouldTriggerOnce = triggerOnce !== void 0 ? triggerOnce : once;
|
|
6459
|
-
const animationVariants =
|
|
6509
|
+
const animationVariants = React24__namespace.useMemo(() => {
|
|
6460
6510
|
if (variants)
|
|
6461
6511
|
return variants;
|
|
6462
6512
|
return createDefaultVariants(direction, distance);
|
|
6463
6513
|
}, [direction, distance, variants]);
|
|
6464
|
-
const transition =
|
|
6514
|
+
const transition = React24__namespace.useMemo(() => ({
|
|
6465
6515
|
...defaultTransition,
|
|
6466
6516
|
duration,
|
|
6467
6517
|
delay: delay + stagger
|
|
6468
6518
|
}), [duration, delay, stagger]);
|
|
6469
|
-
const viewportConfig =
|
|
6519
|
+
const viewportConfig = React24__namespace.useMemo(() => ({
|
|
6470
6520
|
once: shouldTriggerOnce,
|
|
6471
6521
|
amount: threshold,
|
|
6472
6522
|
...viewport
|
|
@@ -6501,7 +6551,7 @@ var ScrollReveal = React10__namespace.forwardRef(
|
|
|
6501
6551
|
}
|
|
6502
6552
|
);
|
|
6503
6553
|
ScrollReveal.displayName = "ScrollReveal";
|
|
6504
|
-
var ScrollRevealContainer =
|
|
6554
|
+
var ScrollRevealContainer = React24__namespace.forwardRef(
|
|
6505
6555
|
({
|
|
6506
6556
|
children,
|
|
6507
6557
|
stagger = 0.1,
|
|
@@ -6514,7 +6564,7 @@ var ScrollRevealContainer = React10__namespace.forwardRef(
|
|
|
6514
6564
|
viewport
|
|
6515
6565
|
}, ref) => {
|
|
6516
6566
|
const shouldTriggerOnce = triggerOnce !== void 0 ? triggerOnce : once;
|
|
6517
|
-
const viewportConfig =
|
|
6567
|
+
const viewportConfig = React24__namespace.useMemo(() => ({
|
|
6518
6568
|
once: shouldTriggerOnce,
|
|
6519
6569
|
amount: threshold,
|
|
6520
6570
|
...viewport
|
|
@@ -6545,7 +6595,7 @@ var ScrollRevealContainer = React10__namespace.forwardRef(
|
|
|
6545
6595
|
}
|
|
6546
6596
|
);
|
|
6547
6597
|
ScrollRevealContainer.displayName = "ScrollRevealContainer";
|
|
6548
|
-
var ScrollRevealItem =
|
|
6598
|
+
var ScrollRevealItem = React24__namespace.forwardRef(
|
|
6549
6599
|
({
|
|
6550
6600
|
children,
|
|
6551
6601
|
direction = "up",
|
|
@@ -6556,12 +6606,12 @@ var ScrollRevealItem = React10__namespace.forwardRef(
|
|
|
6556
6606
|
style,
|
|
6557
6607
|
id
|
|
6558
6608
|
}, ref) => {
|
|
6559
|
-
const animationVariants =
|
|
6609
|
+
const animationVariants = React24__namespace.useMemo(() => {
|
|
6560
6610
|
if (variants)
|
|
6561
6611
|
return variants;
|
|
6562
6612
|
return createDefaultVariants(direction, distance);
|
|
6563
6613
|
}, [direction, distance, variants]);
|
|
6564
|
-
const transition =
|
|
6614
|
+
const transition = React24__namespace.useMemo(() => ({
|
|
6565
6615
|
...defaultTransition,
|
|
6566
6616
|
duration
|
|
6567
6617
|
}), [duration]);
|
|
@@ -6677,7 +6727,7 @@ var separatorVariants = classVarianceAuthority.cva(
|
|
|
6677
6727
|
}
|
|
6678
6728
|
}
|
|
6679
6729
|
);
|
|
6680
|
-
var Separator3 =
|
|
6730
|
+
var Separator3 = React24__namespace.forwardRef(
|
|
6681
6731
|
({
|
|
6682
6732
|
className,
|
|
6683
6733
|
orientation = "horizontal",
|
|
@@ -6720,7 +6770,7 @@ var toggleVariants = classVarianceAuthority.cva(
|
|
|
6720
6770
|
}
|
|
6721
6771
|
}
|
|
6722
6772
|
);
|
|
6723
|
-
var Toggle =
|
|
6773
|
+
var Toggle = React24__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6724
6774
|
TogglePrimitive__namespace.Root,
|
|
6725
6775
|
{
|
|
6726
6776
|
ref,
|
|
@@ -6756,7 +6806,7 @@ var tooltipVariants = classVarianceAuthority.cva(
|
|
|
6756
6806
|
);
|
|
6757
6807
|
var Tooltip = TooltipPrimitive__namespace.Root;
|
|
6758
6808
|
var TooltipTrigger = TooltipPrimitive__namespace.Trigger;
|
|
6759
|
-
var TooltipArrow =
|
|
6809
|
+
var TooltipArrow = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6760
6810
|
TooltipPrimitive__namespace.Arrow,
|
|
6761
6811
|
{
|
|
6762
6812
|
ref,
|
|
@@ -6765,7 +6815,7 @@ var TooltipArrow = React10__namespace.forwardRef(({ className, ...props }, ref)
|
|
|
6765
6815
|
}
|
|
6766
6816
|
));
|
|
6767
6817
|
TooltipArrow.displayName = TooltipPrimitive__namespace.Arrow.displayName;
|
|
6768
|
-
var TooltipContent =
|
|
6818
|
+
var TooltipContent = React24__namespace.forwardRef(({ className, variant, size, showArrow = false, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6769
6819
|
TooltipPrimitive__namespace.Content,
|
|
6770
6820
|
{
|
|
6771
6821
|
ref,
|
|
@@ -6779,7 +6829,7 @@ var TooltipContent = React10__namespace.forwardRef(({ className, variant, size,
|
|
|
6779
6829
|
}
|
|
6780
6830
|
));
|
|
6781
6831
|
TooltipContent.displayName = TooltipPrimitive__namespace.Content.displayName;
|
|
6782
|
-
var SimpleTooltip =
|
|
6832
|
+
var SimpleTooltip = React24__namespace.forwardRef(
|
|
6783
6833
|
({
|
|
6784
6834
|
children,
|
|
6785
6835
|
content,
|
|
@@ -6833,6 +6883,7 @@ var ToolbarButton = ({ icon, tooltip, active, onClick, disabled }) => /* @__PURE
|
|
|
6833
6883
|
pressed: active,
|
|
6834
6884
|
onPressedChange: () => onClick(),
|
|
6835
6885
|
disabled,
|
|
6886
|
+
"aria-label": tooltip,
|
|
6836
6887
|
className: "h-8 w-8 p-0",
|
|
6837
6888
|
children: icon
|
|
6838
6889
|
}
|
|
@@ -6857,14 +6908,16 @@ var ColorPicker2 = ({ onColorSelect }) => {
|
|
|
6857
6908
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-4 gap-1 p-2", children: colors.map((color) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6858
6909
|
"button",
|
|
6859
6910
|
{
|
|
6860
|
-
|
|
6911
|
+
type: "button",
|
|
6912
|
+
"aria-label": `Select color ${color}`,
|
|
6913
|
+
className: "w-6 h-6 rounded border-2 border-border hover:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
6861
6914
|
style: { backgroundColor: color },
|
|
6862
6915
|
onClick: () => onColorSelect(color)
|
|
6863
6916
|
},
|
|
6864
6917
|
color
|
|
6865
6918
|
)) });
|
|
6866
6919
|
};
|
|
6867
|
-
var SimpleEditor =
|
|
6920
|
+
var SimpleEditor = React24__namespace.default.forwardRef(
|
|
6868
6921
|
({
|
|
6869
6922
|
value = "",
|
|
6870
6923
|
onChange,
|
|
@@ -6877,13 +6930,13 @@ var SimpleEditor = React10__namespace.default.forwardRef(
|
|
|
6877
6930
|
showPreview = true,
|
|
6878
6931
|
...props
|
|
6879
6932
|
}, ref) => {
|
|
6880
|
-
const [content, setContent] =
|
|
6881
|
-
const [isPreview, setIsPreview] =
|
|
6882
|
-
const [sourceContent, setSourceContent] =
|
|
6883
|
-
|
|
6884
|
-
const editorRef =
|
|
6885
|
-
const sourceRef =
|
|
6886
|
-
const [formatState, setFormatState] =
|
|
6933
|
+
const [content, setContent] = React24.useState(value);
|
|
6934
|
+
const [isPreview, setIsPreview] = React24.useState(false);
|
|
6935
|
+
const [sourceContent, setSourceContent] = React24.useState(value);
|
|
6936
|
+
React24.useState(null);
|
|
6937
|
+
const editorRef = React24__namespace.default.useRef(null);
|
|
6938
|
+
const sourceRef = React24__namespace.default.useRef(null);
|
|
6939
|
+
const [formatState, setFormatState] = React24.useState({
|
|
6887
6940
|
bold: false,
|
|
6888
6941
|
italic: false,
|
|
6889
6942
|
underline: false,
|
|
@@ -6897,18 +6950,18 @@ var SimpleEditor = React10__namespace.default.forwardRef(
|
|
|
6897
6950
|
quote: false,
|
|
6898
6951
|
code: false
|
|
6899
6952
|
});
|
|
6900
|
-
const updateContent =
|
|
6953
|
+
const updateContent = React24.useCallback((newContent) => {
|
|
6901
6954
|
setContent(newContent);
|
|
6902
6955
|
onChange?.(newContent);
|
|
6903
6956
|
}, [onChange]);
|
|
6904
|
-
const saveSelection =
|
|
6957
|
+
const saveSelection = React24.useCallback(() => {
|
|
6905
6958
|
const selection2 = window.getSelection();
|
|
6906
6959
|
if (selection2 && selection2.rangeCount > 0) {
|
|
6907
6960
|
return selection2.getRangeAt(0);
|
|
6908
6961
|
}
|
|
6909
6962
|
return null;
|
|
6910
6963
|
}, []);
|
|
6911
|
-
|
|
6964
|
+
React24.useCallback((range) => {
|
|
6912
6965
|
if (!range)
|
|
6913
6966
|
return;
|
|
6914
6967
|
const selection2 = window.getSelection();
|
|
@@ -6917,7 +6970,7 @@ var SimpleEditor = React10__namespace.default.forwardRef(
|
|
|
6917
6970
|
selection2.addRange(range);
|
|
6918
6971
|
}
|
|
6919
6972
|
}, []);
|
|
6920
|
-
const executeCommand =
|
|
6973
|
+
const executeCommand = React24.useCallback((command, value2) => {
|
|
6921
6974
|
if (disabled)
|
|
6922
6975
|
return;
|
|
6923
6976
|
if (editorRef.current) {
|
|
@@ -6950,11 +7003,11 @@ var SimpleEditor = React10__namespace.default.forwardRef(
|
|
|
6950
7003
|
editorRef.current.focus();
|
|
6951
7004
|
}
|
|
6952
7005
|
}, [disabled, saveSelection, updateContent]);
|
|
6953
|
-
const handleInput =
|
|
7006
|
+
const handleInput = React24.useCallback((e) => {
|
|
6954
7007
|
const newContent = e.currentTarget.innerHTML;
|
|
6955
7008
|
updateContent(newContent);
|
|
6956
7009
|
}, [updateContent]);
|
|
6957
|
-
const handleKeyDown =
|
|
7010
|
+
const handleKeyDown = React24.useCallback((e) => {
|
|
6958
7011
|
if (e.ctrlKey || e.metaKey) {
|
|
6959
7012
|
switch (e.key) {
|
|
6960
7013
|
case "b":
|
|
@@ -6984,22 +7037,22 @@ var SimpleEditor = React10__namespace.default.forwardRef(
|
|
|
6984
7037
|
executeCommand("insertHTML", " ");
|
|
6985
7038
|
}
|
|
6986
7039
|
}, [executeCommand]);
|
|
6987
|
-
const insertLink =
|
|
7040
|
+
const insertLink = React24.useCallback(() => {
|
|
6988
7041
|
const url = prompt("Enter URL:");
|
|
6989
7042
|
if (url) {
|
|
6990
7043
|
executeCommand("createLink", url);
|
|
6991
7044
|
}
|
|
6992
7045
|
}, [executeCommand]);
|
|
6993
|
-
const insertImage =
|
|
7046
|
+
const insertImage = React24.useCallback(() => {
|
|
6994
7047
|
const url = prompt("Enter image URL:");
|
|
6995
7048
|
if (url) {
|
|
6996
7049
|
executeCommand("insertImage", url);
|
|
6997
7050
|
}
|
|
6998
7051
|
}, [executeCommand]);
|
|
6999
|
-
const formatHeading =
|
|
7052
|
+
const formatHeading = React24.useCallback((level) => {
|
|
7000
7053
|
executeCommand("formatBlock", `<h${level}>`);
|
|
7001
7054
|
}, [executeCommand]);
|
|
7002
|
-
const setTextColor =
|
|
7055
|
+
const setTextColor = React24.useCallback((color) => {
|
|
7003
7056
|
const selection2 = window.getSelection();
|
|
7004
7057
|
if (selection2 && selection2.rangeCount > 0) {
|
|
7005
7058
|
const range = selection2.getRangeAt(0);
|
|
@@ -7016,12 +7069,12 @@ var SimpleEditor = React10__namespace.default.forwardRef(
|
|
|
7016
7069
|
}
|
|
7017
7070
|
}
|
|
7018
7071
|
}, [executeCommand, updateContent]);
|
|
7019
|
-
|
|
7072
|
+
React24__namespace.default.useEffect(() => {
|
|
7020
7073
|
if (editorRef.current && content && content !== editorRef.current.innerHTML) {
|
|
7021
7074
|
editorRef.current.innerHTML = content;
|
|
7022
7075
|
}
|
|
7023
7076
|
}, [content]);
|
|
7024
|
-
|
|
7077
|
+
React24__namespace.default.useEffect(() => {
|
|
7025
7078
|
if (value !== void 0 && value !== content) {
|
|
7026
7079
|
setContent(value);
|
|
7027
7080
|
setSourceContent(value);
|
|
@@ -7336,10 +7389,15 @@ var SimpleEditor = React10__namespace.default.forwardRef(
|
|
|
7336
7389
|
ref: editorRef,
|
|
7337
7390
|
contentEditable: !disabled,
|
|
7338
7391
|
suppressContentEditableWarning: true,
|
|
7392
|
+
role: "textbox",
|
|
7393
|
+
"aria-multiline": "true",
|
|
7394
|
+
"aria-label": placeholder,
|
|
7395
|
+
"aria-disabled": disabled || void 0,
|
|
7339
7396
|
className: cn(
|
|
7340
7397
|
"p-4 outline-none prose prose-sm dark:prose-invert max-w-none overflow-y-auto",
|
|
7341
|
-
|
|
7342
|
-
|
|
7398
|
+
// Token'a bağlandı (önce `bg-slate-50 dark:bg-zinc-900/95` ve
|
|
7399
|
+
// `text-gray-900 dark:text-gray-100` hardcode'luydu).
|
|
7400
|
+
"bg-background text-foreground",
|
|
7343
7401
|
"focus:ring-0",
|
|
7344
7402
|
"[&_h1]:text-3xl [&_h1]:font-bold [&_h1]:mb-4",
|
|
7345
7403
|
"[&_h2]:text-2xl [&_h2]:font-bold [&_h2]:mb-3",
|
|
@@ -7378,8 +7436,8 @@ var SimpleEditor = React10__namespace.default.forwardRef(
|
|
|
7378
7436
|
);
|
|
7379
7437
|
SimpleEditor.displayName = "SimpleEditor";
|
|
7380
7438
|
var CharacterCount = ({ content }) => {
|
|
7381
|
-
const [count, setCount] =
|
|
7382
|
-
|
|
7439
|
+
const [count, setCount] = React24.useState(0);
|
|
7440
|
+
React24.useEffect(() => {
|
|
7383
7441
|
const getPlainText = (html) => {
|
|
7384
7442
|
const div = document.createElement("div");
|
|
7385
7443
|
div.innerHTML = html;
|
|
@@ -7426,7 +7484,7 @@ var skeletonVariants = classVarianceAuthority.cva(
|
|
|
7426
7484
|
}
|
|
7427
7485
|
}
|
|
7428
7486
|
);
|
|
7429
|
-
var Skeleton =
|
|
7487
|
+
var Skeleton = React24__namespace.forwardRef(
|
|
7430
7488
|
({
|
|
7431
7489
|
className,
|
|
7432
7490
|
variant,
|
|
@@ -7510,7 +7568,7 @@ var Skeleton = React10__namespace.forwardRef(
|
|
|
7510
7568
|
}
|
|
7511
7569
|
);
|
|
7512
7570
|
Skeleton.displayName = "Skeleton";
|
|
7513
|
-
var SkeletonText =
|
|
7571
|
+
var SkeletonText = React24__namespace.forwardRef(
|
|
7514
7572
|
({
|
|
7515
7573
|
className,
|
|
7516
7574
|
lines = 3,
|
|
@@ -7551,7 +7609,7 @@ var SkeletonText = React10__namespace.forwardRef(
|
|
|
7551
7609
|
}
|
|
7552
7610
|
);
|
|
7553
7611
|
SkeletonText.displayName = "SkeletonText";
|
|
7554
|
-
var SkeletonAvatar =
|
|
7612
|
+
var SkeletonAvatar = React24__namespace.forwardRef(
|
|
7555
7613
|
({
|
|
7556
7614
|
className,
|
|
7557
7615
|
size = "2.5rem",
|
|
@@ -7577,7 +7635,7 @@ var SkeletonAvatar = React10__namespace.forwardRef(
|
|
|
7577
7635
|
}
|
|
7578
7636
|
);
|
|
7579
7637
|
SkeletonAvatar.displayName = "SkeletonAvatar";
|
|
7580
|
-
var SkeletonCard =
|
|
7638
|
+
var SkeletonCard = React24__namespace.forwardRef(
|
|
7581
7639
|
({
|
|
7582
7640
|
className,
|
|
7583
7641
|
showHeader = true,
|
|
@@ -7651,11 +7709,11 @@ var SkeletonCard = React10__namespace.forwardRef(
|
|
|
7651
7709
|
}
|
|
7652
7710
|
);
|
|
7653
7711
|
SkeletonCard.displayName = "SkeletonCard";
|
|
7654
|
-
var SwipeableCard =
|
|
7712
|
+
var SwipeableCard = React24__namespace.forwardRef(
|
|
7655
7713
|
({ className, children, onSwipeLeft, onSwipeRight, threshold = 100, disabled = false, ...props }, ref) => {
|
|
7656
|
-
const [startX, setStartX] =
|
|
7657
|
-
const [currentX, setCurrentX] =
|
|
7658
|
-
const [isSwiping, setIsSwiping] =
|
|
7714
|
+
const [startX, setStartX] = React24__namespace.useState(0);
|
|
7715
|
+
const [currentX, setCurrentX] = React24__namespace.useState(0);
|
|
7716
|
+
const [isSwiping, setIsSwiping] = React24__namespace.useState(false);
|
|
7659
7717
|
const handleTouchStart = (e) => {
|
|
7660
7718
|
if (disabled)
|
|
7661
7719
|
return;
|
|
@@ -7701,54 +7759,95 @@ var SwipeableCard = React10__namespace.forwardRef(
|
|
|
7701
7759
|
}
|
|
7702
7760
|
);
|
|
7703
7761
|
SwipeableCard.displayName = "SwipeableCard";
|
|
7704
|
-
var
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
"
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
className: cn(
|
|
7736
|
-
"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
7737
|
-
// Boyuta göre thumb boyutları
|
|
7738
|
-
size === "sm" && "h-3 w-3 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",
|
|
7739
|
-
size === "md" && "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
7740
|
-
size === "lg" && "h-6 w-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0"
|
|
7741
|
-
)
|
|
7742
|
-
}
|
|
7743
|
-
)
|
|
7744
|
-
]
|
|
7762
|
+
var switchVariants = classVarianceAuthority.cva(
|
|
7763
|
+
[
|
|
7764
|
+
"peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full",
|
|
7765
|
+
"border-2 border-transparent transition-colors",
|
|
7766
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
7767
|
+
"focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
7768
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
7769
|
+
// Kapalı durum token'a bağlı; `--input` karanlık modda kendi değerini taşır.
|
|
7770
|
+
// (Önceden ayrıca `dark:data-[state=unchecked]:bg-gray-700/70` hardcode'u
|
|
7771
|
+
// vardı ve token'ı eziyordu — kaldırıldı.)
|
|
7772
|
+
"data-[state=unchecked]:bg-input",
|
|
7773
|
+
"dark:focus-visible:ring-primary/40"
|
|
7774
|
+
],
|
|
7775
|
+
{
|
|
7776
|
+
variants: {
|
|
7777
|
+
size: {
|
|
7778
|
+
sm: "h-4 w-8",
|
|
7779
|
+
md: "h-6 w-11",
|
|
7780
|
+
lg: "h-7 w-14"
|
|
7781
|
+
},
|
|
7782
|
+
variant: {
|
|
7783
|
+
primary: "data-[state=checked]:bg-primary",
|
|
7784
|
+
success: "data-[state=checked]:bg-success",
|
|
7785
|
+
warning: "data-[state=checked]:bg-warning",
|
|
7786
|
+
destructive: "data-[state=checked]:bg-error",
|
|
7787
|
+
secondary: "data-[state=checked]:bg-accent"
|
|
7788
|
+
}
|
|
7789
|
+
},
|
|
7790
|
+
defaultVariants: {
|
|
7791
|
+
size: "md",
|
|
7792
|
+
variant: "primary"
|
|
7745
7793
|
}
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7794
|
+
}
|
|
7795
|
+
);
|
|
7796
|
+
var switchThumbVariants = classVarianceAuthority.cva(
|
|
7797
|
+
"pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",
|
|
7798
|
+
{
|
|
7799
|
+
variants: {
|
|
7800
|
+
size: {
|
|
7801
|
+
sm: "h-3 w-3 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",
|
|
7802
|
+
md: "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
|
|
7803
|
+
lg: "h-6 w-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0"
|
|
7804
|
+
}
|
|
7805
|
+
},
|
|
7806
|
+
defaultVariants: {
|
|
7807
|
+
size: "md"
|
|
7808
|
+
}
|
|
7809
|
+
}
|
|
7810
|
+
);
|
|
7811
|
+
var Switch = React24__namespace.forwardRef(({
|
|
7812
|
+
className,
|
|
7813
|
+
size,
|
|
7814
|
+
variant,
|
|
7815
|
+
loading,
|
|
7816
|
+
leftIcon,
|
|
7817
|
+
rightIcon,
|
|
7818
|
+
description,
|
|
7819
|
+
"aria-describedby": ariaDescribedBy,
|
|
7820
|
+
...props
|
|
7821
|
+
}, ref) => {
|
|
7822
|
+
const reactId = React24__namespace.useId();
|
|
7823
|
+
const descriptionId = description ? `${reactId}-description` : void 0;
|
|
7824
|
+
const describedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" ") || void 0;
|
|
7825
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "moonui-theme inline-flex items-center gap-2", children: [
|
|
7826
|
+
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: leftIcon }),
|
|
7827
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
7828
|
+
SwitchPrimitives__namespace.Root,
|
|
7829
|
+
{
|
|
7830
|
+
className: cn(
|
|
7831
|
+
switchVariants({ size, variant }),
|
|
7832
|
+
loading && "opacity-80 cursor-wait",
|
|
7833
|
+
className
|
|
7834
|
+
),
|
|
7835
|
+
disabled: loading || props.disabled,
|
|
7836
|
+
"aria-describedby": describedBy,
|
|
7837
|
+
...props,
|
|
7838
|
+
ref,
|
|
7839
|
+
children: [
|
|
7840
|
+
loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-3 w-3 animate-spin rounded-full border-2 border-muted border-t-primary" }) }) : null,
|
|
7841
|
+
/* @__PURE__ */ jsxRuntime.jsx(SwitchPrimitives__namespace.Thumb, { className: cn(switchThumbVariants({ size })) })
|
|
7842
|
+
]
|
|
7843
|
+
}
|
|
7844
|
+
),
|
|
7845
|
+
rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: rightIcon }),
|
|
7846
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("span", { id: descriptionId, className: "text-sm text-muted-foreground", children: description })
|
|
7847
|
+
] });
|
|
7848
|
+
});
|
|
7750
7849
|
Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
|
|
7751
|
-
var TagsInput =
|
|
7850
|
+
var TagsInput = React24__namespace.forwardRef(
|
|
7752
7851
|
({
|
|
7753
7852
|
value = [],
|
|
7754
7853
|
onChange,
|
|
@@ -7761,14 +7860,63 @@ var TagsInput = React10__namespace.forwardRef(
|
|
|
7761
7860
|
disabled,
|
|
7762
7861
|
...props
|
|
7763
7862
|
}, ref) => {
|
|
7764
|
-
const [inputValue, setInputValue] =
|
|
7765
|
-
const [error, setError] =
|
|
7863
|
+
const [inputValue, setInputValue] = React24__namespace.useState("");
|
|
7864
|
+
const [error, setError] = React24__namespace.useState("");
|
|
7865
|
+
const innerInputRef = React24__namespace.useRef(null);
|
|
7866
|
+
React24__namespace.useImperativeHandle(ref, () => innerInputRef.current);
|
|
7867
|
+
const tagButtonRefs = React24__namespace.useRef([]);
|
|
7868
|
+
const errorId = React24__namespace.useId();
|
|
7869
|
+
const focusTag = (index) => {
|
|
7870
|
+
if (value.length === 0)
|
|
7871
|
+
return;
|
|
7872
|
+
const clamped = Math.max(0, Math.min(value.length - 1, index));
|
|
7873
|
+
tagButtonRefs.current[clamped]?.focus();
|
|
7874
|
+
};
|
|
7766
7875
|
const handleKeyDown = (e) => {
|
|
7767
7876
|
if (e.key === "Enter" || e.key === delimiter) {
|
|
7768
7877
|
e.preventDefault();
|
|
7769
7878
|
addTag();
|
|
7770
7879
|
} else if (e.key === "Backspace" && inputValue === "" && value.length > 0) {
|
|
7771
7880
|
removeTag(value.length - 1);
|
|
7881
|
+
} else if (e.key === "ArrowLeft" && inputValue === "" && value.length > 0) {
|
|
7882
|
+
e.preventDefault();
|
|
7883
|
+
focusTag(value.length - 1);
|
|
7884
|
+
}
|
|
7885
|
+
};
|
|
7886
|
+
const handleTagKeyDown = (index) => (e) => {
|
|
7887
|
+
switch (e.key) {
|
|
7888
|
+
case "ArrowLeft":
|
|
7889
|
+
e.preventDefault();
|
|
7890
|
+
focusTag(index - 1);
|
|
7891
|
+
break;
|
|
7892
|
+
case "ArrowRight":
|
|
7893
|
+
e.preventDefault();
|
|
7894
|
+
if (index >= value.length - 1)
|
|
7895
|
+
innerInputRef.current?.focus();
|
|
7896
|
+
else
|
|
7897
|
+
focusTag(index + 1);
|
|
7898
|
+
break;
|
|
7899
|
+
case "Home":
|
|
7900
|
+
e.preventDefault();
|
|
7901
|
+
focusTag(0);
|
|
7902
|
+
break;
|
|
7903
|
+
case "End":
|
|
7904
|
+
e.preventDefault();
|
|
7905
|
+
focusTag(value.length - 1);
|
|
7906
|
+
break;
|
|
7907
|
+
case "Delete":
|
|
7908
|
+
case "Backspace": {
|
|
7909
|
+
e.preventDefault();
|
|
7910
|
+
const remaining = value.length - 1;
|
|
7911
|
+
removeTag(index);
|
|
7912
|
+
requestAnimationFrame(() => {
|
|
7913
|
+
if (remaining > 0)
|
|
7914
|
+
focusTag(Math.min(index, remaining - 1));
|
|
7915
|
+
else
|
|
7916
|
+
innerInputRef.current?.focus();
|
|
7917
|
+
});
|
|
7918
|
+
break;
|
|
7919
|
+
}
|
|
7772
7920
|
}
|
|
7773
7921
|
};
|
|
7774
7922
|
const addTag = () => {
|
|
@@ -7800,36 +7948,35 @@ var TagsInput = React10__namespace.forwardRef(
|
|
|
7800
7948
|
{
|
|
7801
7949
|
className: cn(
|
|
7802
7950
|
"flex items-center min-h-[2.5rem] w-full flex-wrap gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background",
|
|
7803
|
-
|
|
7951
|
+
// NOT: burada `dark:bg-zinc-950/50 dark:border-zinc-800` hardcode'u
|
|
7952
|
+
// vardı ve aynı satırdaki `bg-background`/`border-input` token'larını
|
|
7953
|
+
// karanlık modda eziyordu. Token'lar zaten dark-mode duyarlı.
|
|
7804
7954
|
"focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
7805
7955
|
disabled && "cursor-not-allowed opacity-50",
|
|
7806
7956
|
className
|
|
7807
7957
|
),
|
|
7808
7958
|
children: [
|
|
7809
|
-
value.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
},
|
|
7827
|
-
index
|
|
7828
|
-
)),
|
|
7959
|
+
value.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant, className: "gap-1 pr-1.5", children: [
|
|
7960
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: tag }),
|
|
7961
|
+
!disabled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
7962
|
+
"button",
|
|
7963
|
+
{
|
|
7964
|
+
ref: (el) => {
|
|
7965
|
+
tagButtonRefs.current[index] = el;
|
|
7966
|
+
},
|
|
7967
|
+
type: "button",
|
|
7968
|
+
"aria-label": `Remove ${tag}`,
|
|
7969
|
+
onClick: () => removeTag(index),
|
|
7970
|
+
onKeyDown: handleTagKeyDown(index),
|
|
7971
|
+
className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
7972
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3 text-muted-foreground hover:text-foreground transition-colors" })
|
|
7973
|
+
}
|
|
7974
|
+
)
|
|
7975
|
+
] }, index)),
|
|
7829
7976
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
7830
7977
|
"input",
|
|
7831
7978
|
{
|
|
7832
|
-
ref,
|
|
7979
|
+
ref: innerInputRef,
|
|
7833
7980
|
type: "text",
|
|
7834
7981
|
value: inputValue,
|
|
7835
7982
|
onChange: (e) => setInputValue(e.target.value),
|
|
@@ -7837,9 +7984,11 @@ var TagsInput = React10__namespace.forwardRef(
|
|
|
7837
7984
|
onBlur: addTag,
|
|
7838
7985
|
disabled,
|
|
7839
7986
|
placeholder: value.length === 0 ? placeholder : "",
|
|
7987
|
+
"aria-label": "Add tag",
|
|
7988
|
+
"aria-describedby": error ? errorId : void 0,
|
|
7989
|
+
"aria-invalid": error ? true : void 0,
|
|
7840
7990
|
className: cn(
|
|
7841
7991
|
"flex-1 bg-transparent outline-none placeholder:text-muted-foreground",
|
|
7842
|
-
"dark:placeholder:text-zinc-500",
|
|
7843
7992
|
"min-w-[120px]",
|
|
7844
7993
|
disabled && "cursor-not-allowed"
|
|
7845
7994
|
),
|
|
@@ -7849,7 +7998,7 @@ var TagsInput = React10__namespace.forwardRef(
|
|
|
7849
7998
|
]
|
|
7850
7999
|
}
|
|
7851
8000
|
),
|
|
7852
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-destructive", children: error })
|
|
8001
|
+
error && /* @__PURE__ */ jsxRuntime.jsx("p", { id: errorId, role: "status", className: "mt-1 text-xs text-destructive", children: error })
|
|
7853
8002
|
] });
|
|
7854
8003
|
}
|
|
7855
8004
|
);
|
|
@@ -7893,7 +8042,7 @@ var textareaVariants = classVarianceAuthority.cva(
|
|
|
7893
8042
|
}
|
|
7894
8043
|
}
|
|
7895
8044
|
);
|
|
7896
|
-
var Textarea =
|
|
8045
|
+
var Textarea = React24__namespace.forwardRef(
|
|
7897
8046
|
({
|
|
7898
8047
|
className,
|
|
7899
8048
|
wrapperClassName,
|
|
@@ -7913,10 +8062,12 @@ var Textarea = React10__namespace.forwardRef(
|
|
|
7913
8062
|
onChange,
|
|
7914
8063
|
...props
|
|
7915
8064
|
}, ref) => {
|
|
7916
|
-
const
|
|
7917
|
-
const
|
|
7918
|
-
|
|
7919
|
-
const
|
|
8065
|
+
const reactId = React24__namespace.useId();
|
|
8066
|
+
const fieldId = props.id || reactId;
|
|
8067
|
+
const textareaRef = React24__namespace.useRef(null);
|
|
8068
|
+
const [internalValue, setInternalValue] = React24__namespace.useState(value || defaultValue || "");
|
|
8069
|
+
React24__namespace.useImperativeHandle(ref, () => textareaRef.current);
|
|
8070
|
+
const adjustHeight = React24__namespace.useCallback(() => {
|
|
7920
8071
|
const textarea = textareaRef.current;
|
|
7921
8072
|
if (!textarea || !autoResize)
|
|
7922
8073
|
return;
|
|
@@ -7930,10 +8081,10 @@ var Textarea = React10__namespace.forwardRef(
|
|
|
7930
8081
|
textarea.style.overflowY = "hidden";
|
|
7931
8082
|
}
|
|
7932
8083
|
}, [autoResize, maxHeight]);
|
|
7933
|
-
|
|
8084
|
+
React24__namespace.useEffect(() => {
|
|
7934
8085
|
adjustHeight();
|
|
7935
8086
|
}, [internalValue, adjustHeight]);
|
|
7936
|
-
|
|
8087
|
+
React24__namespace.useEffect(() => {
|
|
7937
8088
|
if (value !== void 0) {
|
|
7938
8089
|
setInternalValue(value);
|
|
7939
8090
|
}
|
|
@@ -7969,7 +8120,7 @@ var Textarea = React10__namespace.forwardRef(
|
|
|
7969
8120
|
onChange: handleChange,
|
|
7970
8121
|
maxLength,
|
|
7971
8122
|
"aria-invalid": !!error || void 0,
|
|
7972
|
-
"aria-describedby": errorMessage ? `${
|
|
8123
|
+
"aria-describedby": errorMessage ? `${fieldId}-error` : successMessage ? `${fieldId}-success` : void 0,
|
|
7973
8124
|
...props
|
|
7974
8125
|
}
|
|
7975
8126
|
),
|
|
@@ -7985,7 +8136,7 @@ var Textarea = React10__namespace.forwardRef(
|
|
|
7985
8136
|
successMessage && "text-success",
|
|
7986
8137
|
messageClassName
|
|
7987
8138
|
),
|
|
7988
|
-
id: errorMessage ? `${
|
|
8139
|
+
id: errorMessage ? `${fieldId}-error` : successMessage ? `${fieldId}-success` : void 0,
|
|
7989
8140
|
children: errorMessage || successMessage
|
|
7990
8141
|
}
|
|
7991
8142
|
),
|
|
@@ -7999,7 +8150,7 @@ var Textarea = React10__namespace.forwardRef(
|
|
|
7999
8150
|
);
|
|
8000
8151
|
Textarea.displayName = "Textarea";
|
|
8001
8152
|
var ToastProvider = ToastPrimitives__namespace.Provider;
|
|
8002
|
-
var ToastViewport =
|
|
8153
|
+
var ToastViewport = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8003
8154
|
ToastPrimitives__namespace.Viewport,
|
|
8004
8155
|
{
|
|
8005
8156
|
ref,
|
|
@@ -8028,7 +8179,7 @@ var toastVariants = classVarianceAuthority.cva(
|
|
|
8028
8179
|
}
|
|
8029
8180
|
}
|
|
8030
8181
|
);
|
|
8031
|
-
var Toast =
|
|
8182
|
+
var Toast = React24__namespace.forwardRef(({ className, variant, ...props }, ref) => {
|
|
8032
8183
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8033
8184
|
ToastPrimitives__namespace.Root,
|
|
8034
8185
|
{
|
|
@@ -8039,7 +8190,7 @@ var Toast = React10__namespace.forwardRef(({ className, variant, ...props }, ref
|
|
|
8039
8190
|
);
|
|
8040
8191
|
});
|
|
8041
8192
|
Toast.displayName = ToastPrimitives__namespace.Root.displayName;
|
|
8042
|
-
var ToastAction =
|
|
8193
|
+
var ToastAction = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8043
8194
|
ToastPrimitives__namespace.Action,
|
|
8044
8195
|
{
|
|
8045
8196
|
ref,
|
|
@@ -8051,7 +8202,7 @@ var ToastAction = React10__namespace.forwardRef(({ className, ...props }, ref) =
|
|
|
8051
8202
|
}
|
|
8052
8203
|
));
|
|
8053
8204
|
ToastAction.displayName = ToastPrimitives__namespace.Action.displayName;
|
|
8054
|
-
var ToastClose =
|
|
8205
|
+
var ToastClose = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8055
8206
|
ToastPrimitives__namespace.Close,
|
|
8056
8207
|
{
|
|
8057
8208
|
ref,
|
|
@@ -8065,7 +8216,7 @@ var ToastClose = React10__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
8065
8216
|
}
|
|
8066
8217
|
));
|
|
8067
8218
|
ToastClose.displayName = ToastPrimitives__namespace.Close.displayName;
|
|
8068
|
-
var ToastTitle =
|
|
8219
|
+
var ToastTitle = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8069
8220
|
ToastPrimitives__namespace.Title,
|
|
8070
8221
|
{
|
|
8071
8222
|
ref,
|
|
@@ -8074,7 +8225,7 @@ var ToastTitle = React10__namespace.forwardRef(({ className, ...props }, ref) =>
|
|
|
8074
8225
|
}
|
|
8075
8226
|
));
|
|
8076
8227
|
ToastTitle.displayName = ToastPrimitives__namespace.Title.displayName;
|
|
8077
|
-
var ToastDescription =
|
|
8228
|
+
var ToastDescription = React24__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8078
8229
|
ToastPrimitives__namespace.Description,
|
|
8079
8230
|
{
|
|
8080
8231
|
ref,
|
|
@@ -8182,8 +8333,8 @@ function toast({ ...props }) {
|
|
|
8182
8333
|
};
|
|
8183
8334
|
}
|
|
8184
8335
|
function useToast() {
|
|
8185
|
-
const [state, setState] =
|
|
8186
|
-
|
|
8336
|
+
const [state, setState] = React24__namespace.useState(memoryState);
|
|
8337
|
+
React24__namespace.useEffect(() => {
|
|
8187
8338
|
listeners.push(setState);
|
|
8188
8339
|
return () => {
|
|
8189
8340
|
const index = listeners.indexOf(setState);
|
|
@@ -8236,7 +8387,7 @@ var kbdVariants = classVarianceAuthority.cva(
|
|
|
8236
8387
|
}
|
|
8237
8388
|
}
|
|
8238
8389
|
);
|
|
8239
|
-
var Kbd =
|
|
8390
|
+
var Kbd = React24__namespace.forwardRef(
|
|
8240
8391
|
({ className, size, children, ...props }, ref) => {
|
|
8241
8392
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8242
8393
|
"kbd",
|
|
@@ -8273,7 +8424,7 @@ var iconSizeMap = {
|
|
|
8273
8424
|
md: "h-5 w-5",
|
|
8274
8425
|
lg: "h-6 w-6"
|
|
8275
8426
|
};
|
|
8276
|
-
var Rating =
|
|
8427
|
+
var Rating = React24__namespace.forwardRef(
|
|
8277
8428
|
({
|
|
8278
8429
|
className,
|
|
8279
8430
|
value,
|
|
@@ -8291,11 +8442,11 @@ var Rating = React10__namespace.forwardRef(
|
|
|
8291
8442
|
const iconSizeClass = iconSizeMap[resolvedSize];
|
|
8292
8443
|
const step = precision === "half" ? 0.5 : 1;
|
|
8293
8444
|
const isControlled = value !== void 0;
|
|
8294
|
-
const [internalValue, setInternalValue] =
|
|
8445
|
+
const [internalValue, setInternalValue] = React24__namespace.useState(defaultValue ?? 0);
|
|
8295
8446
|
const currentValue = isControlled ? value ?? 0 : internalValue;
|
|
8296
|
-
const [hoverValue, setHoverValue] =
|
|
8447
|
+
const [hoverValue, setHoverValue] = React24__namespace.useState(null);
|
|
8297
8448
|
const displayValue = hoverValue !== null ? hoverValue : currentValue;
|
|
8298
|
-
const commit =
|
|
8449
|
+
const commit = React24__namespace.useCallback(
|
|
8299
8450
|
(next) => {
|
|
8300
8451
|
if (readOnly)
|
|
8301
8452
|
return;
|
|
@@ -8305,7 +8456,7 @@ var Rating = React10__namespace.forwardRef(
|
|
|
8305
8456
|
},
|
|
8306
8457
|
[readOnly, isControlled, onValueChange]
|
|
8307
8458
|
);
|
|
8308
|
-
const handleKeyDown =
|
|
8459
|
+
const handleKeyDown = React24__namespace.useCallback(
|
|
8309
8460
|
(event) => {
|
|
8310
8461
|
if (readOnly)
|
|
8311
8462
|
return;
|
|
@@ -8334,9 +8485,9 @@ var Rating = React10__namespace.forwardRef(
|
|
|
8334
8485
|
[readOnly, max, currentValue, step, commit]
|
|
8335
8486
|
);
|
|
8336
8487
|
const renderIcon = (filled) => {
|
|
8337
|
-
if (
|
|
8488
|
+
if (React24__namespace.isValidElement(icon)) {
|
|
8338
8489
|
const element = icon;
|
|
8339
|
-
return
|
|
8490
|
+
return React24__namespace.cloneElement(element, {
|
|
8340
8491
|
className: cn(
|
|
8341
8492
|
iconSizeClass,
|
|
8342
8493
|
"shrink-0",
|
|
@@ -8470,7 +8621,7 @@ var dotSizeMap = {
|
|
|
8470
8621
|
lg: "h-2 w-2",
|
|
8471
8622
|
xl: "h-2.5 w-2.5"
|
|
8472
8623
|
};
|
|
8473
|
-
var Spinner =
|
|
8624
|
+
var Spinner = React24__namespace.forwardRef(
|
|
8474
8625
|
({ className, size, variant = "default", label = "Loading", ...props }, ref) => {
|
|
8475
8626
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
8476
8627
|
"div",
|
|
@@ -8549,15 +8700,15 @@ var buttonGroupVariants = classVarianceAuthority.cva(
|
|
|
8549
8700
|
}
|
|
8550
8701
|
}
|
|
8551
8702
|
);
|
|
8552
|
-
var ButtonGroup =
|
|
8703
|
+
var ButtonGroup = React24__namespace.forwardRef(
|
|
8553
8704
|
({ className, orientation, attached, size, variant, children, ...props }, ref) => {
|
|
8554
8705
|
const shouldPropagate = size !== void 0 || variant !== void 0;
|
|
8555
|
-
const enhancedChildren = shouldPropagate ?
|
|
8556
|
-
if (!
|
|
8706
|
+
const enhancedChildren = shouldPropagate ? React24__namespace.Children.map(children, (child) => {
|
|
8707
|
+
if (!React24__namespace.isValidElement(child) || child.type !== Button) {
|
|
8557
8708
|
return child;
|
|
8558
8709
|
}
|
|
8559
8710
|
const childProps = child.props;
|
|
8560
|
-
return
|
|
8711
|
+
return React24__namespace.cloneElement(child, {
|
|
8561
8712
|
size: childProps.size ?? size,
|
|
8562
8713
|
variant: childProps.variant ?? variant
|
|
8563
8714
|
});
|
|
@@ -8575,11 +8726,11 @@ var ButtonGroup = React10__namespace.forwardRef(
|
|
|
8575
8726
|
}
|
|
8576
8727
|
);
|
|
8577
8728
|
ButtonGroup.displayName = "ButtonGroup";
|
|
8578
|
-
var ToggleGroupContext =
|
|
8729
|
+
var ToggleGroupContext = React24__namespace.createContext({
|
|
8579
8730
|
size: "default",
|
|
8580
8731
|
variant: "default"
|
|
8581
8732
|
});
|
|
8582
|
-
var ToggleGroup =
|
|
8733
|
+
var ToggleGroup = React24__namespace.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
8583
8734
|
ToggleGroupPrimitive__namespace.Root,
|
|
8584
8735
|
{
|
|
8585
8736
|
ref,
|
|
@@ -8596,8 +8747,8 @@ var ToggleGroup = React10__namespace.forwardRef(({ className, variant, size, chi
|
|
|
8596
8747
|
}
|
|
8597
8748
|
));
|
|
8598
8749
|
ToggleGroup.displayName = "ToggleGroup";
|
|
8599
|
-
var ToggleGroupItem =
|
|
8600
|
-
const context =
|
|
8750
|
+
var ToggleGroupItem = React24__namespace.forwardRef(({ className, children, variant, size, ...props }, ref) => {
|
|
8751
|
+
const context = React24__namespace.useContext(ToggleGroupContext);
|
|
8601
8752
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
8602
8753
|
ToggleGroupPrimitive__namespace.Item,
|
|
8603
8754
|
{
|
|
@@ -9024,6 +9175,7 @@ exports.ratingVariants = ratingVariants;
|
|
|
9024
9175
|
exports.separatorVariants = separatorVariants;
|
|
9025
9176
|
exports.skeletonVariants = skeletonVariants;
|
|
9026
9177
|
exports.spinnerVariants = spinnerVariants;
|
|
9178
|
+
exports.switchVariants = switchVariants;
|
|
9027
9179
|
exports.toast = toast;
|
|
9028
9180
|
exports.toggleVariants = toggleVariants;
|
|
9029
9181
|
exports.tooltipVariants = tooltipVariants;
|