@polastack/design-system 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +17 -1
- package/dist/index.js +565 -442
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/styles/globals.css +17 -0
package/dist/index.js
CHANGED
|
@@ -334,34 +334,63 @@ Badge.displayName = "Badge";
|
|
|
334
334
|
// src/components/avatar/avatar.tsx
|
|
335
335
|
import * as React5 from "react";
|
|
336
336
|
import { cva as cva3 } from "class-variance-authority";
|
|
337
|
+
|
|
338
|
+
// src/lib/string-hash.ts
|
|
339
|
+
function stringToIndex(str, buckets) {
|
|
340
|
+
let hash = 5381;
|
|
341
|
+
for (let i = 0; i < str.length; i++) {
|
|
342
|
+
hash = (hash << 5) + hash + str.charCodeAt(i) | 0;
|
|
343
|
+
}
|
|
344
|
+
return Math.abs(hash) % buckets;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
// src/components/avatar/avatar.tsx
|
|
337
348
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
338
349
|
var [AvatarContextProvider, useAvatarContext] = createContext2("Avatar");
|
|
339
|
-
var
|
|
340
|
-
"
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
350
|
+
var FALLBACK_COLORS = [
|
|
351
|
+
"bg-primary-100 text-primary-700 dark:bg-primary-950 dark:text-primary-300",
|
|
352
|
+
"bg-success-100 text-success-700 dark:bg-success-950 dark:text-success-300",
|
|
353
|
+
"bg-warning-100 text-warning-700 dark:bg-warning-950 dark:text-warning-300",
|
|
354
|
+
"bg-error-100 text-error-700 dark:bg-error-950 dark:text-error-300",
|
|
355
|
+
"bg-info-100 text-info-700 dark:bg-info-950 dark:text-info-300",
|
|
356
|
+
"bg-primary-200 text-primary-800 dark:bg-primary-900 dark:text-primary-200",
|
|
357
|
+
"bg-info-200 text-info-800 dark:bg-info-900 dark:text-info-200",
|
|
358
|
+
"bg-success-200 text-success-800 dark:bg-success-900 dark:text-success-200"
|
|
359
|
+
];
|
|
360
|
+
var avatarVariants = cva3("relative flex shrink-0 overflow-hidden", {
|
|
361
|
+
variants: {
|
|
362
|
+
size: {
|
|
363
|
+
sm: "h-8 w-8 text-xs",
|
|
364
|
+
md: "h-10 w-10 text-sm",
|
|
365
|
+
lg: "h-12 w-12 text-base"
|
|
348
366
|
},
|
|
349
|
-
|
|
350
|
-
|
|
367
|
+
shape: {
|
|
368
|
+
circle: "rounded-full",
|
|
369
|
+
square: "rounded-lg"
|
|
351
370
|
}
|
|
371
|
+
},
|
|
372
|
+
defaultVariants: {
|
|
373
|
+
size: "md",
|
|
374
|
+
shape: "circle"
|
|
352
375
|
}
|
|
353
|
-
);
|
|
376
|
+
});
|
|
354
377
|
var Avatar = React5.forwardRef(
|
|
355
|
-
({ className, size, ...props }, ref) => {
|
|
378
|
+
({ className, size = "md", shape = "circle", ...props }, ref) => {
|
|
356
379
|
const [imageLoaded, setImageLoaded] = React5.useState(false);
|
|
357
|
-
return /* @__PURE__ */ jsx4(
|
|
358
|
-
|
|
380
|
+
return /* @__PURE__ */ jsx4(
|
|
381
|
+
AvatarContextProvider,
|
|
359
382
|
{
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
383
|
+
value: { imageLoaded, setImageLoaded, shape, size },
|
|
384
|
+
children: /* @__PURE__ */ jsx4(
|
|
385
|
+
"span",
|
|
386
|
+
{
|
|
387
|
+
ref,
|
|
388
|
+
className: cn(avatarVariants({ size, shape }), className),
|
|
389
|
+
...props
|
|
390
|
+
}
|
|
391
|
+
)
|
|
363
392
|
}
|
|
364
|
-
)
|
|
393
|
+
);
|
|
365
394
|
}
|
|
366
395
|
);
|
|
367
396
|
Avatar.displayName = "Avatar";
|
|
@@ -391,15 +420,18 @@ var AvatarImage = React5.forwardRef(
|
|
|
391
420
|
}
|
|
392
421
|
);
|
|
393
422
|
AvatarImage.displayName = "AvatarImage";
|
|
394
|
-
var AvatarFallback = React5.forwardRef(({ className, ...props }, ref) => {
|
|
395
|
-
const { imageLoaded } = useAvatarContext();
|
|
423
|
+
var AvatarFallback = React5.forwardRef(({ className, colorSeed, ...props }, ref) => {
|
|
424
|
+
const { imageLoaded, shape } = useAvatarContext();
|
|
396
425
|
if (imageLoaded) return null;
|
|
426
|
+
const colorClasses = colorSeed ? FALLBACK_COLORS[stringToIndex(colorSeed, FALLBACK_COLORS.length)] : "bg-[var(--color-surface-muted)] text-[var(--color-on-surface-secondary)]";
|
|
397
427
|
return /* @__PURE__ */ jsx4(
|
|
398
428
|
"span",
|
|
399
429
|
{
|
|
400
430
|
ref,
|
|
401
431
|
className: cn(
|
|
402
|
-
"flex h-full w-full items-center justify-center
|
|
432
|
+
"flex h-full w-full items-center justify-center font-medium",
|
|
433
|
+
shape === "circle" ? "rounded-full" : "rounded-lg",
|
|
434
|
+
colorClasses,
|
|
403
435
|
className
|
|
404
436
|
),
|
|
405
437
|
...props
|
|
@@ -407,12 +439,101 @@ var AvatarFallback = React5.forwardRef(({ className, ...props }, ref) => {
|
|
|
407
439
|
);
|
|
408
440
|
});
|
|
409
441
|
AvatarFallback.displayName = "AvatarFallback";
|
|
442
|
+
var STATUS_COLORS = {
|
|
443
|
+
online: "bg-success-500",
|
|
444
|
+
offline: "bg-neutral-400",
|
|
445
|
+
busy: "bg-error-500",
|
|
446
|
+
away: "bg-warning-500"
|
|
447
|
+
};
|
|
448
|
+
var STATUS_LABELS = {
|
|
449
|
+
online: "Online",
|
|
450
|
+
offline: "Offline",
|
|
451
|
+
busy: "Busy",
|
|
452
|
+
away: "Away"
|
|
453
|
+
};
|
|
454
|
+
var STATUS_SIZES = {
|
|
455
|
+
sm: "h-2.5 w-2.5",
|
|
456
|
+
md: "h-3 w-3",
|
|
457
|
+
lg: "h-3.5 w-3.5"
|
|
458
|
+
};
|
|
459
|
+
var AvatarStatus = React5.forwardRef(({ status, className, ...props }, ref) => {
|
|
460
|
+
const { size, shape } = useAvatarContext();
|
|
461
|
+
return /* @__PURE__ */ jsx4(
|
|
462
|
+
"span",
|
|
463
|
+
{
|
|
464
|
+
ref,
|
|
465
|
+
role: "status",
|
|
466
|
+
"aria-label": props["aria-label"] ?? STATUS_LABELS[status],
|
|
467
|
+
className: cn(
|
|
468
|
+
"absolute bottom-0 right-0 rounded-full ring-2 ring-[var(--color-surface)]",
|
|
469
|
+
STATUS_COLORS[status],
|
|
470
|
+
STATUS_SIZES[size],
|
|
471
|
+
shape === "circle" && "translate-x-[10%] translate-y-[10%]",
|
|
472
|
+
className
|
|
473
|
+
),
|
|
474
|
+
...props
|
|
475
|
+
}
|
|
476
|
+
);
|
|
477
|
+
});
|
|
478
|
+
AvatarStatus.displayName = "AvatarStatus";
|
|
410
479
|
|
|
411
|
-
// src/components/
|
|
480
|
+
// src/components/avatar-group/avatar-group.tsx
|
|
412
481
|
import * as React6 from "react";
|
|
413
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
414
|
-
var
|
|
415
|
-
|
|
482
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
483
|
+
var SPACING = {
|
|
484
|
+
sm: "-space-x-2",
|
|
485
|
+
md: "-space-x-3",
|
|
486
|
+
lg: "-space-x-3"
|
|
487
|
+
};
|
|
488
|
+
var AvatarGroup = React6.forwardRef(
|
|
489
|
+
({ className, max = 3, size = "md", children, ...props }, ref) => {
|
|
490
|
+
const items = React6.Children.toArray(children);
|
|
491
|
+
const visible = items.slice(0, max);
|
|
492
|
+
const overflow = items.length - max;
|
|
493
|
+
return /* @__PURE__ */ jsxs(
|
|
494
|
+
"div",
|
|
495
|
+
{
|
|
496
|
+
ref,
|
|
497
|
+
role: "group",
|
|
498
|
+
className: cn(
|
|
499
|
+
"flex items-center",
|
|
500
|
+
SPACING[size],
|
|
501
|
+
className
|
|
502
|
+
),
|
|
503
|
+
...props,
|
|
504
|
+
children: [
|
|
505
|
+
visible.map((child, i) => /* @__PURE__ */ jsx5(
|
|
506
|
+
"span",
|
|
507
|
+
{
|
|
508
|
+
className: "relative ring-2 ring-[var(--color-surface)] rounded-full",
|
|
509
|
+
style: { zIndex: visible.length - i },
|
|
510
|
+
children: child
|
|
511
|
+
},
|
|
512
|
+
i
|
|
513
|
+
)),
|
|
514
|
+
overflow > 0 && /* @__PURE__ */ jsx5(
|
|
515
|
+
"span",
|
|
516
|
+
{
|
|
517
|
+
className: "relative ring-2 ring-[var(--color-surface)] rounded-full",
|
|
518
|
+
style: { zIndex: 0 },
|
|
519
|
+
children: /* @__PURE__ */ jsx5(Avatar, { size, children: /* @__PURE__ */ jsxs(AvatarFallback, { children: [
|
|
520
|
+
"+",
|
|
521
|
+
overflow
|
|
522
|
+
] }) })
|
|
523
|
+
}
|
|
524
|
+
)
|
|
525
|
+
]
|
|
526
|
+
}
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
AvatarGroup.displayName = "AvatarGroup";
|
|
531
|
+
|
|
532
|
+
// src/components/separator/separator.tsx
|
|
533
|
+
import * as React7 from "react";
|
|
534
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
535
|
+
var Separator = React7.forwardRef(
|
|
536
|
+
({ className, orientation = "horizontal", decorative = false, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
416
537
|
"div",
|
|
417
538
|
{
|
|
418
539
|
ref,
|
|
@@ -430,10 +551,10 @@ var Separator = React6.forwardRef(
|
|
|
430
551
|
Separator.displayName = "Separator";
|
|
431
552
|
|
|
432
553
|
// src/components/skeleton/skeleton.tsx
|
|
433
|
-
import * as
|
|
434
|
-
import { jsx as
|
|
435
|
-
var Skeleton =
|
|
436
|
-
({ className, ...props }, ref) => /* @__PURE__ */
|
|
554
|
+
import * as React8 from "react";
|
|
555
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
556
|
+
var Skeleton = React8.forwardRef(
|
|
557
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx7(
|
|
437
558
|
"div",
|
|
438
559
|
{
|
|
439
560
|
ref,
|
|
@@ -446,9 +567,9 @@ var Skeleton = React7.forwardRef(
|
|
|
446
567
|
Skeleton.displayName = "Skeleton";
|
|
447
568
|
|
|
448
569
|
// src/components/spinner/spinner.tsx
|
|
449
|
-
import * as
|
|
570
|
+
import * as React9 from "react";
|
|
450
571
|
import { cva as cva4 } from "class-variance-authority";
|
|
451
|
-
import { jsx as
|
|
572
|
+
import { jsx as jsx8, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
452
573
|
var spinnerVariants = cva4("animate-spin", {
|
|
453
574
|
variants: {
|
|
454
575
|
size: {
|
|
@@ -461,9 +582,9 @@ var spinnerVariants = cva4("animate-spin", {
|
|
|
461
582
|
size: "md"
|
|
462
583
|
}
|
|
463
584
|
});
|
|
464
|
-
var Spinner =
|
|
465
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */
|
|
466
|
-
/* @__PURE__ */
|
|
585
|
+
var Spinner = React9.forwardRef(
|
|
586
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsxs2("div", { ref, role: "status", "aria-label": "Loading", ...props, children: [
|
|
587
|
+
/* @__PURE__ */ jsxs2(
|
|
467
588
|
"svg",
|
|
468
589
|
{
|
|
469
590
|
className: cn(spinnerVariants({ size }), className),
|
|
@@ -471,7 +592,7 @@ var Spinner = React8.forwardRef(
|
|
|
471
592
|
fill: "none",
|
|
472
593
|
viewBox: "0 0 24 24",
|
|
473
594
|
children: [
|
|
474
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ jsx8(
|
|
475
596
|
"circle",
|
|
476
597
|
{
|
|
477
598
|
className: "opacity-25",
|
|
@@ -482,7 +603,7 @@ var Spinner = React8.forwardRef(
|
|
|
482
603
|
strokeWidth: "4"
|
|
483
604
|
}
|
|
484
605
|
),
|
|
485
|
-
/* @__PURE__ */
|
|
606
|
+
/* @__PURE__ */ jsx8(
|
|
486
607
|
"path",
|
|
487
608
|
{
|
|
488
609
|
className: "opacity-75",
|
|
@@ -493,15 +614,15 @@ var Spinner = React8.forwardRef(
|
|
|
493
614
|
]
|
|
494
615
|
}
|
|
495
616
|
),
|
|
496
|
-
/* @__PURE__ */
|
|
617
|
+
/* @__PURE__ */ jsx8("span", { className: "sr-only", children: "Loading..." })
|
|
497
618
|
] })
|
|
498
619
|
);
|
|
499
620
|
Spinner.displayName = "Spinner";
|
|
500
621
|
|
|
501
622
|
// src/components/card/card.tsx
|
|
502
|
-
import * as
|
|
503
|
-
import { jsx as
|
|
504
|
-
var Card =
|
|
623
|
+
import * as React10 from "react";
|
|
624
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
625
|
+
var Card = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
505
626
|
"div",
|
|
506
627
|
{
|
|
507
628
|
ref,
|
|
@@ -513,7 +634,7 @@ var Card = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ j
|
|
|
513
634
|
}
|
|
514
635
|
));
|
|
515
636
|
Card.displayName = "Card";
|
|
516
|
-
var CardHeader =
|
|
637
|
+
var CardHeader = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
517
638
|
"div",
|
|
518
639
|
{
|
|
519
640
|
ref,
|
|
@@ -522,7 +643,7 @@ var CardHeader = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
522
643
|
}
|
|
523
644
|
));
|
|
524
645
|
CardHeader.displayName = "CardHeader";
|
|
525
|
-
var CardTitle =
|
|
646
|
+
var CardTitle = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
526
647
|
"h3",
|
|
527
648
|
{
|
|
528
649
|
ref,
|
|
@@ -531,7 +652,7 @@ var CardTitle = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
531
652
|
}
|
|
532
653
|
));
|
|
533
654
|
CardTitle.displayName = "CardTitle";
|
|
534
|
-
var CardDescription =
|
|
655
|
+
var CardDescription = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
535
656
|
"p",
|
|
536
657
|
{
|
|
537
658
|
ref,
|
|
@@ -540,9 +661,9 @@ var CardDescription = React9.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
540
661
|
}
|
|
541
662
|
));
|
|
542
663
|
CardDescription.displayName = "CardDescription";
|
|
543
|
-
var CardContent =
|
|
664
|
+
var CardContent = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9("div", { ref, className: cn("p-6 pt-0", className), ...props }));
|
|
544
665
|
CardContent.displayName = "CardContent";
|
|
545
|
-
var CardFooter =
|
|
666
|
+
var CardFooter = React10.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
546
667
|
"div",
|
|
547
668
|
{
|
|
548
669
|
ref,
|
|
@@ -553,13 +674,13 @@ var CardFooter = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
553
674
|
CardFooter.displayName = "CardFooter";
|
|
554
675
|
|
|
555
676
|
// src/components/tooltip/tooltip.tsx
|
|
556
|
-
import * as
|
|
677
|
+
import * as React11 from "react";
|
|
557
678
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
558
|
-
import { jsx as
|
|
679
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
559
680
|
var TooltipProvider = TooltipPrimitive.Provider;
|
|
560
681
|
var Tooltip = TooltipPrimitive.Root;
|
|
561
682
|
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
562
|
-
var TooltipContent =
|
|
683
|
+
var TooltipContent = React11.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx10(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsx10(
|
|
563
684
|
TooltipPrimitive.Content,
|
|
564
685
|
{
|
|
565
686
|
ref,
|
|
@@ -577,12 +698,12 @@ var TooltipContent = React10.forwardRef(({ className, sideOffset = 4, ...props }
|
|
|
577
698
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
578
699
|
|
|
579
700
|
// src/components/toast/toast.tsx
|
|
580
|
-
import * as
|
|
701
|
+
import * as React12 from "react";
|
|
581
702
|
import * as ToastPrimitive from "@radix-ui/react-toast";
|
|
582
703
|
import { cva as cva5 } from "class-variance-authority";
|
|
583
|
-
import { jsx as
|
|
704
|
+
import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
584
705
|
var ToastProvider = ToastPrimitive.Provider;
|
|
585
|
-
var ToastViewport =
|
|
706
|
+
var ToastViewport = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
586
707
|
ToastPrimitive.Viewport,
|
|
587
708
|
{
|
|
588
709
|
ref,
|
|
@@ -609,7 +730,7 @@ var toastVariants = cva5(
|
|
|
609
730
|
}
|
|
610
731
|
}
|
|
611
732
|
);
|
|
612
|
-
var Toast =
|
|
733
|
+
var Toast = React12.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
613
734
|
ToastPrimitive.Root,
|
|
614
735
|
{
|
|
615
736
|
ref,
|
|
@@ -618,7 +739,7 @@ var Toast = React11.forwardRef(({ className, variant, ...props }, ref) => /* @__
|
|
|
618
739
|
}
|
|
619
740
|
));
|
|
620
741
|
Toast.displayName = "Toast";
|
|
621
|
-
var ToastAction =
|
|
742
|
+
var ToastAction = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
622
743
|
ToastPrimitive.Action,
|
|
623
744
|
{
|
|
624
745
|
ref,
|
|
@@ -630,7 +751,7 @@ var ToastAction = React11.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
630
751
|
}
|
|
631
752
|
));
|
|
632
753
|
ToastAction.displayName = "ToastAction";
|
|
633
|
-
var ToastClose =
|
|
754
|
+
var ToastClose = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
634
755
|
ToastPrimitive.Close,
|
|
635
756
|
{
|
|
636
757
|
ref,
|
|
@@ -641,7 +762,7 @@ var ToastClose = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
641
762
|
"toast-close": "",
|
|
642
763
|
"aria-label": "Close",
|
|
643
764
|
...props,
|
|
644
|
-
children: /* @__PURE__ */
|
|
765
|
+
children: /* @__PURE__ */ jsxs3(
|
|
645
766
|
"svg",
|
|
646
767
|
{
|
|
647
768
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -654,15 +775,15 @@ var ToastClose = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
654
775
|
strokeLinecap: "round",
|
|
655
776
|
strokeLinejoin: "round",
|
|
656
777
|
children: [
|
|
657
|
-
/* @__PURE__ */
|
|
658
|
-
/* @__PURE__ */
|
|
778
|
+
/* @__PURE__ */ jsx11("path", { d: "M18 6 6 18" }),
|
|
779
|
+
/* @__PURE__ */ jsx11("path", { d: "m6 6 12 12" })
|
|
659
780
|
]
|
|
660
781
|
}
|
|
661
782
|
)
|
|
662
783
|
}
|
|
663
784
|
));
|
|
664
785
|
ToastClose.displayName = "ToastClose";
|
|
665
|
-
var ToastTitle =
|
|
786
|
+
var ToastTitle = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
666
787
|
ToastPrimitive.Title,
|
|
667
788
|
{
|
|
668
789
|
ref,
|
|
@@ -671,7 +792,7 @@ var ToastTitle = React11.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
671
792
|
}
|
|
672
793
|
));
|
|
673
794
|
ToastTitle.displayName = "ToastTitle";
|
|
674
|
-
var ToastDescription =
|
|
795
|
+
var ToastDescription = React12.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
675
796
|
ToastPrimitive.Description,
|
|
676
797
|
{
|
|
677
798
|
ref,
|
|
@@ -682,7 +803,7 @@ var ToastDescription = React11.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
682
803
|
ToastDescription.displayName = "ToastDescription";
|
|
683
804
|
|
|
684
805
|
// src/components/toast/use-toast.ts
|
|
685
|
-
import * as
|
|
806
|
+
import * as React13 from "react";
|
|
686
807
|
var TOAST_LIMIT = 5;
|
|
687
808
|
var TOAST_REMOVE_DELAY = 1e3;
|
|
688
809
|
var count = 0;
|
|
@@ -753,8 +874,8 @@ function toast(props) {
|
|
|
753
874
|
return { id, dismiss };
|
|
754
875
|
}
|
|
755
876
|
function useToast() {
|
|
756
|
-
const [state, setState] =
|
|
757
|
-
|
|
877
|
+
const [state, setState] = React13.useState(memoryState);
|
|
878
|
+
React13.useEffect(() => {
|
|
758
879
|
listeners.push(setState);
|
|
759
880
|
return () => {
|
|
760
881
|
const index = listeners.indexOf(setState);
|
|
@@ -769,27 +890,27 @@ function useToast() {
|
|
|
769
890
|
}
|
|
770
891
|
|
|
771
892
|
// src/components/toast/toaster.tsx
|
|
772
|
-
import { jsx as
|
|
893
|
+
import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
773
894
|
function Toaster() {
|
|
774
895
|
const { toasts } = useToast();
|
|
775
|
-
return /* @__PURE__ */
|
|
776
|
-
toasts.map(({ id, title, description, action, ...props }) => /* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */
|
|
778
|
-
title && /* @__PURE__ */
|
|
779
|
-
description && /* @__PURE__ */
|
|
896
|
+
return /* @__PURE__ */ jsxs4(ToastProvider, { children: [
|
|
897
|
+
toasts.map(({ id, title, description, action, ...props }) => /* @__PURE__ */ jsxs4(Toast, { ...props, children: [
|
|
898
|
+
/* @__PURE__ */ jsxs4("div", { className: "grid gap-1", children: [
|
|
899
|
+
title && /* @__PURE__ */ jsx12(ToastTitle, { children: title }),
|
|
900
|
+
description && /* @__PURE__ */ jsx12(ToastDescription, { children: description })
|
|
780
901
|
] }),
|
|
781
902
|
action,
|
|
782
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ jsx12(ToastClose, {})
|
|
783
904
|
] }, id)),
|
|
784
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ jsx12(ToastViewport, {})
|
|
785
906
|
] });
|
|
786
907
|
}
|
|
787
908
|
|
|
788
909
|
// src/components/label/label.tsx
|
|
789
|
-
import * as
|
|
910
|
+
import * as React14 from "react";
|
|
790
911
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
791
|
-
import { jsx as
|
|
792
|
-
var Label =
|
|
912
|
+
import { jsx as jsx13, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
913
|
+
var Label = React14.forwardRef(({ className, required, children, ...props }, ref) => /* @__PURE__ */ jsxs5(
|
|
793
914
|
LabelPrimitive.Root,
|
|
794
915
|
{
|
|
795
916
|
ref,
|
|
@@ -800,16 +921,16 @@ var Label = React13.forwardRef(({ className, required, children, ...props }, ref
|
|
|
800
921
|
...props,
|
|
801
922
|
children: [
|
|
802
923
|
children,
|
|
803
|
-
required && /* @__PURE__ */
|
|
924
|
+
required && /* @__PURE__ */ jsx13("span", { "aria-hidden": "true", className: "ml-0.5 text-error-500", children: "*" })
|
|
804
925
|
]
|
|
805
926
|
}
|
|
806
927
|
));
|
|
807
928
|
Label.displayName = "Label";
|
|
808
929
|
|
|
809
930
|
// src/components/input/input.tsx
|
|
810
|
-
import * as
|
|
931
|
+
import * as React15 from "react";
|
|
811
932
|
import { cva as cva6 } from "class-variance-authority";
|
|
812
|
-
import { jsx as
|
|
933
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
813
934
|
var inputVariants = cva6(
|
|
814
935
|
"flex w-full rounded-md border border-[var(--color-border-input)] bg-[var(--color-surface-raised)] px-3 text-[var(--color-on-surface)] transition-colors duration-fast file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[var(--color-on-surface-muted)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)] disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-error-500 aria-[invalid=true]:focus-visible:ring-error-500 touch:min-h-[--touch-target-min]",
|
|
815
936
|
{
|
|
@@ -825,8 +946,8 @@ var inputVariants = cva6(
|
|
|
825
946
|
}
|
|
826
947
|
}
|
|
827
948
|
);
|
|
828
|
-
var Input =
|
|
829
|
-
({ className, size, type, ...props }, ref) => /* @__PURE__ */
|
|
949
|
+
var Input = React15.forwardRef(
|
|
950
|
+
({ className, size, type, ...props }, ref) => /* @__PURE__ */ jsx14(
|
|
830
951
|
"input",
|
|
831
952
|
{
|
|
832
953
|
ref,
|
|
@@ -839,9 +960,9 @@ var Input = React14.forwardRef(
|
|
|
839
960
|
Input.displayName = "Input";
|
|
840
961
|
|
|
841
962
|
// src/components/textarea/textarea.tsx
|
|
842
|
-
import * as
|
|
963
|
+
import * as React16 from "react";
|
|
843
964
|
import { cva as cva7 } from "class-variance-authority";
|
|
844
|
-
import { jsx as
|
|
965
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
845
966
|
var textareaVariants = cva7(
|
|
846
967
|
"flex w-full resize-y rounded-md border border-[var(--color-border-input)] bg-[var(--color-surface-raised)] px-3 py-2 text-[var(--color-on-surface)] transition-colors duration-fast placeholder:text-[var(--color-on-surface-muted)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)] disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-error-500 aria-[invalid=true]:focus-visible:ring-error-500",
|
|
847
968
|
{
|
|
@@ -857,8 +978,8 @@ var textareaVariants = cva7(
|
|
|
857
978
|
}
|
|
858
979
|
}
|
|
859
980
|
);
|
|
860
|
-
var Textarea =
|
|
861
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */
|
|
981
|
+
var Textarea = React16.forwardRef(
|
|
982
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx15(
|
|
862
983
|
"textarea",
|
|
863
984
|
{
|
|
864
985
|
ref,
|
|
@@ -870,10 +991,10 @@ var Textarea = React15.forwardRef(
|
|
|
870
991
|
Textarea.displayName = "Textarea";
|
|
871
992
|
|
|
872
993
|
// src/components/checkbox/checkbox.tsx
|
|
873
|
-
import * as
|
|
994
|
+
import * as React17 from "react";
|
|
874
995
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
875
|
-
import { jsx as
|
|
876
|
-
var Checkbox =
|
|
996
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
997
|
+
var Checkbox = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx16(
|
|
877
998
|
CheckboxPrimitive.Root,
|
|
878
999
|
{
|
|
879
1000
|
ref,
|
|
@@ -887,7 +1008,7 @@ var Checkbox = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
887
1008
|
className
|
|
888
1009
|
),
|
|
889
1010
|
...props,
|
|
890
|
-
children: /* @__PURE__ */
|
|
1011
|
+
children: /* @__PURE__ */ jsx16(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center", children: props.checked === "indeterminate" ? /* @__PURE__ */ jsx16(
|
|
891
1012
|
"svg",
|
|
892
1013
|
{
|
|
893
1014
|
width: "12",
|
|
@@ -897,9 +1018,9 @@ var Checkbox = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
897
1018
|
stroke: "currentColor",
|
|
898
1019
|
strokeWidth: "3",
|
|
899
1020
|
strokeLinecap: "round",
|
|
900
|
-
children: /* @__PURE__ */
|
|
1021
|
+
children: /* @__PURE__ */ jsx16("path", { d: "M5 12h14" })
|
|
901
1022
|
}
|
|
902
|
-
) : /* @__PURE__ */
|
|
1023
|
+
) : /* @__PURE__ */ jsx16(
|
|
903
1024
|
"svg",
|
|
904
1025
|
{
|
|
905
1026
|
width: "12",
|
|
@@ -910,7 +1031,7 @@ var Checkbox = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
910
1031
|
strokeWidth: "3",
|
|
911
1032
|
strokeLinecap: "round",
|
|
912
1033
|
strokeLinejoin: "round",
|
|
913
|
-
children: /* @__PURE__ */
|
|
1034
|
+
children: /* @__PURE__ */ jsx16("polyline", { points: "20 6 9 17 4 12" })
|
|
914
1035
|
}
|
|
915
1036
|
) })
|
|
916
1037
|
}
|
|
@@ -918,10 +1039,10 @@ var Checkbox = React16.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
918
1039
|
Checkbox.displayName = "Checkbox";
|
|
919
1040
|
|
|
920
1041
|
// src/components/radio-group/radio-group.tsx
|
|
921
|
-
import * as
|
|
1042
|
+
import * as React18 from "react";
|
|
922
1043
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
923
|
-
import { jsx as
|
|
924
|
-
var RadioGroup =
|
|
1044
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1045
|
+
var RadioGroup = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
925
1046
|
RadioGroupPrimitive.Root,
|
|
926
1047
|
{
|
|
927
1048
|
ref,
|
|
@@ -930,7 +1051,7 @@ var RadioGroup = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
930
1051
|
}
|
|
931
1052
|
));
|
|
932
1053
|
RadioGroup.displayName = "RadioGroup";
|
|
933
|
-
var RadioGroupItem =
|
|
1054
|
+
var RadioGroupItem = React18.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx17(
|
|
934
1055
|
RadioGroupPrimitive.Item,
|
|
935
1056
|
{
|
|
936
1057
|
ref,
|
|
@@ -943,7 +1064,7 @@ var RadioGroupItem = React17.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
943
1064
|
className
|
|
944
1065
|
),
|
|
945
1066
|
...props,
|
|
946
|
-
children: /* @__PURE__ */
|
|
1067
|
+
children: /* @__PURE__ */ jsx17(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: /* @__PURE__ */ jsx17(
|
|
947
1068
|
"svg",
|
|
948
1069
|
{
|
|
949
1070
|
width: "8",
|
|
@@ -951,7 +1072,7 @@ var RadioGroupItem = React17.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
951
1072
|
viewBox: "0 0 8 8",
|
|
952
1073
|
fill: "currentColor",
|
|
953
1074
|
className: "text-primary-500",
|
|
954
|
-
children: /* @__PURE__ */
|
|
1075
|
+
children: /* @__PURE__ */ jsx17("circle", { cx: "4", cy: "4", r: "4" })
|
|
955
1076
|
}
|
|
956
1077
|
) })
|
|
957
1078
|
}
|
|
@@ -959,10 +1080,10 @@ var RadioGroupItem = React17.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
959
1080
|
RadioGroupItem.displayName = "RadioGroupItem";
|
|
960
1081
|
|
|
961
1082
|
// src/components/switch/switch.tsx
|
|
962
|
-
import * as
|
|
1083
|
+
import * as React19 from "react";
|
|
963
1084
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
964
1085
|
import { cva as cva8 } from "class-variance-authority";
|
|
965
|
-
import { jsx as
|
|
1086
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
966
1087
|
var switchVariants = cva8(
|
|
967
1088
|
"peer inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-ring)] focus-visible:ring-offset-2 ring-offset-[var(--color-ring-offset)] disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary-500 data-[state=unchecked]:bg-neutral-300 dark:data-[state=unchecked]:bg-neutral-600 touch:min-h-[--touch-target-min]",
|
|
968
1089
|
{
|
|
@@ -993,25 +1114,25 @@ var thumbVariants = cva8(
|
|
|
993
1114
|
}
|
|
994
1115
|
}
|
|
995
1116
|
);
|
|
996
|
-
var Switch =
|
|
1117
|
+
var Switch = React19.forwardRef(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx18(
|
|
997
1118
|
SwitchPrimitive.Root,
|
|
998
1119
|
{
|
|
999
1120
|
ref,
|
|
1000
1121
|
className: cn(switchVariants({ size }), className),
|
|
1001
1122
|
...props,
|
|
1002
|
-
children: /* @__PURE__ */
|
|
1123
|
+
children: /* @__PURE__ */ jsx18(SwitchPrimitive.Thumb, { className: thumbVariants({ size }) })
|
|
1003
1124
|
}
|
|
1004
1125
|
));
|
|
1005
1126
|
Switch.displayName = "Switch";
|
|
1006
1127
|
|
|
1007
1128
|
// src/components/select/select.tsx
|
|
1008
|
-
import * as
|
|
1129
|
+
import * as React20 from "react";
|
|
1009
1130
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1010
|
-
import { jsx as
|
|
1131
|
+
import { jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1011
1132
|
var Select = SelectPrimitive.Root;
|
|
1012
1133
|
var SelectGroup = SelectPrimitive.Group;
|
|
1013
1134
|
var SelectValue = SelectPrimitive.Value;
|
|
1014
|
-
var SelectTrigger =
|
|
1135
|
+
var SelectTrigger = React20.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
1015
1136
|
SelectPrimitive.Trigger,
|
|
1016
1137
|
{
|
|
1017
1138
|
ref,
|
|
@@ -1027,7 +1148,7 @@ var SelectTrigger = React19.forwardRef(({ className, children, ...props }, ref)
|
|
|
1027
1148
|
...props,
|
|
1028
1149
|
children: [
|
|
1029
1150
|
children,
|
|
1030
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ jsx19(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx19(
|
|
1031
1152
|
"svg",
|
|
1032
1153
|
{
|
|
1033
1154
|
width: "16",
|
|
@@ -1039,14 +1160,14 @@ var SelectTrigger = React19.forwardRef(({ className, children, ...props }, ref)
|
|
|
1039
1160
|
strokeLinecap: "round",
|
|
1040
1161
|
strokeLinejoin: "round",
|
|
1041
1162
|
className: "shrink-0 opacity-50",
|
|
1042
|
-
children: /* @__PURE__ */
|
|
1163
|
+
children: /* @__PURE__ */ jsx19("path", { d: "m6 9 6 6 6-6" })
|
|
1043
1164
|
}
|
|
1044
1165
|
) })
|
|
1045
1166
|
]
|
|
1046
1167
|
}
|
|
1047
1168
|
));
|
|
1048
1169
|
SelectTrigger.displayName = "SelectTrigger";
|
|
1049
|
-
var SelectContent =
|
|
1170
|
+
var SelectContent = React20.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx19(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx19(
|
|
1050
1171
|
SelectPrimitive.Content,
|
|
1051
1172
|
{
|
|
1052
1173
|
ref,
|
|
@@ -1060,7 +1181,7 @@ var SelectContent = React19.forwardRef(({ className, children, position = "poppe
|
|
|
1060
1181
|
),
|
|
1061
1182
|
position,
|
|
1062
1183
|
...props,
|
|
1063
|
-
children: /* @__PURE__ */
|
|
1184
|
+
children: /* @__PURE__ */ jsx19(
|
|
1064
1185
|
SelectPrimitive.Viewport,
|
|
1065
1186
|
{
|
|
1066
1187
|
className: cn(
|
|
@@ -1073,7 +1194,7 @@ var SelectContent = React19.forwardRef(({ className, children, position = "poppe
|
|
|
1073
1194
|
}
|
|
1074
1195
|
) }));
|
|
1075
1196
|
SelectContent.displayName = "SelectContent";
|
|
1076
|
-
var SelectItem =
|
|
1197
|
+
var SelectItem = React20.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(
|
|
1077
1198
|
SelectPrimitive.Item,
|
|
1078
1199
|
{
|
|
1079
1200
|
ref,
|
|
@@ -1085,7 +1206,7 @@ var SelectItem = React19.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1085
1206
|
),
|
|
1086
1207
|
...props,
|
|
1087
1208
|
children: [
|
|
1088
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ jsx19("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx19(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx19(
|
|
1089
1210
|
"svg",
|
|
1090
1211
|
{
|
|
1091
1212
|
width: "14",
|
|
@@ -1096,15 +1217,15 @@ var SelectItem = React19.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1096
1217
|
strokeWidth: "2",
|
|
1097
1218
|
strokeLinecap: "round",
|
|
1098
1219
|
strokeLinejoin: "round",
|
|
1099
|
-
children: /* @__PURE__ */
|
|
1220
|
+
children: /* @__PURE__ */ jsx19("polyline", { points: "20 6 9 17 4 12" })
|
|
1100
1221
|
}
|
|
1101
1222
|
) }) }),
|
|
1102
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ jsx19(SelectPrimitive.ItemText, { children })
|
|
1103
1224
|
]
|
|
1104
1225
|
}
|
|
1105
1226
|
));
|
|
1106
1227
|
SelectItem.displayName = "SelectItem";
|
|
1107
|
-
var SelectLabel =
|
|
1228
|
+
var SelectLabel = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1108
1229
|
SelectPrimitive.Label,
|
|
1109
1230
|
{
|
|
1110
1231
|
ref,
|
|
@@ -1113,7 +1234,7 @@ var SelectLabel = React19.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1113
1234
|
}
|
|
1114
1235
|
));
|
|
1115
1236
|
SelectLabel.displayName = "SelectLabel";
|
|
1116
|
-
var SelectSeparator =
|
|
1237
|
+
var SelectSeparator = React20.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
1117
1238
|
SelectPrimitive.Separator,
|
|
1118
1239
|
{
|
|
1119
1240
|
ref,
|
|
@@ -1124,9 +1245,9 @@ var SelectSeparator = React19.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1124
1245
|
SelectSeparator.displayName = "SelectSeparator";
|
|
1125
1246
|
|
|
1126
1247
|
// src/components/number-input/number-input.tsx
|
|
1127
|
-
import * as
|
|
1248
|
+
import * as React21 from "react";
|
|
1128
1249
|
import { cva as cva9 } from "class-variance-authority";
|
|
1129
|
-
import { jsx as
|
|
1250
|
+
import { jsx as jsx20, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1130
1251
|
var numberInputVariants = cva9(
|
|
1131
1252
|
"flex w-full rounded-md border border-[var(--color-border-input)] bg-[var(--color-surface-raised)] text-[var(--color-on-surface)] transition-colors duration-fast focus-within:ring-2 focus-within:ring-[var(--color-ring)] focus-within:ring-offset-2 ring-offset-[var(--color-ring-offset)] aria-[invalid=true]:border-error-500 aria-[invalid=true]:focus-within:ring-error-500",
|
|
1132
1253
|
{
|
|
@@ -1142,7 +1263,7 @@ var numberInputVariants = cva9(
|
|
|
1142
1263
|
}
|
|
1143
1264
|
}
|
|
1144
1265
|
);
|
|
1145
|
-
var NumberInput =
|
|
1266
|
+
var NumberInput = React21.forwardRef(
|
|
1146
1267
|
({
|
|
1147
1268
|
className,
|
|
1148
1269
|
size,
|
|
@@ -1157,7 +1278,7 @@ var NumberInput = React20.forwardRef(
|
|
|
1157
1278
|
readOnly,
|
|
1158
1279
|
...props
|
|
1159
1280
|
}, ref) => {
|
|
1160
|
-
const [internalValue, setInternalValue] =
|
|
1281
|
+
const [internalValue, setInternalValue] = React21.useState(
|
|
1161
1282
|
defaultValue != null ? formatValue(defaultValue, precision) : ""
|
|
1162
1283
|
);
|
|
1163
1284
|
const isControlled = controlledValue !== void 0;
|
|
@@ -1224,7 +1345,7 @@ var NumberInput = React20.forwardRef(
|
|
|
1224
1345
|
decrement();
|
|
1225
1346
|
}
|
|
1226
1347
|
}
|
|
1227
|
-
return /* @__PURE__ */
|
|
1348
|
+
return /* @__PURE__ */ jsxs7(
|
|
1228
1349
|
"div",
|
|
1229
1350
|
{
|
|
1230
1351
|
className: cn(
|
|
@@ -1234,7 +1355,7 @@ var NumberInput = React20.forwardRef(
|
|
|
1234
1355
|
),
|
|
1235
1356
|
"aria-invalid": props["aria-invalid"],
|
|
1236
1357
|
children: [
|
|
1237
|
-
/* @__PURE__ */
|
|
1358
|
+
/* @__PURE__ */ jsx20(
|
|
1238
1359
|
"input",
|
|
1239
1360
|
{
|
|
1240
1361
|
ref,
|
|
@@ -1250,8 +1371,8 @@ var NumberInput = React20.forwardRef(
|
|
|
1250
1371
|
...props
|
|
1251
1372
|
}
|
|
1252
1373
|
),
|
|
1253
|
-
!readOnly && !disabled && /* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1374
|
+
!readOnly && !disabled && /* @__PURE__ */ jsxs7("div", { className: "flex flex-col border-l border-[var(--color-border-input)]", children: [
|
|
1375
|
+
/* @__PURE__ */ jsx20(
|
|
1255
1376
|
"button",
|
|
1256
1377
|
{
|
|
1257
1378
|
type: "button",
|
|
@@ -1260,7 +1381,7 @@ var NumberInput = React20.forwardRef(
|
|
|
1260
1381
|
disabled: max != null && parseFloat(displayValue) >= max,
|
|
1261
1382
|
className: "flex flex-1 items-center justify-center px-1.5 text-[var(--color-on-surface-muted)] hover:bg-[var(--color-surface-muted)] disabled:opacity-30",
|
|
1262
1383
|
"aria-label": "Increment",
|
|
1263
|
-
children: /* @__PURE__ */
|
|
1384
|
+
children: /* @__PURE__ */ jsx20(
|
|
1264
1385
|
"svg",
|
|
1265
1386
|
{
|
|
1266
1387
|
width: "10",
|
|
@@ -1271,12 +1392,12 @@ var NumberInput = React20.forwardRef(
|
|
|
1271
1392
|
strokeWidth: "2.5",
|
|
1272
1393
|
strokeLinecap: "round",
|
|
1273
1394
|
strokeLinejoin: "round",
|
|
1274
|
-
children: /* @__PURE__ */
|
|
1395
|
+
children: /* @__PURE__ */ jsx20("path", { d: "m18 15-6-6-6 6" })
|
|
1275
1396
|
}
|
|
1276
1397
|
)
|
|
1277
1398
|
}
|
|
1278
1399
|
),
|
|
1279
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ jsx20(
|
|
1280
1401
|
"button",
|
|
1281
1402
|
{
|
|
1282
1403
|
type: "button",
|
|
@@ -1285,7 +1406,7 @@ var NumberInput = React20.forwardRef(
|
|
|
1285
1406
|
disabled: min != null && parseFloat(displayValue) <= min,
|
|
1286
1407
|
className: "flex flex-1 items-center justify-center border-t border-[var(--color-border-input)] px-1.5 text-[var(--color-on-surface-muted)] hover:bg-[var(--color-surface-muted)] disabled:opacity-30",
|
|
1287
1408
|
"aria-label": "Decrement",
|
|
1288
|
-
children: /* @__PURE__ */
|
|
1409
|
+
children: /* @__PURE__ */ jsx20(
|
|
1289
1410
|
"svg",
|
|
1290
1411
|
{
|
|
1291
1412
|
width: "10",
|
|
@@ -1296,7 +1417,7 @@ var NumberInput = React20.forwardRef(
|
|
|
1296
1417
|
strokeWidth: "2.5",
|
|
1297
1418
|
strokeLinecap: "round",
|
|
1298
1419
|
strokeLinejoin: "round",
|
|
1299
|
-
children: /* @__PURE__ */
|
|
1420
|
+
children: /* @__PURE__ */ jsx20("path", { d: "m6 9 6 6 6-6" })
|
|
1300
1421
|
}
|
|
1301
1422
|
)
|
|
1302
1423
|
}
|
|
@@ -1310,10 +1431,10 @@ var NumberInput = React20.forwardRef(
|
|
|
1310
1431
|
NumberInput.displayName = "NumberInput";
|
|
1311
1432
|
|
|
1312
1433
|
// src/components/date-picker/date-picker.tsx
|
|
1313
|
-
import * as
|
|
1314
|
-
import { jsx as
|
|
1315
|
-
var DatePicker =
|
|
1316
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */
|
|
1434
|
+
import * as React22 from "react";
|
|
1435
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1436
|
+
var DatePicker = React22.forwardRef(
|
|
1437
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
1317
1438
|
"input",
|
|
1318
1439
|
{
|
|
1319
1440
|
ref,
|
|
@@ -1330,11 +1451,11 @@ var DatePicker = React21.forwardRef(
|
|
|
1330
1451
|
DatePicker.displayName = "DatePicker";
|
|
1331
1452
|
|
|
1332
1453
|
// src/components/combobox/combobox.tsx
|
|
1333
|
-
import * as
|
|
1454
|
+
import * as React23 from "react";
|
|
1334
1455
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1335
1456
|
import { Command } from "cmdk";
|
|
1336
|
-
import { jsx as
|
|
1337
|
-
var Combobox =
|
|
1457
|
+
import { jsx as jsx22, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1458
|
+
var Combobox = React23.forwardRef(
|
|
1338
1459
|
({
|
|
1339
1460
|
options,
|
|
1340
1461
|
value,
|
|
@@ -1346,11 +1467,11 @@ var Combobox = React22.forwardRef(
|
|
|
1346
1467
|
className,
|
|
1347
1468
|
...props
|
|
1348
1469
|
}, ref) => {
|
|
1349
|
-
const [open, setOpen] =
|
|
1350
|
-
const [search, setSearch] =
|
|
1470
|
+
const [open, setOpen] = React23.useState(false);
|
|
1471
|
+
const [search, setSearch] = React23.useState("");
|
|
1351
1472
|
const selectedOption = options.find((o) => o.value === value);
|
|
1352
|
-
return /* @__PURE__ */
|
|
1353
|
-
/* @__PURE__ */
|
|
1473
|
+
return /* @__PURE__ */ jsxs8(PopoverPrimitive.Root, { open, onOpenChange: setOpen, children: [
|
|
1474
|
+
/* @__PURE__ */ jsxs8(
|
|
1354
1475
|
PopoverPrimitive.Trigger,
|
|
1355
1476
|
{
|
|
1356
1477
|
ref,
|
|
@@ -1367,8 +1488,8 @@ var Combobox = React22.forwardRef(
|
|
|
1367
1488
|
),
|
|
1368
1489
|
...props,
|
|
1369
1490
|
children: [
|
|
1370
|
-
/* @__PURE__ */
|
|
1371
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ jsx22("span", { className: cn(!selectedOption && "text-[var(--color-on-surface-muted)]"), children: selectedOption?.label ?? placeholder }),
|
|
1492
|
+
/* @__PURE__ */ jsxs8(
|
|
1372
1493
|
"svg",
|
|
1373
1494
|
{
|
|
1374
1495
|
width: "16",
|
|
@@ -1381,22 +1502,22 @@ var Combobox = React22.forwardRef(
|
|
|
1381
1502
|
strokeLinejoin: "round",
|
|
1382
1503
|
className: "shrink-0 opacity-50",
|
|
1383
1504
|
children: [
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ jsx22("path", { d: "m7 15 5 5 5-5" }),
|
|
1506
|
+
/* @__PURE__ */ jsx22("path", { d: "m7 9 5-5 5 5" })
|
|
1386
1507
|
]
|
|
1387
1508
|
}
|
|
1388
1509
|
)
|
|
1389
1510
|
]
|
|
1390
1511
|
}
|
|
1391
1512
|
),
|
|
1392
|
-
/* @__PURE__ */
|
|
1513
|
+
/* @__PURE__ */ jsx22(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx22(
|
|
1393
1514
|
PopoverPrimitive.Content,
|
|
1394
1515
|
{
|
|
1395
1516
|
className: "z-popover w-[var(--radix-popover-trigger-width)] rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] p-0 shadow-md animate-in fade-in-0 zoom-in-95",
|
|
1396
1517
|
sideOffset: 4,
|
|
1397
1518
|
align: "start",
|
|
1398
|
-
children: /* @__PURE__ */
|
|
1399
|
-
/* @__PURE__ */
|
|
1519
|
+
children: /* @__PURE__ */ jsxs8(Command, { shouldFilter: true, children: [
|
|
1520
|
+
/* @__PURE__ */ jsx22(
|
|
1400
1521
|
Command.Input,
|
|
1401
1522
|
{
|
|
1402
1523
|
value: search,
|
|
@@ -1405,9 +1526,9 @@ var Combobox = React22.forwardRef(
|
|
|
1405
1526
|
className: "flex h-9 w-full border-b border-[var(--color-border)] bg-transparent px-3 text-sm outline-none placeholder:text-[var(--color-on-surface-muted)]"
|
|
1406
1527
|
}
|
|
1407
1528
|
),
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1410
|
-
options.map((option) => /* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ jsxs8(Command.List, { className: "max-h-60 overflow-auto p-1", children: [
|
|
1530
|
+
/* @__PURE__ */ jsx22(Command.Empty, { className: "px-2 py-6 text-center text-sm text-[var(--color-on-surface-muted)]", children: emptyMessage }),
|
|
1531
|
+
options.map((option) => /* @__PURE__ */ jsxs8(
|
|
1411
1532
|
Command.Item,
|
|
1412
1533
|
{
|
|
1413
1534
|
value: option.label,
|
|
@@ -1425,7 +1546,7 @@ var Combobox = React22.forwardRef(
|
|
|
1425
1546
|
"data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50"
|
|
1426
1547
|
),
|
|
1427
1548
|
children: [
|
|
1428
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ jsx22("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: option.value === value && /* @__PURE__ */ jsx22(
|
|
1429
1550
|
"svg",
|
|
1430
1551
|
{
|
|
1431
1552
|
width: "14",
|
|
@@ -1436,7 +1557,7 @@ var Combobox = React22.forwardRef(
|
|
|
1436
1557
|
strokeWidth: "2",
|
|
1437
1558
|
strokeLinecap: "round",
|
|
1438
1559
|
strokeLinejoin: "round",
|
|
1439
|
-
children: /* @__PURE__ */
|
|
1560
|
+
children: /* @__PURE__ */ jsx22("polyline", { points: "20 6 9 17 4 12" })
|
|
1440
1561
|
}
|
|
1441
1562
|
) }),
|
|
1442
1563
|
option.label
|
|
@@ -1454,28 +1575,28 @@ var Combobox = React22.forwardRef(
|
|
|
1454
1575
|
Combobox.displayName = "Combobox";
|
|
1455
1576
|
|
|
1456
1577
|
// src/components/form-field/form-field.tsx
|
|
1457
|
-
import * as
|
|
1458
|
-
import { jsx as
|
|
1578
|
+
import * as React24 from "react";
|
|
1579
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1459
1580
|
var [FormFieldProvider, useFormField] = createContext2("FormField");
|
|
1460
|
-
var FormField =
|
|
1581
|
+
var FormField = React24.forwardRef(
|
|
1461
1582
|
({ className, error, required, disabled, children, ...props }, ref) => {
|
|
1462
|
-
const id =
|
|
1583
|
+
const id = React24.useId();
|
|
1463
1584
|
const descriptionId = `${id}-description`;
|
|
1464
1585
|
const messageId = `${id}-message`;
|
|
1465
|
-
return /* @__PURE__ */
|
|
1586
|
+
return /* @__PURE__ */ jsx23(
|
|
1466
1587
|
FormFieldProvider,
|
|
1467
1588
|
{
|
|
1468
1589
|
value: { id, error, required, disabled, descriptionId, messageId },
|
|
1469
|
-
children: /* @__PURE__ */
|
|
1590
|
+
children: /* @__PURE__ */ jsx23("div", { ref, className: cn("space-y-1.5", className), ...props, children })
|
|
1470
1591
|
}
|
|
1471
1592
|
);
|
|
1472
1593
|
}
|
|
1473
1594
|
);
|
|
1474
1595
|
FormField.displayName = "FormField";
|
|
1475
|
-
var FormLabel =
|
|
1596
|
+
var FormLabel = React24.forwardRef(
|
|
1476
1597
|
({ className, children, ...props }, ref) => {
|
|
1477
1598
|
const { id, error, required } = useFormField();
|
|
1478
|
-
return /* @__PURE__ */
|
|
1599
|
+
return /* @__PURE__ */ jsx23(
|
|
1479
1600
|
Label,
|
|
1480
1601
|
{
|
|
1481
1602
|
ref,
|
|
@@ -1495,7 +1616,7 @@ function FormControl({ children }) {
|
|
|
1495
1616
|
!error ? descriptionId : void 0,
|
|
1496
1617
|
error ? messageId : void 0
|
|
1497
1618
|
].filter(Boolean).join(" ") || void 0;
|
|
1498
|
-
return
|
|
1619
|
+
return React24.cloneElement(children, {
|
|
1499
1620
|
id,
|
|
1500
1621
|
"aria-invalid": error ? true : void 0,
|
|
1501
1622
|
"aria-describedby": describedBy,
|
|
@@ -1504,9 +1625,9 @@ function FormControl({ children }) {
|
|
|
1504
1625
|
});
|
|
1505
1626
|
}
|
|
1506
1627
|
FormControl.displayName = "FormControl";
|
|
1507
|
-
var FormDescription =
|
|
1628
|
+
var FormDescription = React24.forwardRef(({ className, ...props }, ref) => {
|
|
1508
1629
|
const { descriptionId } = useFormField();
|
|
1509
|
-
return /* @__PURE__ */
|
|
1630
|
+
return /* @__PURE__ */ jsx23(
|
|
1510
1631
|
"p",
|
|
1511
1632
|
{
|
|
1512
1633
|
ref,
|
|
@@ -1517,11 +1638,11 @@ var FormDescription = React23.forwardRef(({ className, ...props }, ref) => {
|
|
|
1517
1638
|
);
|
|
1518
1639
|
});
|
|
1519
1640
|
FormDescription.displayName = "FormDescription";
|
|
1520
|
-
var FormMessage =
|
|
1641
|
+
var FormMessage = React24.forwardRef(({ className, children, ...props }, ref) => {
|
|
1521
1642
|
const { error, messageId } = useFormField();
|
|
1522
1643
|
const message = error || children;
|
|
1523
1644
|
if (!message) return null;
|
|
1524
|
-
return /* @__PURE__ */
|
|
1645
|
+
return /* @__PURE__ */ jsx23(
|
|
1525
1646
|
"p",
|
|
1526
1647
|
{
|
|
1527
1648
|
ref,
|
|
@@ -1536,8 +1657,8 @@ var FormMessage = React23.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
1536
1657
|
FormMessage.displayName = "FormMessage";
|
|
1537
1658
|
|
|
1538
1659
|
// src/components/dynamic-form-field/dynamic-form-field.tsx
|
|
1539
|
-
import * as
|
|
1540
|
-
import { jsx as
|
|
1660
|
+
import * as React25 from "react";
|
|
1661
|
+
import { jsx as jsx24, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1541
1662
|
function getFieldComponent(type) {
|
|
1542
1663
|
const map = {
|
|
1543
1664
|
text: "Input",
|
|
@@ -1562,7 +1683,7 @@ function getFieldComponent(type) {
|
|
|
1562
1683
|
function isInlineField(type) {
|
|
1563
1684
|
return type === "checkbox" || type === "switch";
|
|
1564
1685
|
}
|
|
1565
|
-
var DynamicFormField =
|
|
1686
|
+
var DynamicFormField = React25.forwardRef(
|
|
1566
1687
|
({
|
|
1567
1688
|
type,
|
|
1568
1689
|
name,
|
|
@@ -1582,16 +1703,16 @@ var DynamicFormField = React24.forwardRef(
|
|
|
1582
1703
|
className
|
|
1583
1704
|
}, ref) => {
|
|
1584
1705
|
if (isInlineField(type)) {
|
|
1585
|
-
return /* @__PURE__ */
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1706
|
+
return /* @__PURE__ */ jsxs9(FormField, { ref, error, disabled, className, children: [
|
|
1707
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
1708
|
+
/* @__PURE__ */ jsx24(FormControl, { children: type === "checkbox" ? /* @__PURE__ */ jsx24(
|
|
1588
1709
|
Checkbox,
|
|
1589
1710
|
{
|
|
1590
1711
|
name,
|
|
1591
1712
|
checked: value,
|
|
1592
1713
|
onCheckedChange: (checked) => onChange?.(checked)
|
|
1593
1714
|
}
|
|
1594
|
-
) : /* @__PURE__ */
|
|
1715
|
+
) : /* @__PURE__ */ jsx24(
|
|
1595
1716
|
Switch,
|
|
1596
1717
|
{
|
|
1597
1718
|
name,
|
|
@@ -1599,19 +1720,19 @@ var DynamicFormField = React24.forwardRef(
|
|
|
1599
1720
|
onCheckedChange: (checked) => onChange?.(checked)
|
|
1600
1721
|
}
|
|
1601
1722
|
) }),
|
|
1602
|
-
/* @__PURE__ */
|
|
1723
|
+
/* @__PURE__ */ jsxs9(Label, { className: "text-sm font-normal", children: [
|
|
1603
1724
|
label,
|
|
1604
|
-
required && /* @__PURE__ */
|
|
1725
|
+
required && /* @__PURE__ */ jsx24("span", { "aria-hidden": "true", className: "ml-0.5 text-error-500", children: "*" })
|
|
1605
1726
|
] })
|
|
1606
1727
|
] }),
|
|
1607
|
-
description && /* @__PURE__ */
|
|
1608
|
-
/* @__PURE__ */
|
|
1728
|
+
description && /* @__PURE__ */ jsx24(FormDescription, { children: description }),
|
|
1729
|
+
/* @__PURE__ */ jsx24(FormMessage, {})
|
|
1609
1730
|
] });
|
|
1610
1731
|
}
|
|
1611
1732
|
function renderControl() {
|
|
1612
1733
|
switch (type) {
|
|
1613
1734
|
case "textarea":
|
|
1614
|
-
return /* @__PURE__ */
|
|
1735
|
+
return /* @__PURE__ */ jsx24(
|
|
1615
1736
|
Textarea,
|
|
1616
1737
|
{
|
|
1617
1738
|
name,
|
|
@@ -1622,7 +1743,7 @@ var DynamicFormField = React24.forwardRef(
|
|
|
1622
1743
|
}
|
|
1623
1744
|
);
|
|
1624
1745
|
case "number":
|
|
1625
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ jsx24(
|
|
1626
1747
|
NumberInput,
|
|
1627
1748
|
{
|
|
1628
1749
|
name,
|
|
@@ -1635,7 +1756,7 @@ var DynamicFormField = React24.forwardRef(
|
|
|
1635
1756
|
}
|
|
1636
1757
|
);
|
|
1637
1758
|
case "date":
|
|
1638
|
-
return /* @__PURE__ */
|
|
1759
|
+
return /* @__PURE__ */ jsx24(
|
|
1639
1760
|
DatePicker,
|
|
1640
1761
|
{
|
|
1641
1762
|
name,
|
|
@@ -1646,7 +1767,7 @@ var DynamicFormField = React24.forwardRef(
|
|
|
1646
1767
|
}
|
|
1647
1768
|
);
|
|
1648
1769
|
case "select":
|
|
1649
|
-
return /* @__PURE__ */
|
|
1770
|
+
return /* @__PURE__ */ jsxs9(
|
|
1650
1771
|
Select,
|
|
1651
1772
|
{
|
|
1652
1773
|
value,
|
|
@@ -1654,13 +1775,13 @@ var DynamicFormField = React24.forwardRef(
|
|
|
1654
1775
|
disabled,
|
|
1655
1776
|
name,
|
|
1656
1777
|
children: [
|
|
1657
|
-
/* @__PURE__ */
|
|
1658
|
-
/* @__PURE__ */
|
|
1778
|
+
/* @__PURE__ */ jsx24(SelectTrigger, { children: /* @__PURE__ */ jsx24(SelectValue, { placeholder }) }),
|
|
1779
|
+
/* @__PURE__ */ jsx24(SelectContent, { children: options.map((opt) => /* @__PURE__ */ jsx24(SelectItem, { value: opt.value, children: opt.label }, opt.value)) })
|
|
1659
1780
|
]
|
|
1660
1781
|
}
|
|
1661
1782
|
);
|
|
1662
1783
|
case "combobox":
|
|
1663
|
-
return /* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ jsx24(
|
|
1664
1785
|
Combobox,
|
|
1665
1786
|
{
|
|
1666
1787
|
name,
|
|
@@ -1671,19 +1792,19 @@ var DynamicFormField = React24.forwardRef(
|
|
|
1671
1792
|
}
|
|
1672
1793
|
);
|
|
1673
1794
|
case "radio":
|
|
1674
|
-
return /* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ jsx24(
|
|
1675
1796
|
RadioGroup,
|
|
1676
1797
|
{
|
|
1677
1798
|
value,
|
|
1678
1799
|
onValueChange: (v) => onChange?.(v),
|
|
1679
|
-
children: options.map((opt) => /* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
/* @__PURE__ */
|
|
1800
|
+
children: options.map((opt) => /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
1801
|
+
/* @__PURE__ */ jsx24(RadioGroupItem, { value: opt.value, id: `${name}-${opt.value}` }),
|
|
1802
|
+
/* @__PURE__ */ jsx24(Label, { htmlFor: `${name}-${opt.value}`, className: "font-normal", children: opt.label })
|
|
1682
1803
|
] }, opt.value))
|
|
1683
1804
|
}
|
|
1684
1805
|
);
|
|
1685
1806
|
default:
|
|
1686
|
-
return /* @__PURE__ */
|
|
1807
|
+
return /* @__PURE__ */ jsx24(
|
|
1687
1808
|
Input,
|
|
1688
1809
|
{
|
|
1689
1810
|
type: type === "datetime" ? "datetime-local" : type,
|
|
@@ -1695,20 +1816,20 @@ var DynamicFormField = React24.forwardRef(
|
|
|
1695
1816
|
);
|
|
1696
1817
|
}
|
|
1697
1818
|
}
|
|
1698
|
-
return /* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1701
|
-
description && /* @__PURE__ */
|
|
1702
|
-
/* @__PURE__ */
|
|
1819
|
+
return /* @__PURE__ */ jsxs9(FormField, { ref, error, required, disabled, className, children: [
|
|
1820
|
+
/* @__PURE__ */ jsx24(FormLabel, { children: label }),
|
|
1821
|
+
/* @__PURE__ */ jsx24(FormControl, { children: renderControl() }),
|
|
1822
|
+
description && /* @__PURE__ */ jsx24(FormDescription, { children: description }),
|
|
1823
|
+
/* @__PURE__ */ jsx24(FormMessage, {})
|
|
1703
1824
|
] });
|
|
1704
1825
|
}
|
|
1705
1826
|
);
|
|
1706
1827
|
DynamicFormField.displayName = "DynamicFormField";
|
|
1707
1828
|
|
|
1708
1829
|
// src/components/form-layout/form-layout.tsx
|
|
1709
|
-
import * as
|
|
1830
|
+
import * as React26 from "react";
|
|
1710
1831
|
import { cva as cva10 } from "class-variance-authority";
|
|
1711
|
-
import { jsx as
|
|
1832
|
+
import { jsx as jsx25, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1712
1833
|
var formLayoutVariants = cva10("", {
|
|
1713
1834
|
variants: {
|
|
1714
1835
|
layout: {
|
|
@@ -1744,8 +1865,8 @@ var formLayoutVariants = cva10("", {
|
|
|
1744
1865
|
size: "md"
|
|
1745
1866
|
}
|
|
1746
1867
|
});
|
|
1747
|
-
var FormLayout =
|
|
1748
|
-
({ className, layout, size, columns = 2, style, ...props }, ref) => /* @__PURE__ */
|
|
1868
|
+
var FormLayout = React26.forwardRef(
|
|
1869
|
+
({ className, layout, size, columns = 2, style, ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
1749
1870
|
"div",
|
|
1750
1871
|
{
|
|
1751
1872
|
ref,
|
|
@@ -1756,15 +1877,15 @@ var FormLayout = React25.forwardRef(
|
|
|
1756
1877
|
)
|
|
1757
1878
|
);
|
|
1758
1879
|
FormLayout.displayName = "FormLayout";
|
|
1759
|
-
var FormSection =
|
|
1880
|
+
var FormSection = React26.forwardRef(({ className, title, description, children, ...props }, ref) => /* @__PURE__ */ jsxs10(
|
|
1760
1881
|
"fieldset",
|
|
1761
1882
|
{
|
|
1762
1883
|
ref,
|
|
1763
1884
|
className: cn("space-y-4 border-0 p-0", className),
|
|
1764
1885
|
...props,
|
|
1765
1886
|
children: [
|
|
1766
|
-
/* @__PURE__ */
|
|
1767
|
-
description && /* @__PURE__ */
|
|
1887
|
+
/* @__PURE__ */ jsx25("legend", { className: "text-sm font-semibold text-[var(--color-on-surface)]", children: title }),
|
|
1888
|
+
description && /* @__PURE__ */ jsx25("p", { className: "-mt-2 text-xs text-[var(--color-on-surface-muted)]", children: description }),
|
|
1768
1889
|
children
|
|
1769
1890
|
]
|
|
1770
1891
|
}
|
|
@@ -1776,8 +1897,8 @@ var alignClasses = {
|
|
|
1776
1897
|
center: "justify-center",
|
|
1777
1898
|
between: "justify-between"
|
|
1778
1899
|
};
|
|
1779
|
-
var FormActions =
|
|
1780
|
-
({ className, align = "right", ...props }, ref) => /* @__PURE__ */
|
|
1900
|
+
var FormActions = React26.forwardRef(
|
|
1901
|
+
({ className, align = "right", ...props }, ref) => /* @__PURE__ */ jsx25(
|
|
1781
1902
|
"div",
|
|
1782
1903
|
{
|
|
1783
1904
|
ref,
|
|
@@ -1793,10 +1914,10 @@ var FormActions = React25.forwardRef(
|
|
|
1793
1914
|
FormActions.displayName = "FormActions";
|
|
1794
1915
|
|
|
1795
1916
|
// src/components/tabs/tabs.tsx
|
|
1796
|
-
import * as
|
|
1917
|
+
import * as React27 from "react";
|
|
1797
1918
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
1798
1919
|
import { cva as cva11 } from "class-variance-authority";
|
|
1799
|
-
import { jsx as
|
|
1920
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1800
1921
|
var [TabsVariantProvider, useTabsVariant] = createContext2("TabsVariant");
|
|
1801
1922
|
var Tabs = TabsPrimitive.Root;
|
|
1802
1923
|
var tabsListVariants = cva11(
|
|
@@ -1811,7 +1932,7 @@ var tabsListVariants = cva11(
|
|
|
1811
1932
|
defaultVariants: { variant: "default" }
|
|
1812
1933
|
}
|
|
1813
1934
|
);
|
|
1814
|
-
var TabsList =
|
|
1935
|
+
var TabsList = React27.forwardRef(({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ jsx26(TabsVariantProvider, { value: { variant }, children: /* @__PURE__ */ jsx26(
|
|
1815
1936
|
TabsPrimitive.List,
|
|
1816
1937
|
{
|
|
1817
1938
|
ref,
|
|
@@ -1825,9 +1946,9 @@ var tabsTriggerVariantStyles = {
|
|
|
1825
1946
|
default: "rounded-md data-[state=active]:bg-[var(--color-surface-raised)] data-[state=active]:shadow-sm data-[state=active]:text-[var(--color-on-surface)] text-[var(--color-on-surface-secondary)]",
|
|
1826
1947
|
underline: "border-b-2 border-transparent rounded-none data-[state=active]:border-primary-500 data-[state=active]:text-[var(--color-on-surface)] text-[var(--color-on-surface-secondary)]"
|
|
1827
1948
|
};
|
|
1828
|
-
var TabsTrigger =
|
|
1949
|
+
var TabsTrigger = React27.forwardRef(({ className, ...props }, ref) => {
|
|
1829
1950
|
const { variant } = useTabsVariant();
|
|
1830
|
-
return /* @__PURE__ */
|
|
1951
|
+
return /* @__PURE__ */ jsx26(
|
|
1831
1952
|
TabsPrimitive.Trigger,
|
|
1832
1953
|
{
|
|
1833
1954
|
ref,
|
|
@@ -1841,7 +1962,7 @@ var TabsTrigger = React26.forwardRef(({ className, ...props }, ref) => {
|
|
|
1841
1962
|
);
|
|
1842
1963
|
});
|
|
1843
1964
|
TabsTrigger.displayName = "TabsTrigger";
|
|
1844
|
-
var TabsContent =
|
|
1965
|
+
var TabsContent = React27.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx26(
|
|
1845
1966
|
TabsPrimitive.Content,
|
|
1846
1967
|
{
|
|
1847
1968
|
ref,
|
|
@@ -1855,9 +1976,9 @@ var TabsContent = React26.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1855
1976
|
TabsContent.displayName = "TabsContent";
|
|
1856
1977
|
|
|
1857
1978
|
// src/components/empty-state/empty-state.tsx
|
|
1858
|
-
import * as
|
|
1979
|
+
import * as React28 from "react";
|
|
1859
1980
|
import { cva as cva12 } from "class-variance-authority";
|
|
1860
|
-
import { jsx as
|
|
1981
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
1861
1982
|
var emptyStateVariants = cva12(
|
|
1862
1983
|
"flex flex-col items-center justify-center text-center",
|
|
1863
1984
|
{
|
|
@@ -1871,8 +1992,8 @@ var emptyStateVariants = cva12(
|
|
|
1871
1992
|
defaultVariants: { size: "md" }
|
|
1872
1993
|
}
|
|
1873
1994
|
);
|
|
1874
|
-
var EmptyState =
|
|
1875
|
-
({ className, size, ...props }, ref) => /* @__PURE__ */
|
|
1995
|
+
var EmptyState = React28.forwardRef(
|
|
1996
|
+
({ className, size, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1876
1997
|
"div",
|
|
1877
1998
|
{
|
|
1878
1999
|
ref,
|
|
@@ -1882,7 +2003,7 @@ var EmptyState = React27.forwardRef(
|
|
|
1882
2003
|
)
|
|
1883
2004
|
);
|
|
1884
2005
|
EmptyState.displayName = "EmptyState";
|
|
1885
|
-
var EmptyStateIcon =
|
|
2006
|
+
var EmptyStateIcon = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1886
2007
|
"div",
|
|
1887
2008
|
{
|
|
1888
2009
|
ref,
|
|
@@ -1891,7 +2012,7 @@ var EmptyStateIcon = React27.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
1891
2012
|
}
|
|
1892
2013
|
));
|
|
1893
2014
|
EmptyStateIcon.displayName = "EmptyStateIcon";
|
|
1894
|
-
var EmptyStateTitle =
|
|
2015
|
+
var EmptyStateTitle = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1895
2016
|
"h3",
|
|
1896
2017
|
{
|
|
1897
2018
|
ref,
|
|
@@ -1900,7 +2021,7 @@ var EmptyStateTitle = React27.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
1900
2021
|
}
|
|
1901
2022
|
));
|
|
1902
2023
|
EmptyStateTitle.displayName = "EmptyStateTitle";
|
|
1903
|
-
var EmptyStateDescription =
|
|
2024
|
+
var EmptyStateDescription = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1904
2025
|
"p",
|
|
1905
2026
|
{
|
|
1906
2027
|
ref,
|
|
@@ -1909,7 +2030,7 @@ var EmptyStateDescription = React27.forwardRef(({ className, ...props }, ref) =>
|
|
|
1909
2030
|
}
|
|
1910
2031
|
));
|
|
1911
2032
|
EmptyStateDescription.displayName = "EmptyStateDescription";
|
|
1912
|
-
var EmptyStateActions =
|
|
2033
|
+
var EmptyStateActions = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx27(
|
|
1913
2034
|
"div",
|
|
1914
2035
|
{
|
|
1915
2036
|
ref,
|
|
@@ -1920,9 +2041,9 @@ var EmptyStateActions = React27.forwardRef(({ className, ...props }, ref) => /*
|
|
|
1920
2041
|
EmptyStateActions.displayName = "EmptyStateActions";
|
|
1921
2042
|
|
|
1922
2043
|
// src/components/table/table.tsx
|
|
1923
|
-
import * as
|
|
1924
|
-
import { jsx as
|
|
1925
|
-
var Table =
|
|
2044
|
+
import * as React29 from "react";
|
|
2045
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2046
|
+
var Table = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx28(
|
|
1926
2047
|
"table",
|
|
1927
2048
|
{
|
|
1928
2049
|
ref,
|
|
@@ -1931,9 +2052,9 @@ var Table = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
|
1931
2052
|
}
|
|
1932
2053
|
) }));
|
|
1933
2054
|
Table.displayName = "Table";
|
|
1934
|
-
var TableHeader =
|
|
2055
|
+
var TableHeader = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
|
|
1935
2056
|
TableHeader.displayName = "TableHeader";
|
|
1936
|
-
var TableBody =
|
|
2057
|
+
var TableBody = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1937
2058
|
"tbody",
|
|
1938
2059
|
{
|
|
1939
2060
|
ref,
|
|
@@ -1942,7 +2063,7 @@ var TableBody = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1942
2063
|
}
|
|
1943
2064
|
));
|
|
1944
2065
|
TableBody.displayName = "TableBody";
|
|
1945
|
-
var TableFooter =
|
|
2066
|
+
var TableFooter = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1946
2067
|
"tfoot",
|
|
1947
2068
|
{
|
|
1948
2069
|
ref,
|
|
@@ -1954,7 +2075,7 @@ var TableFooter = React28.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1954
2075
|
}
|
|
1955
2076
|
));
|
|
1956
2077
|
TableFooter.displayName = "TableFooter";
|
|
1957
|
-
var TableRow =
|
|
2078
|
+
var TableRow = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1958
2079
|
"tr",
|
|
1959
2080
|
{
|
|
1960
2081
|
ref,
|
|
@@ -1966,7 +2087,7 @@ var TableRow = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1966
2087
|
}
|
|
1967
2088
|
));
|
|
1968
2089
|
TableRow.displayName = "TableRow";
|
|
1969
|
-
var TableHead =
|
|
2090
|
+
var TableHead = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1970
2091
|
"th",
|
|
1971
2092
|
{
|
|
1972
2093
|
ref,
|
|
@@ -1978,7 +2099,7 @@ var TableHead = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1978
2099
|
}
|
|
1979
2100
|
));
|
|
1980
2101
|
TableHead.displayName = "TableHead";
|
|
1981
|
-
var TableCell =
|
|
2102
|
+
var TableCell = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1982
2103
|
"td",
|
|
1983
2104
|
{
|
|
1984
2105
|
ref,
|
|
@@ -1990,7 +2111,7 @@ var TableCell = React28.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
1990
2111
|
}
|
|
1991
2112
|
));
|
|
1992
2113
|
TableCell.displayName = "TableCell";
|
|
1993
|
-
var TableCaption =
|
|
2114
|
+
var TableCaption = React29.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx28(
|
|
1994
2115
|
"caption",
|
|
1995
2116
|
{
|
|
1996
2117
|
ref,
|
|
@@ -2001,7 +2122,7 @@ var TableCaption = React28.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2001
2122
|
TableCaption.displayName = "TableCaption";
|
|
2002
2123
|
|
|
2003
2124
|
// src/components/data-table/data-table.tsx
|
|
2004
|
-
import * as
|
|
2125
|
+
import * as React31 from "react";
|
|
2005
2126
|
import {
|
|
2006
2127
|
useReactTable,
|
|
2007
2128
|
getCoreRowModel,
|
|
@@ -2011,7 +2132,7 @@ import {
|
|
|
2011
2132
|
} from "@tanstack/react-table";
|
|
2012
2133
|
|
|
2013
2134
|
// src/components/data-table/data-table-pagination.tsx
|
|
2014
|
-
import { jsx as
|
|
2135
|
+
import { jsx as jsx29, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2015
2136
|
function DataTablePagination({
|
|
2016
2137
|
table,
|
|
2017
2138
|
pageSizeOptions = [10, 20, 30, 50],
|
|
@@ -2021,7 +2142,7 @@ function DataTablePagination({
|
|
|
2021
2142
|
const totalRows = table.getFilteredRowModel().rows.length;
|
|
2022
2143
|
const from = pageIndex * pageSize + 1;
|
|
2023
2144
|
const to = Math.min((pageIndex + 1) * pageSize, totalRows);
|
|
2024
|
-
return /* @__PURE__ */
|
|
2145
|
+
return /* @__PURE__ */ jsxs11(
|
|
2025
2146
|
"div",
|
|
2026
2147
|
{
|
|
2027
2148
|
className: cn(
|
|
@@ -2029,30 +2150,30 @@ function DataTablePagination({
|
|
|
2029
2150
|
className
|
|
2030
2151
|
),
|
|
2031
2152
|
children: [
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2153
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
|
|
2154
|
+
/* @__PURE__ */ jsx29("span", { children: "Rows per page" }),
|
|
2155
|
+
/* @__PURE__ */ jsx29(
|
|
2035
2156
|
"select",
|
|
2036
2157
|
{
|
|
2037
2158
|
value: pageSize,
|
|
2038
2159
|
onChange: (e) => table.setPageSize(Number(e.target.value)),
|
|
2039
2160
|
className: "h-8 rounded-md border border-[var(--color-border-input)] bg-[var(--color-surface-raised)] px-2 text-sm",
|
|
2040
2161
|
"aria-label": "Rows per page",
|
|
2041
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */
|
|
2162
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ jsx29("option", { value: size, children: size }, size))
|
|
2042
2163
|
}
|
|
2043
2164
|
)
|
|
2044
2165
|
] }),
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
/* @__PURE__ */
|
|
2047
|
-
/* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2166
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-4", children: [
|
|
2167
|
+
/* @__PURE__ */ jsx29("span", { children: totalRows > 0 ? `${from}-${to} of ${totalRows}` : "0 results" }),
|
|
2168
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", children: [
|
|
2169
|
+
/* @__PURE__ */ jsx29(
|
|
2049
2170
|
"button",
|
|
2050
2171
|
{
|
|
2051
2172
|
className: "inline-flex h-8 w-8 items-center justify-center rounded-md border border-[var(--color-border-input)] bg-[var(--color-surface-raised)] transition-colors hover:bg-[var(--color-surface-sunken)] disabled:opacity-50 disabled:pointer-events-none",
|
|
2052
2173
|
onClick: () => table.previousPage(),
|
|
2053
2174
|
disabled: !table.getCanPreviousPage(),
|
|
2054
2175
|
"aria-label": "Previous page",
|
|
2055
|
-
children: /* @__PURE__ */
|
|
2176
|
+
children: /* @__PURE__ */ jsx29(
|
|
2056
2177
|
"svg",
|
|
2057
2178
|
{
|
|
2058
2179
|
width: "16",
|
|
@@ -2063,19 +2184,19 @@ function DataTablePagination({
|
|
|
2063
2184
|
strokeWidth: "2",
|
|
2064
2185
|
strokeLinecap: "round",
|
|
2065
2186
|
strokeLinejoin: "round",
|
|
2066
|
-
children: /* @__PURE__ */
|
|
2187
|
+
children: /* @__PURE__ */ jsx29("path", { d: "m15 18-6-6 6-6" })
|
|
2067
2188
|
}
|
|
2068
2189
|
)
|
|
2069
2190
|
}
|
|
2070
2191
|
),
|
|
2071
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ jsx29(
|
|
2072
2193
|
"button",
|
|
2073
2194
|
{
|
|
2074
2195
|
className: "inline-flex h-8 w-8 items-center justify-center rounded-md border border-[var(--color-border-input)] bg-[var(--color-surface-raised)] transition-colors hover:bg-[var(--color-surface-sunken)] disabled:opacity-50 disabled:pointer-events-none",
|
|
2075
2196
|
onClick: () => table.nextPage(),
|
|
2076
2197
|
disabled: !table.getCanNextPage(),
|
|
2077
2198
|
"aria-label": "Next page",
|
|
2078
|
-
children: /* @__PURE__ */
|
|
2199
|
+
children: /* @__PURE__ */ jsx29(
|
|
2079
2200
|
"svg",
|
|
2080
2201
|
{
|
|
2081
2202
|
width: "16",
|
|
@@ -2086,7 +2207,7 @@ function DataTablePagination({
|
|
|
2086
2207
|
strokeWidth: "2",
|
|
2087
2208
|
strokeLinecap: "round",
|
|
2088
2209
|
strokeLinejoin: "round",
|
|
2089
|
-
children: /* @__PURE__ */
|
|
2210
|
+
children: /* @__PURE__ */ jsx29("path", { d: "m9 18 6-6-6-6" })
|
|
2090
2211
|
}
|
|
2091
2212
|
)
|
|
2092
2213
|
}
|
|
@@ -2100,18 +2221,18 @@ function DataTablePagination({
|
|
|
2100
2221
|
DataTablePagination.displayName = "DataTablePagination";
|
|
2101
2222
|
|
|
2102
2223
|
// src/components/data-table/data-table-toolbar.tsx
|
|
2103
|
-
import * as
|
|
2104
|
-
import { jsx as
|
|
2224
|
+
import * as React30 from "react";
|
|
2225
|
+
import { jsx as jsx30, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2105
2226
|
function DataTableToolbar({
|
|
2106
2227
|
table,
|
|
2107
2228
|
enableColumnVisibility = false,
|
|
2108
2229
|
className,
|
|
2109
2230
|
children
|
|
2110
2231
|
}) {
|
|
2111
|
-
const [showColumnMenu, setShowColumnMenu] =
|
|
2112
|
-
const menuRef =
|
|
2232
|
+
const [showColumnMenu, setShowColumnMenu] = React30.useState(false);
|
|
2233
|
+
const menuRef = React30.useRef(null);
|
|
2113
2234
|
const selectedCount = table.getFilteredSelectedRowModel().rows.length;
|
|
2114
|
-
|
|
2235
|
+
React30.useEffect(() => {
|
|
2115
2236
|
function handleClickOutside(event) {
|
|
2116
2237
|
if (menuRef.current && !menuRef.current.contains(event.target)) {
|
|
2117
2238
|
setShowColumnMenu(false);
|
|
@@ -2122,7 +2243,7 @@ function DataTableToolbar({
|
|
|
2122
2243
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
2123
2244
|
}
|
|
2124
2245
|
}, [showColumnMenu]);
|
|
2125
|
-
return /* @__PURE__ */
|
|
2246
|
+
return /* @__PURE__ */ jsxs12(
|
|
2126
2247
|
"div",
|
|
2127
2248
|
{
|
|
2128
2249
|
className: cn(
|
|
@@ -2130,15 +2251,15 @@ function DataTableToolbar({
|
|
|
2130
2251
|
className
|
|
2131
2252
|
),
|
|
2132
2253
|
children: [
|
|
2133
|
-
/* @__PURE__ */
|
|
2134
|
-
selectedCount > 0 && /* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
|
|
2255
|
+
selectedCount > 0 && /* @__PURE__ */ jsxs12("span", { className: "text-sm text-[var(--color-on-surface-secondary)]", children: [
|
|
2135
2256
|
selectedCount,
|
|
2136
2257
|
" selected"
|
|
2137
2258
|
] }),
|
|
2138
2259
|
children
|
|
2139
2260
|
] }),
|
|
2140
|
-
enableColumnVisibility && /* @__PURE__ */
|
|
2141
|
-
/* @__PURE__ */
|
|
2261
|
+
enableColumnVisibility && /* @__PURE__ */ jsxs12("div", { className: "relative", ref: menuRef, children: [
|
|
2262
|
+
/* @__PURE__ */ jsxs12(
|
|
2142
2263
|
"button",
|
|
2143
2264
|
{
|
|
2144
2265
|
className: "inline-flex items-center gap-1 rounded-md border border-[var(--color-border-input)] bg-[var(--color-surface-raised)] px-3 py-1.5 text-sm transition-colors hover:bg-[var(--color-surface-sunken)]",
|
|
@@ -2146,7 +2267,7 @@ function DataTableToolbar({
|
|
|
2146
2267
|
"aria-label": "Toggle columns",
|
|
2147
2268
|
"aria-expanded": showColumnMenu,
|
|
2148
2269
|
children: [
|
|
2149
|
-
/* @__PURE__ */
|
|
2270
|
+
/* @__PURE__ */ jsx30(
|
|
2150
2271
|
"svg",
|
|
2151
2272
|
{
|
|
2152
2273
|
width: "14",
|
|
@@ -2157,19 +2278,19 @@ function DataTableToolbar({
|
|
|
2157
2278
|
strokeWidth: "2",
|
|
2158
2279
|
strokeLinecap: "round",
|
|
2159
2280
|
strokeLinejoin: "round",
|
|
2160
|
-
children: /* @__PURE__ */
|
|
2281
|
+
children: /* @__PURE__ */ jsx30("path", { d: "M12 3v18M3 12h18" })
|
|
2161
2282
|
}
|
|
2162
2283
|
),
|
|
2163
2284
|
"Columns"
|
|
2164
2285
|
]
|
|
2165
2286
|
}
|
|
2166
2287
|
),
|
|
2167
|
-
showColumnMenu && /* @__PURE__ */
|
|
2288
|
+
showColumnMenu && /* @__PURE__ */ jsx30("div", { className: "absolute right-0 top-full z-popover mt-1 min-w-[10rem] rounded-md border border-[var(--color-border)] bg-[var(--color-surface-raised)] p-2 shadow-md", children: table.getAllColumns().filter((col) => col.getCanHide()).map((col) => /* @__PURE__ */ jsxs12(
|
|
2168
2289
|
"label",
|
|
2169
2290
|
{
|
|
2170
2291
|
className: "flex items-center gap-2 rounded px-2 py-1 text-sm hover:bg-[var(--color-surface-sunken)] cursor-pointer capitalize",
|
|
2171
2292
|
children: [
|
|
2172
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ jsx30(
|
|
2173
2294
|
"input",
|
|
2174
2295
|
{
|
|
2175
2296
|
type: "checkbox",
|
|
@@ -2191,7 +2312,7 @@ function DataTableToolbar({
|
|
|
2191
2312
|
DataTableToolbar.displayName = "DataTableToolbar";
|
|
2192
2313
|
|
|
2193
2314
|
// src/components/data-table/data-table.tsx
|
|
2194
|
-
import { jsx as
|
|
2315
|
+
import { jsx as jsx31, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2195
2316
|
function DataTable({
|
|
2196
2317
|
columns,
|
|
2197
2318
|
data,
|
|
@@ -2206,14 +2327,14 @@ function DataTable({
|
|
|
2206
2327
|
className,
|
|
2207
2328
|
"aria-label": ariaLabel
|
|
2208
2329
|
}) {
|
|
2209
|
-
const [sorting, setSorting] =
|
|
2210
|
-
const [rowSelection, setRowSelection] =
|
|
2211
|
-
const [columnVisibility, setColumnVisibility] =
|
|
2212
|
-
const allColumns =
|
|
2330
|
+
const [sorting, setSorting] = React31.useState([]);
|
|
2331
|
+
const [rowSelection, setRowSelection] = React31.useState({});
|
|
2332
|
+
const [columnVisibility, setColumnVisibility] = React31.useState({});
|
|
2333
|
+
const allColumns = React31.useMemo(() => {
|
|
2213
2334
|
if (!enableRowSelection) return columns;
|
|
2214
2335
|
const selectColumn = {
|
|
2215
2336
|
id: "select",
|
|
2216
|
-
header: ({ table: table2 }) => /* @__PURE__ */
|
|
2337
|
+
header: ({ table: table2 }) => /* @__PURE__ */ jsx31(
|
|
2217
2338
|
Checkbox,
|
|
2218
2339
|
{
|
|
2219
2340
|
checked: table2.getIsAllPageRowsSelected() ? true : table2.getIsSomePageRowsSelected() ? "indeterminate" : false,
|
|
@@ -2221,7 +2342,7 @@ function DataTable({
|
|
|
2221
2342
|
"aria-label": "Select all"
|
|
2222
2343
|
}
|
|
2223
2344
|
),
|
|
2224
|
-
cell: ({ row }) => /* @__PURE__ */
|
|
2345
|
+
cell: ({ row }) => /* @__PURE__ */ jsx31(
|
|
2225
2346
|
Checkbox,
|
|
2226
2347
|
{
|
|
2227
2348
|
checked: row.getIsSelected(),
|
|
@@ -2249,23 +2370,23 @@ function DataTable({
|
|
|
2249
2370
|
enableRowSelection,
|
|
2250
2371
|
initialState: { pagination: { pageSize } }
|
|
2251
2372
|
});
|
|
2252
|
-
|
|
2373
|
+
React31.useEffect(() => {
|
|
2253
2374
|
if (onRowSelectionChange) {
|
|
2254
2375
|
const selectedRows = table.getFilteredSelectedRowModel().rows.map((row) => row.original);
|
|
2255
2376
|
onRowSelectionChange(selectedRows);
|
|
2256
2377
|
}
|
|
2257
2378
|
}, [rowSelection, table, onRowSelectionChange]);
|
|
2258
2379
|
const showToolbar = enableRowSelection || enableColumnVisibility;
|
|
2259
|
-
return /* @__PURE__ */
|
|
2260
|
-
showToolbar && /* @__PURE__ */
|
|
2380
|
+
return /* @__PURE__ */ jsxs13("div", { className: cn("rounded-md border border-[var(--color-border)]", className), children: [
|
|
2381
|
+
showToolbar && /* @__PURE__ */ jsx31(
|
|
2261
2382
|
DataTableToolbar,
|
|
2262
2383
|
{
|
|
2263
2384
|
table,
|
|
2264
2385
|
enableColumnVisibility
|
|
2265
2386
|
}
|
|
2266
2387
|
),
|
|
2267
|
-
/* @__PURE__ */
|
|
2268
|
-
/* @__PURE__ */
|
|
2388
|
+
/* @__PURE__ */ jsxs13(Table, { "aria-label": ariaLabel, children: [
|
|
2389
|
+
/* @__PURE__ */ jsx31(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx31(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx31(TableHead, { children: header.isPlaceholder ? null : header.column.getCanSort() ? /* @__PURE__ */ jsxs13(
|
|
2269
2390
|
"button",
|
|
2270
2391
|
{
|
|
2271
2392
|
className: "flex items-center gap-1 -ml-2 px-2 py-1 rounded-md hover:bg-[var(--color-surface-muted)] transition-colors duration-fast",
|
|
@@ -2276,7 +2397,7 @@ function DataTable({
|
|
|
2276
2397
|
header.column.columnDef.header,
|
|
2277
2398
|
header.getContext()
|
|
2278
2399
|
),
|
|
2279
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ jsx31(
|
|
2280
2401
|
"svg",
|
|
2281
2402
|
{
|
|
2282
2403
|
width: "14",
|
|
@@ -2291,7 +2412,7 @@ function DataTable({
|
|
|
2291
2412
|
"shrink-0",
|
|
2292
2413
|
header.column.getIsSorted() ? "opacity-100" : "opacity-30"
|
|
2293
2414
|
),
|
|
2294
|
-
children: /* @__PURE__ */
|
|
2415
|
+
children: /* @__PURE__ */ jsx31("path", { d: "m7 15 5 5 5-5M7 9l5-5 5 5" })
|
|
2295
2416
|
}
|
|
2296
2417
|
)
|
|
2297
2418
|
]
|
|
@@ -2300,14 +2421,14 @@ function DataTable({
|
|
|
2300
2421
|
header.column.columnDef.header,
|
|
2301
2422
|
header.getContext()
|
|
2302
2423
|
) }, header.id)) }, headerGroup.id)) }),
|
|
2303
|
-
/* @__PURE__ */
|
|
2424
|
+
/* @__PURE__ */ jsx31(TableBody, { children: table.getRowModel().rows.length > 0 ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx31(
|
|
2304
2425
|
TableRow,
|
|
2305
2426
|
{
|
|
2306
2427
|
"data-state": row.getIsSelected() ? "selected" : void 0,
|
|
2307
|
-
children: row.getVisibleCells().map((cell) => /* @__PURE__ */
|
|
2428
|
+
children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx31(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
|
|
2308
2429
|
},
|
|
2309
2430
|
row.id
|
|
2310
|
-
)) : /* @__PURE__ */
|
|
2431
|
+
)) : /* @__PURE__ */ jsx31(TableRow, { children: /* @__PURE__ */ jsx31(
|
|
2311
2432
|
TableCell,
|
|
2312
2433
|
{
|
|
2313
2434
|
colSpan: allColumns.length,
|
|
@@ -2316,7 +2437,7 @@ function DataTable({
|
|
|
2316
2437
|
}
|
|
2317
2438
|
) }) })
|
|
2318
2439
|
] }),
|
|
2319
|
-
enablePagination && /* @__PURE__ */
|
|
2440
|
+
enablePagination && /* @__PURE__ */ jsx31(
|
|
2320
2441
|
DataTablePagination,
|
|
2321
2442
|
{
|
|
2322
2443
|
table,
|
|
@@ -2328,17 +2449,17 @@ function DataTable({
|
|
|
2328
2449
|
DataTable.displayName = "DataTable";
|
|
2329
2450
|
|
|
2330
2451
|
// src/components/data-table/data-table-column-header.tsx
|
|
2331
|
-
import { jsx as
|
|
2452
|
+
import { jsx as jsx32, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2332
2453
|
function DataTableColumnHeader({
|
|
2333
2454
|
column,
|
|
2334
2455
|
title,
|
|
2335
2456
|
className
|
|
2336
2457
|
}) {
|
|
2337
2458
|
if (!column.getCanSort()) {
|
|
2338
|
-
return /* @__PURE__ */
|
|
2459
|
+
return /* @__PURE__ */ jsx32("div", { className: cn(className), children: title });
|
|
2339
2460
|
}
|
|
2340
2461
|
const sorted = column.getIsSorted();
|
|
2341
|
-
return /* @__PURE__ */
|
|
2462
|
+
return /* @__PURE__ */ jsxs14(
|
|
2342
2463
|
"button",
|
|
2343
2464
|
{
|
|
2344
2465
|
className: cn(
|
|
@@ -2349,7 +2470,7 @@ function DataTableColumnHeader({
|
|
|
2349
2470
|
"aria-label": `Sort by ${title}`,
|
|
2350
2471
|
children: [
|
|
2351
2472
|
title,
|
|
2352
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsx32(
|
|
2353
2474
|
"svg",
|
|
2354
2475
|
{
|
|
2355
2476
|
width: "14",
|
|
@@ -2364,11 +2485,11 @@ function DataTableColumnHeader({
|
|
|
2364
2485
|
"shrink-0 transition-opacity",
|
|
2365
2486
|
sorted ? "opacity-100" : "opacity-30"
|
|
2366
2487
|
),
|
|
2367
|
-
children: sorted === "desc" ? /* @__PURE__ */
|
|
2488
|
+
children: sorted === "desc" ? /* @__PURE__ */ jsx32("path", { d: "m7 15 5 5 5-5M7 9l5-5 5 5" }) : sorted === "asc" ? /* @__PURE__ */ jsx32("path", { d: "m7 15 5 5 5-5M7 9l5-5 5 5" }) : /* @__PURE__ */ jsx32("path", { d: "m7 15 5 5 5-5M7 9l5-5 5 5" })
|
|
2368
2489
|
}
|
|
2369
2490
|
),
|
|
2370
|
-
sorted === "asc" && /* @__PURE__ */
|
|
2371
|
-
sorted === "desc" && /* @__PURE__ */
|
|
2491
|
+
sorted === "asc" && /* @__PURE__ */ jsx32("span", { className: "sr-only", children: "sorted ascending" }),
|
|
2492
|
+
sorted === "desc" && /* @__PURE__ */ jsx32("span", { className: "sr-only", children: "sorted descending" })
|
|
2372
2493
|
]
|
|
2373
2494
|
}
|
|
2374
2495
|
);
|
|
@@ -2376,10 +2497,10 @@ function DataTableColumnHeader({
|
|
|
2376
2497
|
DataTableColumnHeader.displayName = "DataTableColumnHeader";
|
|
2377
2498
|
|
|
2378
2499
|
// src/components/filter-bar/filter-bar.tsx
|
|
2379
|
-
import * as
|
|
2500
|
+
import * as React32 from "react";
|
|
2380
2501
|
import { cva as cva13 } from "class-variance-authority";
|
|
2381
|
-
import { jsx as
|
|
2382
|
-
var FilterBar =
|
|
2502
|
+
import { jsx as jsx33, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2503
|
+
var FilterBar = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
2383
2504
|
"div",
|
|
2384
2505
|
{
|
|
2385
2506
|
ref,
|
|
@@ -2393,7 +2514,7 @@ var FilterBar = React31.forwardRef(({ className, ...props }, ref) => /* @__PURE_
|
|
|
2393
2514
|
}
|
|
2394
2515
|
));
|
|
2395
2516
|
FilterBar.displayName = "FilterBar";
|
|
2396
|
-
var FilterBarGroup =
|
|
2517
|
+
var FilterBarGroup = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
2397
2518
|
"div",
|
|
2398
2519
|
{
|
|
2399
2520
|
ref,
|
|
@@ -2415,27 +2536,27 @@ var filterChipVariants = cva13(
|
|
|
2415
2536
|
defaultVariants: { variant: "default" }
|
|
2416
2537
|
}
|
|
2417
2538
|
);
|
|
2418
|
-
var FilterChip =
|
|
2419
|
-
({ className, variant, label, value, onRemove, ...props }, ref) => /* @__PURE__ */
|
|
2539
|
+
var FilterChip = React32.forwardRef(
|
|
2540
|
+
({ className, variant, label, value, onRemove, ...props }, ref) => /* @__PURE__ */ jsxs15(
|
|
2420
2541
|
"span",
|
|
2421
2542
|
{
|
|
2422
2543
|
ref,
|
|
2423
2544
|
className: cn(filterChipVariants({ variant }), className),
|
|
2424
2545
|
...props,
|
|
2425
2546
|
children: [
|
|
2426
|
-
/* @__PURE__ */
|
|
2547
|
+
/* @__PURE__ */ jsxs15("span", { className: "text-xs opacity-70", children: [
|
|
2427
2548
|
label,
|
|
2428
2549
|
":"
|
|
2429
2550
|
] }),
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
onRemove && /* @__PURE__ */
|
|
2551
|
+
/* @__PURE__ */ jsx33("span", { children: value }),
|
|
2552
|
+
onRemove && /* @__PURE__ */ jsx33(
|
|
2432
2553
|
"button",
|
|
2433
2554
|
{
|
|
2434
2555
|
type: "button",
|
|
2435
2556
|
onClick: onRemove,
|
|
2436
2557
|
className: "ml-0.5 rounded-full p-0.5 hover:bg-black/10 transition-colors",
|
|
2437
2558
|
"aria-label": `Remove ${label} filter`,
|
|
2438
|
-
children: /* @__PURE__ */
|
|
2559
|
+
children: /* @__PURE__ */ jsx33(
|
|
2439
2560
|
"svg",
|
|
2440
2561
|
{
|
|
2441
2562
|
width: "12",
|
|
@@ -2446,7 +2567,7 @@ var FilterChip = React31.forwardRef(
|
|
|
2446
2567
|
strokeWidth: "2",
|
|
2447
2568
|
strokeLinecap: "round",
|
|
2448
2569
|
strokeLinejoin: "round",
|
|
2449
|
-
children: /* @__PURE__ */
|
|
2570
|
+
children: /* @__PURE__ */ jsx33("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
2450
2571
|
}
|
|
2451
2572
|
)
|
|
2452
2573
|
}
|
|
@@ -2456,7 +2577,7 @@ var FilterChip = React31.forwardRef(
|
|
|
2456
2577
|
)
|
|
2457
2578
|
);
|
|
2458
2579
|
FilterChip.displayName = "FilterChip";
|
|
2459
|
-
var ActiveFilters =
|
|
2580
|
+
var ActiveFilters = React32.forwardRef(({ className, onClearAll, clearAllLabel = "Clear all", children, ...props }, ref) => /* @__PURE__ */ jsxs15(
|
|
2460
2581
|
"div",
|
|
2461
2582
|
{
|
|
2462
2583
|
ref,
|
|
@@ -2464,7 +2585,7 @@ var ActiveFilters = React31.forwardRef(({ className, onClearAll, clearAllLabel =
|
|
|
2464
2585
|
...props,
|
|
2465
2586
|
children: [
|
|
2466
2587
|
children,
|
|
2467
|
-
onClearAll && /* @__PURE__ */
|
|
2588
|
+
onClearAll && /* @__PURE__ */ jsx33(
|
|
2468
2589
|
"button",
|
|
2469
2590
|
{
|
|
2470
2591
|
type: "button",
|
|
@@ -2477,7 +2598,7 @@ var ActiveFilters = React31.forwardRef(({ className, onClearAll, clearAllLabel =
|
|
|
2477
2598
|
}
|
|
2478
2599
|
));
|
|
2479
2600
|
ActiveFilters.displayName = "ActiveFilters";
|
|
2480
|
-
var FilterBarActions =
|
|
2601
|
+
var FilterBarActions = React32.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx33(
|
|
2481
2602
|
"div",
|
|
2482
2603
|
{
|
|
2483
2604
|
ref,
|
|
@@ -2488,13 +2609,13 @@ var FilterBarActions = React31.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
2488
2609
|
FilterBarActions.displayName = "FilterBarActions";
|
|
2489
2610
|
|
|
2490
2611
|
// src/components/popover/popover.tsx
|
|
2491
|
-
import * as
|
|
2612
|
+
import * as React33 from "react";
|
|
2492
2613
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
2493
|
-
import { jsx as
|
|
2614
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
2494
2615
|
var Popover = PopoverPrimitive2.Root;
|
|
2495
2616
|
var PopoverTrigger = PopoverPrimitive2.Trigger;
|
|
2496
2617
|
var PopoverAnchor = PopoverPrimitive2.Anchor;
|
|
2497
|
-
var PopoverContent =
|
|
2618
|
+
var PopoverContent = React33.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx34(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx34(
|
|
2498
2619
|
PopoverPrimitive2.Content,
|
|
2499
2620
|
{
|
|
2500
2621
|
ref,
|
|
@@ -2514,16 +2635,16 @@ var PopoverContent = React32.forwardRef(({ className, align = "center", sideOffs
|
|
|
2514
2635
|
PopoverContent.displayName = "PopoverContent";
|
|
2515
2636
|
|
|
2516
2637
|
// src/components/dropdown-menu/dropdown-menu.tsx
|
|
2517
|
-
import * as
|
|
2638
|
+
import * as React34 from "react";
|
|
2518
2639
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
2519
|
-
import { jsx as
|
|
2640
|
+
import { jsx as jsx35, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2520
2641
|
var DropdownMenu = DropdownMenuPrimitive.Root;
|
|
2521
2642
|
var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
2522
2643
|
var DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
2523
2644
|
var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
2524
2645
|
var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
2525
2646
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
2526
|
-
var DropdownMenuContent =
|
|
2647
|
+
var DropdownMenuContent = React34.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx35(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx35(
|
|
2527
2648
|
DropdownMenuPrimitive.Content,
|
|
2528
2649
|
{
|
|
2529
2650
|
ref,
|
|
@@ -2540,7 +2661,7 @@ var DropdownMenuContent = React33.forwardRef(({ className, sideOffset = 4, ...pr
|
|
|
2540
2661
|
}
|
|
2541
2662
|
) }));
|
|
2542
2663
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
2543
|
-
var DropdownMenuSubTrigger =
|
|
2664
|
+
var DropdownMenuSubTrigger = React34.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
2544
2665
|
DropdownMenuPrimitive.SubTrigger,
|
|
2545
2666
|
{
|
|
2546
2667
|
ref,
|
|
@@ -2555,7 +2676,7 @@ var DropdownMenuSubTrigger = React33.forwardRef(({ className, inset, children, .
|
|
|
2555
2676
|
...props,
|
|
2556
2677
|
children: [
|
|
2557
2678
|
children,
|
|
2558
|
-
/* @__PURE__ */
|
|
2679
|
+
/* @__PURE__ */ jsx35(
|
|
2559
2680
|
"svg",
|
|
2560
2681
|
{
|
|
2561
2682
|
width: "14",
|
|
@@ -2567,14 +2688,14 @@ var DropdownMenuSubTrigger = React33.forwardRef(({ className, inset, children, .
|
|
|
2567
2688
|
strokeLinecap: "round",
|
|
2568
2689
|
strokeLinejoin: "round",
|
|
2569
2690
|
className: "ml-auto",
|
|
2570
|
-
children: /* @__PURE__ */
|
|
2691
|
+
children: /* @__PURE__ */ jsx35("path", { d: "m9 18 6-6-6-6" })
|
|
2571
2692
|
}
|
|
2572
2693
|
)
|
|
2573
2694
|
]
|
|
2574
2695
|
}
|
|
2575
2696
|
));
|
|
2576
2697
|
DropdownMenuSubTrigger.displayName = "DropdownMenuSubTrigger";
|
|
2577
|
-
var DropdownMenuSubContent =
|
|
2698
|
+
var DropdownMenuSubContent = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
2578
2699
|
DropdownMenuPrimitive.SubContent,
|
|
2579
2700
|
{
|
|
2580
2701
|
ref,
|
|
@@ -2589,7 +2710,7 @@ var DropdownMenuSubContent = React33.forwardRef(({ className, ...props }, ref) =
|
|
|
2589
2710
|
}
|
|
2590
2711
|
));
|
|
2591
2712
|
DropdownMenuSubContent.displayName = "DropdownMenuSubContent";
|
|
2592
|
-
var DropdownMenuItem =
|
|
2713
|
+
var DropdownMenuItem = React34.forwardRef(({ className, inset, destructive, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
2593
2714
|
DropdownMenuPrimitive.Item,
|
|
2594
2715
|
{
|
|
2595
2716
|
ref,
|
|
@@ -2606,7 +2727,7 @@ var DropdownMenuItem = React33.forwardRef(({ className, inset, destructive, ...p
|
|
|
2606
2727
|
}
|
|
2607
2728
|
));
|
|
2608
2729
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
2609
|
-
var DropdownMenuCheckboxItem =
|
|
2730
|
+
var DropdownMenuCheckboxItem = React34.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
2610
2731
|
DropdownMenuPrimitive.CheckboxItem,
|
|
2611
2732
|
{
|
|
2612
2733
|
ref,
|
|
@@ -2620,7 +2741,7 @@ var DropdownMenuCheckboxItem = React33.forwardRef(({ className, children, checke
|
|
|
2620
2741
|
checked,
|
|
2621
2742
|
...props,
|
|
2622
2743
|
children: [
|
|
2623
|
-
/* @__PURE__ */
|
|
2744
|
+
/* @__PURE__ */ jsx35("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx35(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx35(
|
|
2624
2745
|
"svg",
|
|
2625
2746
|
{
|
|
2626
2747
|
width: "14",
|
|
@@ -2631,7 +2752,7 @@ var DropdownMenuCheckboxItem = React33.forwardRef(({ className, children, checke
|
|
|
2631
2752
|
strokeWidth: "2",
|
|
2632
2753
|
strokeLinecap: "round",
|
|
2633
2754
|
strokeLinejoin: "round",
|
|
2634
|
-
children: /* @__PURE__ */
|
|
2755
|
+
children: /* @__PURE__ */ jsx35("polyline", { points: "20 6 9 17 4 12" })
|
|
2635
2756
|
}
|
|
2636
2757
|
) }) }),
|
|
2637
2758
|
children
|
|
@@ -2639,7 +2760,7 @@ var DropdownMenuCheckboxItem = React33.forwardRef(({ className, children, checke
|
|
|
2639
2760
|
}
|
|
2640
2761
|
));
|
|
2641
2762
|
DropdownMenuCheckboxItem.displayName = "DropdownMenuCheckboxItem";
|
|
2642
|
-
var DropdownMenuRadioItem =
|
|
2763
|
+
var DropdownMenuRadioItem = React34.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs16(
|
|
2643
2764
|
DropdownMenuPrimitive.RadioItem,
|
|
2644
2765
|
{
|
|
2645
2766
|
ref,
|
|
@@ -2652,13 +2773,13 @@ var DropdownMenuRadioItem = React33.forwardRef(({ className, children, ...props
|
|
|
2652
2773
|
),
|
|
2653
2774
|
...props,
|
|
2654
2775
|
children: [
|
|
2655
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ jsx35("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx35(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx35("svg", { width: "8", height: "8", viewBox: "0 0 8 8", fill: "currentColor", children: /* @__PURE__ */ jsx35("circle", { cx: "4", cy: "4", r: "4" }) }) }) }),
|
|
2656
2777
|
children
|
|
2657
2778
|
]
|
|
2658
2779
|
}
|
|
2659
2780
|
));
|
|
2660
2781
|
DropdownMenuRadioItem.displayName = "DropdownMenuRadioItem";
|
|
2661
|
-
var DropdownMenuLabel =
|
|
2782
|
+
var DropdownMenuLabel = React34.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
2662
2783
|
DropdownMenuPrimitive.Label,
|
|
2663
2784
|
{
|
|
2664
2785
|
ref,
|
|
@@ -2671,7 +2792,7 @@ var DropdownMenuLabel = React33.forwardRef(({ className, inset, ...props }, ref)
|
|
|
2671
2792
|
}
|
|
2672
2793
|
));
|
|
2673
2794
|
DropdownMenuLabel.displayName = "DropdownMenuLabel";
|
|
2674
|
-
var DropdownMenuSeparator =
|
|
2795
|
+
var DropdownMenuSeparator = React34.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx35(
|
|
2675
2796
|
DropdownMenuPrimitive.Separator,
|
|
2676
2797
|
{
|
|
2677
2798
|
ref,
|
|
@@ -2683,7 +2804,7 @@ DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
|
2683
2804
|
var DropdownMenuShortcut = ({
|
|
2684
2805
|
className,
|
|
2685
2806
|
...props
|
|
2686
|
-
}) => /* @__PURE__ */
|
|
2807
|
+
}) => /* @__PURE__ */ jsx35(
|
|
2687
2808
|
"span",
|
|
2688
2809
|
{
|
|
2689
2810
|
className: cn(
|
|
@@ -2696,13 +2817,13 @@ var DropdownMenuShortcut = ({
|
|
|
2696
2817
|
DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
2697
2818
|
|
|
2698
2819
|
// src/components/dialog/dialog.tsx
|
|
2699
|
-
import * as
|
|
2820
|
+
import * as React35 from "react";
|
|
2700
2821
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2701
|
-
import { jsx as
|
|
2822
|
+
import { jsx as jsx36, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2702
2823
|
var Dialog = DialogPrimitive.Root;
|
|
2703
2824
|
var DialogTrigger = DialogPrimitive.Trigger;
|
|
2704
2825
|
var DialogClose = DialogPrimitive.Close;
|
|
2705
|
-
var DialogOverlay =
|
|
2826
|
+
var DialogOverlay = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2706
2827
|
DialogPrimitive.Overlay,
|
|
2707
2828
|
{
|
|
2708
2829
|
ref,
|
|
@@ -2716,9 +2837,9 @@ var DialogOverlay = React34.forwardRef(({ className, ...props }, ref) => /* @__P
|
|
|
2716
2837
|
}
|
|
2717
2838
|
));
|
|
2718
2839
|
DialogOverlay.displayName = "DialogOverlay";
|
|
2719
|
-
var DialogContent =
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
-
/* @__PURE__ */
|
|
2840
|
+
var DialogContent = React35.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs17(DialogPrimitive.Portal, { children: [
|
|
2841
|
+
/* @__PURE__ */ jsx36(DialogOverlay, {}),
|
|
2842
|
+
/* @__PURE__ */ jsxs17(
|
|
2722
2843
|
DialogPrimitive.Content,
|
|
2723
2844
|
{
|
|
2724
2845
|
ref,
|
|
@@ -2740,8 +2861,8 @@ var DialogContent = React34.forwardRef(({ className, children, ...props }, ref)
|
|
|
2740
2861
|
...props,
|
|
2741
2862
|
children: [
|
|
2742
2863
|
children,
|
|
2743
|
-
/* @__PURE__ */
|
|
2744
|
-
/* @__PURE__ */
|
|
2864
|
+
/* @__PURE__ */ jsxs17(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 disabled:pointer-events-none", children: [
|
|
2865
|
+
/* @__PURE__ */ jsx36(
|
|
2745
2866
|
"svg",
|
|
2746
2867
|
{
|
|
2747
2868
|
width: "16",
|
|
@@ -2752,10 +2873,10 @@ var DialogContent = React34.forwardRef(({ className, children, ...props }, ref)
|
|
|
2752
2873
|
strokeWidth: "2",
|
|
2753
2874
|
strokeLinecap: "round",
|
|
2754
2875
|
strokeLinejoin: "round",
|
|
2755
|
-
children: /* @__PURE__ */
|
|
2876
|
+
children: /* @__PURE__ */ jsx36("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
2756
2877
|
}
|
|
2757
2878
|
),
|
|
2758
|
-
/* @__PURE__ */
|
|
2879
|
+
/* @__PURE__ */ jsx36("span", { className: "sr-only", children: "Close" })
|
|
2759
2880
|
] })
|
|
2760
2881
|
]
|
|
2761
2882
|
}
|
|
@@ -2765,7 +2886,7 @@ DialogContent.displayName = "DialogContent";
|
|
|
2765
2886
|
var DialogHeader = ({
|
|
2766
2887
|
className,
|
|
2767
2888
|
...props
|
|
2768
|
-
}) => /* @__PURE__ */
|
|
2889
|
+
}) => /* @__PURE__ */ jsx36(
|
|
2769
2890
|
"div",
|
|
2770
2891
|
{
|
|
2771
2892
|
className: cn("flex flex-col gap-1.5 text-center sm:text-left", className),
|
|
@@ -2776,7 +2897,7 @@ DialogHeader.displayName = "DialogHeader";
|
|
|
2776
2897
|
var DialogFooter = ({
|
|
2777
2898
|
className,
|
|
2778
2899
|
...props
|
|
2779
|
-
}) => /* @__PURE__ */
|
|
2900
|
+
}) => /* @__PURE__ */ jsx36(
|
|
2780
2901
|
"div",
|
|
2781
2902
|
{
|
|
2782
2903
|
className: cn(
|
|
@@ -2787,7 +2908,7 @@ var DialogFooter = ({
|
|
|
2787
2908
|
}
|
|
2788
2909
|
);
|
|
2789
2910
|
DialogFooter.displayName = "DialogFooter";
|
|
2790
|
-
var DialogTitle =
|
|
2911
|
+
var DialogTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2791
2912
|
DialogPrimitive.Title,
|
|
2792
2913
|
{
|
|
2793
2914
|
ref,
|
|
@@ -2796,7 +2917,7 @@ var DialogTitle = React34.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
2796
2917
|
}
|
|
2797
2918
|
));
|
|
2798
2919
|
DialogTitle.displayName = "DialogTitle";
|
|
2799
|
-
var DialogDescription =
|
|
2920
|
+
var DialogDescription = React35.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx36(
|
|
2800
2921
|
DialogPrimitive.Description,
|
|
2801
2922
|
{
|
|
2802
2923
|
ref,
|
|
@@ -2809,7 +2930,7 @@ DialogDescription.displayName = "DialogDescription";
|
|
|
2809
2930
|
// src/components/command-palette/command-palette.tsx
|
|
2810
2931
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
2811
2932
|
import { Command as Command2 } from "cmdk";
|
|
2812
|
-
import { jsx as
|
|
2933
|
+
import { jsx as jsx37, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2813
2934
|
function CommandPalette({
|
|
2814
2935
|
open,
|
|
2815
2936
|
onOpenChange,
|
|
@@ -2817,9 +2938,9 @@ function CommandPalette({
|
|
|
2817
2938
|
className,
|
|
2818
2939
|
children
|
|
2819
2940
|
}) {
|
|
2820
|
-
return /* @__PURE__ */
|
|
2821
|
-
/* @__PURE__ */
|
|
2822
|
-
/* @__PURE__ */
|
|
2941
|
+
return /* @__PURE__ */ jsx37(DialogPrimitive2.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs18(DialogPrimitive2.Portal, { children: [
|
|
2942
|
+
/* @__PURE__ */ jsx37(DialogPrimitive2.Overlay, { className: "fixed inset-0 z-modal bg-[var(--color-surface-overlay)] animate-in fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0" }),
|
|
2943
|
+
/* @__PURE__ */ jsx37(
|
|
2823
2944
|
DialogPrimitive2.Content,
|
|
2824
2945
|
{
|
|
2825
2946
|
className: cn(
|
|
@@ -2828,9 +2949,9 @@ function CommandPalette({
|
|
|
2828
2949
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
2829
2950
|
className
|
|
2830
2951
|
),
|
|
2831
|
-
children: /* @__PURE__ */
|
|
2832
|
-
/* @__PURE__ */
|
|
2833
|
-
/* @__PURE__ */
|
|
2952
|
+
children: /* @__PURE__ */ jsxs18(Command2, { shouldFilter: true, className: "flex flex-col", children: [
|
|
2953
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center border-b border-[var(--color-border)] px-4", children: [
|
|
2954
|
+
/* @__PURE__ */ jsxs18(
|
|
2834
2955
|
"svg",
|
|
2835
2956
|
{
|
|
2836
2957
|
width: "18",
|
|
@@ -2843,12 +2964,12 @@ function CommandPalette({
|
|
|
2843
2964
|
strokeLinejoin: "round",
|
|
2844
2965
|
className: "shrink-0 text-[var(--color-on-surface-muted)]",
|
|
2845
2966
|
children: [
|
|
2846
|
-
/* @__PURE__ */
|
|
2847
|
-
/* @__PURE__ */
|
|
2967
|
+
/* @__PURE__ */ jsx37("circle", { cx: "11", cy: "11", r: "8" }),
|
|
2968
|
+
/* @__PURE__ */ jsx37("path", { d: "m21 21-4.3-4.3" })
|
|
2848
2969
|
]
|
|
2849
2970
|
}
|
|
2850
2971
|
),
|
|
2851
|
-
/* @__PURE__ */
|
|
2972
|
+
/* @__PURE__ */ jsx37(
|
|
2852
2973
|
Command2.Input,
|
|
2853
2974
|
{
|
|
2854
2975
|
placeholder,
|
|
@@ -2856,7 +2977,7 @@ function CommandPalette({
|
|
|
2856
2977
|
}
|
|
2857
2978
|
)
|
|
2858
2979
|
] }),
|
|
2859
|
-
/* @__PURE__ */
|
|
2980
|
+
/* @__PURE__ */ jsx37(Command2.List, { className: "max-h-80 overflow-auto p-2", children })
|
|
2860
2981
|
] })
|
|
2861
2982
|
}
|
|
2862
2983
|
)
|
|
@@ -2867,7 +2988,7 @@ function CommandPaletteGroup({
|
|
|
2867
2988
|
heading,
|
|
2868
2989
|
children
|
|
2869
2990
|
}) {
|
|
2870
|
-
return /* @__PURE__ */
|
|
2991
|
+
return /* @__PURE__ */ jsx37(
|
|
2871
2992
|
Command2.Group,
|
|
2872
2993
|
{
|
|
2873
2994
|
heading,
|
|
@@ -2885,7 +3006,7 @@ function CommandPaletteItem({
|
|
|
2885
3006
|
className,
|
|
2886
3007
|
children
|
|
2887
3008
|
}) {
|
|
2888
|
-
return /* @__PURE__ */
|
|
3009
|
+
return /* @__PURE__ */ jsxs18(
|
|
2889
3010
|
Command2.Item,
|
|
2890
3011
|
{
|
|
2891
3012
|
onSelect,
|
|
@@ -2897,9 +3018,9 @@ function CommandPaletteItem({
|
|
|
2897
3018
|
className
|
|
2898
3019
|
),
|
|
2899
3020
|
children: [
|
|
2900
|
-
icon && /* @__PURE__ */
|
|
2901
|
-
/* @__PURE__ */
|
|
2902
|
-
shortcut && /* @__PURE__ */
|
|
3021
|
+
icon && /* @__PURE__ */ jsx37("span", { className: "mr-2 flex h-4 w-4 items-center justify-center text-[var(--color-on-surface-muted)]", children: icon }),
|
|
3022
|
+
/* @__PURE__ */ jsx37("span", { className: "flex-1", children }),
|
|
3023
|
+
shortcut && /* @__PURE__ */ jsx37(CommandPaletteShortcut, { children: shortcut })
|
|
2903
3024
|
]
|
|
2904
3025
|
}
|
|
2905
3026
|
);
|
|
@@ -2909,7 +3030,7 @@ function CommandPaletteSeparator({
|
|
|
2909
3030
|
className,
|
|
2910
3031
|
...props
|
|
2911
3032
|
}) {
|
|
2912
|
-
return /* @__PURE__ */
|
|
3033
|
+
return /* @__PURE__ */ jsx37(
|
|
2913
3034
|
Command2.Separator,
|
|
2914
3035
|
{
|
|
2915
3036
|
className: cn("-mx-1 my-1 h-px bg-[var(--color-border)]", className),
|
|
@@ -2923,7 +3044,7 @@ function CommandPaletteEmpty({
|
|
|
2923
3044
|
children = "No results found.",
|
|
2924
3045
|
...props
|
|
2925
3046
|
}) {
|
|
2926
|
-
return /* @__PURE__ */
|
|
3047
|
+
return /* @__PURE__ */ jsx37(
|
|
2927
3048
|
Command2.Empty,
|
|
2928
3049
|
{
|
|
2929
3050
|
className: cn("px-2 py-6 text-center text-sm text-[var(--color-on-surface-muted)]", className),
|
|
@@ -2937,7 +3058,7 @@ function CommandPaletteShortcut({
|
|
|
2937
3058
|
className,
|
|
2938
3059
|
...props
|
|
2939
3060
|
}) {
|
|
2940
|
-
return /* @__PURE__ */
|
|
3061
|
+
return /* @__PURE__ */ jsx37(
|
|
2941
3062
|
"span",
|
|
2942
3063
|
{
|
|
2943
3064
|
className: cn(
|
|
@@ -2951,32 +3072,32 @@ function CommandPaletteShortcut({
|
|
|
2951
3072
|
CommandPaletteShortcut.displayName = "CommandPaletteShortcut";
|
|
2952
3073
|
|
|
2953
3074
|
// src/components/drawer/drawer.tsx
|
|
2954
|
-
import * as
|
|
3075
|
+
import * as React36 from "react";
|
|
2955
3076
|
import * as DialogPrimitive3 from "@radix-ui/react-dialog";
|
|
2956
3077
|
import { cva as cva14 } from "class-variance-authority";
|
|
2957
|
-
import { jsx as
|
|
3078
|
+
import { jsx as jsx38, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2958
3079
|
var [DrawerContextProvider, useDrawerContext] = createContext2("Drawer");
|
|
2959
|
-
var DrawerStackContext =
|
|
3080
|
+
var DrawerStackContext = React36.createContext(
|
|
2960
3081
|
null
|
|
2961
3082
|
);
|
|
2962
3083
|
function DrawerProvider({ children }) {
|
|
2963
|
-
const stackRef =
|
|
2964
|
-
const [, forceUpdate] =
|
|
2965
|
-
const register =
|
|
3084
|
+
const stackRef = React36.useRef([]);
|
|
3085
|
+
const [, forceUpdate] = React36.useState(0);
|
|
3086
|
+
const register = React36.useCallback((id) => {
|
|
2966
3087
|
const level = stackRef.current.length;
|
|
2967
3088
|
stackRef.current = [...stackRef.current, { id, level }];
|
|
2968
3089
|
forceUpdate((n) => n + 1);
|
|
2969
3090
|
return level;
|
|
2970
3091
|
}, []);
|
|
2971
|
-
const unregister =
|
|
3092
|
+
const unregister = React36.useCallback((id) => {
|
|
2972
3093
|
stackRef.current = stackRef.current.filter((e) => e.id !== id);
|
|
2973
3094
|
forceUpdate((n) => n + 1);
|
|
2974
3095
|
}, []);
|
|
2975
|
-
const ctx =
|
|
3096
|
+
const ctx = React36.useMemo(
|
|
2976
3097
|
() => ({ stack: stackRef.current, register, unregister }),
|
|
2977
3098
|
[register, unregister]
|
|
2978
3099
|
);
|
|
2979
|
-
return /* @__PURE__ */
|
|
3100
|
+
return /* @__PURE__ */ jsx38(DrawerStackContext.Provider, { value: ctx, children });
|
|
2980
3101
|
}
|
|
2981
3102
|
DrawerProvider.displayName = "DrawerProvider";
|
|
2982
3103
|
function Drawer({
|
|
@@ -2988,7 +3109,7 @@ function Drawer({
|
|
|
2988
3109
|
onPinnedChange,
|
|
2989
3110
|
children
|
|
2990
3111
|
}) {
|
|
2991
|
-
return /* @__PURE__ */
|
|
3112
|
+
return /* @__PURE__ */ jsx38(DrawerContextProvider, { value: { side, pinnable, pinned, onPinnedChange }, children: /* @__PURE__ */ jsx38(DialogPrimitive3.Root, { open, onOpenChange, children }) });
|
|
2992
3113
|
}
|
|
2993
3114
|
Drawer.displayName = "Drawer";
|
|
2994
3115
|
var DrawerTrigger = DialogPrimitive3.Trigger;
|
|
@@ -3005,12 +3126,12 @@ var drawerSizeVariants = cva14("", {
|
|
|
3005
3126
|
},
|
|
3006
3127
|
defaultVariants: { size: "md" }
|
|
3007
3128
|
});
|
|
3008
|
-
var DrawerContent =
|
|
3129
|
+
var DrawerContent = React36.forwardRef(({ className, size, children, ...props }, ref) => {
|
|
3009
3130
|
const { side, pinned } = useDrawerContext();
|
|
3010
|
-
const stackCtx =
|
|
3011
|
-
const drawerId =
|
|
3012
|
-
const [level, setLevel] =
|
|
3013
|
-
|
|
3131
|
+
const stackCtx = React36.useContext(DrawerStackContext);
|
|
3132
|
+
const drawerId = React36.useId();
|
|
3133
|
+
const [level, setLevel] = React36.useState(0);
|
|
3134
|
+
React36.useEffect(() => {
|
|
3014
3135
|
if (stackCtx) {
|
|
3015
3136
|
const l = stackCtx.register(drawerId);
|
|
3016
3137
|
setLevel(l);
|
|
@@ -3019,7 +3140,7 @@ var DrawerContent = React35.forwardRef(({ className, size, children, ...props },
|
|
|
3019
3140
|
}, [stackCtx, drawerId]);
|
|
3020
3141
|
const stackOffset = stackCtx ? level * 2 : 0;
|
|
3021
3142
|
if (pinned) {
|
|
3022
|
-
return /* @__PURE__ */
|
|
3143
|
+
return /* @__PURE__ */ jsx38(
|
|
3023
3144
|
"div",
|
|
3024
3145
|
{
|
|
3025
3146
|
className: cn(
|
|
@@ -3032,8 +3153,8 @@ var DrawerContent = React35.forwardRef(({ className, size, children, ...props },
|
|
|
3032
3153
|
}
|
|
3033
3154
|
);
|
|
3034
3155
|
}
|
|
3035
|
-
return /* @__PURE__ */
|
|
3036
|
-
/* @__PURE__ */
|
|
3156
|
+
return /* @__PURE__ */ jsxs19(DialogPrimitive3.Portal, { children: [
|
|
3157
|
+
/* @__PURE__ */ jsx38(
|
|
3037
3158
|
DialogPrimitive3.Overlay,
|
|
3038
3159
|
{
|
|
3039
3160
|
className: cn(
|
|
@@ -3044,7 +3165,7 @@ var DrawerContent = React35.forwardRef(({ className, size, children, ...props },
|
|
|
3044
3165
|
style: { zIndex: 200 + stackOffset }
|
|
3045
3166
|
}
|
|
3046
3167
|
),
|
|
3047
|
-
/* @__PURE__ */
|
|
3168
|
+
/* @__PURE__ */ jsx38(
|
|
3048
3169
|
DialogPrimitive3.Content,
|
|
3049
3170
|
{
|
|
3050
3171
|
ref,
|
|
@@ -3058,15 +3179,15 @@ var DrawerContent = React35.forwardRef(({ className, size, children, ...props },
|
|
|
3058
3179
|
),
|
|
3059
3180
|
style: { zIndex: 201 + stackOffset },
|
|
3060
3181
|
...props,
|
|
3061
|
-
children: /* @__PURE__ */
|
|
3182
|
+
children: /* @__PURE__ */ jsx38("div", { className: "flex h-full flex-col", children })
|
|
3062
3183
|
}
|
|
3063
3184
|
)
|
|
3064
3185
|
] });
|
|
3065
3186
|
});
|
|
3066
3187
|
DrawerContent.displayName = "DrawerContent";
|
|
3067
|
-
var DrawerHeader =
|
|
3188
|
+
var DrawerHeader = React36.forwardRef(({ className, ...props }, ref) => {
|
|
3068
3189
|
const { pinnable, pinned, onPinnedChange } = useDrawerContext();
|
|
3069
|
-
return /* @__PURE__ */
|
|
3190
|
+
return /* @__PURE__ */ jsxs19(
|
|
3070
3191
|
"div",
|
|
3071
3192
|
{
|
|
3072
3193
|
ref,
|
|
@@ -3076,9 +3197,9 @@ var DrawerHeader = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
3076
3197
|
),
|
|
3077
3198
|
...props,
|
|
3078
3199
|
children: [
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
/* @__PURE__ */
|
|
3081
|
-
pinnable && /* @__PURE__ */
|
|
3200
|
+
/* @__PURE__ */ jsx38("div", { className: "flex-1", children: props.children }),
|
|
3201
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1", children: [
|
|
3202
|
+
pinnable && /* @__PURE__ */ jsx38(
|
|
3082
3203
|
"button",
|
|
3083
3204
|
{
|
|
3084
3205
|
type: "button",
|
|
@@ -3088,7 +3209,7 @@ var DrawerHeader = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
3088
3209
|
pinned ? "opacity-100 text-primary-500" : "opacity-50"
|
|
3089
3210
|
),
|
|
3090
3211
|
"aria-label": pinned ? "Unpin drawer" : "Pin drawer",
|
|
3091
|
-
children: /* @__PURE__ */
|
|
3212
|
+
children: /* @__PURE__ */ jsx38(
|
|
3092
3213
|
"svg",
|
|
3093
3214
|
{
|
|
3094
3215
|
width: "16",
|
|
@@ -3099,13 +3220,13 @@ var DrawerHeader = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
3099
3220
|
strokeWidth: "2",
|
|
3100
3221
|
strokeLinecap: "round",
|
|
3101
3222
|
strokeLinejoin: "round",
|
|
3102
|
-
children: /* @__PURE__ */
|
|
3223
|
+
children: /* @__PURE__ */ jsx38("path", { d: "M12 17v5M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1 1 1 0 0 1 1 1z" })
|
|
3103
3224
|
}
|
|
3104
3225
|
)
|
|
3105
3226
|
}
|
|
3106
3227
|
),
|
|
3107
|
-
/* @__PURE__ */
|
|
3108
|
-
/* @__PURE__ */
|
|
3228
|
+
/* @__PURE__ */ jsxs19(DialogPrimitive3.Close, { className: "rounded-sm p-1 opacity-50 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500", children: [
|
|
3229
|
+
/* @__PURE__ */ jsx38(
|
|
3109
3230
|
"svg",
|
|
3110
3231
|
{
|
|
3111
3232
|
width: "16",
|
|
@@ -3116,10 +3237,10 @@ var DrawerHeader = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
3116
3237
|
strokeWidth: "2",
|
|
3117
3238
|
strokeLinecap: "round",
|
|
3118
3239
|
strokeLinejoin: "round",
|
|
3119
|
-
children: /* @__PURE__ */
|
|
3240
|
+
children: /* @__PURE__ */ jsx38("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
3120
3241
|
}
|
|
3121
3242
|
),
|
|
3122
|
-
/* @__PURE__ */
|
|
3243
|
+
/* @__PURE__ */ jsx38("span", { className: "sr-only", children: "Close" })
|
|
3123
3244
|
] })
|
|
3124
3245
|
] })
|
|
3125
3246
|
]
|
|
@@ -3127,7 +3248,7 @@ var DrawerHeader = React35.forwardRef(({ className, ...props }, ref) => {
|
|
|
3127
3248
|
);
|
|
3128
3249
|
});
|
|
3129
3250
|
DrawerHeader.displayName = "DrawerHeader";
|
|
3130
|
-
var DrawerTitle =
|
|
3251
|
+
var DrawerTitle = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3131
3252
|
DialogPrimitive3.Title,
|
|
3132
3253
|
{
|
|
3133
3254
|
ref,
|
|
@@ -3136,7 +3257,7 @@ var DrawerTitle = React35.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
3136
3257
|
}
|
|
3137
3258
|
));
|
|
3138
3259
|
DrawerTitle.displayName = "DrawerTitle";
|
|
3139
|
-
var DrawerDescription =
|
|
3260
|
+
var DrawerDescription = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3140
3261
|
DialogPrimitive3.Description,
|
|
3141
3262
|
{
|
|
3142
3263
|
ref,
|
|
@@ -3145,7 +3266,7 @@ var DrawerDescription = React35.forwardRef(({ className, ...props }, ref) => /*
|
|
|
3145
3266
|
}
|
|
3146
3267
|
));
|
|
3147
3268
|
DrawerDescription.displayName = "DrawerDescription";
|
|
3148
|
-
var DrawerFooter =
|
|
3269
|
+
var DrawerFooter = React36.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx38(
|
|
3149
3270
|
"div",
|
|
3150
3271
|
{
|
|
3151
3272
|
ref,
|
|
@@ -3159,10 +3280,10 @@ var DrawerFooter = React35.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
3159
3280
|
DrawerFooter.displayName = "DrawerFooter";
|
|
3160
3281
|
|
|
3161
3282
|
// src/components/app-shell/app-shell.tsx
|
|
3162
|
-
import * as
|
|
3163
|
-
import { jsx as
|
|
3283
|
+
import * as React37 from "react";
|
|
3284
|
+
import { jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3164
3285
|
var [AppShellProvider, useAppShell] = createContext2("AppShell");
|
|
3165
|
-
var AppShell =
|
|
3286
|
+
var AppShell = React37.forwardRef(
|
|
3166
3287
|
({
|
|
3167
3288
|
className,
|
|
3168
3289
|
sidebarCollapsed: controlledCollapsed,
|
|
@@ -3174,11 +3295,11 @@ var AppShell = React36.forwardRef(
|
|
|
3174
3295
|
...props
|
|
3175
3296
|
}, ref) => {
|
|
3176
3297
|
const { isMobile } = useBreakpoint();
|
|
3177
|
-
const [internalCollapsed, setInternalCollapsed] =
|
|
3178
|
-
const [mobileSidebarOpen, setMobileSidebarOpen] =
|
|
3298
|
+
const [internalCollapsed, setInternalCollapsed] = React37.useState(false);
|
|
3299
|
+
const [mobileSidebarOpen, setMobileSidebarOpen] = React37.useState(false);
|
|
3179
3300
|
const collapsed = controlledCollapsed ?? internalCollapsed;
|
|
3180
3301
|
const setCollapsed = onSidebarCollapsedChange ?? setInternalCollapsed;
|
|
3181
|
-
return /* @__PURE__ */
|
|
3302
|
+
return /* @__PURE__ */ jsx39(
|
|
3182
3303
|
AppShellProvider,
|
|
3183
3304
|
{
|
|
3184
3305
|
value: {
|
|
@@ -3189,7 +3310,7 @@ var AppShell = React36.forwardRef(
|
|
|
3189
3310
|
mobileSidebarOpen,
|
|
3190
3311
|
setMobileSidebarOpen
|
|
3191
3312
|
},
|
|
3192
|
-
children: /* @__PURE__ */
|
|
3313
|
+
children: /* @__PURE__ */ jsx39(
|
|
3193
3314
|
"div",
|
|
3194
3315
|
{
|
|
3195
3316
|
ref,
|
|
@@ -3207,20 +3328,20 @@ var AppShell = React36.forwardRef(
|
|
|
3207
3328
|
}
|
|
3208
3329
|
);
|
|
3209
3330
|
AppShell.displayName = "AppShell";
|
|
3210
|
-
var AppShellSidebar =
|
|
3331
|
+
var AppShellSidebar = React37.forwardRef(({ className, children, ...props }, ref) => {
|
|
3211
3332
|
const { sidebarCollapsed, isMobile, mobileSidebarOpen, setMobileSidebarOpen } = useAppShell();
|
|
3212
3333
|
if (isMobile) {
|
|
3213
|
-
return /* @__PURE__ */
|
|
3334
|
+
return /* @__PURE__ */ jsx39(
|
|
3214
3335
|
Drawer,
|
|
3215
3336
|
{
|
|
3216
3337
|
open: mobileSidebarOpen,
|
|
3217
3338
|
onOpenChange: setMobileSidebarOpen,
|
|
3218
3339
|
side: "left",
|
|
3219
|
-
children: /* @__PURE__ */
|
|
3340
|
+
children: /* @__PURE__ */ jsx39(DrawerContent, { size: "sm", className, children })
|
|
3220
3341
|
}
|
|
3221
3342
|
);
|
|
3222
3343
|
}
|
|
3223
|
-
return /* @__PURE__ */
|
|
3344
|
+
return /* @__PURE__ */ jsx39(
|
|
3224
3345
|
"aside",
|
|
3225
3346
|
{
|
|
3226
3347
|
ref,
|
|
@@ -3237,9 +3358,9 @@ var AppShellSidebar = React36.forwardRef(({ className, children, ...props }, ref
|
|
|
3237
3358
|
);
|
|
3238
3359
|
});
|
|
3239
3360
|
AppShellSidebar.displayName = "AppShellSidebar";
|
|
3240
|
-
var AppShellHeader =
|
|
3361
|
+
var AppShellHeader = React37.forwardRef(({ className, children, ...props }, ref) => {
|
|
3241
3362
|
const { isMobile, setMobileSidebarOpen } = useAppShell();
|
|
3242
|
-
return /* @__PURE__ */
|
|
3363
|
+
return /* @__PURE__ */ jsxs20(
|
|
3243
3364
|
"header",
|
|
3244
3365
|
{
|
|
3245
3366
|
ref,
|
|
@@ -3249,14 +3370,14 @@ var AppShellHeader = React36.forwardRef(({ className, children, ...props }, ref)
|
|
|
3249
3370
|
),
|
|
3250
3371
|
...props,
|
|
3251
3372
|
children: [
|
|
3252
|
-
isMobile && /* @__PURE__ */
|
|
3373
|
+
isMobile && /* @__PURE__ */ jsx39(
|
|
3253
3374
|
"button",
|
|
3254
3375
|
{
|
|
3255
3376
|
type: "button",
|
|
3256
3377
|
onClick: () => setMobileSidebarOpen(true),
|
|
3257
3378
|
className: "rounded-md p-1.5 hover:bg-[var(--color-surface-muted)] transition-colors touch:min-h-[--touch-target-min] touch:min-w-[--touch-target-min] flex items-center justify-center",
|
|
3258
3379
|
"aria-label": "Open menu",
|
|
3259
|
-
children: /* @__PURE__ */
|
|
3380
|
+
children: /* @__PURE__ */ jsx39(
|
|
3260
3381
|
"svg",
|
|
3261
3382
|
{
|
|
3262
3383
|
width: "20",
|
|
@@ -3267,7 +3388,7 @@ var AppShellHeader = React36.forwardRef(({ className, children, ...props }, ref)
|
|
|
3267
3388
|
strokeWidth: "2",
|
|
3268
3389
|
strokeLinecap: "round",
|
|
3269
3390
|
strokeLinejoin: "round",
|
|
3270
|
-
children: /* @__PURE__ */
|
|
3391
|
+
children: /* @__PURE__ */ jsx39("path", { d: "M4 6h16M4 12h16M4 18h16" })
|
|
3271
3392
|
}
|
|
3272
3393
|
)
|
|
3273
3394
|
}
|
|
@@ -3278,9 +3399,9 @@ var AppShellHeader = React36.forwardRef(({ className, children, ...props }, ref)
|
|
|
3278
3399
|
);
|
|
3279
3400
|
});
|
|
3280
3401
|
AppShellHeader.displayName = "AppShellHeader";
|
|
3281
|
-
var AppShellContent =
|
|
3402
|
+
var AppShellContent = React37.forwardRef(({ className, ...props }, ref) => {
|
|
3282
3403
|
const { withBottomNav } = useAppShell();
|
|
3283
|
-
return /* @__PURE__ */
|
|
3404
|
+
return /* @__PURE__ */ jsx39(
|
|
3284
3405
|
"main",
|
|
3285
3406
|
{
|
|
3286
3407
|
ref,
|
|
@@ -3294,7 +3415,7 @@ var AppShellContent = React36.forwardRef(({ className, ...props }, ref) => {
|
|
|
3294
3415
|
);
|
|
3295
3416
|
});
|
|
3296
3417
|
AppShellContent.displayName = "AppShellContent";
|
|
3297
|
-
var AppShellFooter =
|
|
3418
|
+
var AppShellFooter = React37.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx39(
|
|
3298
3419
|
"footer",
|
|
3299
3420
|
{
|
|
3300
3421
|
ref,
|
|
@@ -3308,9 +3429,9 @@ var AppShellFooter = React36.forwardRef(({ className, ...props }, ref) => /* @__
|
|
|
3308
3429
|
AppShellFooter.displayName = "AppShellFooter";
|
|
3309
3430
|
|
|
3310
3431
|
// src/components/bottom-navigation/bottom-navigation.tsx
|
|
3311
|
-
import * as
|
|
3312
|
-
import { jsx as
|
|
3313
|
-
var BottomNavigation =
|
|
3432
|
+
import * as React38 from "react";
|
|
3433
|
+
import { jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3434
|
+
var BottomNavigation = React38.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx40(
|
|
3314
3435
|
"nav",
|
|
3315
3436
|
{
|
|
3316
3437
|
ref,
|
|
@@ -3323,7 +3444,7 @@ var BottomNavigation = React37.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
3323
3444
|
}
|
|
3324
3445
|
));
|
|
3325
3446
|
BottomNavigation.displayName = "BottomNavigation";
|
|
3326
|
-
var BottomNavigationItem =
|
|
3447
|
+
var BottomNavigationItem = React38.forwardRef(({ className, icon, label, active = false, ...props }, ref) => /* @__PURE__ */ jsxs21(
|
|
3327
3448
|
"button",
|
|
3328
3449
|
{
|
|
3329
3450
|
ref,
|
|
@@ -3335,17 +3456,17 @@ var BottomNavigationItem = React37.forwardRef(({ className, icon, label, active
|
|
|
3335
3456
|
"aria-current": active ? "page" : void 0,
|
|
3336
3457
|
...props,
|
|
3337
3458
|
children: [
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3459
|
+
/* @__PURE__ */ jsx40("span", { className: "flex h-6 w-6 items-center justify-center", children: icon }),
|
|
3460
|
+
/* @__PURE__ */ jsx40("span", { children: label })
|
|
3340
3461
|
]
|
|
3341
3462
|
}
|
|
3342
3463
|
));
|
|
3343
3464
|
BottomNavigationItem.displayName = "BottomNavigationItem";
|
|
3344
3465
|
|
|
3345
3466
|
// src/components/offline-indicator/offline-indicator.tsx
|
|
3346
|
-
import * as
|
|
3347
|
-
import { jsx as
|
|
3348
|
-
var OfflineIndicator =
|
|
3467
|
+
import * as React39 from "react";
|
|
3468
|
+
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3469
|
+
var OfflineIndicator = React39.forwardRef(
|
|
3349
3470
|
({
|
|
3350
3471
|
className,
|
|
3351
3472
|
isOffline,
|
|
@@ -3353,7 +3474,7 @@ var OfflineIndicator = React38.forwardRef(
|
|
|
3353
3474
|
...props
|
|
3354
3475
|
}, ref) => {
|
|
3355
3476
|
if (!isOffline) return null;
|
|
3356
|
-
return /* @__PURE__ */
|
|
3477
|
+
return /* @__PURE__ */ jsxs22(
|
|
3357
3478
|
"div",
|
|
3358
3479
|
{
|
|
3359
3480
|
ref,
|
|
@@ -3364,7 +3485,7 @@ var OfflineIndicator = React38.forwardRef(
|
|
|
3364
3485
|
),
|
|
3365
3486
|
...props,
|
|
3366
3487
|
children: [
|
|
3367
|
-
/* @__PURE__ */
|
|
3488
|
+
/* @__PURE__ */ jsxs22(
|
|
3368
3489
|
"svg",
|
|
3369
3490
|
{
|
|
3370
3491
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3379,13 +3500,13 @@ var OfflineIndicator = React38.forwardRef(
|
|
|
3379
3500
|
className: "mr-2 shrink-0",
|
|
3380
3501
|
"aria-hidden": "true",
|
|
3381
3502
|
children: [
|
|
3382
|
-
/* @__PURE__ */
|
|
3383
|
-
/* @__PURE__ */
|
|
3384
|
-
/* @__PURE__ */
|
|
3385
|
-
/* @__PURE__ */
|
|
3386
|
-
/* @__PURE__ */
|
|
3387
|
-
/* @__PURE__ */
|
|
3388
|
-
/* @__PURE__ */
|
|
3503
|
+
/* @__PURE__ */ jsx41("line", { x1: "2", x2: "22", y1: "2", y2: "22" }),
|
|
3504
|
+
/* @__PURE__ */ jsx41("path", { d: "M8.5 16.5a5 5 0 0 1 7 0" }),
|
|
3505
|
+
/* @__PURE__ */ jsx41("path", { d: "M2 8.82a15 15 0 0 1 4.17-2.65" }),
|
|
3506
|
+
/* @__PURE__ */ jsx41("path", { d: "M10.66 5c4.01-.36 8.14.9 11.34 3.76" }),
|
|
3507
|
+
/* @__PURE__ */ jsx41("path", { d: "M16.85 11.25a10 10 0 0 1 2.22 1.68" }),
|
|
3508
|
+
/* @__PURE__ */ jsx41("path", { d: "M5 12.859a10 10 0 0 1 5.17-2.69" }),
|
|
3509
|
+
/* @__PURE__ */ jsx41("line", { x1: "12", x2: "12.01", y1: "20", y2: "20" })
|
|
3389
3510
|
]
|
|
3390
3511
|
}
|
|
3391
3512
|
),
|
|
@@ -3398,9 +3519,9 @@ var OfflineIndicator = React38.forwardRef(
|
|
|
3398
3519
|
OfflineIndicator.displayName = "OfflineIndicator";
|
|
3399
3520
|
|
|
3400
3521
|
// src/components/install-prompt/install-prompt.tsx
|
|
3401
|
-
import * as
|
|
3402
|
-
import { jsx as
|
|
3403
|
-
var InstallPrompt =
|
|
3522
|
+
import * as React40 from "react";
|
|
3523
|
+
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3524
|
+
var InstallPrompt = React40.forwardRef(
|
|
3404
3525
|
({
|
|
3405
3526
|
className,
|
|
3406
3527
|
canInstall,
|
|
@@ -3413,7 +3534,7 @@ var InstallPrompt = React39.forwardRef(
|
|
|
3413
3534
|
...props
|
|
3414
3535
|
}, ref) => {
|
|
3415
3536
|
if (!canInstall) return null;
|
|
3416
|
-
return /* @__PURE__ */
|
|
3537
|
+
return /* @__PURE__ */ jsx42(
|
|
3417
3538
|
"div",
|
|
3418
3539
|
{
|
|
3419
3540
|
ref,
|
|
@@ -3424,12 +3545,12 @@ var InstallPrompt = React39.forwardRef(
|
|
|
3424
3545
|
className
|
|
3425
3546
|
),
|
|
3426
3547
|
...props,
|
|
3427
|
-
children: /* @__PURE__ */
|
|
3428
|
-
/* @__PURE__ */
|
|
3429
|
-
/* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3548
|
+
children: /* @__PURE__ */ jsxs23("div", { className: "mx-auto max-w-md", children: [
|
|
3549
|
+
/* @__PURE__ */ jsx42("p", { className: "text-sm font-semibold text-[var(--color-on-surface)]", children: title }),
|
|
3550
|
+
/* @__PURE__ */ jsx42("p", { className: "mt-1 text-xs text-[var(--color-on-surface-muted)]", children: description }),
|
|
3551
|
+
/* @__PURE__ */ jsxs23("div", { className: "mt-3 flex gap-2", children: [
|
|
3552
|
+
/* @__PURE__ */ jsx42(Button, { size: "sm", onClick: onInstall, className: "flex-1", children: installLabel }),
|
|
3553
|
+
/* @__PURE__ */ jsx42(
|
|
3433
3554
|
Button,
|
|
3434
3555
|
{
|
|
3435
3556
|
size: "sm",
|
|
@@ -3448,16 +3569,16 @@ var InstallPrompt = React39.forwardRef(
|
|
|
3448
3569
|
InstallPrompt.displayName = "InstallPrompt";
|
|
3449
3570
|
|
|
3450
3571
|
// src/components/pull-to-refresh/pull-to-refresh.tsx
|
|
3451
|
-
import * as
|
|
3452
|
-
import { jsx as
|
|
3453
|
-
var PullToRefresh =
|
|
3572
|
+
import * as React41 from "react";
|
|
3573
|
+
import { jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3574
|
+
var PullToRefresh = React41.forwardRef(
|
|
3454
3575
|
({ className, onRefresh, threshold = 80, disabled = false, children, ...props }, ref) => {
|
|
3455
|
-
const [pullDistance, setPullDistance] =
|
|
3456
|
-
const [isRefreshing, setIsRefreshing] =
|
|
3457
|
-
const startYRef =
|
|
3458
|
-
const containerRef =
|
|
3459
|
-
|
|
3460
|
-
const handleTouchStart =
|
|
3576
|
+
const [pullDistance, setPullDistance] = React41.useState(0);
|
|
3577
|
+
const [isRefreshing, setIsRefreshing] = React41.useState(false);
|
|
3578
|
+
const startYRef = React41.useRef(0);
|
|
3579
|
+
const containerRef = React41.useRef(null);
|
|
3580
|
+
React41.useImperativeHandle(ref, () => containerRef.current);
|
|
3581
|
+
const handleTouchStart = React41.useCallback(
|
|
3461
3582
|
(e) => {
|
|
3462
3583
|
if (disabled || isRefreshing) return;
|
|
3463
3584
|
const container = containerRef.current;
|
|
@@ -3467,7 +3588,7 @@ var PullToRefresh = React40.forwardRef(
|
|
|
3467
3588
|
},
|
|
3468
3589
|
[disabled, isRefreshing]
|
|
3469
3590
|
);
|
|
3470
|
-
const handleTouchMove =
|
|
3591
|
+
const handleTouchMove = React41.useCallback(
|
|
3471
3592
|
(e) => {
|
|
3472
3593
|
if (disabled || isRefreshing || startYRef.current === 0) return;
|
|
3473
3594
|
const distance = Math.max(
|
|
@@ -3480,7 +3601,7 @@ var PullToRefresh = React40.forwardRef(
|
|
|
3480
3601
|
},
|
|
3481
3602
|
[disabled, isRefreshing, threshold]
|
|
3482
3603
|
);
|
|
3483
|
-
const handleTouchEnd =
|
|
3604
|
+
const handleTouchEnd = React41.useCallback(async () => {
|
|
3484
3605
|
if (disabled || isRefreshing) return;
|
|
3485
3606
|
if (pullDistance >= threshold) {
|
|
3486
3607
|
setIsRefreshing(true);
|
|
@@ -3495,7 +3616,7 @@ var PullToRefresh = React40.forwardRef(
|
|
|
3495
3616
|
}, [disabled, isRefreshing, pullDistance, threshold, onRefresh]);
|
|
3496
3617
|
const indicatorOpacity = Math.min(pullDistance / threshold, 1);
|
|
3497
3618
|
const shouldTrigger = pullDistance >= threshold;
|
|
3498
|
-
return /* @__PURE__ */
|
|
3619
|
+
return /* @__PURE__ */ jsxs24(
|
|
3499
3620
|
"div",
|
|
3500
3621
|
{
|
|
3501
3622
|
ref: containerRef,
|
|
@@ -3505,18 +3626,18 @@ var PullToRefresh = React40.forwardRef(
|
|
|
3505
3626
|
onTouchEnd: handleTouchEnd,
|
|
3506
3627
|
...props,
|
|
3507
3628
|
children: [
|
|
3508
|
-
/* @__PURE__ */
|
|
3629
|
+
/* @__PURE__ */ jsx43(
|
|
3509
3630
|
"div",
|
|
3510
3631
|
{
|
|
3511
3632
|
className: "flex items-center justify-center overflow-hidden transition-[height] duration-normal",
|
|
3512
3633
|
style: { height: isRefreshing ? threshold * 0.6 : pullDistance },
|
|
3513
3634
|
"aria-hidden": "true",
|
|
3514
|
-
children: /* @__PURE__ */
|
|
3635
|
+
children: /* @__PURE__ */ jsx43(
|
|
3515
3636
|
"div",
|
|
3516
3637
|
{
|
|
3517
3638
|
className: "transition-opacity",
|
|
3518
3639
|
style: { opacity: isRefreshing ? 1 : indicatorOpacity },
|
|
3519
|
-
children: isRefreshing ? /* @__PURE__ */
|
|
3640
|
+
children: isRefreshing ? /* @__PURE__ */ jsx43(Spinner, { size: "sm" }) : /* @__PURE__ */ jsxs24(
|
|
3520
3641
|
"svg",
|
|
3521
3642
|
{
|
|
3522
3643
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3533,8 +3654,8 @@ var PullToRefresh = React40.forwardRef(
|
|
|
3533
3654
|
shouldTrigger && "rotate-180 text-primary-500"
|
|
3534
3655
|
),
|
|
3535
3656
|
children: [
|
|
3536
|
-
/* @__PURE__ */
|
|
3537
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ jsx43("path", { d: "M12 5v14" }),
|
|
3658
|
+
/* @__PURE__ */ jsx43("path", { d: "m19 12-7 7-7-7" })
|
|
3538
3659
|
]
|
|
3539
3660
|
}
|
|
3540
3661
|
)
|
|
@@ -3558,7 +3679,9 @@ export {
|
|
|
3558
3679
|
AppShellSidebar,
|
|
3559
3680
|
Avatar,
|
|
3560
3681
|
AvatarFallback,
|
|
3682
|
+
AvatarGroup,
|
|
3561
3683
|
AvatarImage,
|
|
3684
|
+
AvatarStatus,
|
|
3562
3685
|
BREAKPOINTS,
|
|
3563
3686
|
Badge,
|
|
3564
3687
|
BottomNavigation,
|