@bubo-squared/ui-framework 0.2.13 → 0.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1853 -883
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +198 -39
- package/dist/index.d.ts +198 -39
- package/dist/index.js +1833 -877
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -1
package/dist/index.js
CHANGED
|
@@ -376,12 +376,77 @@ var MessageButton = (props) => {
|
|
|
376
376
|
};
|
|
377
377
|
MessageButton.displayName = "MessageButton";
|
|
378
378
|
|
|
379
|
-
// src/components/Content/
|
|
379
|
+
// src/components/Content/Accordion.tsx
|
|
380
380
|
import * as React6 from "react";
|
|
381
|
+
import * as AccordionPrimitive from "@radix-ui/react-accordion";
|
|
382
|
+
import { ChevronDownIcon } from "@bubo-squared/icons";
|
|
383
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
384
|
+
var Accordion = React6.forwardRef(
|
|
385
|
+
(props, ref) => {
|
|
386
|
+
const {
|
|
387
|
+
title,
|
|
388
|
+
expandIcon,
|
|
389
|
+
children,
|
|
390
|
+
className,
|
|
391
|
+
defaultOpen = false,
|
|
392
|
+
bordered = false,
|
|
393
|
+
...rootProps
|
|
394
|
+
} = props;
|
|
395
|
+
const {
|
|
396
|
+
value,
|
|
397
|
+
defaultValue,
|
|
398
|
+
onValueChange,
|
|
399
|
+
...restRootProps
|
|
400
|
+
} = rootProps;
|
|
401
|
+
const resolvedDefaultValue = value === void 0 && defaultValue === void 0 && defaultOpen ? "item" : defaultValue;
|
|
402
|
+
return /* @__PURE__ */ jsx8(
|
|
403
|
+
AccordionPrimitive.Root,
|
|
404
|
+
{
|
|
405
|
+
ref,
|
|
406
|
+
type: "single",
|
|
407
|
+
collapsible: true,
|
|
408
|
+
className: cn("w-full", className),
|
|
409
|
+
value,
|
|
410
|
+
defaultValue: resolvedDefaultValue,
|
|
411
|
+
onValueChange,
|
|
412
|
+
...restRootProps,
|
|
413
|
+
children: /* @__PURE__ */ jsxs4(
|
|
414
|
+
AccordionPrimitive.Item,
|
|
415
|
+
{
|
|
416
|
+
value: "item",
|
|
417
|
+
className: cn(bordered ? "border rounded-4" : "border-b", "border-(--border-secondary) px-4"),
|
|
418
|
+
children: [
|
|
419
|
+
/* @__PURE__ */ jsx8(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs4(
|
|
420
|
+
AccordionPrimitive.Trigger,
|
|
421
|
+
{
|
|
422
|
+
className: cn(
|
|
423
|
+
"flex w-full items-center justify-between gap-2 py-3 text-left",
|
|
424
|
+
"paragraph-md text-primary",
|
|
425
|
+
"[&[data-state=open]_.accordion-icon]:rotate-180",
|
|
426
|
+
"disabled:cursor-not-allowed disabled:text-primary-disabled cursor-pointer"
|
|
427
|
+
),
|
|
428
|
+
children: [
|
|
429
|
+
/* @__PURE__ */ jsx8("span", { className: "flex-1", children: title }),
|
|
430
|
+
/* @__PURE__ */ jsx8("span", { className: "accordion-icon inline-flex shrink-0 transition-transform duration-200 [&>svg]:size-5", children: expandIcon ?? /* @__PURE__ */ jsx8(ChevronDownIcon, {}) })
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
) }),
|
|
434
|
+
/* @__PURE__ */ jsx8(AccordionPrimitive.Content, { className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden", children: /* @__PURE__ */ jsx8("div", { className: "pb-3", children }) })
|
|
435
|
+
]
|
|
436
|
+
}
|
|
437
|
+
)
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
Accordion.displayName = "Accordion";
|
|
443
|
+
|
|
444
|
+
// src/components/Content/Avatar.tsx
|
|
445
|
+
import * as React7 from "react";
|
|
381
446
|
import { Slot as Slot4 } from "@radix-ui/react-slot";
|
|
382
447
|
import { cva as cva6 } from "class-variance-authority";
|
|
383
448
|
import { UserIcon } from "@bubo-squared/icons";
|
|
384
|
-
import { jsx as
|
|
449
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
385
450
|
var avatarVariants = cva6(
|
|
386
451
|
"relative inline-flex items-center justify-center rounded-full border-(--border-secondary) border-1 bg-(--background-primary) text-primary overflow-hidden hover:border-(--focus-secondary) focus-visible:border-(--focus-primary) focus-visible:outline-none",
|
|
387
452
|
{
|
|
@@ -439,7 +504,7 @@ var avatarIconVariants = cva6(
|
|
|
439
504
|
}
|
|
440
505
|
}
|
|
441
506
|
);
|
|
442
|
-
var Avatar =
|
|
507
|
+
var Avatar = React7.forwardRef(
|
|
443
508
|
(props, ref) => {
|
|
444
509
|
const {
|
|
445
510
|
asChild = false,
|
|
@@ -453,14 +518,14 @@ var Avatar = React6.forwardRef(
|
|
|
453
518
|
} = props;
|
|
454
519
|
const Comp = asChild ? Slot4 : "button";
|
|
455
520
|
const hasImage = variant === "image" && typeof src === "string" && src.length > 0;
|
|
456
|
-
return /* @__PURE__ */
|
|
521
|
+
return /* @__PURE__ */ jsxs5(
|
|
457
522
|
Comp,
|
|
458
523
|
{
|
|
459
524
|
ref,
|
|
460
525
|
className: cn(avatarVariants({ size }), className),
|
|
461
526
|
...rest,
|
|
462
527
|
children: [
|
|
463
|
-
hasImage ? /* @__PURE__ */
|
|
528
|
+
hasImage ? /* @__PURE__ */ jsx9(
|
|
464
529
|
"img",
|
|
465
530
|
{
|
|
466
531
|
src,
|
|
@@ -468,8 +533,8 @@ var Avatar = React6.forwardRef(
|
|
|
468
533
|
className: "w-full h-full object-cover"
|
|
469
534
|
}
|
|
470
535
|
) : null,
|
|
471
|
-
!hasImage && variant === "initial" && /* @__PURE__ */
|
|
472
|
-
!hasImage && variant === "icon" && /* @__PURE__ */
|
|
536
|
+
!hasImage && variant === "initial" && /* @__PURE__ */ jsx9("span", { className: cn(avatarInitialsVariants({ size }), "relative bottom-px"), children: initials }),
|
|
537
|
+
!hasImage && variant === "icon" && /* @__PURE__ */ jsx9("span", { className: cn(avatarIconVariants({ size })), children: /* @__PURE__ */ jsx9(UserIcon, {}) })
|
|
473
538
|
]
|
|
474
539
|
}
|
|
475
540
|
);
|
|
@@ -479,7 +544,7 @@ Avatar.displayName = "Avatar";
|
|
|
479
544
|
|
|
480
545
|
// src/components/Content/Typography.tsx
|
|
481
546
|
import "react";
|
|
482
|
-
import { jsx as
|
|
547
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
483
548
|
var mbCapableBaseClasses = /* @__PURE__ */ new Set([
|
|
484
549
|
"h1-intro",
|
|
485
550
|
"h2-intro",
|
|
@@ -515,10 +580,10 @@ var Typography = (props) => {
|
|
|
515
580
|
const Comp = as ?? "span";
|
|
516
581
|
const mbClassName = useMargin ? getMbClassName(variant) : null;
|
|
517
582
|
const weightClassName = weight === "regular" ? null : `${variant}-${weight}`;
|
|
518
|
-
return /* @__PURE__ */
|
|
583
|
+
return /* @__PURE__ */ jsx10(
|
|
519
584
|
Comp,
|
|
520
585
|
{
|
|
521
|
-
className: cn(variant, weightClassName, mbClassName, className),
|
|
586
|
+
className: cn("text-primary", variant, weightClassName, mbClassName, className),
|
|
522
587
|
...rest,
|
|
523
588
|
children
|
|
524
589
|
}
|
|
@@ -527,10 +592,10 @@ var Typography = (props) => {
|
|
|
527
592
|
Typography.displayName = "Typography";
|
|
528
593
|
|
|
529
594
|
// src/components/Content/Badge.tsx
|
|
530
|
-
import * as
|
|
595
|
+
import * as React9 from "react";
|
|
531
596
|
import { Slot as Slot5 } from "@radix-ui/react-slot";
|
|
532
597
|
import { cva as cva7 } from "class-variance-authority";
|
|
533
|
-
import { Fragment, jsx as
|
|
598
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
534
599
|
var badgeVariants = cva7(
|
|
535
600
|
"inline-flex items-center justify-center rounded-4 leading-none whitespace-nowrap gap-1 px-1 py-0",
|
|
536
601
|
{
|
|
@@ -560,7 +625,7 @@ var badgeVariants = cva7(
|
|
|
560
625
|
}
|
|
561
626
|
}
|
|
562
627
|
);
|
|
563
|
-
var Badge =
|
|
628
|
+
var Badge = React9.forwardRef(
|
|
564
629
|
(props, ref) => {
|
|
565
630
|
const {
|
|
566
631
|
asChild = false,
|
|
@@ -572,17 +637,17 @@ var Badge = React8.forwardRef(
|
|
|
572
637
|
...rest
|
|
573
638
|
} = props;
|
|
574
639
|
const Comp = asChild ? Slot5 : "div";
|
|
575
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ jsx11(
|
|
576
641
|
Comp,
|
|
577
642
|
{
|
|
578
643
|
ref,
|
|
579
644
|
className: cn(badgeVariants({ size, variant }), className),
|
|
580
645
|
...rest,
|
|
581
|
-
children: value ? /* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
-
] }) : /* @__PURE__ */
|
|
646
|
+
children: value ? /* @__PURE__ */ jsxs6(Fragment, { children: [
|
|
647
|
+
/* @__PURE__ */ jsx11("span", { className: "font-normal", children: label }),
|
|
648
|
+
/* @__PURE__ */ jsx11("span", { className: "font-normal", children: ":" }),
|
|
649
|
+
/* @__PURE__ */ jsx11("span", { className: "font-medium", children: value })
|
|
650
|
+
] }) : /* @__PURE__ */ jsx11("span", { className: "font-normal", children: label })
|
|
586
651
|
}
|
|
587
652
|
);
|
|
588
653
|
}
|
|
@@ -590,9 +655,9 @@ var Badge = React8.forwardRef(
|
|
|
590
655
|
Badge.displayName = "Badge";
|
|
591
656
|
|
|
592
657
|
// src/components/Content/BadgeDigit.tsx
|
|
593
|
-
import * as
|
|
658
|
+
import * as React10 from "react";
|
|
594
659
|
import { cva as cva8 } from "class-variance-authority";
|
|
595
|
-
import { jsx as
|
|
660
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
596
661
|
var badgeDigitVariants = cva8(
|
|
597
662
|
"inline-flex items-center justify-center leading-none whitespace-nowrap text-(--color-b-white)",
|
|
598
663
|
{
|
|
@@ -617,7 +682,7 @@ var badgeDigitVariants = cva8(
|
|
|
617
682
|
}
|
|
618
683
|
}
|
|
619
684
|
);
|
|
620
|
-
var BadgeDigit =
|
|
685
|
+
var BadgeDigit = React10.forwardRef(
|
|
621
686
|
(props, ref) => {
|
|
622
687
|
const {
|
|
623
688
|
value,
|
|
@@ -626,7 +691,7 @@ var BadgeDigit = React9.forwardRef(
|
|
|
626
691
|
className,
|
|
627
692
|
...rest
|
|
628
693
|
} = props;
|
|
629
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsx12(
|
|
630
695
|
"div",
|
|
631
696
|
{
|
|
632
697
|
ref,
|
|
@@ -642,7 +707,7 @@ BadgeDigit.displayName = "BadgeDigit";
|
|
|
642
707
|
// src/components/Content/BadgeDot.tsx
|
|
643
708
|
import "react";
|
|
644
709
|
import { cva as cva9 } from "class-variance-authority";
|
|
645
|
-
import { jsx as
|
|
710
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
646
711
|
var badgeDotVariants = cva9("rounded-12 size-3", {
|
|
647
712
|
variants: {
|
|
648
713
|
status: {
|
|
@@ -658,14 +723,14 @@ var badgeDotVariants = cva9("rounded-12 size-3", {
|
|
|
658
723
|
}
|
|
659
724
|
});
|
|
660
725
|
var BadgeDot = ({ status, className }) => {
|
|
661
|
-
return /* @__PURE__ */
|
|
726
|
+
return /* @__PURE__ */ jsx13("div", { className: cn(badgeDotVariants({ status }), className) });
|
|
662
727
|
};
|
|
663
728
|
BadgeDot.displayName = "BadgeDot";
|
|
664
729
|
|
|
665
730
|
// src/components/Content/BadgeStatus.tsx
|
|
666
|
-
import * as
|
|
667
|
-
import { jsx as
|
|
668
|
-
var BadgeStatus =
|
|
731
|
+
import * as React12 from "react";
|
|
732
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
733
|
+
var BadgeStatus = React12.forwardRef(
|
|
669
734
|
(props, ref) => {
|
|
670
735
|
const {
|
|
671
736
|
label,
|
|
@@ -676,14 +741,14 @@ var BadgeStatus = React11.forwardRef(
|
|
|
676
741
|
} = props;
|
|
677
742
|
const textClasses = active ? "caption-medium text-primary" : "caption-medium text-primary-disabled";
|
|
678
743
|
const dotClasses = active ? "bg-(--background-informal)" : "bg-(--background-primary)";
|
|
679
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ jsxs7(
|
|
680
745
|
"div",
|
|
681
746
|
{
|
|
682
747
|
ref,
|
|
683
748
|
className: cn("inline-flex items-center gap-2", className),
|
|
684
749
|
...rest,
|
|
685
750
|
children: [
|
|
686
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ jsx14(
|
|
687
752
|
"span",
|
|
688
753
|
{
|
|
689
754
|
className: cn(
|
|
@@ -693,7 +758,7 @@ var BadgeStatus = React11.forwardRef(
|
|
|
693
758
|
)
|
|
694
759
|
}
|
|
695
760
|
),
|
|
696
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ jsx14("span", { className: textClasses, children: label })
|
|
697
762
|
]
|
|
698
763
|
}
|
|
699
764
|
);
|
|
@@ -704,7 +769,7 @@ BadgeStatus.displayName = "BadgeStatus";
|
|
|
704
769
|
// src/components/Content/Divider.tsx
|
|
705
770
|
import "react";
|
|
706
771
|
import { TargetIcon } from "@bubo-squared/icons";
|
|
707
|
-
import { jsx as
|
|
772
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
708
773
|
var gapBySize = {
|
|
709
774
|
sm: "gap-2",
|
|
710
775
|
md: "gap-3",
|
|
@@ -739,14 +804,14 @@ var Divider = (props) => {
|
|
|
739
804
|
className: _className,
|
|
740
805
|
...divProps
|
|
741
806
|
} = props;
|
|
742
|
-
return /* @__PURE__ */
|
|
807
|
+
return /* @__PURE__ */ jsx15(
|
|
743
808
|
"div",
|
|
744
809
|
{
|
|
745
810
|
className: wrapperClass,
|
|
746
811
|
role: "separator",
|
|
747
812
|
"aria-orientation": ariaOrientation,
|
|
748
813
|
...divProps,
|
|
749
|
-
children: /* @__PURE__ */
|
|
814
|
+
children: /* @__PURE__ */ jsx15("div", { className: lineClass })
|
|
750
815
|
}
|
|
751
816
|
);
|
|
752
817
|
}
|
|
@@ -760,7 +825,7 @@ var Divider = (props) => {
|
|
|
760
825
|
...divProps
|
|
761
826
|
} = props;
|
|
762
827
|
const textLabel = label ? label : "OR";
|
|
763
|
-
return /* @__PURE__ */
|
|
828
|
+
return /* @__PURE__ */ jsxs8(
|
|
764
829
|
"div",
|
|
765
830
|
{
|
|
766
831
|
className: wrapperClass,
|
|
@@ -768,8 +833,8 @@ var Divider = (props) => {
|
|
|
768
833
|
"aria-orientation": ariaOrientation,
|
|
769
834
|
...divProps,
|
|
770
835
|
children: [
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ jsx15("div", { className: lineClass }),
|
|
837
|
+
/* @__PURE__ */ jsx15(
|
|
773
838
|
"span",
|
|
774
839
|
{
|
|
775
840
|
className: cn(
|
|
@@ -779,7 +844,7 @@ var Divider = (props) => {
|
|
|
779
844
|
children: textLabel
|
|
780
845
|
}
|
|
781
846
|
),
|
|
782
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ jsx15("div", { className: lineClass })
|
|
783
848
|
]
|
|
784
849
|
}
|
|
785
850
|
);
|
|
@@ -796,7 +861,7 @@ var Divider = (props) => {
|
|
|
796
861
|
className: _className,
|
|
797
862
|
...divProps
|
|
798
863
|
} = props;
|
|
799
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ jsxs8(
|
|
800
865
|
"div",
|
|
801
866
|
{
|
|
802
867
|
className: wrapperClass,
|
|
@@ -804,18 +869,18 @@ var Divider = (props) => {
|
|
|
804
869
|
"aria-orientation": ariaOrientation,
|
|
805
870
|
...divProps,
|
|
806
871
|
children: [
|
|
807
|
-
/* @__PURE__ */
|
|
808
|
-
/* @__PURE__ */
|
|
872
|
+
/* @__PURE__ */ jsx15("div", { className: lineClass }),
|
|
873
|
+
/* @__PURE__ */ jsx15(
|
|
809
874
|
IconButton,
|
|
810
875
|
{
|
|
811
876
|
variant: iconButtonVariant ?? "secondary",
|
|
812
877
|
size: resolvedSize,
|
|
813
878
|
"aria-label": ariaLabel ?? "More options",
|
|
814
|
-
icon: icon ?? /* @__PURE__ */
|
|
879
|
+
icon: icon ?? /* @__PURE__ */ jsx15(TargetIcon, {}),
|
|
815
880
|
onClick: onIconClick
|
|
816
881
|
}
|
|
817
882
|
),
|
|
818
|
-
/* @__PURE__ */
|
|
883
|
+
/* @__PURE__ */ jsx15("div", { className: lineClass })
|
|
819
884
|
]
|
|
820
885
|
}
|
|
821
886
|
);
|
|
@@ -829,7 +894,7 @@ var Divider = (props) => {
|
|
|
829
894
|
className: _className,
|
|
830
895
|
...divProps
|
|
831
896
|
} = props;
|
|
832
|
-
return /* @__PURE__ */
|
|
897
|
+
return /* @__PURE__ */ jsxs8(
|
|
833
898
|
"div",
|
|
834
899
|
{
|
|
835
900
|
className: wrapperClass,
|
|
@@ -837,8 +902,8 @@ var Divider = (props) => {
|
|
|
837
902
|
"aria-orientation": ariaOrientation,
|
|
838
903
|
...divProps,
|
|
839
904
|
children: [
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ jsx15("div", { className: lineClass }),
|
|
906
|
+
/* @__PURE__ */ jsx15(
|
|
842
907
|
IconButtonGroup,
|
|
843
908
|
{
|
|
844
909
|
className: resolvedOrientation === "vertical" ? "flex-col" : "flex-row",
|
|
@@ -846,7 +911,7 @@ var Divider = (props) => {
|
|
|
846
911
|
size: resolvedSize
|
|
847
912
|
}
|
|
848
913
|
),
|
|
849
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ jsx15("div", { className: lineClass })
|
|
850
915
|
]
|
|
851
916
|
}
|
|
852
917
|
);
|
|
@@ -862,7 +927,7 @@ var Divider = (props) => {
|
|
|
862
927
|
className: _className,
|
|
863
928
|
...divProps
|
|
864
929
|
} = props;
|
|
865
|
-
return /* @__PURE__ */
|
|
930
|
+
return /* @__PURE__ */ jsxs8(
|
|
866
931
|
"div",
|
|
867
932
|
{
|
|
868
933
|
className: wrapperClass,
|
|
@@ -870,8 +935,8 @@ var Divider = (props) => {
|
|
|
870
935
|
"aria-orientation": ariaOrientation,
|
|
871
936
|
...divProps,
|
|
872
937
|
children: [
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ jsx15("div", { className: lineClass }),
|
|
939
|
+
/* @__PURE__ */ jsx15(
|
|
875
940
|
Button,
|
|
876
941
|
{
|
|
877
942
|
variant: buttonVariant ?? "secondary",
|
|
@@ -880,7 +945,7 @@ var Divider = (props) => {
|
|
|
880
945
|
children: buttonLabel
|
|
881
946
|
}
|
|
882
947
|
),
|
|
883
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ jsx15("div", { className: lineClass })
|
|
884
949
|
]
|
|
885
950
|
}
|
|
886
951
|
);
|
|
@@ -890,11 +955,11 @@ var Divider = (props) => {
|
|
|
890
955
|
Divider.displayName = "Divider";
|
|
891
956
|
|
|
892
957
|
// src/components/Content/Progress.tsx
|
|
893
|
-
import * as
|
|
958
|
+
import * as React15 from "react";
|
|
894
959
|
|
|
895
960
|
// src/components/Inputs/Field.tsx
|
|
896
|
-
import * as
|
|
897
|
-
import { jsx as
|
|
961
|
+
import * as React14 from "react";
|
|
962
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
898
963
|
var fieldBase = "flex flex-col gap-2 items-start";
|
|
899
964
|
var Field = (props) => {
|
|
900
965
|
const {
|
|
@@ -907,18 +972,18 @@ var Field = (props) => {
|
|
|
907
972
|
className,
|
|
908
973
|
children
|
|
909
974
|
} = props;
|
|
910
|
-
const fieldId =
|
|
975
|
+
const fieldId = React14.useId();
|
|
911
976
|
const labelId = label ? `${fieldId}-label` : void 0;
|
|
912
977
|
const hintId = hint ? `${fieldId}-hint` : void 0;
|
|
913
978
|
const hintColorClass = disabled ? "text-primary-disabled" : status === "success" ? "text-(--color-success)" : status === "error" ? "text-(--color-error)" : "text-(--color-secondary)";
|
|
914
979
|
const labelColorClass = disabled ? "text-primary-disabled" : "text-primary";
|
|
915
|
-
return /* @__PURE__ */
|
|
916
|
-
label && /* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
980
|
+
return /* @__PURE__ */ jsxs9("div", { className: cn(fieldBase, className), children: [
|
|
981
|
+
label && /* @__PURE__ */ jsxs9("div", { className: "flex w-full items-center justify-between", children: [
|
|
982
|
+
/* @__PURE__ */ jsx16("label", { id: labelId, className: cn("paragraph-sm", labelColorClass), children: label }),
|
|
918
983
|
labelRight
|
|
919
984
|
] }),
|
|
920
|
-
/* @__PURE__ */
|
|
921
|
-
!hideHint && /* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ jsx16("div", { className: "relative w-full", children }),
|
|
986
|
+
!hideHint && /* @__PURE__ */ jsx16(
|
|
922
987
|
"p",
|
|
923
988
|
{
|
|
924
989
|
id: hint ? hintId : void 0,
|
|
@@ -931,13 +996,13 @@ var Field = (props) => {
|
|
|
931
996
|
Field.displayName = "Field";
|
|
932
997
|
|
|
933
998
|
// src/components/Content/Progress.tsx
|
|
934
|
-
import { jsx as
|
|
999
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
935
1000
|
var sizeToBarClasses = {
|
|
936
1001
|
lg: "h-4 rounded-16",
|
|
937
1002
|
md: "h-2 rounded-8",
|
|
938
1003
|
sm: "h-1 rounded-4"
|
|
939
1004
|
};
|
|
940
|
-
var Progress =
|
|
1005
|
+
var Progress = React15.forwardRef(
|
|
941
1006
|
(props, ref) => {
|
|
942
1007
|
const {
|
|
943
1008
|
value,
|
|
@@ -954,17 +1019,17 @@ var Progress = React14.forwardRef(
|
|
|
954
1019
|
const clamped = Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;
|
|
955
1020
|
const percentageLabel = `${Math.round(clamped)}%`;
|
|
956
1021
|
const barHeightClasses = sizeToBarClasses[size];
|
|
957
|
-
return /* @__PURE__ */
|
|
1022
|
+
return /* @__PURE__ */ jsx17(
|
|
958
1023
|
Field,
|
|
959
1024
|
{
|
|
960
1025
|
label,
|
|
961
|
-
labelRight: showProgressLabel && label ? /* @__PURE__ */
|
|
1026
|
+
labelRight: showProgressLabel && label ? /* @__PURE__ */ jsx17("span", { className: "footnote text-(--color-secondary)", children: percentageLabel }) : void 0,
|
|
962
1027
|
hint,
|
|
963
1028
|
hideHint,
|
|
964
1029
|
status,
|
|
965
1030
|
disabled,
|
|
966
1031
|
className: cn("w-full", className),
|
|
967
|
-
children: /* @__PURE__ */
|
|
1032
|
+
children: /* @__PURE__ */ jsx17(
|
|
968
1033
|
"div",
|
|
969
1034
|
{
|
|
970
1035
|
ref,
|
|
@@ -974,7 +1039,7 @@ var Progress = React14.forwardRef(
|
|
|
974
1039
|
"aria-valuemax": 100,
|
|
975
1040
|
"aria-label": label,
|
|
976
1041
|
...rest,
|
|
977
|
-
children: /* @__PURE__ */
|
|
1042
|
+
children: /* @__PURE__ */ jsx17(
|
|
978
1043
|
"div",
|
|
979
1044
|
{
|
|
980
1045
|
className: cn(
|
|
@@ -982,7 +1047,7 @@ var Progress = React14.forwardRef(
|
|
|
982
1047
|
barHeightClasses,
|
|
983
1048
|
disabled && "opacity-50"
|
|
984
1049
|
),
|
|
985
|
-
children: /* @__PURE__ */
|
|
1050
|
+
children: /* @__PURE__ */ jsx17(
|
|
986
1051
|
"div",
|
|
987
1052
|
{
|
|
988
1053
|
className: cn(
|
|
@@ -1003,7 +1068,7 @@ var Progress = React14.forwardRef(
|
|
|
1003
1068
|
Progress.displayName = "Progress";
|
|
1004
1069
|
|
|
1005
1070
|
// src/components/Content/StatusAvatar.tsx
|
|
1006
|
-
import * as
|
|
1071
|
+
import * as React16 from "react";
|
|
1007
1072
|
import { cva as cva10 } from "class-variance-authority";
|
|
1008
1073
|
import {
|
|
1009
1074
|
BookmarkCheckIcon,
|
|
@@ -1012,7 +1077,7 @@ import {
|
|
|
1012
1077
|
PlusIcon,
|
|
1013
1078
|
StarIcon
|
|
1014
1079
|
} from "@bubo-squared/icons";
|
|
1015
|
-
import { jsx as
|
|
1080
|
+
import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1016
1081
|
var iconStatusVariants = cva10(
|
|
1017
1082
|
"inline-flex size-5 items-center justify-center rounded-full border-1 border-(--color-primary-inverse) p-1",
|
|
1018
1083
|
{
|
|
@@ -1037,11 +1102,11 @@ var presenceDotByVariant = {
|
|
|
1037
1102
|
away: "bg-(--background-warning) border-1 border-(--color-primary-inverse)",
|
|
1038
1103
|
busy: "bg-(--background-error) border-1 border-(--color-primary-inverse)"
|
|
1039
1104
|
};
|
|
1040
|
-
var StatusAvatar =
|
|
1105
|
+
var StatusAvatar = React16.forwardRef((props, ref) => {
|
|
1041
1106
|
const { variant = "verified", className, ...rest } = props;
|
|
1042
1107
|
if (variant === "offline" || variant === "online" || variant === "away" || variant === "busy") {
|
|
1043
1108
|
const dotClasses = presenceDotByVariant[variant];
|
|
1044
|
-
return /* @__PURE__ */
|
|
1109
|
+
return /* @__PURE__ */ jsx18(
|
|
1045
1110
|
"div",
|
|
1046
1111
|
{
|
|
1047
1112
|
ref,
|
|
@@ -1050,23 +1115,23 @@ var StatusAvatar = React15.forwardRef((props, ref) => {
|
|
|
1050
1115
|
className
|
|
1051
1116
|
),
|
|
1052
1117
|
...rest,
|
|
1053
|
-
children: /* @__PURE__ */
|
|
1118
|
+
children: /* @__PURE__ */ jsx18("div", { className: cn(dotClasses, "size-3.5 rounded-full") })
|
|
1054
1119
|
}
|
|
1055
1120
|
);
|
|
1056
1121
|
}
|
|
1057
1122
|
const iconVariant = variant;
|
|
1058
|
-
return /* @__PURE__ */
|
|
1123
|
+
return /* @__PURE__ */ jsxs10(
|
|
1059
1124
|
"div",
|
|
1060
1125
|
{
|
|
1061
1126
|
ref,
|
|
1062
1127
|
className: cn(iconStatusVariants({ variant: iconVariant }), className),
|
|
1063
1128
|
...rest,
|
|
1064
1129
|
children: [
|
|
1065
|
-
iconVariant === "verified" && /* @__PURE__ */
|
|
1066
|
-
iconVariant === "bookmark" && /* @__PURE__ */
|
|
1067
|
-
iconVariant === "favorite" && /* @__PURE__ */
|
|
1068
|
-
iconVariant === "add" && /* @__PURE__ */
|
|
1069
|
-
iconVariant === "remove" && /* @__PURE__ */
|
|
1130
|
+
iconVariant === "verified" && /* @__PURE__ */ jsx18(CheckIcon, { className: "size-3 text-button-white" }),
|
|
1131
|
+
iconVariant === "bookmark" && /* @__PURE__ */ jsx18(BookmarkCheckIcon, { className: "size-3 text-button-white" }),
|
|
1132
|
+
iconVariant === "favorite" && /* @__PURE__ */ jsx18(StarIcon, { className: "size-3 text-button-white" }),
|
|
1133
|
+
iconVariant === "add" && /* @__PURE__ */ jsx18(PlusIcon, { className: "size-3 text-button-white" }),
|
|
1134
|
+
iconVariant === "remove" && /* @__PURE__ */ jsx18(CrossIcon, { className: "size-3 text-button-white" })
|
|
1070
1135
|
]
|
|
1071
1136
|
}
|
|
1072
1137
|
);
|
|
@@ -1074,10 +1139,10 @@ var StatusAvatar = React15.forwardRef((props, ref) => {
|
|
|
1074
1139
|
StatusAvatar.displayName = "StatusAvatar";
|
|
1075
1140
|
|
|
1076
1141
|
// src/components/Content/Tag.tsx
|
|
1077
|
-
import * as
|
|
1142
|
+
import * as React17 from "react";
|
|
1078
1143
|
import { Slot as Slot6 } from "@radix-ui/react-slot";
|
|
1079
1144
|
import { cva as cva11 } from "class-variance-authority";
|
|
1080
|
-
import { jsx as
|
|
1145
|
+
import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1081
1146
|
var tagVariants = cva11(
|
|
1082
1147
|
"inline-flex flex-row items-center justify-center rounded-6 gap-2 px-3 overflow-hidden border-1 border-(--border-secondary) bg-(--background-neutral) hover:border-(--border-secondary-hover) focus:border-(--border-brand) focus-ring-primary ",
|
|
1083
1148
|
{
|
|
@@ -1094,7 +1159,7 @@ var tagVariants = cva11(
|
|
|
1094
1159
|
);
|
|
1095
1160
|
var disabledTag = "pointer-events-none border-(--border-secondary-disabled) bg-(--background-neutral-disabled) text-primary-disabled";
|
|
1096
1161
|
var iconClasses = "flex items-center justify-center w-5 h-5 [&>*]:w-5 [&>*]:h-5 shrink-0 text-primary";
|
|
1097
|
-
var Tag =
|
|
1162
|
+
var Tag = React17.forwardRef(
|
|
1098
1163
|
(props, ref) => {
|
|
1099
1164
|
const {
|
|
1100
1165
|
size = "sm",
|
|
@@ -1106,37 +1171,295 @@ var Tag = React16.forwardRef(
|
|
|
1106
1171
|
...rest
|
|
1107
1172
|
} = props;
|
|
1108
1173
|
const Comp = asChild ? Slot6 : "div";
|
|
1109
|
-
const leading = props.leadingIcon &&
|
|
1110
|
-
const trailing = props.trailingIcon &&
|
|
1111
|
-
return /* @__PURE__ */
|
|
1174
|
+
const leading = props.leadingIcon && React17.isValidElement(props.leadingIcon) ? React17.cloneElement(props.leadingIcon, { disabled, ...props.leadingIcon.props }) : null;
|
|
1175
|
+
const trailing = props.trailingIcon && React17.isValidElement(props.trailingIcon) ? React17.cloneElement(props.trailingIcon, { disabled, ...props.trailingIcon.props }) : null;
|
|
1176
|
+
return /* @__PURE__ */ jsxs11(
|
|
1112
1177
|
Comp,
|
|
1113
1178
|
{
|
|
1114
1179
|
className: cn(tagVariants({ size }), disabled && disabledTag, className),
|
|
1115
1180
|
ref,
|
|
1116
1181
|
...rest,
|
|
1117
1182
|
children: [
|
|
1118
|
-
leading && /* @__PURE__ */
|
|
1119
|
-
value ? /* @__PURE__ */
|
|
1120
|
-
/* @__PURE__ */
|
|
1121
|
-
/* @__PURE__ */
|
|
1122
|
-
/* @__PURE__ */
|
|
1123
|
-
] }) : /* @__PURE__ */
|
|
1124
|
-
trailing && /* @__PURE__ */
|
|
1183
|
+
leading && /* @__PURE__ */ jsx19("div", { className: iconClasses, children: leading }),
|
|
1184
|
+
value ? /* @__PURE__ */ jsxs11("div", { className: "flex flex-row gap-1 items-center", children: [
|
|
1185
|
+
/* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: label }),
|
|
1186
|
+
/* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg mb-0! cursor-default font-normal", children: ":" }),
|
|
1187
|
+
/* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg-medium mb-0! cursor-default font-medium", children: value })
|
|
1188
|
+
] }) : /* @__PURE__ */ jsx19("span", { className: "text-primary paragraph-lg mb-0! cursor-default", children: label }),
|
|
1189
|
+
trailing && /* @__PURE__ */ jsx19("div", { className: iconClasses, children: trailing })
|
|
1125
1190
|
]
|
|
1126
1191
|
}
|
|
1127
1192
|
);
|
|
1128
1193
|
}
|
|
1129
1194
|
);
|
|
1130
1195
|
|
|
1196
|
+
// src/components/Content/Menu.tsx
|
|
1197
|
+
import "react";
|
|
1198
|
+
|
|
1199
|
+
// src/components/ui/dropdown-menu.tsx
|
|
1200
|
+
import * as React18 from "react";
|
|
1201
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
1202
|
+
import { ChevronRightIcon } from "@bubo-squared/icons";
|
|
1203
|
+
|
|
1204
|
+
// src/components/ui/dropdown-styles.ts
|
|
1205
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
1206
|
+
var dropdownSurfaceClass = "z-50 rounded-4 border border-(--border-secondary-hover) bg-(--background-neutral) shadow-card-md";
|
|
1207
|
+
var dropdownScrollClass = "max-h-79 overflow-y-auto dropdown-scrollbar";
|
|
1208
|
+
var dropdownRowVariants = cva12(
|
|
1209
|
+
"flex w-full items-center gap-2 pl-(--space-8) pr-(--space-16) text-left text-primary cursor-pointer hover:bg-(--background-secondary)",
|
|
1210
|
+
{
|
|
1211
|
+
variants: {
|
|
1212
|
+
size: {
|
|
1213
|
+
sm: "paragraph-sm py-(--space-4)",
|
|
1214
|
+
md: "paragraph-md py-(--space-6)",
|
|
1215
|
+
lg: "paragraph-lg py-(--space-8)",
|
|
1216
|
+
xl: "subtitle py-(--space-10)"
|
|
1217
|
+
},
|
|
1218
|
+
inset: {
|
|
1219
|
+
true: "pl-(--space-16)"
|
|
1220
|
+
}
|
|
1221
|
+
},
|
|
1222
|
+
defaultVariants: {
|
|
1223
|
+
size: "lg"
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
);
|
|
1227
|
+
|
|
1228
|
+
// src/components/ui/dropdown-menu.tsx
|
|
1229
|
+
import { jsx as jsx20, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1230
|
+
var DropdownMenuSizeContext = React18.createContext("lg");
|
|
1231
|
+
function useDropdownMenuSize(explicitSize) {
|
|
1232
|
+
const contextSize = React18.useContext(DropdownMenuSizeContext);
|
|
1233
|
+
return explicitSize ?? contextSize;
|
|
1234
|
+
}
|
|
1235
|
+
function DropdownMenu({
|
|
1236
|
+
...props
|
|
1237
|
+
}) {
|
|
1238
|
+
return /* @__PURE__ */ jsx20(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
1239
|
+
}
|
|
1240
|
+
function DropdownMenuPortal({
|
|
1241
|
+
...props
|
|
1242
|
+
}) {
|
|
1243
|
+
return /* @__PURE__ */ jsx20(DropdownMenuPrimitive.Portal, { "data-slot": "dropdown-menu-portal", ...props });
|
|
1244
|
+
}
|
|
1245
|
+
function DropdownMenuTrigger({
|
|
1246
|
+
...props
|
|
1247
|
+
}) {
|
|
1248
|
+
return /* @__PURE__ */ jsx20(
|
|
1249
|
+
DropdownMenuPrimitive.Trigger,
|
|
1250
|
+
{
|
|
1251
|
+
"data-slot": "dropdown-menu-trigger",
|
|
1252
|
+
...props
|
|
1253
|
+
}
|
|
1254
|
+
);
|
|
1255
|
+
}
|
|
1256
|
+
function DropdownMenuContent({
|
|
1257
|
+
className,
|
|
1258
|
+
sideOffset = 4,
|
|
1259
|
+
size = "lg",
|
|
1260
|
+
...props
|
|
1261
|
+
}) {
|
|
1262
|
+
return /* @__PURE__ */ jsx20(DropdownMenuSizeContext.Provider, { value: size, children: /* @__PURE__ */ jsx20(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx20(
|
|
1263
|
+
DropdownMenuPrimitive.Content,
|
|
1264
|
+
{
|
|
1265
|
+
"data-slot": "dropdown-menu-content",
|
|
1266
|
+
sideOffset,
|
|
1267
|
+
className: cn(
|
|
1268
|
+
dropdownSurfaceClass,
|
|
1269
|
+
dropdownScrollClass,
|
|
1270
|
+
"min-w-37.5 p-0",
|
|
1271
|
+
className
|
|
1272
|
+
),
|
|
1273
|
+
...props
|
|
1274
|
+
}
|
|
1275
|
+
) }) });
|
|
1276
|
+
}
|
|
1277
|
+
function DropdownMenuGroup({
|
|
1278
|
+
...props
|
|
1279
|
+
}) {
|
|
1280
|
+
return /* @__PURE__ */ jsx20(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props });
|
|
1281
|
+
}
|
|
1282
|
+
function DropdownMenuItem({
|
|
1283
|
+
className,
|
|
1284
|
+
inset,
|
|
1285
|
+
size,
|
|
1286
|
+
variant = "default",
|
|
1287
|
+
...props
|
|
1288
|
+
}) {
|
|
1289
|
+
const resolvedSize = useDropdownMenuSize(size);
|
|
1290
|
+
return /* @__PURE__ */ jsx20(
|
|
1291
|
+
DropdownMenuPrimitive.Item,
|
|
1292
|
+
{
|
|
1293
|
+
"data-slot": "dropdown-menu-item",
|
|
1294
|
+
"data-inset": inset,
|
|
1295
|
+
"data-variant": variant,
|
|
1296
|
+
className: cn(
|
|
1297
|
+
dropdownRowVariants({ size: resolvedSize, inset }),
|
|
1298
|
+
"data-highlighted:bg-(--background-secondary) data-highlighted:outline-none",
|
|
1299
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50 data-disabled:text-primary-disabled",
|
|
1300
|
+
variant === "destructive" ? "text-(--color-error)" : null,
|
|
1301
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1302
|
+
className
|
|
1303
|
+
),
|
|
1304
|
+
...props
|
|
1305
|
+
}
|
|
1306
|
+
);
|
|
1307
|
+
}
|
|
1308
|
+
function DropdownMenuLabel({
|
|
1309
|
+
className,
|
|
1310
|
+
inset,
|
|
1311
|
+
size,
|
|
1312
|
+
...props
|
|
1313
|
+
}) {
|
|
1314
|
+
const resolvedSize = useDropdownMenuSize(size);
|
|
1315
|
+
return /* @__PURE__ */ jsx20(
|
|
1316
|
+
DropdownMenuPrimitive.Label,
|
|
1317
|
+
{
|
|
1318
|
+
"data-slot": "dropdown-menu-label",
|
|
1319
|
+
"data-inset": inset,
|
|
1320
|
+
className: cn(
|
|
1321
|
+
dropdownRowVariants({ size: resolvedSize, inset }),
|
|
1322
|
+
"text-secondary cursor-default hover:bg-transparent caption",
|
|
1323
|
+
className
|
|
1324
|
+
),
|
|
1325
|
+
...props
|
|
1326
|
+
}
|
|
1327
|
+
);
|
|
1328
|
+
}
|
|
1329
|
+
function DropdownMenuSeparator({
|
|
1330
|
+
className,
|
|
1331
|
+
...props
|
|
1332
|
+
}) {
|
|
1333
|
+
return /* @__PURE__ */ jsx20(
|
|
1334
|
+
DropdownMenuPrimitive.Separator,
|
|
1335
|
+
{
|
|
1336
|
+
"data-slot": "dropdown-menu-separator",
|
|
1337
|
+
className: cn("my-1 h-px bg-(--border-secondary)", className),
|
|
1338
|
+
...props
|
|
1339
|
+
}
|
|
1340
|
+
);
|
|
1341
|
+
}
|
|
1342
|
+
function DropdownMenuShortcut({
|
|
1343
|
+
className,
|
|
1344
|
+
...props
|
|
1345
|
+
}) {
|
|
1346
|
+
return /* @__PURE__ */ jsx20(
|
|
1347
|
+
"span",
|
|
1348
|
+
{
|
|
1349
|
+
"data-slot": "dropdown-menu-shortcut",
|
|
1350
|
+
className: cn(
|
|
1351
|
+
"ml-auto paragraph-sm text-secondary",
|
|
1352
|
+
className
|
|
1353
|
+
),
|
|
1354
|
+
...props
|
|
1355
|
+
}
|
|
1356
|
+
);
|
|
1357
|
+
}
|
|
1358
|
+
function DropdownMenuSub({
|
|
1359
|
+
...props
|
|
1360
|
+
}) {
|
|
1361
|
+
return /* @__PURE__ */ jsx20(DropdownMenuPrimitive.Sub, { "data-slot": "dropdown-menu-sub", ...props });
|
|
1362
|
+
}
|
|
1363
|
+
function DropdownMenuSubTrigger({
|
|
1364
|
+
className,
|
|
1365
|
+
inset,
|
|
1366
|
+
size,
|
|
1367
|
+
children,
|
|
1368
|
+
...props
|
|
1369
|
+
}) {
|
|
1370
|
+
const resolvedSize = useDropdownMenuSize(size);
|
|
1371
|
+
return /* @__PURE__ */ jsxs12(
|
|
1372
|
+
DropdownMenuPrimitive.SubTrigger,
|
|
1373
|
+
{
|
|
1374
|
+
"data-slot": "dropdown-menu-sub-trigger",
|
|
1375
|
+
"data-inset": inset,
|
|
1376
|
+
className: cn(
|
|
1377
|
+
dropdownRowVariants({ size: resolvedSize, inset }),
|
|
1378
|
+
"data-highlighted:bg-(--background-secondary) data-highlighted:outline-none",
|
|
1379
|
+
"data-[state=open]:bg-(--background-secondary)",
|
|
1380
|
+
"data-disabled:pointer-events-none data-disabled:opacity-50 data-disabled:text-primary-disabled",
|
|
1381
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
1382
|
+
className
|
|
1383
|
+
),
|
|
1384
|
+
...props,
|
|
1385
|
+
children: [
|
|
1386
|
+
children,
|
|
1387
|
+
/* @__PURE__ */ jsx20(ChevronRightIcon, { className: "ml-auto size-4 text-(--icon-primary)" })
|
|
1388
|
+
]
|
|
1389
|
+
}
|
|
1390
|
+
);
|
|
1391
|
+
}
|
|
1392
|
+
function DropdownMenuSubContent({
|
|
1393
|
+
className,
|
|
1394
|
+
size,
|
|
1395
|
+
...props
|
|
1396
|
+
}) {
|
|
1397
|
+
const resolvedSize = useDropdownMenuSize(size);
|
|
1398
|
+
return /* @__PURE__ */ jsx20(DropdownMenuSizeContext.Provider, { value: resolvedSize, children: /* @__PURE__ */ jsx20(
|
|
1399
|
+
DropdownMenuPrimitive.SubContent,
|
|
1400
|
+
{
|
|
1401
|
+
"data-slot": "dropdown-menu-sub-content",
|
|
1402
|
+
className: cn(
|
|
1403
|
+
dropdownSurfaceClass,
|
|
1404
|
+
dropdownScrollClass,
|
|
1405
|
+
"min-w-37.5 p-0",
|
|
1406
|
+
className
|
|
1407
|
+
),
|
|
1408
|
+
...props
|
|
1409
|
+
}
|
|
1410
|
+
) });
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
// src/components/Content/Menu.tsx
|
|
1414
|
+
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1415
|
+
var Menu = (props) => {
|
|
1416
|
+
const {
|
|
1417
|
+
trigger,
|
|
1418
|
+
children,
|
|
1419
|
+
size = "lg",
|
|
1420
|
+
align = "start",
|
|
1421
|
+
side,
|
|
1422
|
+
offset = 4,
|
|
1423
|
+
className,
|
|
1424
|
+
open,
|
|
1425
|
+
onOpenChange,
|
|
1426
|
+
modal
|
|
1427
|
+
} = props;
|
|
1428
|
+
return /* @__PURE__ */ jsxs13(DropdownMenu, { open, onOpenChange, modal, children: [
|
|
1429
|
+
/* @__PURE__ */ jsx21(DropdownMenuTrigger, { asChild: true, children: trigger }),
|
|
1430
|
+
/* @__PURE__ */ jsx21(
|
|
1431
|
+
DropdownMenuContent,
|
|
1432
|
+
{
|
|
1433
|
+
align,
|
|
1434
|
+
side,
|
|
1435
|
+
sideOffset: offset,
|
|
1436
|
+
size,
|
|
1437
|
+
className: cn(className),
|
|
1438
|
+
children
|
|
1439
|
+
}
|
|
1440
|
+
)
|
|
1441
|
+
] });
|
|
1442
|
+
};
|
|
1443
|
+
Menu.displayName = "Menu";
|
|
1444
|
+
var MenuGroup = DropdownMenuGroup;
|
|
1445
|
+
var MenuItem = DropdownMenuItem;
|
|
1446
|
+
var MenuLabel = DropdownMenuLabel;
|
|
1447
|
+
var MenuPortal = DropdownMenuPortal;
|
|
1448
|
+
var MenuSeparator = DropdownMenuSeparator;
|
|
1449
|
+
var MenuShortcut = DropdownMenuShortcut;
|
|
1450
|
+
var MenuSub = DropdownMenuSub;
|
|
1451
|
+
var MenuSubContent = DropdownMenuSubContent;
|
|
1452
|
+
var MenuSubTrigger = DropdownMenuSubTrigger;
|
|
1453
|
+
|
|
1131
1454
|
// src/components/Inputs/Checkbox.tsx
|
|
1132
1455
|
import "react";
|
|
1133
1456
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
1134
1457
|
import { CheckIcon as CheckIcon2 } from "@bubo-squared/icons";
|
|
1135
1458
|
import { MinusIcon } from "@bubo-squared/icons";
|
|
1136
|
-
import { jsx as
|
|
1459
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1137
1460
|
function Checkbox({ label, className, ...props }) {
|
|
1138
|
-
return /* @__PURE__ */
|
|
1139
|
-
/* @__PURE__ */
|
|
1461
|
+
return /* @__PURE__ */ jsxs14("label", { className: "inline-flex items-center gap-(--space-12) cursor-pointer select-none", children: [
|
|
1462
|
+
/* @__PURE__ */ jsx22(
|
|
1140
1463
|
CheckboxPrimitive.Root,
|
|
1141
1464
|
{
|
|
1142
1465
|
className: cn(
|
|
@@ -1152,35 +1475,41 @@ function Checkbox({ label, className, ...props }) {
|
|
|
1152
1475
|
className
|
|
1153
1476
|
),
|
|
1154
1477
|
...props,
|
|
1155
|
-
children: /* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */
|
|
1478
|
+
children: /* @__PURE__ */ jsxs14(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
|
|
1479
|
+
/* @__PURE__ */ jsx22(CheckIcon2, { className: "h-5 w-5 hidden group-data-[state=checked]:block" }),
|
|
1480
|
+
/* @__PURE__ */ jsx22(MinusIcon, { className: "h-5 w-5 hidden group-data-[state=indeterminate]:block" })
|
|
1158
1481
|
] })
|
|
1159
1482
|
}
|
|
1160
1483
|
),
|
|
1161
|
-
label && /* @__PURE__ */
|
|
1484
|
+
label && /* @__PURE__ */ jsx22("span", { className: "paragraph-md-medium text-primary", children: label })
|
|
1162
1485
|
] });
|
|
1163
1486
|
}
|
|
1164
1487
|
|
|
1165
|
-
// src/components/Inputs/
|
|
1166
|
-
import * as
|
|
1167
|
-
import { cva as
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1488
|
+
// src/components/Inputs/Autocomplete.tsx
|
|
1489
|
+
import * as React23 from "react";
|
|
1490
|
+
import { cva as cva14 } from "class-variance-authority";
|
|
1491
|
+
|
|
1492
|
+
// src/components/Inputs/InputShell.tsx
|
|
1493
|
+
import * as React21 from "react";
|
|
1494
|
+
import { cva as cva13 } from "class-variance-authority";
|
|
1495
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1496
|
+
var inputShellVariants = cva13(
|
|
1497
|
+
"group flex w-full items-center rounded-4 border bg-(--background-primary) text-left cursor-text border-(--border-secondary)",
|
|
1172
1498
|
{
|
|
1173
1499
|
variants: {
|
|
1174
1500
|
size: {
|
|
1175
|
-
sm: "
|
|
1176
|
-
md: "
|
|
1177
|
-
lg: "h-11",
|
|
1178
|
-
xl: "h-14"
|
|
1501
|
+
sm: "gap-2 px-2 py-1 h-8",
|
|
1502
|
+
md: "gap-2 px-2 py-2 h-10",
|
|
1503
|
+
lg: "gap-2 px-2 py-2 h-11",
|
|
1504
|
+
xl: "gap-2 px-[10px] py-2 h-14"
|
|
1179
1505
|
},
|
|
1180
1506
|
status: {
|
|
1181
|
-
default: "
|
|
1182
|
-
success: "
|
|
1183
|
-
error: "
|
|
1507
|
+
default: "input-default",
|
|
1508
|
+
success: "input-success",
|
|
1509
|
+
error: "input-error"
|
|
1510
|
+
},
|
|
1511
|
+
disabled: {
|
|
1512
|
+
true: "bg-(--background-primary-disabled) border-(--border-secondary-disabled) text-primary-disabled cursor-default"
|
|
1184
1513
|
}
|
|
1185
1514
|
},
|
|
1186
1515
|
defaultVariants: {
|
|
@@ -1189,70 +1518,410 @@ var dropdownTriggerVariants = cva12(
|
|
|
1189
1518
|
}
|
|
1190
1519
|
}
|
|
1191
1520
|
);
|
|
1192
|
-
var
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
}
|
|
1207
|
-
},
|
|
1208
|
-
defaultVariants: {
|
|
1209
|
-
size: "lg",
|
|
1210
|
-
hasValue: false
|
|
1521
|
+
var InputShell = React21.forwardRef(
|
|
1522
|
+
({ size, status, disabled, className, ...rest }, ref) => {
|
|
1523
|
+
return /* @__PURE__ */ jsx23(
|
|
1524
|
+
"div",
|
|
1525
|
+
{
|
|
1526
|
+
ref,
|
|
1527
|
+
"aria-disabled": disabled || void 0,
|
|
1528
|
+
className: cn(
|
|
1529
|
+
inputShellVariants({ size, status, disabled }),
|
|
1530
|
+
className
|
|
1531
|
+
),
|
|
1532
|
+
...rest
|
|
1533
|
+
}
|
|
1534
|
+
);
|
|
1211
1535
|
}
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1536
|
+
);
|
|
1537
|
+
InputShell.displayName = "InputShell";
|
|
1538
|
+
|
|
1539
|
+
// src/components/ui/input.tsx
|
|
1540
|
+
import * as React22 from "react";
|
|
1541
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1542
|
+
var Input = React22.forwardRef(
|
|
1543
|
+
({ className, type, variant = "default", ...props }, ref) => {
|
|
1544
|
+
const base = "text-primary placeholder:text-(--color-secondary) disabled:text-primary-disabled disabled:placeholder:text-primary-disabled selection:bg-primary selection:text-primary-foreground file:text-foreground";
|
|
1545
|
+
const defaultStyles = "dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 shadow-xs transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 focus-visible:border-ring focus-visible:ring-0 focus-visible:shadow-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive";
|
|
1546
|
+
const bareStyles = "bg-transparent outline-none w-full";
|
|
1547
|
+
return /* @__PURE__ */ jsx24(
|
|
1548
|
+
"input",
|
|
1549
|
+
{
|
|
1550
|
+
ref,
|
|
1551
|
+
type,
|
|
1552
|
+
"data-slot": "input",
|
|
1553
|
+
className: cn(
|
|
1554
|
+
base,
|
|
1555
|
+
variant === "default" ? defaultStyles : bareStyles,
|
|
1556
|
+
className
|
|
1557
|
+
),
|
|
1558
|
+
...props
|
|
1559
|
+
}
|
|
1560
|
+
);
|
|
1561
|
+
}
|
|
1562
|
+
);
|
|
1563
|
+
Input.displayName = "Input";
|
|
1564
|
+
|
|
1565
|
+
// src/components/Inputs/Autocomplete.tsx
|
|
1566
|
+
import { jsx as jsx25, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1567
|
+
var inputTextVariants = cva14("truncate", {
|
|
1568
|
+
variants: {
|
|
1215
1569
|
size: {
|
|
1216
|
-
sm: "
|
|
1217
|
-
md: "
|
|
1218
|
-
lg: "
|
|
1219
|
-
xl: "
|
|
1220
|
-
},
|
|
1221
|
-
disabled: {
|
|
1222
|
-
false: "text-(--icon-primary)",
|
|
1223
|
-
true: "text-(--icon-primary-disabled)"
|
|
1570
|
+
sm: "paragraph-md",
|
|
1571
|
+
md: "paragraph-lg",
|
|
1572
|
+
lg: "subtitle",
|
|
1573
|
+
xl: "h6-title"
|
|
1224
1574
|
}
|
|
1225
1575
|
},
|
|
1226
1576
|
defaultVariants: {
|
|
1227
|
-
size: "lg"
|
|
1228
|
-
disabled: false
|
|
1577
|
+
size: "lg"
|
|
1229
1578
|
}
|
|
1230
1579
|
});
|
|
1231
|
-
var
|
|
1580
|
+
var optionVariants = cva14(
|
|
1581
|
+
"w-full text-left hover:bg-(--background-secondary)",
|
|
1582
|
+
{
|
|
1583
|
+
variants: {
|
|
1584
|
+
size: {
|
|
1585
|
+
sm: "paragraph-sm py-(--space-4) ",
|
|
1586
|
+
md: "paragraph-md py-(--space-6) ",
|
|
1587
|
+
lg: "paragraph-lg py-(--space-8) ",
|
|
1588
|
+
xl: "subtitle py-(--space-10) "
|
|
1589
|
+
},
|
|
1590
|
+
active: {
|
|
1591
|
+
true: "bg-(--background-secondary)"
|
|
1592
|
+
}
|
|
1593
|
+
},
|
|
1594
|
+
defaultVariants: {
|
|
1595
|
+
size: "lg",
|
|
1596
|
+
active: false
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
);
|
|
1600
|
+
var iconWrapperVariants = cva14(
|
|
1601
|
+
"flex items-center justify-center shrink-0 text-(--icon-primary)",
|
|
1602
|
+
{
|
|
1603
|
+
variants: {
|
|
1604
|
+
size: {
|
|
1605
|
+
sm: "size-4 [&>svg]:size-4",
|
|
1606
|
+
md: "size-5 [&>svg]:size-5",
|
|
1607
|
+
lg: "size-5 [&>svg]:size-5",
|
|
1608
|
+
xl: "size-6 [&>svg]:size-6"
|
|
1609
|
+
},
|
|
1610
|
+
disabled: {
|
|
1611
|
+
true: "text-(--icon-primary-disabled)"
|
|
1612
|
+
}
|
|
1613
|
+
},
|
|
1614
|
+
defaultVariants: {
|
|
1615
|
+
size: "lg"
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
);
|
|
1619
|
+
var Autocomplete = (props) => {
|
|
1620
|
+
const {
|
|
1621
|
+
label,
|
|
1622
|
+
hint,
|
|
1623
|
+
hideHint,
|
|
1624
|
+
status = "default",
|
|
1625
|
+
size = "lg",
|
|
1626
|
+
disabled,
|
|
1627
|
+
className,
|
|
1628
|
+
leadingIcon,
|
|
1629
|
+
trailingIcon,
|
|
1630
|
+
options,
|
|
1631
|
+
loading = false,
|
|
1632
|
+
loadingText = "Loading\u2026",
|
|
1633
|
+
noOptionsText = "No matches",
|
|
1634
|
+
value,
|
|
1635
|
+
defaultValue,
|
|
1636
|
+
onChange,
|
|
1637
|
+
inputValue,
|
|
1638
|
+
defaultInputValue,
|
|
1639
|
+
onInputChange,
|
|
1640
|
+
placeholder = "Search\u2026",
|
|
1641
|
+
onKeyDown,
|
|
1642
|
+
onFocus,
|
|
1643
|
+
onBlur,
|
|
1644
|
+
id,
|
|
1645
|
+
...inputProps
|
|
1646
|
+
} = props;
|
|
1647
|
+
const isValueControlled = value !== void 0;
|
|
1648
|
+
const [internalValue, setInternalValue] = React23.useState(
|
|
1649
|
+
defaultValue ?? ""
|
|
1650
|
+
);
|
|
1651
|
+
const isInputControlled = inputValue !== void 0;
|
|
1652
|
+
const [internalInputValue, setInternalInputValue] = React23.useState(
|
|
1653
|
+
defaultInputValue ?? ""
|
|
1654
|
+
);
|
|
1655
|
+
const [isFocused, setIsFocused] = React23.useState(false);
|
|
1656
|
+
const [activeIndex, setActiveIndex] = React23.useState(-1);
|
|
1657
|
+
const inputRef = React23.useRef(null);
|
|
1658
|
+
const baseId = React23.useId();
|
|
1659
|
+
const inputId = id ?? baseId;
|
|
1660
|
+
const listboxId = `${inputId}-listbox`;
|
|
1661
|
+
const currentValue = (isValueControlled ? value : internalValue) ?? "";
|
|
1662
|
+
const currentInput = (isInputControlled ? inputValue : internalInputValue) ?? "";
|
|
1663
|
+
React23.useEffect(() => {
|
|
1664
|
+
if (isFocused) return;
|
|
1665
|
+
if (isInputControlled) return;
|
|
1666
|
+
if (!isValueControlled) return;
|
|
1667
|
+
setInternalInputValue(currentValue);
|
|
1668
|
+
}, [currentValue, isFocused, isInputControlled, isValueControlled]);
|
|
1669
|
+
const showDropdown = isFocused && (loading || options.length > 0 || currentInput.trim().length > 0);
|
|
1670
|
+
const setInputText = (next) => {
|
|
1671
|
+
if (!isInputControlled) {
|
|
1672
|
+
setInternalInputValue(next);
|
|
1673
|
+
}
|
|
1674
|
+
onInputChange?.(next);
|
|
1675
|
+
};
|
|
1676
|
+
const commitValue = (next) => {
|
|
1677
|
+
if (!isValueControlled) {
|
|
1678
|
+
setInternalValue(next);
|
|
1679
|
+
}
|
|
1680
|
+
onChange?.(next);
|
|
1681
|
+
setInputText(next);
|
|
1682
|
+
setActiveIndex(-1);
|
|
1683
|
+
};
|
|
1684
|
+
const handleContainerClick = () => {
|
|
1685
|
+
if (disabled) return;
|
|
1686
|
+
inputRef.current?.focus();
|
|
1687
|
+
};
|
|
1688
|
+
const handleInputChange = (event) => {
|
|
1689
|
+
const next = event.target.value;
|
|
1690
|
+
setInputText(next);
|
|
1691
|
+
setActiveIndex(-1);
|
|
1692
|
+
};
|
|
1693
|
+
const handleFocus = (event) => {
|
|
1694
|
+
setIsFocused(true);
|
|
1695
|
+
onFocus?.(event);
|
|
1696
|
+
};
|
|
1697
|
+
const handleBlur = (event) => {
|
|
1698
|
+
setIsFocused(false);
|
|
1699
|
+
setActiveIndex(-1);
|
|
1700
|
+
onBlur?.(event);
|
|
1701
|
+
};
|
|
1702
|
+
const handleKeyDown = (event) => {
|
|
1703
|
+
onKeyDown?.(event);
|
|
1704
|
+
if (event.defaultPrevented) return;
|
|
1705
|
+
if (!showDropdown && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
1706
|
+
setIsFocused(true);
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
switch (event.key) {
|
|
1710
|
+
case "ArrowDown": {
|
|
1711
|
+
event.preventDefault();
|
|
1712
|
+
setActiveIndex((prev) => {
|
|
1713
|
+
if (options.length === 0) return -1;
|
|
1714
|
+
const next = prev < 0 ? 0 : Math.min(prev + 1, options.length - 1);
|
|
1715
|
+
return next;
|
|
1716
|
+
});
|
|
1717
|
+
break;
|
|
1718
|
+
}
|
|
1719
|
+
case "ArrowUp": {
|
|
1720
|
+
event.preventDefault();
|
|
1721
|
+
setActiveIndex((prev) => {
|
|
1722
|
+
if (options.length === 0) return -1;
|
|
1723
|
+
const next = prev <= 0 ? 0 : prev - 1;
|
|
1724
|
+
return next;
|
|
1725
|
+
});
|
|
1726
|
+
break;
|
|
1727
|
+
}
|
|
1728
|
+
case "Enter": {
|
|
1729
|
+
if (activeIndex >= 0 && activeIndex < options.length) {
|
|
1730
|
+
event.preventDefault();
|
|
1731
|
+
commitValue(options[activeIndex]);
|
|
1732
|
+
setIsFocused(false);
|
|
1733
|
+
}
|
|
1734
|
+
break;
|
|
1735
|
+
}
|
|
1736
|
+
case "Escape": {
|
|
1737
|
+
event.preventDefault();
|
|
1738
|
+
setIsFocused(false);
|
|
1739
|
+
setActiveIndex(-1);
|
|
1740
|
+
break;
|
|
1741
|
+
}
|
|
1742
|
+
default:
|
|
1743
|
+
break;
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
const handleOptionMouseDown = (event) => {
|
|
1747
|
+
event.preventDefault();
|
|
1748
|
+
};
|
|
1749
|
+
const handleOptionClick = (option) => {
|
|
1750
|
+
commitValue(option);
|
|
1751
|
+
setIsFocused(false);
|
|
1752
|
+
};
|
|
1753
|
+
const activeDescendantId = activeIndex >= 0 ? `${inputId}-option-${activeIndex}` : void 0;
|
|
1754
|
+
const showLeadingIcon = !!leadingIcon;
|
|
1755
|
+
const showTrailingIcon = !!trailingIcon;
|
|
1756
|
+
return /* @__PURE__ */ jsx25(Field, { label, hint, hideHint, status, disabled, children: /* @__PURE__ */ jsxs15("div", { className: "relative w-full", children: [
|
|
1757
|
+
/* @__PURE__ */ jsxs15(
|
|
1758
|
+
InputShell,
|
|
1759
|
+
{
|
|
1760
|
+
size,
|
|
1761
|
+
status,
|
|
1762
|
+
disabled,
|
|
1763
|
+
className,
|
|
1764
|
+
onClick: handleContainerClick,
|
|
1765
|
+
children: [
|
|
1766
|
+
showLeadingIcon && /* @__PURE__ */ jsx25("span", { className: cn(iconWrapperVariants({ size, disabled: !!disabled })), children: leadingIcon }),
|
|
1767
|
+
/* @__PURE__ */ jsx25(
|
|
1768
|
+
Input,
|
|
1769
|
+
{
|
|
1770
|
+
ref: inputRef,
|
|
1771
|
+
id: inputId,
|
|
1772
|
+
type: "text",
|
|
1773
|
+
disabled: disabled ?? void 0,
|
|
1774
|
+
placeholder,
|
|
1775
|
+
value: currentInput,
|
|
1776
|
+
onChange: handleInputChange,
|
|
1777
|
+
onFocus: handleFocus,
|
|
1778
|
+
onBlur: handleBlur,
|
|
1779
|
+
onKeyDown: handleKeyDown,
|
|
1780
|
+
role: "combobox",
|
|
1781
|
+
"aria-autocomplete": "list",
|
|
1782
|
+
"aria-controls": listboxId,
|
|
1783
|
+
"aria-expanded": showDropdown,
|
|
1784
|
+
"aria-activedescendant": activeDescendantId,
|
|
1785
|
+
variant: "bare",
|
|
1786
|
+
className: cn(inputTextVariants({ size }), "bg-transparent outline-none w-full"),
|
|
1787
|
+
...inputProps
|
|
1788
|
+
}
|
|
1789
|
+
),
|
|
1790
|
+
showTrailingIcon && /* @__PURE__ */ jsx25("span", { className: cn(iconWrapperVariants({ size, disabled: !!disabled })), children: trailingIcon })
|
|
1791
|
+
]
|
|
1792
|
+
}
|
|
1793
|
+
),
|
|
1794
|
+
showDropdown && /* @__PURE__ */ jsx25(
|
|
1795
|
+
"div",
|
|
1796
|
+
{
|
|
1797
|
+
className: cn(
|
|
1798
|
+
"absolute left-0 right-0 mt-1",
|
|
1799
|
+
dropdownSurfaceClass,
|
|
1800
|
+
dropdownScrollClass
|
|
1801
|
+
),
|
|
1802
|
+
children: loading ? /* @__PURE__ */ jsx25(
|
|
1803
|
+
"div",
|
|
1804
|
+
{
|
|
1805
|
+
className: cn(optionVariants({ size }), "px-(--space-8) pr-(--space-16) text-secondary"),
|
|
1806
|
+
"aria-live": "polite",
|
|
1807
|
+
children: loadingText
|
|
1808
|
+
}
|
|
1809
|
+
) : options.length === 0 ? /* @__PURE__ */ jsx25(
|
|
1810
|
+
"div",
|
|
1811
|
+
{
|
|
1812
|
+
className: cn(optionVariants({ size }), "px-(--space-8) pr-(--space-16) text-secondary"),
|
|
1813
|
+
"aria-live": "polite",
|
|
1814
|
+
children: noOptionsText
|
|
1815
|
+
}
|
|
1816
|
+
) : /* @__PURE__ */ jsx25("ul", { id: listboxId, role: "listbox", className: "flex flex-col", children: options.map((option, index) => /* @__PURE__ */ jsx25(
|
|
1817
|
+
"li",
|
|
1818
|
+
{
|
|
1819
|
+
id: `${inputId}-option-${index}`,
|
|
1820
|
+
role: "option",
|
|
1821
|
+
"aria-selected": index === activeIndex,
|
|
1822
|
+
className: cn(
|
|
1823
|
+
optionVariants({ size, active: index === activeIndex }),
|
|
1824
|
+
"px-(--space-8) pr-(--space-16) text-primary cursor-pointer"
|
|
1825
|
+
),
|
|
1826
|
+
onMouseDown: handleOptionMouseDown,
|
|
1827
|
+
onMouseEnter: () => setActiveIndex(index),
|
|
1828
|
+
onClick: () => handleOptionClick(option),
|
|
1829
|
+
children: option
|
|
1830
|
+
},
|
|
1831
|
+
`${option}-${index}`
|
|
1832
|
+
)) })
|
|
1833
|
+
}
|
|
1834
|
+
)
|
|
1835
|
+
] }) });
|
|
1836
|
+
};
|
|
1837
|
+
Autocomplete.displayName = "Autocomplete";
|
|
1838
|
+
|
|
1839
|
+
// src/components/Inputs/Select.tsx
|
|
1840
|
+
import * as React24 from "react";
|
|
1841
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1842
|
+
import { cva as cva15 } from "class-variance-authority";
|
|
1843
|
+
import { ChevronDownIcon as ChevronDownIcon2 } from "@bubo-squared/icons";
|
|
1844
|
+
import { jsx as jsx26, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1845
|
+
var selectTriggerVariants = cva15(
|
|
1846
|
+
"group flex w-full items-center justify-between rounded-4 border bg-(--background-primary) p-2 text-left transition-colors cursor-pointer focus-ring-primary focus:border-(--border-brand) hover:bg-(--background-primary-hover) disabled:bg-(--background-primary) disabled:border-(--border-secondary-disabled) disabled:text-primary-disabled disabled:cursor-default",
|
|
1847
|
+
{
|
|
1848
|
+
variants: {
|
|
1849
|
+
size: {
|
|
1850
|
+
sm: "h-8 py-1",
|
|
1851
|
+
md: "h-10 py-2",
|
|
1852
|
+
lg: "h-11",
|
|
1853
|
+
xl: "h-14"
|
|
1854
|
+
},
|
|
1855
|
+
status: {
|
|
1856
|
+
default: "border-(--border-secondary)",
|
|
1857
|
+
success: "border-(--border-success)",
|
|
1858
|
+
error: "border-(--border-error)"
|
|
1859
|
+
}
|
|
1860
|
+
},
|
|
1861
|
+
defaultVariants: {
|
|
1862
|
+
size: "lg",
|
|
1863
|
+
status: "default"
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
);
|
|
1867
|
+
var textVariants = cva15("truncate", {
|
|
1232
1868
|
variants: {
|
|
1233
1869
|
size: {
|
|
1234
|
-
sm: "
|
|
1235
|
-
md: "
|
|
1236
|
-
lg: "
|
|
1237
|
-
xl: "
|
|
1870
|
+
sm: "paragraph-md",
|
|
1871
|
+
md: "paragraph-lg",
|
|
1872
|
+
lg: "subtitle",
|
|
1873
|
+
xl: "h6-title"
|
|
1874
|
+
},
|
|
1875
|
+
hasValue: {
|
|
1876
|
+
false: "text-secondary",
|
|
1877
|
+
true: "text-primary"
|
|
1878
|
+
},
|
|
1879
|
+
disabled: {
|
|
1880
|
+
true: "text-primary-disabled"
|
|
1238
1881
|
}
|
|
1882
|
+
},
|
|
1883
|
+
defaultVariants: {
|
|
1884
|
+
size: "lg",
|
|
1885
|
+
hasValue: false
|
|
1239
1886
|
}
|
|
1240
1887
|
});
|
|
1241
|
-
var
|
|
1888
|
+
var selectIconVariants = cva15("flex items-center justify-center shrink-0", {
|
|
1242
1889
|
variants: {
|
|
1243
1890
|
size: {
|
|
1244
|
-
sm: "
|
|
1245
|
-
md: "
|
|
1246
|
-
lg: "
|
|
1247
|
-
xl: "
|
|
1891
|
+
sm: "size-4",
|
|
1892
|
+
md: "size-5",
|
|
1893
|
+
lg: "size-5",
|
|
1894
|
+
xl: "size-6"
|
|
1895
|
+
},
|
|
1896
|
+
disabled: {
|
|
1897
|
+
false: "text-(--icon-primary)",
|
|
1898
|
+
true: "text-(--icon-primary-disabled)"
|
|
1248
1899
|
}
|
|
1900
|
+
},
|
|
1901
|
+
defaultVariants: {
|
|
1902
|
+
size: "lg",
|
|
1903
|
+
disabled: false
|
|
1249
1904
|
}
|
|
1250
1905
|
});
|
|
1251
|
-
var
|
|
1906
|
+
var selectButtonVariants = cva15(
|
|
1907
|
+
"flex w-full items-center gap-2 pl-(--space-8) pr-(--space-16) text-left paragraph-lg text-primary hover:bg-(--background-secondary)",
|
|
1908
|
+
{
|
|
1909
|
+
variants: {
|
|
1910
|
+
size: {
|
|
1911
|
+
sm: "paragraph-sm py-(--space-4) ",
|
|
1912
|
+
md: "paragraph-md py-(--space-6) ",
|
|
1913
|
+
lg: "paragraph-lg py-(--space-8) ",
|
|
1914
|
+
xl: "subtitle py-(--space-10) "
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
);
|
|
1919
|
+
var Select = (props) => {
|
|
1252
1920
|
const {
|
|
1253
1921
|
label = "Field Label",
|
|
1254
1922
|
hint = "This is a hint text to help user.",
|
|
1255
1923
|
hideHint = false,
|
|
1924
|
+
name,
|
|
1256
1925
|
placeholder = "Placeholder text",
|
|
1257
1926
|
size = "lg",
|
|
1258
1927
|
status = "default",
|
|
@@ -1263,218 +1932,148 @@ var Dropdown = (props) => {
|
|
|
1263
1932
|
onChange,
|
|
1264
1933
|
className,
|
|
1265
1934
|
showMenu,
|
|
1935
|
+
required = false,
|
|
1266
1936
|
...buttonProps
|
|
1267
1937
|
} = props;
|
|
1268
|
-
const dropdownRef = React18.useRef(null);
|
|
1269
1938
|
const isControlled = value !== void 0;
|
|
1270
|
-
const
|
|
1271
|
-
|
|
1939
|
+
const controlledValue = value ?? "";
|
|
1940
|
+
const [internalValue, setInternalValue] = React24.useState(
|
|
1941
|
+
defaultValue ?? ""
|
|
1272
1942
|
);
|
|
1273
|
-
const [open, setOpen] =
|
|
1274
|
-
const
|
|
1275
|
-
const selectedOption = options.find((opt) => opt.value ===
|
|
1943
|
+
const [open, setOpen] = React24.useState(false);
|
|
1944
|
+
const rawValue = isControlled ? controlledValue : internalValue;
|
|
1945
|
+
const selectedOption = options.find((opt) => opt.value === rawValue);
|
|
1946
|
+
const currentValue = selectedOption ? selectedOption.value : "";
|
|
1276
1947
|
const hasValue = !!selectedOption;
|
|
1277
1948
|
const isOpen = showMenu ?? open;
|
|
1278
|
-
const
|
|
1279
|
-
if (disabled) return;
|
|
1949
|
+
const handleOpenChange = (nextOpen) => {
|
|
1280
1950
|
if (showMenu === void 0) {
|
|
1281
|
-
setOpen(
|
|
1951
|
+
setOpen(nextOpen);
|
|
1282
1952
|
}
|
|
1283
1953
|
};
|
|
1284
|
-
const
|
|
1954
|
+
const handleValueChange = (nextValue) => {
|
|
1285
1955
|
if (!isControlled) {
|
|
1286
|
-
setInternalValue(
|
|
1956
|
+
setInternalValue(nextValue);
|
|
1287
1957
|
}
|
|
1288
|
-
onChange?.(
|
|
1958
|
+
onChange?.(nextValue);
|
|
1289
1959
|
if (showMenu === void 0) {
|
|
1290
1960
|
setOpen(false);
|
|
1291
1961
|
}
|
|
1292
1962
|
};
|
|
1293
|
-
|
|
1294
|
-
if (
|
|
1295
|
-
|
|
1296
|
-
if (!dropdownRef.current) return;
|
|
1297
|
-
if (!dropdownRef.current.contains(event.target)) {
|
|
1298
|
-
setOpen(false);
|
|
1299
|
-
}
|
|
1300
|
-
};
|
|
1301
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
1302
|
-
return () => {
|
|
1303
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
1304
|
-
};
|
|
1305
|
-
}, [showMenu]);
|
|
1306
|
-
return /* @__PURE__ */ jsx20("div", { ref: dropdownRef, children: /* @__PURE__ */ jsxs12(
|
|
1307
|
-
Field,
|
|
1308
|
-
{
|
|
1309
|
-
label,
|
|
1310
|
-
hint,
|
|
1311
|
-
hideHint,
|
|
1312
|
-
status,
|
|
1313
|
-
disabled,
|
|
1314
|
-
children: [
|
|
1315
|
-
/* @__PURE__ */ jsxs12(
|
|
1316
|
-
"button",
|
|
1317
|
-
{
|
|
1318
|
-
type: "button",
|
|
1319
|
-
"aria-haspopup": "listbox",
|
|
1320
|
-
"aria-expanded": isOpen,
|
|
1321
|
-
disabled,
|
|
1322
|
-
className: cn(dropdownTriggerVariants({ size, status }), className),
|
|
1323
|
-
onClick: handleToggle,
|
|
1324
|
-
"data-open": isOpen || void 0,
|
|
1325
|
-
...buttonProps,
|
|
1326
|
-
children: [
|
|
1327
|
-
/* @__PURE__ */ jsx20(
|
|
1328
|
-
"span",
|
|
1329
|
-
{
|
|
1330
|
-
className: cn(
|
|
1331
|
-
dropdownTextVariants({
|
|
1332
|
-
size,
|
|
1333
|
-
hasValue,
|
|
1334
|
-
disabled: !!disabled
|
|
1335
|
-
})
|
|
1336
|
-
),
|
|
1337
|
-
children: hasValue ? selectedOption?.label : placeholder
|
|
1338
|
-
}
|
|
1339
|
-
),
|
|
1340
|
-
/* @__PURE__ */ jsx20("span", { className: cn(dropdownIconVariants({ size, disabled: !!disabled })), children: /* @__PURE__ */ jsx20(ChevronDownIcon, {}) })
|
|
1341
|
-
]
|
|
1342
|
-
}
|
|
1343
|
-
),
|
|
1344
|
-
isOpen && options.length > 0 && /* @__PURE__ */ jsx20("div", { className: "absolute z-10 mt-1 w-full min-w-343 rounded-4 border border-(--border-secondary-hover) bg-(--background-neutral) shadow-card-md flex overflow-y-scroll dropdown-scrollbar max-h-79", children: /* @__PURE__ */ jsxs12("ul", { role: "listbox", className: "flex flex-1 flex-col", children: [
|
|
1345
|
-
hasValue && /* @__PURE__ */ jsx20(
|
|
1346
|
-
"li",
|
|
1347
|
-
{
|
|
1348
|
-
className: cn(
|
|
1349
|
-
"bg-(--background-neutral) border-b border-(--border-secondary)",
|
|
1350
|
-
dropdownItemVariants({ size })
|
|
1351
|
-
),
|
|
1352
|
-
children: /* @__PURE__ */ jsx20(
|
|
1353
|
-
"button",
|
|
1354
|
-
{
|
|
1355
|
-
type: "button",
|
|
1356
|
-
className: cn(dropdownButtonVariants({ size }), "text-secondary"),
|
|
1357
|
-
role: "option",
|
|
1358
|
-
"aria-selected": false,
|
|
1359
|
-
onClick: () => handleSelect(""),
|
|
1360
|
-
children: "Clear"
|
|
1361
|
-
}
|
|
1362
|
-
)
|
|
1363
|
-
}
|
|
1364
|
-
),
|
|
1365
|
-
options.map((opt) => {
|
|
1366
|
-
const selected = opt.value === currentValue;
|
|
1367
|
-
return /* @__PURE__ */ jsx20(
|
|
1368
|
-
"li",
|
|
1369
|
-
{
|
|
1370
|
-
className: cn(
|
|
1371
|
-
"bg-(--background-neutral) border-b border-(--border-secondary) last:border-b-0 ",
|
|
1372
|
-
selected && "bg-(--background-secondary)",
|
|
1373
|
-
dropdownItemVariants({ size })
|
|
1374
|
-
),
|
|
1375
|
-
children: /* @__PURE__ */ jsx20(
|
|
1376
|
-
"button",
|
|
1377
|
-
{
|
|
1378
|
-
type: "button",
|
|
1379
|
-
className: dropdownButtonVariants({ size }),
|
|
1380
|
-
role: "option",
|
|
1381
|
-
"aria-selected": selected,
|
|
1382
|
-
onClick: () => handleSelect(opt.value),
|
|
1383
|
-
children: opt.label
|
|
1384
|
-
}
|
|
1385
|
-
)
|
|
1386
|
-
},
|
|
1387
|
-
opt.value
|
|
1388
|
-
);
|
|
1389
|
-
})
|
|
1390
|
-
] }) })
|
|
1391
|
-
]
|
|
1963
|
+
const handleClear = () => {
|
|
1964
|
+
if (!isControlled) {
|
|
1965
|
+
setInternalValue("");
|
|
1392
1966
|
}
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
// src/components/Inputs/PasswordInput.tsx
|
|
1398
|
-
import * as React21 from "react";
|
|
1399
|
-
import { cva as cva14 } from "class-variance-authority";
|
|
1400
|
-
|
|
1401
|
-
// src/components/ui/input.tsx
|
|
1402
|
-
import * as React19 from "react";
|
|
1403
|
-
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1404
|
-
var Input = React19.forwardRef(
|
|
1405
|
-
({ className, type, variant = "default", ...props }, ref) => {
|
|
1406
|
-
const base = "text-primary placeholder:text-(--color-secondary) disabled:text-primary-disabled disabled:placeholder:text-primary-disabled selection:bg-primary selection:text-primary-foreground file:text-foreground";
|
|
1407
|
-
const defaultStyles = "dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 shadow-xs transition-[color,box-shadow] file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 focus-visible:border-ring focus-visible:ring-0 focus-visible:shadow-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive";
|
|
1408
|
-
const bareStyles = "bg-transparent outline-none w-full";
|
|
1409
|
-
return /* @__PURE__ */ jsx21(
|
|
1410
|
-
"input",
|
|
1411
|
-
{
|
|
1412
|
-
ref,
|
|
1413
|
-
type,
|
|
1414
|
-
"data-slot": "input",
|
|
1415
|
-
className: cn(
|
|
1416
|
-
base,
|
|
1417
|
-
variant === "default" ? defaultStyles : bareStyles,
|
|
1418
|
-
className
|
|
1419
|
-
),
|
|
1420
|
-
...props
|
|
1421
|
-
}
|
|
1422
|
-
);
|
|
1423
|
-
}
|
|
1424
|
-
);
|
|
1425
|
-
Input.displayName = "Input";
|
|
1426
|
-
|
|
1427
|
-
// src/components/Inputs/InputShell.tsx
|
|
1428
|
-
import * as React20 from "react";
|
|
1429
|
-
import { cva as cva13 } from "class-variance-authority";
|
|
1430
|
-
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1431
|
-
var inputShellVariants = cva13(
|
|
1432
|
-
"group flex w-full items-center rounded-4 border bg-(--background-primary) text-left cursor-text border-(--border-secondary)",
|
|
1433
|
-
{
|
|
1434
|
-
variants: {
|
|
1435
|
-
size: {
|
|
1436
|
-
sm: "gap-2 px-2 py-1 h-8",
|
|
1437
|
-
md: "gap-2 px-2 py-2 h-10",
|
|
1438
|
-
lg: "gap-2 px-2 py-2 h-11",
|
|
1439
|
-
xl: "gap-2 px-[10px] py-2 h-14"
|
|
1440
|
-
},
|
|
1441
|
-
status: {
|
|
1442
|
-
default: "input-default",
|
|
1443
|
-
success: "input-success",
|
|
1444
|
-
error: "input-error"
|
|
1445
|
-
},
|
|
1446
|
-
disabled: {
|
|
1447
|
-
true: "bg-(--background-primary-disabled) border-(--border-secondary-disabled) text-primary-disabled cursor-default"
|
|
1448
|
-
}
|
|
1449
|
-
},
|
|
1450
|
-
defaultVariants: {
|
|
1451
|
-
size: "lg",
|
|
1452
|
-
status: "default"
|
|
1967
|
+
onChange?.("");
|
|
1968
|
+
if (showMenu === void 0) {
|
|
1969
|
+
setOpen(false);
|
|
1453
1970
|
}
|
|
1454
|
-
}
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1971
|
+
};
|
|
1972
|
+
return /* @__PURE__ */ jsx26(
|
|
1973
|
+
Field,
|
|
1974
|
+
{
|
|
1975
|
+
label,
|
|
1976
|
+
hint,
|
|
1977
|
+
hideHint,
|
|
1978
|
+
status,
|
|
1979
|
+
disabled,
|
|
1980
|
+
children: /* @__PURE__ */ jsxs16(
|
|
1981
|
+
SelectPrimitive.Root,
|
|
1982
|
+
{
|
|
1983
|
+
value: currentValue,
|
|
1984
|
+
onValueChange: handleValueChange,
|
|
1985
|
+
open: isOpen,
|
|
1986
|
+
onOpenChange: handleOpenChange,
|
|
1987
|
+
disabled,
|
|
1988
|
+
name,
|
|
1989
|
+
required,
|
|
1990
|
+
children: [
|
|
1991
|
+
/* @__PURE__ */ jsx26(SelectPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs16(
|
|
1992
|
+
"button",
|
|
1993
|
+
{
|
|
1994
|
+
type: "button",
|
|
1995
|
+
"aria-haspopup": "listbox",
|
|
1996
|
+
"aria-expanded": isOpen,
|
|
1997
|
+
disabled,
|
|
1998
|
+
className: cn(
|
|
1999
|
+
selectTriggerVariants({ size, status }),
|
|
2000
|
+
textVariants({
|
|
2001
|
+
size,
|
|
2002
|
+
hasValue,
|
|
2003
|
+
disabled: !!disabled
|
|
2004
|
+
}),
|
|
2005
|
+
hasValue ? "text-primary" : "text-secondary",
|
|
2006
|
+
className
|
|
2007
|
+
),
|
|
2008
|
+
"data-open": isOpen || void 0,
|
|
2009
|
+
...buttonProps,
|
|
2010
|
+
children: [
|
|
2011
|
+
/* @__PURE__ */ jsx26(SelectPrimitive.Value, { placeholder }),
|
|
2012
|
+
/* @__PURE__ */ jsx26(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx26(
|
|
2013
|
+
"span",
|
|
2014
|
+
{
|
|
2015
|
+
className: cn(selectIconVariants({ size, disabled: !!disabled })),
|
|
2016
|
+
children: /* @__PURE__ */ jsx26(ChevronDownIcon2, {})
|
|
2017
|
+
}
|
|
2018
|
+
) })
|
|
2019
|
+
]
|
|
2020
|
+
}
|
|
2021
|
+
) }),
|
|
2022
|
+
/* @__PURE__ */ jsx26(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx26(
|
|
2023
|
+
SelectPrimitive.Content,
|
|
2024
|
+
{
|
|
2025
|
+
position: "popper",
|
|
2026
|
+
align: "start",
|
|
2027
|
+
sideOffset: 4,
|
|
2028
|
+
className: cn(
|
|
2029
|
+
dropdownSurfaceClass,
|
|
2030
|
+
dropdownScrollClass,
|
|
2031
|
+
"min-w-343"
|
|
2032
|
+
),
|
|
2033
|
+
style: { minWidth: "var(--radix-select-trigger-width)" },
|
|
2034
|
+
children: /* @__PURE__ */ jsx26(SelectPrimitive.Viewport, { children: /* @__PURE__ */ jsxs16("div", { className: "flex flex-col", children: [
|
|
2035
|
+
hasValue && /* @__PURE__ */ jsx26("div", { className: cn("bg-(--background-neutral)"), children: /* @__PURE__ */ jsx26(
|
|
2036
|
+
"button",
|
|
2037
|
+
{
|
|
2038
|
+
type: "button",
|
|
2039
|
+
className: cn(
|
|
2040
|
+
selectButtonVariants({ size }),
|
|
2041
|
+
"text-secondary"
|
|
2042
|
+
),
|
|
2043
|
+
onClick: handleClear,
|
|
2044
|
+
children: "Clear"
|
|
2045
|
+
}
|
|
2046
|
+
) }),
|
|
2047
|
+
options.map((opt) => /* @__PURE__ */ jsx26(
|
|
2048
|
+
SelectPrimitive.Item,
|
|
2049
|
+
{
|
|
2050
|
+
value: opt.value,
|
|
2051
|
+
className: cn(
|
|
2052
|
+
"bg-(--background-neutral)",
|
|
2053
|
+
"data-highlighted:bg-(--background-secondary) data-highlighted:outline-none",
|
|
2054
|
+
"data-[state=checked]:bg-(--background-secondary)"
|
|
2055
|
+
),
|
|
2056
|
+
children: /* @__PURE__ */ jsx26("div", { className: selectButtonVariants({ size }), children: /* @__PURE__ */ jsx26(SelectPrimitive.ItemText, { children: opt.label }) })
|
|
2057
|
+
},
|
|
2058
|
+
opt.value
|
|
2059
|
+
))
|
|
2060
|
+
] }) })
|
|
2061
|
+
}
|
|
2062
|
+
) })
|
|
2063
|
+
]
|
|
2064
|
+
}
|
|
2065
|
+
)
|
|
2066
|
+
}
|
|
2067
|
+
);
|
|
2068
|
+
};
|
|
2069
|
+
Select.displayName = "Select";
|
|
1473
2070
|
|
|
1474
2071
|
// src/components/Inputs/PasswordInput.tsx
|
|
2072
|
+
import * as React25 from "react";
|
|
2073
|
+
import { cva as cva16 } from "class-variance-authority";
|
|
1475
2074
|
import { EyeIcon, EyeSlashIcon } from "@bubo-squared/icons";
|
|
1476
|
-
import { jsx as
|
|
1477
|
-
var passwordTextVariants =
|
|
2075
|
+
import { jsx as jsx27, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2076
|
+
var passwordTextVariants = cva16("truncate", {
|
|
1478
2077
|
variants: {
|
|
1479
2078
|
size: {
|
|
1480
2079
|
sm: "paragraph-md",
|
|
@@ -1492,7 +2091,7 @@ var passwordTextVariants = cva14("truncate", {
|
|
|
1492
2091
|
disabled: false
|
|
1493
2092
|
}
|
|
1494
2093
|
});
|
|
1495
|
-
var
|
|
2094
|
+
var iconWrapperVariants2 = cva16(
|
|
1496
2095
|
"flex items-center justify-center shrink-0 text-(--icon-primary)",
|
|
1497
2096
|
{
|
|
1498
2097
|
variants: {
|
|
@@ -1511,7 +2110,7 @@ var iconWrapperVariants = cva14(
|
|
|
1511
2110
|
}
|
|
1512
2111
|
}
|
|
1513
2112
|
);
|
|
1514
|
-
var actionButtonVariants =
|
|
2113
|
+
var actionButtonVariants = cva16(
|
|
1515
2114
|
"flex items-center justify-center shrink-0 cursor-pointer bg-transparent border-0 p-0 text-left paragraph-sm text-(--icon-primary) hover:text-(--icon-primary-hover) focus:outline-none ",
|
|
1516
2115
|
{
|
|
1517
2116
|
variants: {
|
|
@@ -1548,12 +2147,12 @@ var PasswordInput = (props) => {
|
|
|
1548
2147
|
...inputProps
|
|
1549
2148
|
} = props;
|
|
1550
2149
|
const isControlled = value !== void 0;
|
|
1551
|
-
const [internalValue, setInternalValue] =
|
|
2150
|
+
const [internalValue, setInternalValue] = React25.useState(
|
|
1552
2151
|
defaultValue ?? ""
|
|
1553
2152
|
);
|
|
1554
|
-
const [isRevealed, setIsRevealed] =
|
|
2153
|
+
const [isRevealed, setIsRevealed] = React25.useState(false);
|
|
1555
2154
|
const currentValue = (isControlled ? value : internalValue) ?? "";
|
|
1556
|
-
const inputRef =
|
|
2155
|
+
const inputRef = React25.useRef(null);
|
|
1557
2156
|
const showLeadingIcon = !!leadingIcon;
|
|
1558
2157
|
const handleContainerClick = () => {
|
|
1559
2158
|
if (disabled) return;
|
|
@@ -1565,7 +2164,7 @@ var PasswordInput = (props) => {
|
|
|
1565
2164
|
}
|
|
1566
2165
|
onChange?.(event);
|
|
1567
2166
|
};
|
|
1568
|
-
return /* @__PURE__ */
|
|
2167
|
+
return /* @__PURE__ */ jsx27(
|
|
1569
2168
|
Field,
|
|
1570
2169
|
{
|
|
1571
2170
|
label,
|
|
@@ -1573,7 +2172,7 @@ var PasswordInput = (props) => {
|
|
|
1573
2172
|
hideHint,
|
|
1574
2173
|
status,
|
|
1575
2174
|
disabled,
|
|
1576
|
-
children: /* @__PURE__ */
|
|
2175
|
+
children: /* @__PURE__ */ jsxs17(
|
|
1577
2176
|
InputShell,
|
|
1578
2177
|
{
|
|
1579
2178
|
size,
|
|
@@ -1582,16 +2181,16 @@ var PasswordInput = (props) => {
|
|
|
1582
2181
|
className,
|
|
1583
2182
|
onClick: handleContainerClick,
|
|
1584
2183
|
children: [
|
|
1585
|
-
showLeadingIcon && /* @__PURE__ */
|
|
2184
|
+
showLeadingIcon && /* @__PURE__ */ jsx27(
|
|
1586
2185
|
"span",
|
|
1587
2186
|
{
|
|
1588
2187
|
className: cn(
|
|
1589
|
-
|
|
2188
|
+
iconWrapperVariants2({ size, disabled: !!disabled })
|
|
1590
2189
|
),
|
|
1591
2190
|
children: leadingIcon
|
|
1592
2191
|
}
|
|
1593
2192
|
),
|
|
1594
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ jsx27(
|
|
1595
2194
|
Input,
|
|
1596
2195
|
{
|
|
1597
2196
|
ref: inputRef,
|
|
@@ -1606,7 +2205,7 @@ var PasswordInput = (props) => {
|
|
|
1606
2205
|
...inputProps
|
|
1607
2206
|
}
|
|
1608
2207
|
),
|
|
1609
|
-
/* @__PURE__ */
|
|
2208
|
+
/* @__PURE__ */ jsx27(
|
|
1610
2209
|
"button",
|
|
1611
2210
|
{
|
|
1612
2211
|
type: "button",
|
|
@@ -1619,9 +2218,9 @@ var PasswordInput = (props) => {
|
|
|
1619
2218
|
"aria-label": isRevealed ? "Hide password" : "Show password",
|
|
1620
2219
|
className: cn(
|
|
1621
2220
|
"cursor-pointer",
|
|
1622
|
-
variant === "text" ? actionButtonVariants({ size, disabled: !!disabled }) :
|
|
2221
|
+
variant === "text" ? actionButtonVariants({ size, disabled: !!disabled }) : iconWrapperVariants2({ size, disabled: !!disabled })
|
|
1623
2222
|
),
|
|
1624
|
-
children: variant === "icon" ? isRevealed ? /* @__PURE__ */
|
|
2223
|
+
children: variant === "icon" ? isRevealed ? /* @__PURE__ */ jsx27(EyeSlashIcon, {}) : /* @__PURE__ */ jsx27(EyeIcon, {}) : isRevealed ? "Hide" : "Show"
|
|
1625
2224
|
}
|
|
1626
2225
|
)
|
|
1627
2226
|
]
|
|
@@ -1633,7 +2232,7 @@ var PasswordInput = (props) => {
|
|
|
1633
2232
|
PasswordInput.displayName = "PasswordInput";
|
|
1634
2233
|
|
|
1635
2234
|
// src/components/Inputs/PhoneInput.tsx
|
|
1636
|
-
import * as
|
|
2235
|
+
import * as React31 from "react";
|
|
1637
2236
|
import { CheckIcon as CheckIcon3, CodeIcon } from "@bubo-squared/icons";
|
|
1638
2237
|
import * as RPNInput from "react-phone-number-input";
|
|
1639
2238
|
import flags from "react-phone-number-input/flags";
|
|
@@ -1641,9 +2240,9 @@ import flags from "react-phone-number-input/flags";
|
|
|
1641
2240
|
// src/components/ui/button.tsx
|
|
1642
2241
|
import "react";
|
|
1643
2242
|
import { Slot as Slot7 } from "@radix-ui/react-slot";
|
|
1644
|
-
import { cva as
|
|
1645
|
-
import { jsx as
|
|
1646
|
-
var buttonVariants2 =
|
|
2243
|
+
import { cva as cva17 } from "class-variance-authority";
|
|
2244
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2245
|
+
var buttonVariants2 = cva17(
|
|
1647
2246
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-0 focus-visible:shadow-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
1648
2247
|
{
|
|
1649
2248
|
variants: {
|
|
@@ -1678,7 +2277,7 @@ function Button2({
|
|
|
1678
2277
|
...props
|
|
1679
2278
|
}) {
|
|
1680
2279
|
const Comp = asChild ? Slot7 : "button";
|
|
1681
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ jsx28(
|
|
1682
2281
|
Comp,
|
|
1683
2282
|
{
|
|
1684
2283
|
"data-slot": "button",
|
|
@@ -1698,15 +2297,118 @@ import { SearchIcon } from "@bubo-squared/icons";
|
|
|
1698
2297
|
// src/components/ui/dialog.tsx
|
|
1699
2298
|
import "react";
|
|
1700
2299
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
1701
|
-
|
|
2300
|
+
|
|
2301
|
+
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
2302
|
+
import { forwardRef as forwardRef15, createElement as createElement2 } from "react";
|
|
2303
|
+
|
|
2304
|
+
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
2305
|
+
var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
2306
|
+
var toCamelCase = (string) => string.replace(
|
|
2307
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
2308
|
+
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
2309
|
+
);
|
|
2310
|
+
var toPascalCase = (string) => {
|
|
2311
|
+
const camelCase = toCamelCase(string);
|
|
2312
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
2313
|
+
};
|
|
2314
|
+
var mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
2315
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
2316
|
+
}).join(" ").trim();
|
|
2317
|
+
var hasA11yProp = (props) => {
|
|
2318
|
+
for (const prop in props) {
|
|
2319
|
+
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
2320
|
+
return true;
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
};
|
|
2324
|
+
|
|
2325
|
+
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/Icon.js
|
|
2326
|
+
import { forwardRef as forwardRef14, createElement } from "react";
|
|
2327
|
+
|
|
2328
|
+
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
2329
|
+
var defaultAttributes = {
|
|
2330
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2331
|
+
width: 24,
|
|
2332
|
+
height: 24,
|
|
2333
|
+
viewBox: "0 0 24 24",
|
|
2334
|
+
fill: "none",
|
|
2335
|
+
stroke: "currentColor",
|
|
2336
|
+
strokeWidth: 2,
|
|
2337
|
+
strokeLinecap: "round",
|
|
2338
|
+
strokeLinejoin: "round"
|
|
2339
|
+
};
|
|
2340
|
+
|
|
2341
|
+
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/Icon.js
|
|
2342
|
+
var Icon2 = forwardRef14(
|
|
2343
|
+
({
|
|
2344
|
+
color = "currentColor",
|
|
2345
|
+
size = 24,
|
|
2346
|
+
strokeWidth = 2,
|
|
2347
|
+
absoluteStrokeWidth,
|
|
2348
|
+
className = "",
|
|
2349
|
+
children,
|
|
2350
|
+
iconNode,
|
|
2351
|
+
...rest
|
|
2352
|
+
}, ref) => createElement(
|
|
2353
|
+
"svg",
|
|
2354
|
+
{
|
|
2355
|
+
ref,
|
|
2356
|
+
...defaultAttributes,
|
|
2357
|
+
width: size,
|
|
2358
|
+
height: size,
|
|
2359
|
+
stroke: color,
|
|
2360
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
2361
|
+
className: mergeClasses("lucide", className),
|
|
2362
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
2363
|
+
...rest
|
|
2364
|
+
},
|
|
2365
|
+
[
|
|
2366
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
2367
|
+
...Array.isArray(children) ? children : [children]
|
|
2368
|
+
]
|
|
2369
|
+
)
|
|
2370
|
+
);
|
|
2371
|
+
|
|
2372
|
+
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
2373
|
+
var createLucideIcon = (iconName, iconNode) => {
|
|
2374
|
+
const Component = forwardRef15(
|
|
2375
|
+
({ className, ...props }, ref) => createElement2(Icon2, {
|
|
2376
|
+
ref,
|
|
2377
|
+
iconNode,
|
|
2378
|
+
className: mergeClasses(
|
|
2379
|
+
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
2380
|
+
`lucide-${iconName}`,
|
|
2381
|
+
className
|
|
2382
|
+
),
|
|
2383
|
+
...props
|
|
2384
|
+
})
|
|
2385
|
+
);
|
|
2386
|
+
Component.displayName = toPascalCase(iconName);
|
|
2387
|
+
return Component;
|
|
2388
|
+
};
|
|
2389
|
+
|
|
2390
|
+
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-right.js
|
|
2391
|
+
var __iconNode = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
2392
|
+
var ChevronRight = createLucideIcon("chevron-right", __iconNode);
|
|
2393
|
+
|
|
2394
|
+
// ../../node_modules/.pnpm/lucide-react@0.555.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/ellipsis.js
|
|
2395
|
+
var __iconNode2 = [
|
|
2396
|
+
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
|
2397
|
+
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
|
2398
|
+
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }]
|
|
2399
|
+
];
|
|
2400
|
+
var Ellipsis = createLucideIcon("ellipsis", __iconNode2);
|
|
2401
|
+
|
|
2402
|
+
// src/components/ui/dialog.tsx
|
|
2403
|
+
import { jsx as jsx29, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1702
2404
|
|
|
1703
2405
|
// src/components/ui/command.tsx
|
|
1704
|
-
import { jsx as
|
|
2406
|
+
import { jsx as jsx30, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1705
2407
|
function Command({
|
|
1706
2408
|
className,
|
|
1707
2409
|
...props
|
|
1708
2410
|
}) {
|
|
1709
|
-
return /* @__PURE__ */
|
|
2411
|
+
return /* @__PURE__ */ jsx30(
|
|
1710
2412
|
CommandPrimitive,
|
|
1711
2413
|
{
|
|
1712
2414
|
"data-slot": "command",
|
|
@@ -1722,14 +2424,14 @@ function CommandInput({
|
|
|
1722
2424
|
className,
|
|
1723
2425
|
...props
|
|
1724
2426
|
}) {
|
|
1725
|
-
return /* @__PURE__ */
|
|
2427
|
+
return /* @__PURE__ */ jsxs19(
|
|
1726
2428
|
"div",
|
|
1727
2429
|
{
|
|
1728
2430
|
"data-slot": "command-input-wrapper",
|
|
1729
2431
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
1730
2432
|
children: [
|
|
1731
|
-
/* @__PURE__ */
|
|
1732
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ jsx30(SearchIcon, { className: "size-4 shrink-0 opacity-50 text-(--color-secondary)" }),
|
|
2434
|
+
/* @__PURE__ */ jsx30(
|
|
1733
2435
|
CommandPrimitive.Input,
|
|
1734
2436
|
{
|
|
1735
2437
|
"data-slot": "command-input",
|
|
@@ -1748,7 +2450,7 @@ function CommandList({
|
|
|
1748
2450
|
className,
|
|
1749
2451
|
...props
|
|
1750
2452
|
}) {
|
|
1751
|
-
return /* @__PURE__ */
|
|
2453
|
+
return /* @__PURE__ */ jsx30(
|
|
1752
2454
|
CommandPrimitive.List,
|
|
1753
2455
|
{
|
|
1754
2456
|
"data-slot": "command-list",
|
|
@@ -1763,7 +2465,7 @@ function CommandList({
|
|
|
1763
2465
|
function CommandEmpty({
|
|
1764
2466
|
...props
|
|
1765
2467
|
}) {
|
|
1766
|
-
return /* @__PURE__ */
|
|
2468
|
+
return /* @__PURE__ */ jsx30(
|
|
1767
2469
|
CommandPrimitive.Empty,
|
|
1768
2470
|
{
|
|
1769
2471
|
"data-slot": "command-empty",
|
|
@@ -1776,7 +2478,7 @@ function CommandGroup({
|
|
|
1776
2478
|
className,
|
|
1777
2479
|
...props
|
|
1778
2480
|
}) {
|
|
1779
|
-
return /* @__PURE__ */
|
|
2481
|
+
return /* @__PURE__ */ jsx30(
|
|
1780
2482
|
CommandPrimitive.Group,
|
|
1781
2483
|
{
|
|
1782
2484
|
"data-slot": "command-group",
|
|
@@ -1792,7 +2494,7 @@ function CommandItem({
|
|
|
1792
2494
|
className,
|
|
1793
2495
|
...props
|
|
1794
2496
|
}) {
|
|
1795
|
-
return /* @__PURE__ */
|
|
2497
|
+
return /* @__PURE__ */ jsx30(
|
|
1796
2498
|
CommandPrimitive.Item,
|
|
1797
2499
|
{
|
|
1798
2500
|
"data-slot": "command-item",
|
|
@@ -1808,16 +2510,16 @@ function CommandItem({
|
|
|
1808
2510
|
// src/components/ui/popover.tsx
|
|
1809
2511
|
import "react";
|
|
1810
2512
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
1811
|
-
import { jsx as
|
|
2513
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1812
2514
|
function Popover({
|
|
1813
2515
|
...props
|
|
1814
2516
|
}) {
|
|
1815
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ jsx31(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
1816
2518
|
}
|
|
1817
2519
|
function PopoverTrigger({
|
|
1818
2520
|
...props
|
|
1819
2521
|
}) {
|
|
1820
|
-
return /* @__PURE__ */
|
|
2522
|
+
return /* @__PURE__ */ jsx31(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
1821
2523
|
}
|
|
1822
2524
|
function PopoverContent({
|
|
1823
2525
|
className,
|
|
@@ -1825,7 +2527,7 @@ function PopoverContent({
|
|
|
1825
2527
|
sideOffset = 4,
|
|
1826
2528
|
...props
|
|
1827
2529
|
}) {
|
|
1828
|
-
return /* @__PURE__ */
|
|
2530
|
+
return /* @__PURE__ */ jsx31(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx31(
|
|
1829
2531
|
PopoverPrimitive.Content,
|
|
1830
2532
|
{
|
|
1831
2533
|
"data-slot": "popover-content",
|
|
@@ -1843,20 +2545,20 @@ function PopoverContent({
|
|
|
1843
2545
|
// src/components/ui/scroll-area.tsx
|
|
1844
2546
|
import "react";
|
|
1845
2547
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
1846
|
-
import { jsx as
|
|
2548
|
+
import { jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1847
2549
|
function ScrollArea({
|
|
1848
2550
|
className,
|
|
1849
2551
|
children,
|
|
1850
2552
|
...props
|
|
1851
2553
|
}) {
|
|
1852
|
-
return /* @__PURE__ */
|
|
2554
|
+
return /* @__PURE__ */ jsxs20(
|
|
1853
2555
|
ScrollAreaPrimitive.Root,
|
|
1854
2556
|
{
|
|
1855
2557
|
"data-slot": "scroll-area",
|
|
1856
2558
|
className: cn("relative", className),
|
|
1857
2559
|
...props,
|
|
1858
2560
|
children: [
|
|
1859
|
-
/* @__PURE__ */
|
|
2561
|
+
/* @__PURE__ */ jsx32(
|
|
1860
2562
|
ScrollAreaPrimitive.Viewport,
|
|
1861
2563
|
{
|
|
1862
2564
|
"data-slot": "scroll-area-viewport",
|
|
@@ -1864,8 +2566,8 @@ function ScrollArea({
|
|
|
1864
2566
|
children
|
|
1865
2567
|
}
|
|
1866
2568
|
),
|
|
1867
|
-
/* @__PURE__ */
|
|
1868
|
-
/* @__PURE__ */
|
|
2569
|
+
/* @__PURE__ */ jsx32(ScrollBar, {}),
|
|
2570
|
+
/* @__PURE__ */ jsx32(ScrollAreaPrimitive.Corner, {})
|
|
1869
2571
|
]
|
|
1870
2572
|
}
|
|
1871
2573
|
);
|
|
@@ -1875,7 +2577,7 @@ function ScrollBar({
|
|
|
1875
2577
|
orientation = "vertical",
|
|
1876
2578
|
...props
|
|
1877
2579
|
}) {
|
|
1878
|
-
return /* @__PURE__ */
|
|
2580
|
+
return /* @__PURE__ */ jsx32(
|
|
1879
2581
|
ScrollAreaPrimitive.ScrollAreaScrollbar,
|
|
1880
2582
|
{
|
|
1881
2583
|
"data-slot": "scroll-area-scrollbar",
|
|
@@ -1888,7 +2590,7 @@ function ScrollBar({
|
|
|
1888
2590
|
className
|
|
1889
2591
|
),
|
|
1890
2592
|
...props,
|
|
1891
|
-
children: /* @__PURE__ */
|
|
2593
|
+
children: /* @__PURE__ */ jsx32(
|
|
1892
2594
|
ScrollAreaPrimitive.ScrollAreaThumb,
|
|
1893
2595
|
{
|
|
1894
2596
|
"data-slot": "scroll-area-thumb",
|
|
@@ -1900,10 +2602,10 @@ function ScrollBar({
|
|
|
1900
2602
|
}
|
|
1901
2603
|
|
|
1902
2604
|
// src/components/Inputs/PhoneInput.tsx
|
|
1903
|
-
import { cva as
|
|
1904
|
-
import { jsx as
|
|
2605
|
+
import { cva as cva18 } from "class-variance-authority";
|
|
2606
|
+
import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1905
2607
|
var inputBase = "h-full rounded-4 border-(--border-secondary) bg-(--background-primary) hover:border-(--border-secondary-hover)";
|
|
1906
|
-
var sizeBase =
|
|
2608
|
+
var sizeBase = cva18(
|
|
1907
2609
|
"flex w-full",
|
|
1908
2610
|
{
|
|
1909
2611
|
variants: {
|
|
@@ -1916,7 +2618,7 @@ var sizeBase = cva16(
|
|
|
1916
2618
|
}
|
|
1917
2619
|
}
|
|
1918
2620
|
);
|
|
1919
|
-
var
|
|
2621
|
+
var inputTextVariants2 = cva18("", {
|
|
1920
2622
|
variants: {
|
|
1921
2623
|
size: {
|
|
1922
2624
|
sm: "paragraph-md",
|
|
@@ -1932,12 +2634,41 @@ var inputTextVariants = cva16("", {
|
|
|
1932
2634
|
size: "lg"
|
|
1933
2635
|
}
|
|
1934
2636
|
});
|
|
2637
|
+
var dropdownWidthVariants = cva18("", {
|
|
2638
|
+
variants: {
|
|
2639
|
+
size: {
|
|
2640
|
+
sm: "min-w-70",
|
|
2641
|
+
md: "min-w-72",
|
|
2642
|
+
lg: "min-w-80",
|
|
2643
|
+
xl: "min-w-96"
|
|
2644
|
+
}
|
|
2645
|
+
},
|
|
2646
|
+
defaultVariants: {
|
|
2647
|
+
size: "lg"
|
|
2648
|
+
}
|
|
2649
|
+
});
|
|
1935
2650
|
var wrapperStatusClass = {
|
|
1936
2651
|
default: "input-default-nested",
|
|
1937
2652
|
success: "input-success-nested",
|
|
1938
2653
|
error: "input-error-nested"
|
|
1939
2654
|
};
|
|
1940
|
-
var
|
|
2655
|
+
var countryOptionVariants = cva18(
|
|
2656
|
+
"gap-2 pl-(--space-8) pr-(--space-16) text-left text-primary cursor-pointer hover:bg-(--background-secondary) data-[selected=true]:bg-(--background-secondary) data-[selected=true]:text-primary",
|
|
2657
|
+
{
|
|
2658
|
+
variants: {
|
|
2659
|
+
size: {
|
|
2660
|
+
sm: "paragraph-sm py-(--space-4)",
|
|
2661
|
+
md: "paragraph-md py-(--space-6)",
|
|
2662
|
+
lg: "paragraph-lg py-(--space-8)",
|
|
2663
|
+
xl: "subtitle py-(--space-10)"
|
|
2664
|
+
}
|
|
2665
|
+
},
|
|
2666
|
+
defaultVariants: {
|
|
2667
|
+
size: "lg"
|
|
2668
|
+
}
|
|
2669
|
+
}
|
|
2670
|
+
);
|
|
2671
|
+
var PhoneInput = React31.forwardRef(
|
|
1941
2672
|
(props, ref) => {
|
|
1942
2673
|
const {
|
|
1943
2674
|
className,
|
|
@@ -1952,7 +2683,7 @@ var PhoneInput = React27.forwardRef(
|
|
|
1952
2683
|
status = "default",
|
|
1953
2684
|
...rest
|
|
1954
2685
|
} = props;
|
|
1955
|
-
return /* @__PURE__ */
|
|
2686
|
+
return /* @__PURE__ */ jsx33(
|
|
1956
2687
|
Field,
|
|
1957
2688
|
{
|
|
1958
2689
|
label,
|
|
@@ -1961,16 +2692,16 @@ var PhoneInput = React27.forwardRef(
|
|
|
1961
2692
|
status,
|
|
1962
2693
|
disabled,
|
|
1963
2694
|
className,
|
|
1964
|
-
children: /* @__PURE__ */
|
|
2695
|
+
children: /* @__PURE__ */ jsx33("div", { className: cn("w-full", wrapperStatusClass[status]), children: /* @__PURE__ */ jsx33(
|
|
1965
2696
|
RPNInput.default,
|
|
1966
2697
|
{
|
|
1967
2698
|
ref,
|
|
1968
2699
|
className: cn(
|
|
1969
2700
|
sizeBase({ size }),
|
|
1970
|
-
|
|
2701
|
+
inputTextVariants2({ size, disabled })
|
|
1971
2702
|
),
|
|
1972
2703
|
flagComponent: FlagComponent,
|
|
1973
|
-
countrySelectComponent: CountrySelect,
|
|
2704
|
+
countrySelectComponent: (countrySelectProps) => /* @__PURE__ */ jsx33(CountrySelect, { ...countrySelectProps, size }),
|
|
1974
2705
|
inputComponent: InputComponent,
|
|
1975
2706
|
smartCaret: false,
|
|
1976
2707
|
value: value || void 0,
|
|
@@ -1987,9 +2718,9 @@ var PhoneInput = React27.forwardRef(
|
|
|
1987
2718
|
}
|
|
1988
2719
|
);
|
|
1989
2720
|
PhoneInput.displayName = "PhoneInput";
|
|
1990
|
-
var InputComponent =
|
|
2721
|
+
var InputComponent = React31.forwardRef((props, ref) => {
|
|
1991
2722
|
const { className, ...rest } = props;
|
|
1992
|
-
return /* @__PURE__ */
|
|
2723
|
+
return /* @__PURE__ */ jsx33(
|
|
1993
2724
|
Input,
|
|
1994
2725
|
{
|
|
1995
2726
|
ref,
|
|
@@ -2004,22 +2735,25 @@ var CountrySelect = ({
|
|
|
2004
2735
|
disabled,
|
|
2005
2736
|
value: selectedCountry,
|
|
2006
2737
|
options: countryList,
|
|
2007
|
-
onChange
|
|
2738
|
+
onChange,
|
|
2739
|
+
size = "lg"
|
|
2008
2740
|
}) => {
|
|
2009
|
-
const scrollAreaRef =
|
|
2010
|
-
const [searchValue, setSearchValue] =
|
|
2011
|
-
const [isOpen, setIsOpen] =
|
|
2012
|
-
return /* @__PURE__ */
|
|
2741
|
+
const scrollAreaRef = React31.useRef(null);
|
|
2742
|
+
const [searchValue, setSearchValue] = React31.useState("");
|
|
2743
|
+
const [isOpen, setIsOpen] = React31.useState(false);
|
|
2744
|
+
return /* @__PURE__ */ jsxs21(
|
|
2013
2745
|
Popover,
|
|
2014
2746
|
{
|
|
2015
2747
|
open: isOpen,
|
|
2016
2748
|
modal: true,
|
|
2017
2749
|
onOpenChange: (open) => {
|
|
2018
2750
|
setIsOpen(open);
|
|
2019
|
-
|
|
2751
|
+
if (open) {
|
|
2752
|
+
setSearchValue("");
|
|
2753
|
+
}
|
|
2020
2754
|
},
|
|
2021
2755
|
children: [
|
|
2022
|
-
/* @__PURE__ */
|
|
2756
|
+
/* @__PURE__ */ jsx33(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs21(
|
|
2023
2757
|
Button2,
|
|
2024
2758
|
{
|
|
2025
2759
|
type: "button",
|
|
@@ -2027,14 +2761,14 @@ var CountrySelect = ({
|
|
|
2027
2761
|
className: cn(inputBase, "flex gap-1 rounded-4 px-3 focus:z-10 mr-(--space-12) text-primary-disabled hover:text-(--color-primary-hover) focus:text-(--color-primary-focus)"),
|
|
2028
2762
|
disabled,
|
|
2029
2763
|
children: [
|
|
2030
|
-
/* @__PURE__ */
|
|
2764
|
+
/* @__PURE__ */ jsx33(
|
|
2031
2765
|
FlagComponent,
|
|
2032
2766
|
{
|
|
2033
2767
|
country: selectedCountry,
|
|
2034
2768
|
countryName: selectedCountry
|
|
2035
2769
|
}
|
|
2036
2770
|
),
|
|
2037
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsx33(
|
|
2038
2772
|
CodeIcon,
|
|
2039
2773
|
{
|
|
2040
2774
|
className: cn(
|
|
@@ -2046,13 +2780,17 @@ var CountrySelect = ({
|
|
|
2046
2780
|
]
|
|
2047
2781
|
}
|
|
2048
2782
|
) }),
|
|
2049
|
-
/* @__PURE__ */
|
|
2783
|
+
/* @__PURE__ */ jsx33(
|
|
2050
2784
|
PopoverContent,
|
|
2051
2785
|
{
|
|
2052
2786
|
align: "start",
|
|
2053
|
-
className:
|
|
2054
|
-
|
|
2055
|
-
|
|
2787
|
+
className: cn(
|
|
2788
|
+
"p-0 **:data-[slot='command-input-wrapper']:border-b-(--border-secondary)",
|
|
2789
|
+
dropdownWidthVariants({ size }),
|
|
2790
|
+
dropdownSurfaceClass
|
|
2791
|
+
),
|
|
2792
|
+
children: /* @__PURE__ */ jsxs21(Command, { className: "bg-transparent", children: [
|
|
2793
|
+
/* @__PURE__ */ jsx33(
|
|
2056
2794
|
CommandInput,
|
|
2057
2795
|
{
|
|
2058
2796
|
value: searchValue,
|
|
@@ -2072,17 +2810,18 @@ var CountrySelect = ({
|
|
|
2072
2810
|
placeholder: "Search country..."
|
|
2073
2811
|
}
|
|
2074
2812
|
),
|
|
2075
|
-
/* @__PURE__ */
|
|
2076
|
-
/* @__PURE__ */
|
|
2077
|
-
/* @__PURE__ */
|
|
2078
|
-
({ value, label }) => value ? /* @__PURE__ */
|
|
2813
|
+
/* @__PURE__ */ jsx33(CommandList, { children: /* @__PURE__ */ jsxs21(ScrollArea, { ref: scrollAreaRef, className: "max-h-79", children: [
|
|
2814
|
+
/* @__PURE__ */ jsx33(CommandEmpty, { children: "No country found." }),
|
|
2815
|
+
/* @__PURE__ */ jsx33(CommandGroup, { className: "p-0", children: countryList.map(
|
|
2816
|
+
({ value, label }) => value ? /* @__PURE__ */ jsx33(
|
|
2079
2817
|
CountrySelectOption,
|
|
2080
2818
|
{
|
|
2081
2819
|
country: value,
|
|
2082
2820
|
countryName: label,
|
|
2083
2821
|
selectedCountry,
|
|
2084
2822
|
onChange,
|
|
2085
|
-
onSelectComplete: () => setIsOpen(false)
|
|
2823
|
+
onSelectComplete: () => setIsOpen(false),
|
|
2824
|
+
size
|
|
2086
2825
|
},
|
|
2087
2826
|
value
|
|
2088
2827
|
) : null
|
|
@@ -2101,22 +2840,23 @@ var CountrySelectOption = (props) => {
|
|
|
2101
2840
|
countryName,
|
|
2102
2841
|
selectedCountry,
|
|
2103
2842
|
onChange,
|
|
2104
|
-
onSelectComplete
|
|
2843
|
+
onSelectComplete,
|
|
2844
|
+
size = "lg"
|
|
2105
2845
|
} = props;
|
|
2106
2846
|
const handleSelect = () => {
|
|
2107
2847
|
onChange(country);
|
|
2108
2848
|
onSelectComplete();
|
|
2109
2849
|
};
|
|
2110
|
-
return /* @__PURE__ */
|
|
2850
|
+
return /* @__PURE__ */ jsxs21(
|
|
2111
2851
|
CommandItem,
|
|
2112
2852
|
{
|
|
2113
|
-
className:
|
|
2853
|
+
className: cn(countryOptionVariants({ size })),
|
|
2114
2854
|
onSelect: handleSelect,
|
|
2115
2855
|
children: [
|
|
2116
|
-
/* @__PURE__ */
|
|
2117
|
-
/* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
/* @__PURE__ */
|
|
2856
|
+
/* @__PURE__ */ jsx33(FlagComponent, { country, countryName }),
|
|
2857
|
+
/* @__PURE__ */ jsx33("span", { className: "flex-1", children: countryName }),
|
|
2858
|
+
/* @__PURE__ */ jsx33("span", { className: "text-foreground/50", children: `+${RPNInput.getCountryCallingCode(country)}` }),
|
|
2859
|
+
/* @__PURE__ */ jsx33(
|
|
2120
2860
|
CheckIcon3,
|
|
2121
2861
|
{
|
|
2122
2862
|
className: `ml-auto size-4 ${country === selectedCountry ? "opacity-100" : "opacity-0"}`
|
|
@@ -2128,14 +2868,13 @@ var CountrySelectOption = (props) => {
|
|
|
2128
2868
|
};
|
|
2129
2869
|
var FlagComponent = ({ country, countryName }) => {
|
|
2130
2870
|
const Flag = flags[country];
|
|
2131
|
-
return /* @__PURE__ */
|
|
2871
|
+
return /* @__PURE__ */ jsx33("span", { className: "flex h-4 w-6 overflow-hidden rounded-2 bg-foreground/20 [&_svg:not([class*='size-'])]:size-full", children: Flag && /* @__PURE__ */ jsx33(Flag, { title: countryName }) });
|
|
2132
2872
|
};
|
|
2133
2873
|
|
|
2134
2874
|
// src/components/Inputs/RadioGroup.tsx
|
|
2135
|
-
import * as
|
|
2875
|
+
import * as React32 from "react";
|
|
2136
2876
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
2137
|
-
import { jsx as
|
|
2138
|
-
var wrapperBase = "flex flex-col gap-2 items-start";
|
|
2877
|
+
import { jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2139
2878
|
var RadioGroup = ({
|
|
2140
2879
|
label,
|
|
2141
2880
|
hint,
|
|
@@ -2149,131 +2888,110 @@ var RadioGroup = ({
|
|
|
2149
2888
|
className,
|
|
2150
2889
|
...rootProps
|
|
2151
2890
|
}) => {
|
|
2152
|
-
const groupId =
|
|
2891
|
+
const groupId = React32.useId();
|
|
2153
2892
|
const hintId = hint ? `${groupId}-hint` : void 0;
|
|
2154
2893
|
const handleValueChange = (next) => {
|
|
2155
2894
|
onValueChange?.(next);
|
|
2156
2895
|
};
|
|
2157
2896
|
const isHorizontal = orientation === "horizontal";
|
|
2158
|
-
return /* @__PURE__ */
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2897
|
+
return /* @__PURE__ */ jsx34(
|
|
2898
|
+
Field,
|
|
2899
|
+
{
|
|
2900
|
+
label,
|
|
2901
|
+
hint,
|
|
2902
|
+
hideHint,
|
|
2903
|
+
disabled,
|
|
2904
|
+
children: /* @__PURE__ */ jsx34(
|
|
2905
|
+
RadioGroupPrimitive.Root,
|
|
2906
|
+
{
|
|
2907
|
+
...rootProps,
|
|
2908
|
+
value,
|
|
2909
|
+
defaultValue,
|
|
2910
|
+
onValueChange: handleValueChange,
|
|
2911
|
+
disabled,
|
|
2912
|
+
"aria-describedby": hintId,
|
|
2913
|
+
className: cn(
|
|
2914
|
+
"flex",
|
|
2915
|
+
isHorizontal ? "flex-row gap-6" : "flex-col gap-2",
|
|
2916
|
+
className
|
|
2917
|
+
),
|
|
2918
|
+
children: options.map((option) => /* @__PURE__ */ jsx34("div", { className: "relative inline-flex", children: /* @__PURE__ */ jsxs22(
|
|
2919
|
+
RadioGroupPrimitive.Item,
|
|
2920
|
+
{
|
|
2921
|
+
value: option.value,
|
|
2922
|
+
disabled: disabled || option.disabled,
|
|
2923
|
+
className: cn(
|
|
2924
|
+
"group inline-flex items-center gap-2 outline-none",
|
|
2925
|
+
"data-disabled:pointer-events-none",
|
|
2926
|
+
disabled || option.disabled ? "cursor-default" : "cursor-pointer"
|
|
2927
|
+
),
|
|
2928
|
+
children: [
|
|
2929
|
+
/* @__PURE__ */ jsx34(
|
|
2930
|
+
"span",
|
|
2931
|
+
{
|
|
2932
|
+
className: cn(
|
|
2933
|
+
"flex items-center justify-center shrink-0 h-5 w-5 rounded-full border bg-(--background-primary) transition-all",
|
|
2934
|
+
// 1: enabled, unchecked, unfocused, unhovered
|
|
2935
|
+
"group-data-[state=unchecked]:border-(--border-secondary)",
|
|
2936
|
+
// 2: enabled, checked, unfocused, unhovered
|
|
2937
|
+
"group-data-[state=checked]:border-(--border-brand)",
|
|
2938
|
+
// 3: enabled, unchecked, hovered, unfocused
|
|
2939
|
+
"group-data-[state=unchecked]:group-hover:border-(--border-secondary-hover)",
|
|
2940
|
+
// 4: enabled, checked, hovered, unfocused
|
|
2941
|
+
"group-data-[state=checked]:group-hover:border-(--border-brand-hover)",
|
|
2942
|
+
"group-data-[state=checked]:group-hover:shadow-[0_0_0_var(--focus-ring-spread)_var(--focus-secondary)]",
|
|
2943
|
+
// 5: enabled, unchecked, focused (override 1/3)
|
|
2944
|
+
"group-data-[state=unchecked]:group-focus-visible:border-(--border-secondary-hover)",
|
|
2945
|
+
// 6: enabled, checked, focused (override 2/4)
|
|
2946
|
+
"group-data-[state=checked]:group-focus-visible:border-(--border-brand-focus)",
|
|
2947
|
+
"group-data-[state=checked]:group-focus-visible:shadow-[0_0_0_var(--focus-ring-spread)_var(--focus-primary)]",
|
|
2948
|
+
// 7: disabled, unchecked (override everything above)
|
|
2949
|
+
"group-[&[data-disabled][data-state=unchecked]]:border-none",
|
|
2950
|
+
"group-[&[data-disabled][data-state=unchecked]]:bg-(--background-primary-disabled)",
|
|
2951
|
+
// 8: disabled, checked (override everything above)
|
|
2952
|
+
"group-[&[data-disabled][data-state=checked]]:border-(--border-primary-disabled)",
|
|
2953
|
+
"group-[&[data-disabled][data-state=checked]]:bg-(--background-primary-disabled)"
|
|
2954
|
+
),
|
|
2955
|
+
children: /* @__PURE__ */ jsx34(
|
|
2956
|
+
"span",
|
|
2957
|
+
{
|
|
2958
|
+
className: cn(
|
|
2959
|
+
"h-4 w-4 rounded-full bg-(--background-brand) scale-0 transition-transform",
|
|
2960
|
+
"group-data-[state=checked]:scale-100",
|
|
2961
|
+
"group-data-[state=checked]:group-hover:bg-(--background-brand-hover)",
|
|
2962
|
+
"group-data-[state=checked]:group-focus-visible:bg-(--background-brand-hover)",
|
|
2963
|
+
"group-[&[data-disabled][data-state=checked]]:bg-(--background-brand-disabled)",
|
|
2964
|
+
"group-[&[data-disabled][data-state=unchecked]]:scale-0"
|
|
2965
|
+
)
|
|
2966
|
+
}
|
|
2967
|
+
)
|
|
2968
|
+
}
|
|
2196
2969
|
),
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
// 6: enabled, checked, focused (override 2/4)
|
|
2215
|
-
"group-data-[state=checked]:group-focus-visible:border-(--border-brand-focus)",
|
|
2216
|
-
"group-data-[state=checked]:group-focus-visible:shadow-[0_0_0_var(--focus-ring-spread)_var(--focus-primary)]",
|
|
2217
|
-
// 7: disabled, unchecked (override everything above)
|
|
2218
|
-
"group-[&[data-disabled][data-state=unchecked]]:border-none",
|
|
2219
|
-
"group-[&[data-disabled][data-state=unchecked]]:bg-(--background-primary-disabled)",
|
|
2220
|
-
// 8: disabled, checked (override everything above)
|
|
2221
|
-
"group-[&[data-disabled][data-state=checked]]:border-(--border-primary-disabled)",
|
|
2222
|
-
"group-[&[data-disabled][data-state=checked]]:bg-(--background-primary-disabled)"
|
|
2223
|
-
),
|
|
2224
|
-
children: /* @__PURE__ */ jsx30(
|
|
2225
|
-
"span",
|
|
2226
|
-
{
|
|
2227
|
-
className: cn(
|
|
2228
|
-
"h-4 w-4 rounded-full bg-(--background-brand) scale-0 transition-transform",
|
|
2229
|
-
"group-data-[state=checked]:scale-100",
|
|
2230
|
-
"group-data-[state=checked]:group-hover:bg-(--background-brand-hover)",
|
|
2231
|
-
"group-data-[state=checked]:group-focus-visible:bg-(--background-brand-hover)",
|
|
2232
|
-
"group-[&[data-disabled][data-state=checked]]:bg-(--background-brand-disabled)",
|
|
2233
|
-
"group-[&[data-disabled][data-state=unchecked]]:scale-0"
|
|
2234
|
-
)
|
|
2235
|
-
}
|
|
2236
|
-
)
|
|
2237
|
-
}
|
|
2238
|
-
),
|
|
2239
|
-
/* @__PURE__ */ jsx30(
|
|
2240
|
-
"span",
|
|
2241
|
-
{
|
|
2242
|
-
className: cn(
|
|
2243
|
-
"paragraph-sm text-primary",
|
|
2244
|
-
"group-data-[disabled]:text-primary-disabled whitespace-nowrap"
|
|
2245
|
-
),
|
|
2246
|
-
children: option.label
|
|
2247
|
-
}
|
|
2248
|
-
)
|
|
2249
|
-
]
|
|
2250
|
-
}
|
|
2251
|
-
)
|
|
2252
|
-
},
|
|
2253
|
-
option.value
|
|
2254
|
-
))
|
|
2255
|
-
}
|
|
2256
|
-
),
|
|
2257
|
-
!hideHint && /* @__PURE__ */ jsx30(
|
|
2258
|
-
"p",
|
|
2259
|
-
{
|
|
2260
|
-
id: hintId,
|
|
2261
|
-
className: cn(
|
|
2262
|
-
"caption text-(--color-secondary)",
|
|
2263
|
-
disabled && "text-primary-disabled"
|
|
2264
|
-
),
|
|
2265
|
-
children: hint ?? "\xA0"
|
|
2266
|
-
}
|
|
2267
|
-
)
|
|
2268
|
-
] });
|
|
2970
|
+
/* @__PURE__ */ jsx34(
|
|
2971
|
+
"span",
|
|
2972
|
+
{
|
|
2973
|
+
className: cn(
|
|
2974
|
+
"paragraph-sm text-primary",
|
|
2975
|
+
"group-data-disabled:text-primary-disabled whitespace-nowrap"
|
|
2976
|
+
),
|
|
2977
|
+
children: option.label
|
|
2978
|
+
}
|
|
2979
|
+
)
|
|
2980
|
+
]
|
|
2981
|
+
}
|
|
2982
|
+
) }, option.value))
|
|
2983
|
+
}
|
|
2984
|
+
)
|
|
2985
|
+
}
|
|
2986
|
+
);
|
|
2269
2987
|
};
|
|
2270
2988
|
|
|
2271
2989
|
// src/components/Inputs/SearchInput.tsx
|
|
2272
|
-
import * as
|
|
2273
|
-
import { cva as
|
|
2990
|
+
import * as React33 from "react";
|
|
2991
|
+
import { cva as cva19 } from "class-variance-authority";
|
|
2274
2992
|
import { SearchIcon as SearchIcon2 } from "@bubo-squared/icons";
|
|
2275
|
-
import { jsx as
|
|
2276
|
-
var searchTextVariants =
|
|
2993
|
+
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2994
|
+
var searchTextVariants = cva19("truncate", {
|
|
2277
2995
|
variants: {
|
|
2278
2996
|
size: {
|
|
2279
2997
|
sm: "paragraph-md",
|
|
@@ -2286,7 +3004,7 @@ var searchTextVariants = cva17("truncate", {
|
|
|
2286
3004
|
size: "lg"
|
|
2287
3005
|
}
|
|
2288
3006
|
});
|
|
2289
|
-
var
|
|
3007
|
+
var iconWrapperVariants3 = cva19("flex items-center justify-center shrink-0 text-(--icon-primary)", {
|
|
2290
3008
|
variants: {
|
|
2291
3009
|
size: {
|
|
2292
3010
|
sm: "size-4 [&>svg]:size-4",
|
|
@@ -2313,13 +3031,13 @@ var SearchInput = (props) => {
|
|
|
2313
3031
|
trailingIcon,
|
|
2314
3032
|
...inputProps
|
|
2315
3033
|
} = props;
|
|
2316
|
-
const inputRef =
|
|
3034
|
+
const inputRef = React33.useRef(null);
|
|
2317
3035
|
const handleContainerClick = () => {
|
|
2318
3036
|
if (disabled) return;
|
|
2319
3037
|
inputRef.current?.focus();
|
|
2320
3038
|
};
|
|
2321
3039
|
const showTrailingIcon = !!trailingIcon;
|
|
2322
|
-
return /* @__PURE__ */
|
|
3040
|
+
return /* @__PURE__ */ jsx35("div", { className: "flex flex-col gap-2 items-start w-full", children: /* @__PURE__ */ jsx35("div", { className: "relative w-full", children: /* @__PURE__ */ jsxs23(
|
|
2323
3041
|
InputShell,
|
|
2324
3042
|
{
|
|
2325
3043
|
size,
|
|
@@ -2328,8 +3046,8 @@ var SearchInput = (props) => {
|
|
|
2328
3046
|
className,
|
|
2329
3047
|
onClick: handleContainerClick,
|
|
2330
3048
|
children: [
|
|
2331
|
-
showLeadingIcon && /* @__PURE__ */
|
|
2332
|
-
/* @__PURE__ */
|
|
3049
|
+
showLeadingIcon && /* @__PURE__ */ jsx35("span", { className: cn(iconWrapperVariants3({ size, disabled: !!disabled })), children: leadingIcon ?? /* @__PURE__ */ jsx35(SearchIcon2, {}) }),
|
|
3050
|
+
/* @__PURE__ */ jsx35(
|
|
2333
3051
|
Input,
|
|
2334
3052
|
{
|
|
2335
3053
|
ref: inputRef,
|
|
@@ -2343,7 +3061,7 @@ var SearchInput = (props) => {
|
|
|
2343
3061
|
...inputProps
|
|
2344
3062
|
}
|
|
2345
3063
|
),
|
|
2346
|
-
showTrailingIcon && /* @__PURE__ */
|
|
3064
|
+
showTrailingIcon && /* @__PURE__ */ jsx35("span", { className: cn("cursor-pointer", iconWrapperVariants3({ size, disabled: !!disabled })), children: trailingIcon })
|
|
2347
3065
|
]
|
|
2348
3066
|
}
|
|
2349
3067
|
) }) });
|
|
@@ -2351,9 +3069,9 @@ var SearchInput = (props) => {
|
|
|
2351
3069
|
SearchInput.displayName = "SearchInput";
|
|
2352
3070
|
|
|
2353
3071
|
// src/components/Inputs/Slider.tsx
|
|
2354
|
-
import * as
|
|
2355
|
-
import { jsx as
|
|
2356
|
-
var
|
|
3072
|
+
import * as React34 from "react";
|
|
3073
|
+
import { Fragment as Fragment2, jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3074
|
+
var wrapperBase = "flex flex-col gap-2 items-start";
|
|
2357
3075
|
var isRangeProps = (props) => {
|
|
2358
3076
|
return Array.isArray(props.value) || Array.isArray(props.defaultValue);
|
|
2359
3077
|
};
|
|
@@ -2363,6 +3081,7 @@ var toArray = (value) => {
|
|
|
2363
3081
|
};
|
|
2364
3082
|
var Slider = (props) => {
|
|
2365
3083
|
const {
|
|
3084
|
+
name,
|
|
2366
3085
|
display = "flat",
|
|
2367
3086
|
tooltipPlacement = "top",
|
|
2368
3087
|
tooltipFormatter,
|
|
@@ -2378,7 +3097,7 @@ var Slider = (props) => {
|
|
|
2378
3097
|
const isRange = isRangeProps(props);
|
|
2379
3098
|
const isControlled = value !== void 0;
|
|
2380
3099
|
const expectedLength = isRange ? 2 : 1;
|
|
2381
|
-
const normalizeArray =
|
|
3100
|
+
const normalizeArray = React34.useCallback(
|
|
2382
3101
|
(arr, fallback) => {
|
|
2383
3102
|
if (!arr || arr.length === 0) return fallback;
|
|
2384
3103
|
if (arr.length === expectedLength) return arr;
|
|
@@ -2390,16 +3109,16 @@ var Slider = (props) => {
|
|
|
2390
3109
|
},
|
|
2391
3110
|
[expectedLength, max]
|
|
2392
3111
|
);
|
|
2393
|
-
const defaultInternal =
|
|
3112
|
+
const defaultInternal = React34.useMemo(() => {
|
|
2394
3113
|
const defaultValueArray = toArray(defaultValue);
|
|
2395
3114
|
if (defaultValueArray) return normalizeArray(defaultValueArray, []);
|
|
2396
3115
|
if (isRange) return [min, Math.min(min + (max - min) / 4, max)];
|
|
2397
3116
|
return [min + (max - min) / 3];
|
|
2398
3117
|
}, [defaultValue, min, max, isRange, normalizeArray]);
|
|
2399
|
-
const [internalValue, setInternalValue] =
|
|
3118
|
+
const [internalValue, setInternalValue] = React34.useState(
|
|
2400
3119
|
() => normalizeArray(isControlled ? toArray(value) : defaultInternal, defaultInternal)
|
|
2401
3120
|
);
|
|
2402
|
-
|
|
3121
|
+
React34.useEffect(() => {
|
|
2403
3122
|
if (isControlled) {
|
|
2404
3123
|
setInternalValue(
|
|
2405
3124
|
(current2) => normalizeArray(toArray(value), current2.length ? current2 : defaultInternal)
|
|
@@ -2407,32 +3126,15 @@ var Slider = (props) => {
|
|
|
2407
3126
|
}
|
|
2408
3127
|
}, [isControlled, value, normalizeArray, defaultInternal]);
|
|
2409
3128
|
const current = internalValue;
|
|
2410
|
-
const trackRef =
|
|
2411
|
-
const [draggingThumbIndex, setDraggingThumbIndex] =
|
|
2412
|
-
const [hoveredThumbIndex, setHoveredThumbIndex] =
|
|
2413
|
-
const clamp = (val) => {
|
|
3129
|
+
const trackRef = React34.useRef(null);
|
|
3130
|
+
const [draggingThumbIndex, setDraggingThumbIndex] = React34.useState(null);
|
|
3131
|
+
const [hoveredThumbIndex, setHoveredThumbIndex] = React34.useState(null);
|
|
3132
|
+
const clamp = React34.useCallback((val) => {
|
|
2414
3133
|
if (val < min) return min;
|
|
2415
3134
|
if (val > max) return max;
|
|
2416
3135
|
return val;
|
|
2417
|
-
};
|
|
2418
|
-
|
|
2419
|
-
if (!isControlled) {
|
|
2420
|
-
setInternalValue((prev) => {
|
|
2421
|
-
const clamped = prev.map((v) => clamp(v));
|
|
2422
|
-
if (isRange && clamped.length === 2 && step > 0) {
|
|
2423
|
-
return enforceMinGap(clamped, prev);
|
|
2424
|
-
}
|
|
2425
|
-
return clamped;
|
|
2426
|
-
});
|
|
2427
|
-
}
|
|
2428
|
-
}, [isControlled, min, max, isRange]);
|
|
2429
|
-
const snap = (val) => {
|
|
2430
|
-
const range = max - min;
|
|
2431
|
-
if (range <= 0 || step <= 0) return clamp(val);
|
|
2432
|
-
const stepsFromMin = Math.round((val - min) / step);
|
|
2433
|
-
return clamp(min + stepsFromMin * step);
|
|
2434
|
-
};
|
|
2435
|
-
const enforceMinGap = (next, prev) => {
|
|
3136
|
+
}, [min, max]);
|
|
3137
|
+
const enforceMinGap = React34.useCallback((next, prev) => {
|
|
2436
3138
|
if (!isRange || next.length !== 2 || step <= 0) return next;
|
|
2437
3139
|
let [low, high] = next;
|
|
2438
3140
|
const [prevLow, prevHigh] = prev.length === 2 ? prev : next;
|
|
@@ -2455,6 +3157,23 @@ var Slider = (props) => {
|
|
|
2455
3157
|
}
|
|
2456
3158
|
}
|
|
2457
3159
|
return [low, high];
|
|
3160
|
+
}, [isRange, step, clamp]);
|
|
3161
|
+
React34.useEffect(() => {
|
|
3162
|
+
if (!isControlled) {
|
|
3163
|
+
setInternalValue((prev) => {
|
|
3164
|
+
const clamped = prev.map((v) => clamp(v));
|
|
3165
|
+
if (isRange && clamped.length === 2 && step > 0) {
|
|
3166
|
+
return enforceMinGap(clamped, prev);
|
|
3167
|
+
}
|
|
3168
|
+
return clamped;
|
|
3169
|
+
});
|
|
3170
|
+
}
|
|
3171
|
+
}, [isControlled, clamp, enforceMinGap, isRange, step]);
|
|
3172
|
+
const snap = (val) => {
|
|
3173
|
+
const range = max - min;
|
|
3174
|
+
if (range <= 0 || step <= 0) return clamp(val);
|
|
3175
|
+
const stepsFromMin = Math.round((val - min) / step);
|
|
3176
|
+
return clamp(min + stepsFromMin * step);
|
|
2458
3177
|
};
|
|
2459
3178
|
const updateValue = (next) => {
|
|
2460
3179
|
let normalized = normalizeArray(next, current);
|
|
@@ -2608,7 +3327,7 @@ var Slider = (props) => {
|
|
|
2608
3327
|
const trackHeight = 32;
|
|
2609
3328
|
const thumbWidth = 18;
|
|
2610
3329
|
const thumbRadius = thumbWidth / 2;
|
|
2611
|
-
const renderTooltipBubble = (key, percent, labelText, isVisible) => /* @__PURE__ */
|
|
3330
|
+
const renderTooltipBubble = (key, percent, labelText, isVisible) => /* @__PURE__ */ jsx36(
|
|
2612
3331
|
"div",
|
|
2613
3332
|
{
|
|
2614
3333
|
className: cn(
|
|
@@ -2623,12 +3342,12 @@ var Slider = (props) => {
|
|
|
2623
3342
|
marginBottom: isTooltipAbove ? 8 : void 0,
|
|
2624
3343
|
marginTop: isTooltipAbove ? void 0 : 8
|
|
2625
3344
|
},
|
|
2626
|
-
children: /* @__PURE__ */
|
|
3345
|
+
children: /* @__PURE__ */ jsxs24(
|
|
2627
3346
|
"div",
|
|
2628
3347
|
{
|
|
2629
3348
|
className: cn("relative rounded-4 shadow-card-md px-(--space-8) py-(--space-4) bg-(--background-tooltip)"),
|
|
2630
3349
|
children: [
|
|
2631
|
-
/* @__PURE__ */
|
|
3350
|
+
/* @__PURE__ */ jsx36(
|
|
2632
3351
|
"p",
|
|
2633
3352
|
{
|
|
2634
3353
|
className: cn(
|
|
@@ -2638,7 +3357,7 @@ var Slider = (props) => {
|
|
|
2638
3357
|
children: labelText
|
|
2639
3358
|
}
|
|
2640
3359
|
),
|
|
2641
|
-
/* @__PURE__ */
|
|
3360
|
+
/* @__PURE__ */ jsx36(
|
|
2642
3361
|
"div",
|
|
2643
3362
|
{
|
|
2644
3363
|
className: cn(
|
|
@@ -2656,7 +3375,7 @@ var Slider = (props) => {
|
|
|
2656
3375
|
const renderHandle = (index, percent, ariaValueText) => {
|
|
2657
3376
|
const val = index === 0 ? primary : secondary;
|
|
2658
3377
|
const isDragging = draggingThumbIndex === index;
|
|
2659
|
-
return /* @__PURE__ */
|
|
3378
|
+
return /* @__PURE__ */ jsx36(
|
|
2660
3379
|
"button",
|
|
2661
3380
|
{
|
|
2662
3381
|
type: "button",
|
|
@@ -2677,7 +3396,7 @@ var Slider = (props) => {
|
|
|
2677
3396
|
style: {
|
|
2678
3397
|
left: `${percent}%`,
|
|
2679
3398
|
top: `calc(50% - ${trackHeight / 2}px)`,
|
|
2680
|
-
|
|
3399
|
+
"--slider-halo-color": "color-mix(in srgb, var(--color-brand) 10%, transparent)"
|
|
2681
3400
|
},
|
|
2682
3401
|
onPointerEnter: () => {
|
|
2683
3402
|
setHoveredThumbIndex(index);
|
|
@@ -2696,76 +3415,97 @@ var Slider = (props) => {
|
|
|
2696
3415
|
index
|
|
2697
3416
|
);
|
|
2698
3417
|
};
|
|
2699
|
-
return /* @__PURE__ */
|
|
3418
|
+
return /* @__PURE__ */ jsxs24(
|
|
2700
3419
|
"div",
|
|
2701
3420
|
{
|
|
2702
|
-
className:
|
|
3421
|
+
className: wrapperBase,
|
|
2703
3422
|
style: { marginInline: `${thumbRadius}px` },
|
|
2704
|
-
children:
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
|
|
2707
|
-
"
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
secondaryPercent,
|
|
2715
|
-
formatDisplayValue(secondary),
|
|
2716
|
-
hoveredThumbIndex === 1 || draggingThumbIndex === 1
|
|
3423
|
+
children: [
|
|
3424
|
+
name && /* @__PURE__ */ jsxs24(Fragment2, { children: [
|
|
3425
|
+
/* @__PURE__ */ jsx36(
|
|
3426
|
+
"input",
|
|
3427
|
+
{
|
|
3428
|
+
type: "hidden",
|
|
3429
|
+
name,
|
|
3430
|
+
value: primary === void 0 ? "" : String(primary),
|
|
3431
|
+
disabled
|
|
3432
|
+
}
|
|
2717
3433
|
),
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
"
|
|
3434
|
+
isRange && secondary !== void 0 && /* @__PURE__ */ jsx36(
|
|
3435
|
+
"input",
|
|
3436
|
+
{
|
|
3437
|
+
type: "hidden",
|
|
3438
|
+
name,
|
|
3439
|
+
value: String(secondary),
|
|
3440
|
+
disabled
|
|
3441
|
+
}
|
|
3442
|
+
)
|
|
3443
|
+
] }),
|
|
3444
|
+
/* @__PURE__ */ jsxs24("div", { className: cn("w-full flex flex-col gap-1", className), children: [
|
|
3445
|
+
/* @__PURE__ */ jsxs24("div", { className: "relative w-full", children: [
|
|
3446
|
+
showTooltip && primary !== void 0 && renderTooltipBubble(
|
|
3447
|
+
"primary",
|
|
3448
|
+
primaryPercent,
|
|
3449
|
+
formatDisplayValue(primary),
|
|
3450
|
+
hoveredThumbIndex === 0 || draggingThumbIndex === 0
|
|
3451
|
+
),
|
|
3452
|
+
showTooltip && isRange && secondary !== void 0 && renderTooltipBubble(
|
|
3453
|
+
"secondary",
|
|
3454
|
+
secondaryPercent,
|
|
3455
|
+
formatDisplayValue(secondary),
|
|
3456
|
+
hoveredThumbIndex === 1 || draggingThumbIndex === 1
|
|
3457
|
+
),
|
|
3458
|
+
/* @__PURE__ */ jsxs24(
|
|
3459
|
+
"div",
|
|
3460
|
+
{
|
|
3461
|
+
className: cn(
|
|
3462
|
+
"relative w-full flex items-center rounded-4",
|
|
3463
|
+
disabled ? "bg-(--background-primary-disabled) cursor-default" : "bg-(--background-secondary) cursor-pointer"
|
|
3464
|
+
),
|
|
3465
|
+
style: { height: `${trackHeight}px` },
|
|
3466
|
+
ref: trackRef,
|
|
3467
|
+
onPointerDown: handleTrackPointerDown,
|
|
3468
|
+
children: [
|
|
3469
|
+
/* @__PURE__ */ jsx36(
|
|
3470
|
+
"div",
|
|
3471
|
+
{
|
|
3472
|
+
className: cn(
|
|
3473
|
+
"absolute h-full rounded-4",
|
|
3474
|
+
disabled ? "bg-(--background-primary-disabled)" : "bg-(--background-secondary)"
|
|
3475
|
+
),
|
|
3476
|
+
style: {
|
|
3477
|
+
width: `calc(100% + ${thumbWidth}px)`,
|
|
3478
|
+
left: `-${thumbRadius}px`
|
|
3479
|
+
}
|
|
3480
|
+
}
|
|
3481
|
+
),
|
|
3482
|
+
renderHandle(0, primaryPercent, formatDisplayValue(primary)),
|
|
3483
|
+
isRange && secondary !== void 0 && renderHandle(1, secondaryPercent, formatDisplayValue(secondary))
|
|
3484
|
+
]
|
|
3485
|
+
}
|
|
3486
|
+
)
|
|
3487
|
+
] }),
|
|
3488
|
+
showNumeric && /* @__PURE__ */ jsx36(
|
|
3489
|
+
"p",
|
|
2720
3490
|
{
|
|
2721
3491
|
className: cn(
|
|
2722
|
-
"
|
|
2723
|
-
disabled
|
|
3492
|
+
"paragraph-sm text-primary",
|
|
3493
|
+
disabled && "text-primary-disabled"
|
|
2724
3494
|
),
|
|
2725
|
-
|
|
2726
|
-
ref: trackRef,
|
|
2727
|
-
onPointerDown: handleTrackPointerDown,
|
|
2728
|
-
children: [
|
|
2729
|
-
/* @__PURE__ */ jsx32(
|
|
2730
|
-
"div",
|
|
2731
|
-
{
|
|
2732
|
-
className: cn(
|
|
2733
|
-
"absolute h-full rounded-4",
|
|
2734
|
-
disabled ? "bg-(--background-primary-disabled)" : "bg-(--background-secondary)"
|
|
2735
|
-
),
|
|
2736
|
-
style: {
|
|
2737
|
-
width: `calc(100% + ${thumbWidth}px)`,
|
|
2738
|
-
left: `-${thumbRadius}px`
|
|
2739
|
-
}
|
|
2740
|
-
}
|
|
2741
|
-
),
|
|
2742
|
-
renderHandle(0, primaryPercent, formatDisplayValue(primary)),
|
|
2743
|
-
isRange && secondary !== void 0 && renderHandle(1, secondaryPercent, formatDisplayValue(secondary))
|
|
2744
|
-
]
|
|
3495
|
+
children: formatNumericLabel()
|
|
2745
3496
|
}
|
|
2746
3497
|
)
|
|
2747
|
-
] })
|
|
2748
|
-
|
|
2749
|
-
"p",
|
|
2750
|
-
{
|
|
2751
|
-
className: cn(
|
|
2752
|
-
"paragraph-sm text-primary",
|
|
2753
|
-
disabled && "text-primary-disabled"
|
|
2754
|
-
),
|
|
2755
|
-
children: formatNumericLabel()
|
|
2756
|
-
}
|
|
2757
|
-
)
|
|
2758
|
-
] })
|
|
3498
|
+
] })
|
|
3499
|
+
]
|
|
2759
3500
|
}
|
|
2760
3501
|
);
|
|
2761
3502
|
};
|
|
2762
3503
|
Slider.displayName = "Slider";
|
|
2763
3504
|
|
|
2764
3505
|
// src/components/Inputs/TextArea.tsx
|
|
2765
|
-
import * as
|
|
3506
|
+
import * as React35 from "react";
|
|
2766
3507
|
import { MaximizeIcon } from "@bubo-squared/icons";
|
|
2767
|
-
import { jsx as
|
|
2768
|
-
var wrapperBase3 = "flex flex-col gap-2 items-start w-full";
|
|
3508
|
+
import { jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2769
3509
|
var TextArea = (props) => {
|
|
2770
3510
|
const {
|
|
2771
3511
|
label,
|
|
@@ -2780,10 +3520,12 @@ var TextArea = (props) => {
|
|
|
2780
3520
|
defaultValue,
|
|
2781
3521
|
onChange,
|
|
2782
3522
|
rows = 3,
|
|
3523
|
+
id,
|
|
3524
|
+
name,
|
|
2783
3525
|
...textareaProps
|
|
2784
3526
|
} = props;
|
|
2785
3527
|
const isControlled = value !== void 0;
|
|
2786
|
-
const [internalValue, setInternalValue] =
|
|
3528
|
+
const [internalValue, setInternalValue] = React35.useState(
|
|
2787
3529
|
defaultValue ?? ""
|
|
2788
3530
|
);
|
|
2789
3531
|
const currentValue = (isControlled ? value : internalValue) ?? "";
|
|
@@ -2791,10 +3533,10 @@ var TextArea = (props) => {
|
|
|
2791
3533
|
const currentLength = currentValue.length;
|
|
2792
3534
|
const effectiveMaxLength = type === "character-limit" ? maxLength ?? 144 : void 0;
|
|
2793
3535
|
const showCharacterLimit = type === "character-limit" && typeof effectiveMaxLength === "number";
|
|
2794
|
-
const textareaRef =
|
|
2795
|
-
const containerRef =
|
|
2796
|
-
const [height, setHeight] =
|
|
2797
|
-
const [width, setWidth] =
|
|
3536
|
+
const textareaRef = React35.useRef(null);
|
|
3537
|
+
const containerRef = React35.useRef(null);
|
|
3538
|
+
const [height, setHeight] = React35.useState(void 0);
|
|
3539
|
+
const [width, setWidth] = React35.useState(void 0);
|
|
2798
3540
|
const minHeight = 80;
|
|
2799
3541
|
const minWidth = 240;
|
|
2800
3542
|
const handleContainerClick = () => {
|
|
@@ -2807,9 +3549,8 @@ var TextArea = (props) => {
|
|
|
2807
3549
|
}
|
|
2808
3550
|
onChange?.(event);
|
|
2809
3551
|
};
|
|
2810
|
-
const
|
|
2811
|
-
const
|
|
2812
|
-
const hintId = `${inputId}-hint`;
|
|
3552
|
+
const generatedId = React35.useId();
|
|
3553
|
+
const textareaId = id ?? generatedId;
|
|
2813
3554
|
const statusBorderClass = {
|
|
2814
3555
|
default: "",
|
|
2815
3556
|
success: "border-(--border-success)",
|
|
@@ -2820,7 +3561,6 @@ var TextArea = (props) => {
|
|
|
2820
3561
|
success: "focus-within:border-(--border-success) focus-within:hover:border-(--border-success) focus-within:shadow-[0_0_0_var(--focus-ring-spread)_var(--focus-success)]",
|
|
2821
3562
|
error: "focus-within:border-(--border-error) focus-within:hover:border-(--border-error) focus-within:shadow-[0_0_0_var(--focus-ring-spread)_var(--focus-error)]"
|
|
2822
3563
|
};
|
|
2823
|
-
const hintColorClass = disabled ? "text-primary-disabled" : status === "success" ? "text-(--color-success)" : status === "error" ? "text-(--color-error)" : "text-(--color-secondary)";
|
|
2824
3564
|
const counterColorClass = disabled ? "text-primary-disabled" : status === "success" ? "text-(--color-success)" : status === "error" ? "text-(--color-error)" : "text-primary";
|
|
2825
3565
|
const handleResizePointerDown = (event) => {
|
|
2826
3566
|
if (disabled) return;
|
|
@@ -2846,110 +3586,98 @@ var TextArea = (props) => {
|
|
|
2846
3586
|
window.addEventListener("pointermove", handlePointerMove);
|
|
2847
3587
|
window.addEventListener("pointerup", handlePointerUp);
|
|
2848
3588
|
};
|
|
2849
|
-
return /* @__PURE__ */
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
disabled && "bg-(--background-primary-disabled) border-(--border-secondary-disabled) cursor-default",
|
|
2869
|
-
statusBorderClass[status],
|
|
2870
|
-
!disabled && statusFocusClass[status],
|
|
2871
|
-
className
|
|
2872
|
-
),
|
|
2873
|
-
ref: containerRef,
|
|
2874
|
-
style: {
|
|
2875
|
-
...type === "responsive" && height !== void 0 ? { height } : {},
|
|
2876
|
-
...type === "responsive" && width !== void 0 ? { width } : {}
|
|
2877
|
-
},
|
|
2878
|
-
onClick: handleContainerClick,
|
|
2879
|
-
"aria-disabled": disabled || void 0,
|
|
2880
|
-
children: [
|
|
2881
|
-
/* @__PURE__ */ jsx33(
|
|
2882
|
-
"textarea",
|
|
2883
|
-
{
|
|
2884
|
-
id: inputId,
|
|
2885
|
-
ref: textareaRef,
|
|
2886
|
-
"aria-labelledby": label ? labelId : void 0,
|
|
2887
|
-
"aria-describedby": hint ? hintId : void 0,
|
|
2888
|
-
disabled: disabled ?? void 0,
|
|
2889
|
-
value: isControlled ? value : currentValue,
|
|
2890
|
-
defaultValue: isControlled ? void 0 : defaultValue,
|
|
2891
|
-
onChange: handleChange,
|
|
2892
|
-
rows,
|
|
2893
|
-
maxLength: effectiveMaxLength,
|
|
2894
|
-
className: cn(
|
|
2895
|
-
"paragraph-md bg-transparent outline-none w-full h-full resize-none px-2 py-2 pr-8",
|
|
2896
|
-
disabled ? "text-primary-disabled" : hasValue ? "text-primary" : "text-(--color-secondary)",
|
|
2897
|
-
showCharacterLimit && "pr-16"
|
|
2898
|
-
),
|
|
2899
|
-
...textareaProps
|
|
2900
|
-
}
|
|
2901
|
-
),
|
|
2902
|
-
showCharacterLimit && /* @__PURE__ */ jsxs21(
|
|
2903
|
-
"span",
|
|
2904
|
-
{
|
|
2905
|
-
className: cn(
|
|
2906
|
-
"absolute bottom-1 right-1 footnote mb-0!",
|
|
2907
|
-
counterColorClass
|
|
2908
|
-
),
|
|
2909
|
-
children: [
|
|
2910
|
-
currentLength,
|
|
2911
|
-
"/",
|
|
2912
|
-
effectiveMaxLength
|
|
2913
|
-
]
|
|
2914
|
-
}
|
|
3589
|
+
return /* @__PURE__ */ jsx37(
|
|
3590
|
+
Field,
|
|
3591
|
+
{
|
|
3592
|
+
className: "w-full",
|
|
3593
|
+
label,
|
|
3594
|
+
hint,
|
|
3595
|
+
hideHint,
|
|
3596
|
+
status,
|
|
3597
|
+
disabled,
|
|
3598
|
+
children: /* @__PURE__ */ jsxs25(
|
|
3599
|
+
"div",
|
|
3600
|
+
{
|
|
3601
|
+
className: cn(
|
|
3602
|
+
"relative flex w-full rounded-4 border bg-(--background-primary) cursor-text transition-colors",
|
|
3603
|
+
"border-(--border-secondary) hover:border-(--border-secondary-hover) hover:bg-(--background-primary-hover)",
|
|
3604
|
+
disabled && "bg-(--background-primary-disabled) border-(--border-secondary-disabled) cursor-default",
|
|
3605
|
+
statusBorderClass[status],
|
|
3606
|
+
!disabled && statusFocusClass[status],
|
|
3607
|
+
className
|
|
2915
3608
|
),
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
{
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
3609
|
+
ref: containerRef,
|
|
3610
|
+
style: {
|
|
3611
|
+
...type === "responsive" && height !== void 0 ? { height } : {},
|
|
3612
|
+
...type === "responsive" && width !== void 0 ? { width } : {}
|
|
3613
|
+
},
|
|
3614
|
+
onClick: handleContainerClick,
|
|
3615
|
+
"aria-disabled": disabled || void 0,
|
|
3616
|
+
children: [
|
|
3617
|
+
/* @__PURE__ */ jsx37(
|
|
3618
|
+
"textarea",
|
|
3619
|
+
{
|
|
3620
|
+
id: textareaId,
|
|
3621
|
+
name,
|
|
3622
|
+
ref: textareaRef,
|
|
3623
|
+
disabled: disabled ?? void 0,
|
|
3624
|
+
value: isControlled ? value : currentValue,
|
|
3625
|
+
defaultValue: isControlled ? void 0 : defaultValue,
|
|
3626
|
+
onChange: handleChange,
|
|
3627
|
+
rows,
|
|
3628
|
+
maxLength: effectiveMaxLength,
|
|
3629
|
+
className: cn(
|
|
3630
|
+
"paragraph-md bg-transparent outline-none w-full h-full resize-none px-2 py-2 pr-8",
|
|
3631
|
+
disabled ? "text-primary-disabled" : hasValue ? "text-primary" : "text-(--color-secondary)",
|
|
3632
|
+
showCharacterLimit && "pr-16"
|
|
3633
|
+
),
|
|
3634
|
+
...textareaProps
|
|
3635
|
+
}
|
|
3636
|
+
),
|
|
3637
|
+
showCharacterLimit && /* @__PURE__ */ jsxs25(
|
|
3638
|
+
"span",
|
|
3639
|
+
{
|
|
3640
|
+
className: cn(
|
|
3641
|
+
"absolute bottom-1 right-1 footnote mb-0!",
|
|
3642
|
+
counterColorClass
|
|
3643
|
+
),
|
|
3644
|
+
children: [
|
|
3645
|
+
currentLength,
|
|
3646
|
+
"/",
|
|
3647
|
+
effectiveMaxLength
|
|
3648
|
+
]
|
|
3649
|
+
}
|
|
3650
|
+
),
|
|
3651
|
+
type === "responsive" && /* @__PURE__ */ jsx37(
|
|
3652
|
+
"div",
|
|
3653
|
+
{
|
|
3654
|
+
className: "absolute bottom-1 right-1 h-3 w-3 " + (disabled ? "cursor-auto" : "cursor-nwse-resize"),
|
|
3655
|
+
onPointerDown: disabled ? void 0 : handleResizePointerDown,
|
|
3656
|
+
children: /* @__PURE__ */ jsx37(
|
|
3657
|
+
"span",
|
|
3658
|
+
{
|
|
3659
|
+
className: cn(
|
|
3660
|
+
"absolute bottom-0 right-0 flex h-4 w-4 items-center justify-center text-(--icon-primary)",
|
|
3661
|
+
disabled && "text-(--icon-primary-disabled)"
|
|
3662
|
+
),
|
|
3663
|
+
children: /* @__PURE__ */ jsx37(MaximizeIcon, {})
|
|
3664
|
+
}
|
|
3665
|
+
)
|
|
3666
|
+
}
|
|
3667
|
+
)
|
|
3668
|
+
]
|
|
3669
|
+
}
|
|
3670
|
+
)
|
|
3671
|
+
}
|
|
3672
|
+
);
|
|
2945
3673
|
};
|
|
2946
3674
|
TextArea.displayName = "TextArea";
|
|
2947
3675
|
|
|
2948
3676
|
// src/components/Inputs/TextInput.tsx
|
|
2949
|
-
import * as
|
|
2950
|
-
import { cva as
|
|
2951
|
-
import { jsx as
|
|
2952
|
-
var
|
|
3677
|
+
import * as React36 from "react";
|
|
3678
|
+
import { cva as cva20 } from "class-variance-authority";
|
|
3679
|
+
import { jsx as jsx38, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3680
|
+
var inputTextVariants3 = cva20("truncate", {
|
|
2953
3681
|
variants: {
|
|
2954
3682
|
size: {
|
|
2955
3683
|
sm: "paragraph-md",
|
|
@@ -2962,7 +3690,7 @@ var inputTextVariants2 = cva18("truncate", {
|
|
|
2962
3690
|
size: "lg"
|
|
2963
3691
|
}
|
|
2964
3692
|
});
|
|
2965
|
-
var
|
|
3693
|
+
var iconWrapperVariants4 = cva20(
|
|
2966
3694
|
"flex items-center justify-center shrink-0 text-(--icon-primary)",
|
|
2967
3695
|
{
|
|
2968
3696
|
variants: {
|
|
@@ -2999,11 +3727,11 @@ var TextInput = (props) => {
|
|
|
2999
3727
|
...inputProps
|
|
3000
3728
|
} = props;
|
|
3001
3729
|
const isControlled = value !== void 0;
|
|
3002
|
-
const [internalValue, setInternalValue] =
|
|
3730
|
+
const [internalValue, setInternalValue] = React36.useState(
|
|
3003
3731
|
defaultValue ?? ""
|
|
3004
3732
|
);
|
|
3005
3733
|
const currentValue = (isControlled ? value : internalValue) ?? "";
|
|
3006
|
-
const inputRef =
|
|
3734
|
+
const inputRef = React36.useRef(null);
|
|
3007
3735
|
const handleContainerClick = () => {
|
|
3008
3736
|
if (disabled) return;
|
|
3009
3737
|
inputRef.current?.focus();
|
|
@@ -3016,7 +3744,7 @@ var TextInput = (props) => {
|
|
|
3016
3744
|
};
|
|
3017
3745
|
const showLeadingIcon = !!leadingIcon;
|
|
3018
3746
|
const showTrailingIcon = !!trailingIcon;
|
|
3019
|
-
return /* @__PURE__ */
|
|
3747
|
+
return /* @__PURE__ */ jsx38(
|
|
3020
3748
|
Field,
|
|
3021
3749
|
{
|
|
3022
3750
|
label,
|
|
@@ -3024,7 +3752,7 @@ var TextInput = (props) => {
|
|
|
3024
3752
|
hideHint,
|
|
3025
3753
|
status,
|
|
3026
3754
|
disabled,
|
|
3027
|
-
children: /* @__PURE__ */
|
|
3755
|
+
children: /* @__PURE__ */ jsxs26(
|
|
3028
3756
|
InputShell,
|
|
3029
3757
|
{
|
|
3030
3758
|
size,
|
|
@@ -3033,16 +3761,16 @@ var TextInput = (props) => {
|
|
|
3033
3761
|
className,
|
|
3034
3762
|
onClick: handleContainerClick,
|
|
3035
3763
|
children: [
|
|
3036
|
-
showLeadingIcon && /* @__PURE__ */
|
|
3764
|
+
showLeadingIcon && /* @__PURE__ */ jsx38(
|
|
3037
3765
|
"span",
|
|
3038
3766
|
{
|
|
3039
3767
|
className: cn(
|
|
3040
|
-
|
|
3768
|
+
iconWrapperVariants4({ size, disabled })
|
|
3041
3769
|
),
|
|
3042
3770
|
children: leadingIcon
|
|
3043
3771
|
}
|
|
3044
3772
|
),
|
|
3045
|
-
/* @__PURE__ */
|
|
3773
|
+
/* @__PURE__ */ jsx38(
|
|
3046
3774
|
Input,
|
|
3047
3775
|
{
|
|
3048
3776
|
ref: inputRef,
|
|
@@ -3054,17 +3782,17 @@ var TextInput = (props) => {
|
|
|
3054
3782
|
onChange: handleChange,
|
|
3055
3783
|
variant: "bare",
|
|
3056
3784
|
className: cn(
|
|
3057
|
-
|
|
3785
|
+
inputTextVariants3({ size }),
|
|
3058
3786
|
"bg-transparent outline-none w-full"
|
|
3059
3787
|
),
|
|
3060
3788
|
...inputProps
|
|
3061
3789
|
}
|
|
3062
3790
|
),
|
|
3063
|
-
showTrailingIcon && /* @__PURE__ */
|
|
3791
|
+
showTrailingIcon && /* @__PURE__ */ jsx38(
|
|
3064
3792
|
"span",
|
|
3065
3793
|
{
|
|
3066
3794
|
className: cn(
|
|
3067
|
-
|
|
3795
|
+
iconWrapperVariants4({ size, disabled: !!disabled })
|
|
3068
3796
|
),
|
|
3069
3797
|
children: trailingIcon
|
|
3070
3798
|
}
|
|
@@ -3079,10 +3807,10 @@ TextInput.displayName = "TextInput";
|
|
|
3079
3807
|
|
|
3080
3808
|
// src/components/Inputs/Toggle.tsx
|
|
3081
3809
|
import "react";
|
|
3082
|
-
import { jsx as
|
|
3810
|
+
import { jsx as jsx39, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3083
3811
|
var Toggle = (props) => {
|
|
3084
3812
|
const { label, className, disabled, ...inputProps } = props;
|
|
3085
|
-
return /* @__PURE__ */
|
|
3813
|
+
return /* @__PURE__ */ jsxs27(
|
|
3086
3814
|
"label",
|
|
3087
3815
|
{
|
|
3088
3816
|
className: cn(
|
|
@@ -3090,8 +3818,8 @@ var Toggle = (props) => {
|
|
|
3090
3818
|
disabled ? "cursor-default" : "cursor-pointer"
|
|
3091
3819
|
),
|
|
3092
3820
|
children: [
|
|
3093
|
-
/* @__PURE__ */
|
|
3094
|
-
/* @__PURE__ */
|
|
3821
|
+
/* @__PURE__ */ jsxs27("span", { className: "relative inline-flex items-center", children: [
|
|
3822
|
+
/* @__PURE__ */ jsx39(
|
|
3095
3823
|
"input",
|
|
3096
3824
|
{
|
|
3097
3825
|
type: "checkbox",
|
|
@@ -3100,7 +3828,7 @@ var Toggle = (props) => {
|
|
|
3100
3828
|
...inputProps
|
|
3101
3829
|
}
|
|
3102
3830
|
),
|
|
3103
|
-
/* @__PURE__ */
|
|
3831
|
+
/* @__PURE__ */ jsx39(
|
|
3104
3832
|
"span",
|
|
3105
3833
|
{
|
|
3106
3834
|
className: cn(
|
|
@@ -3140,7 +3868,7 @@ var Toggle = (props) => {
|
|
|
3140
3868
|
"peer-disabled:[&>.knob]:peer-checked:bg-(--background-primary-hover)",
|
|
3141
3869
|
className
|
|
3142
3870
|
),
|
|
3143
|
-
children: /* @__PURE__ */
|
|
3871
|
+
children: /* @__PURE__ */ jsx39(
|
|
3144
3872
|
"span",
|
|
3145
3873
|
{
|
|
3146
3874
|
className: cn(
|
|
@@ -3152,7 +3880,7 @@ var Toggle = (props) => {
|
|
|
3152
3880
|
}
|
|
3153
3881
|
)
|
|
3154
3882
|
] }),
|
|
3155
|
-
label && /* @__PURE__ */
|
|
3883
|
+
label && /* @__PURE__ */ jsx39(
|
|
3156
3884
|
"span",
|
|
3157
3885
|
{
|
|
3158
3886
|
className: cn(
|
|
@@ -3170,7 +3898,7 @@ Toggle.displayName = "Toggle";
|
|
|
3170
3898
|
|
|
3171
3899
|
// src/components/Inputs/WebsiteInput.tsx
|
|
3172
3900
|
import "react";
|
|
3173
|
-
import { jsx as
|
|
3901
|
+
import { jsx as jsx40, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3174
3902
|
var WebsiteInput = (props) => {
|
|
3175
3903
|
const {
|
|
3176
3904
|
hierarchy = "leading",
|
|
@@ -3207,15 +3935,15 @@ var WebsiteInput = (props) => {
|
|
|
3207
3935
|
size === "xl" ? "[&>svg]:w-6 [&>svg]:h-6" : size === "sm" ? "[&>svg]:w-4 [&>svg]:h-4" : "[&>svg]:w-5 [&>svg]:h-5",
|
|
3208
3936
|
disabled ? "text-(--icon-primary-disabled)" : "text-(--icon-primary) group-hover:text-(--icon-primary-hover) group-focus-within:text-(--icon-primary-focus)"
|
|
3209
3937
|
);
|
|
3210
|
-
const leadingAddon = /* @__PURE__ */
|
|
3211
|
-
/* @__PURE__ */
|
|
3212
|
-
icon != null && /* @__PURE__ */
|
|
3938
|
+
const leadingAddon = /* @__PURE__ */ jsxs28("div", { className: baseAddonClass, children: [
|
|
3939
|
+
/* @__PURE__ */ jsx40("div", { className: addonTextClass, children: protocolLabel }),
|
|
3940
|
+
icon != null && /* @__PURE__ */ jsx40("span", { className: iconWrapperClass, children: icon })
|
|
3213
3941
|
] });
|
|
3214
|
-
const trailingAddon = /* @__PURE__ */
|
|
3215
|
-
icon != null && /* @__PURE__ */
|
|
3216
|
-
/* @__PURE__ */
|
|
3942
|
+
const trailingAddon = /* @__PURE__ */ jsxs28("div", { className: baseAddonClass, children: [
|
|
3943
|
+
icon != null && /* @__PURE__ */ jsx40("span", { className: iconWrapperClass, children: icon }),
|
|
3944
|
+
/* @__PURE__ */ jsx40("div", { className: addonTextClass, children: protocolLabel })
|
|
3217
3945
|
] });
|
|
3218
|
-
return /* @__PURE__ */
|
|
3946
|
+
return /* @__PURE__ */ jsx40(
|
|
3219
3947
|
TextInput,
|
|
3220
3948
|
{
|
|
3221
3949
|
...rest,
|
|
@@ -3230,9 +3958,9 @@ var WebsiteInput = (props) => {
|
|
|
3230
3958
|
WebsiteInput.displayName = "WebsiteInput";
|
|
3231
3959
|
|
|
3232
3960
|
// src/components/Feedback/Popover.tsx
|
|
3233
|
-
import * as
|
|
3961
|
+
import * as React39 from "react";
|
|
3234
3962
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
3235
|
-
import { jsx as
|
|
3963
|
+
import { jsx as jsx41, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3236
3964
|
var PopoverArrow = PopoverPrimitive2.Arrow;
|
|
3237
3965
|
var Popover2 = (props) => {
|
|
3238
3966
|
const {
|
|
@@ -3249,7 +3977,7 @@ var Popover2 = (props) => {
|
|
|
3249
3977
|
offset = 10,
|
|
3250
3978
|
children
|
|
3251
3979
|
} = props;
|
|
3252
|
-
const [open, setOpen] =
|
|
3980
|
+
const [open, setOpen] = React39.useState(false);
|
|
3253
3981
|
const handleCancel = () => {
|
|
3254
3982
|
onCancel?.();
|
|
3255
3983
|
setOpen(false);
|
|
@@ -3258,9 +3986,9 @@ var Popover2 = (props) => {
|
|
|
3258
3986
|
onOk?.();
|
|
3259
3987
|
setOpen(false);
|
|
3260
3988
|
};
|
|
3261
|
-
const popoverClasses = "group bg-(--background-popover) popover w-80 max-w-[calc(100vw-2rem)] shadow-card-md border-none [
|
|
3262
|
-
const popoverArrowClasses = "relative fill-(--background-popover) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[
|
|
3263
|
-
const
|
|
3989
|
+
const popoverClasses = "group bg-(--background-popover) popover w-80 max-w-[calc(100vw-2rem)] shadow-card-md border-none [&>span]:scale-240 rounded-4";
|
|
3990
|
+
const popoverArrowClasses = "relative fill-(--background-popover) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=bottom]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=right]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)]";
|
|
3991
|
+
const mapPlacementToSideAndAlign2 = (placement2) => {
|
|
3264
3992
|
switch (placement2) {
|
|
3265
3993
|
case "top":
|
|
3266
3994
|
return { side: "top", align: "center" };
|
|
@@ -3290,10 +4018,10 @@ var Popover2 = (props) => {
|
|
|
3290
4018
|
return { side: "bottom", align: "center" };
|
|
3291
4019
|
}
|
|
3292
4020
|
};
|
|
3293
|
-
const { side, align } =
|
|
3294
|
-
return /* @__PURE__ */
|
|
3295
|
-
/* @__PURE__ */
|
|
3296
|
-
/* @__PURE__ */
|
|
4021
|
+
const { side, align } = mapPlacementToSideAndAlign2(placement);
|
|
4022
|
+
return /* @__PURE__ */ jsxs29(Popover, { open, onOpenChange: setOpen, children: [
|
|
4023
|
+
/* @__PURE__ */ jsx41(PopoverTrigger, { asChild: true, children }),
|
|
4024
|
+
/* @__PURE__ */ jsxs29(
|
|
3297
4025
|
PopoverContent,
|
|
3298
4026
|
{
|
|
3299
4027
|
side,
|
|
@@ -3301,16 +4029,16 @@ var Popover2 = (props) => {
|
|
|
3301
4029
|
sideOffset: offset,
|
|
3302
4030
|
className: cn(popoverClasses, className),
|
|
3303
4031
|
children: [
|
|
3304
|
-
showArrow && /* @__PURE__ */
|
|
3305
|
-
/* @__PURE__ */
|
|
3306
|
-
/* @__PURE__ */
|
|
3307
|
-
/* @__PURE__ */
|
|
3308
|
-
/* @__PURE__ */
|
|
3309
|
-
/* @__PURE__ */
|
|
4032
|
+
showArrow && /* @__PURE__ */ jsx41(PopoverArrow, { className: popoverArrowClasses }),
|
|
4033
|
+
/* @__PURE__ */ jsxs29("div", { className: "grid gap-4", children: [
|
|
4034
|
+
/* @__PURE__ */ jsxs29("div", { className: "space-y-2", children: [
|
|
4035
|
+
/* @__PURE__ */ jsx41("span", { className: "caption text-secondary", children: strapline }),
|
|
4036
|
+
/* @__PURE__ */ jsx41("h4", { className: "subtitle-medium text-primary", children: title }),
|
|
4037
|
+
/* @__PURE__ */ jsx41("p", { className: "paragraph-sm text-primary", children: description })
|
|
3310
4038
|
] }),
|
|
3311
|
-
/* @__PURE__ */
|
|
3312
|
-
/* @__PURE__ */
|
|
3313
|
-
/* @__PURE__ */
|
|
4039
|
+
/* @__PURE__ */ jsxs29("div", { className: "flex justify-start items-center gap-4 flex-wrap", children: [
|
|
4040
|
+
/* @__PURE__ */ jsx41(Button, { size: "sm", variant: "secondary", onClick: handleCancel, children: cancelText || "Cancel" }),
|
|
4041
|
+
/* @__PURE__ */ jsx41(Button, { size: "sm", variant: "primary", onClick: handleOk, children: okText || "Ok" })
|
|
3314
4042
|
] })
|
|
3315
4043
|
] })
|
|
3316
4044
|
]
|
|
@@ -3320,82 +4048,280 @@ var Popover2 = (props) => {
|
|
|
3320
4048
|
};
|
|
3321
4049
|
Popover2.displayName = "Popover";
|
|
3322
4050
|
|
|
3323
|
-
// src/components/
|
|
3324
|
-
import
|
|
3325
|
-
import
|
|
3326
|
-
import {
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
}
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
}
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
4051
|
+
// src/components/Feedback/Tooltip.tsx
|
|
4052
|
+
import "react";
|
|
4053
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4054
|
+
import { jsx as jsx42, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
4055
|
+
var TooltipArrow = TooltipPrimitive.Arrow;
|
|
4056
|
+
var mapPlacementToSideAndAlign = (placement) => {
|
|
4057
|
+
switch (placement) {
|
|
4058
|
+
case "top":
|
|
4059
|
+
return { side: "top", align: "center" };
|
|
4060
|
+
case "topLeft":
|
|
4061
|
+
return { side: "top", align: "start" };
|
|
4062
|
+
case "topRight":
|
|
4063
|
+
return { side: "top", align: "end" };
|
|
4064
|
+
case "bottom":
|
|
4065
|
+
return { side: "bottom", align: "center" };
|
|
4066
|
+
case "bottomLeft":
|
|
4067
|
+
return { side: "bottom", align: "start" };
|
|
4068
|
+
case "bottomRight":
|
|
4069
|
+
return { side: "bottom", align: "end" };
|
|
4070
|
+
case "left":
|
|
4071
|
+
return { side: "left", align: "center" };
|
|
4072
|
+
case "leftTop":
|
|
4073
|
+
return { side: "left", align: "start" };
|
|
4074
|
+
case "leftBottom":
|
|
4075
|
+
return { side: "left", align: "end" };
|
|
4076
|
+
case "right":
|
|
4077
|
+
return { side: "right", align: "center" };
|
|
4078
|
+
case "rightTop":
|
|
4079
|
+
return { side: "right", align: "start" };
|
|
4080
|
+
case "rightBottom":
|
|
4081
|
+
return { side: "right", align: "end" };
|
|
4082
|
+
default:
|
|
4083
|
+
return { side: "top", align: "center" };
|
|
3356
4084
|
}
|
|
3357
|
-
|
|
3358
|
-
var
|
|
4085
|
+
};
|
|
4086
|
+
var Tooltip = (props) => {
|
|
3359
4087
|
const {
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
showText = true,
|
|
3365
|
-
icon,
|
|
4088
|
+
strapline,
|
|
4089
|
+
title,
|
|
4090
|
+
description,
|
|
4091
|
+
showArrow = true,
|
|
3366
4092
|
className,
|
|
4093
|
+
placement = "top",
|
|
4094
|
+
offset = 10,
|
|
4095
|
+
disableHoverableContent,
|
|
4096
|
+
open,
|
|
4097
|
+
defaultOpen,
|
|
4098
|
+
onOpenChange,
|
|
4099
|
+
children
|
|
4100
|
+
} = props;
|
|
4101
|
+
const { side, align } = mapPlacementToSideAndAlign(placement);
|
|
4102
|
+
const tooltipClasses = "group bg-(--background-popover) max-w-[calc(100vw-2rem)] shadow-card-md border-none rounded-4 p-4 [&>span]:scale-200 data-[state=delayed-open]:animate-in data-[state=instant-open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=delayed-open]:fade-in-0 data-[state=instant-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-[state=instant-open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2";
|
|
4103
|
+
const tooltipArrowClasses = "relative fill-(--background-popover) transition-[filter,transform] group-data-[side=top]:top-[-2px] group-data-[side=top]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=bottom]:drop-shadow-[0px_1px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=left]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)] group-data-[side=right]:drop-shadow-[0px_2px_1px_color-mix(in_srgb,_var(--color-b-black-10)_66%,_transparent)]";
|
|
4104
|
+
return /* @__PURE__ */ jsxs30(
|
|
4105
|
+
TooltipPrimitive.Root,
|
|
4106
|
+
{
|
|
4107
|
+
open,
|
|
4108
|
+
defaultOpen,
|
|
4109
|
+
onOpenChange,
|
|
4110
|
+
disableHoverableContent,
|
|
4111
|
+
children: [
|
|
4112
|
+
/* @__PURE__ */ jsx42(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
4113
|
+
/* @__PURE__ */ jsx42(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs30(
|
|
4114
|
+
TooltipPrimitive.Content,
|
|
4115
|
+
{
|
|
4116
|
+
side,
|
|
4117
|
+
align,
|
|
4118
|
+
sideOffset: offset,
|
|
4119
|
+
className: cn(tooltipClasses, className),
|
|
4120
|
+
children: [
|
|
4121
|
+
showArrow && /* @__PURE__ */ jsx42(TooltipArrow, { className: tooltipArrowClasses }),
|
|
4122
|
+
/* @__PURE__ */ jsxs30("div", { className: "grid gap-2", children: [
|
|
4123
|
+
(strapline ?? "") !== "" && /* @__PURE__ */ jsx42("span", { className: "caption text-secondary", children: strapline }),
|
|
4124
|
+
/* @__PURE__ */ jsx42("h4", { className: "subtitle-medium text-primary", children: title }),
|
|
4125
|
+
(description ?? "") !== "" && /* @__PURE__ */ jsx42("p", { className: "paragraph-sm text-primary", children: description })
|
|
4126
|
+
] })
|
|
4127
|
+
]
|
|
4128
|
+
}
|
|
4129
|
+
) })
|
|
4130
|
+
]
|
|
4131
|
+
}
|
|
4132
|
+
);
|
|
4133
|
+
};
|
|
4134
|
+
Tooltip.displayName = "Tooltip";
|
|
4135
|
+
|
|
4136
|
+
// src/components/Feedback/TooltipProvider.tsx
|
|
4137
|
+
import "react";
|
|
4138
|
+
import * as TooltipPrimitive2 from "@radix-ui/react-tooltip";
|
|
4139
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
4140
|
+
var TooltipProvider = (props) => {
|
|
4141
|
+
const {
|
|
3367
4142
|
children,
|
|
3368
|
-
|
|
4143
|
+
delayDuration = 200,
|
|
4144
|
+
skipDelayDuration = 300,
|
|
4145
|
+
disableHoverableContent = false
|
|
3369
4146
|
} = props;
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
return /* @__PURE__ */ jsxs26(
|
|
3373
|
-
Comp,
|
|
4147
|
+
return /* @__PURE__ */ jsx43(
|
|
4148
|
+
TooltipPrimitive2.Provider,
|
|
3374
4149
|
{
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
4150
|
+
delayDuration,
|
|
4151
|
+
skipDelayDuration,
|
|
4152
|
+
disableHoverableContent,
|
|
4153
|
+
children
|
|
4154
|
+
}
|
|
4155
|
+
);
|
|
4156
|
+
};
|
|
4157
|
+
TooltipProvider.displayName = "TooltipProvider";
|
|
4158
|
+
|
|
4159
|
+
// src/components/Navigation/Breadcrumbs.tsx
|
|
4160
|
+
import * as React43 from "react";
|
|
4161
|
+
|
|
4162
|
+
// src/components/ui/breadcrumb.tsx
|
|
4163
|
+
import "react";
|
|
4164
|
+
import { Slot as Slot8 } from "@radix-ui/react-slot";
|
|
4165
|
+
import { jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
4166
|
+
var breadcrumbItemClasses = "h6-title inline-flex items-center gap-1.5 text-(--color-secondary) hover:text-(--color-primary-hover) focus-within:text-(--color-secondary-focus) [&_[aria-current=page]]:font-medium [&_[aria-current=page]]:text-primary";
|
|
4167
|
+
var disabledItemClasses = "text-primary-disabled cursor-default pointer-events-none";
|
|
4168
|
+
function Breadcrumb({ ...props }) {
|
|
4169
|
+
return /* @__PURE__ */ jsx44("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
4170
|
+
}
|
|
4171
|
+
function BreadcrumbList({ className, ...props }) {
|
|
4172
|
+
return /* @__PURE__ */ jsx44(
|
|
4173
|
+
"ol",
|
|
4174
|
+
{
|
|
4175
|
+
"data-slot": "breadcrumb-list",
|
|
4176
|
+
className: cn(
|
|
4177
|
+
"flex flex-wrap items-center gap-1.5 wrap-break-word sm:gap-2.5",
|
|
4178
|
+
className
|
|
4179
|
+
),
|
|
4180
|
+
...props
|
|
4181
|
+
}
|
|
4182
|
+
);
|
|
4183
|
+
}
|
|
4184
|
+
function BreadcrumbItem({ className, disabled, ...props }) {
|
|
4185
|
+
return /* @__PURE__ */ jsx44(
|
|
4186
|
+
"li",
|
|
4187
|
+
{
|
|
4188
|
+
"data-slot": "breadcrumb-item",
|
|
4189
|
+
className: cn(breadcrumbItemClasses, disabled && disabledItemClasses, className),
|
|
4190
|
+
style: { marginBottom: "7px" },
|
|
4191
|
+
...props
|
|
4192
|
+
}
|
|
4193
|
+
);
|
|
4194
|
+
}
|
|
4195
|
+
function BreadcrumbPage({ className, ...props }) {
|
|
4196
|
+
return /* @__PURE__ */ jsx44(
|
|
4197
|
+
"span",
|
|
4198
|
+
{
|
|
4199
|
+
"data-slot": "breadcrumb-page",
|
|
4200
|
+
role: "link",
|
|
4201
|
+
"aria-disabled": "true",
|
|
4202
|
+
"aria-current": "page",
|
|
4203
|
+
className: cn(className),
|
|
4204
|
+
...props
|
|
4205
|
+
}
|
|
4206
|
+
);
|
|
4207
|
+
}
|
|
4208
|
+
function BreadcrumbSeparator({
|
|
4209
|
+
children,
|
|
4210
|
+
className,
|
|
4211
|
+
...props
|
|
4212
|
+
}) {
|
|
4213
|
+
return /* @__PURE__ */ jsx44(
|
|
4214
|
+
"li",
|
|
4215
|
+
{
|
|
4216
|
+
"data-slot": "breadcrumb-separator",
|
|
4217
|
+
role: "presentation",
|
|
4218
|
+
"aria-hidden": "true",
|
|
4219
|
+
className: cn("[&>svg]:size-6 [&>svg]:text-(--color-secondary)", className),
|
|
4220
|
+
...props,
|
|
4221
|
+
children: children ?? /* @__PURE__ */ jsx44(ChevronRight, {})
|
|
4222
|
+
}
|
|
4223
|
+
);
|
|
4224
|
+
}
|
|
4225
|
+
function BreadcrumbEllipsis({
|
|
4226
|
+
className,
|
|
4227
|
+
...props
|
|
4228
|
+
}) {
|
|
4229
|
+
return /* @__PURE__ */ jsxs31(
|
|
4230
|
+
"span",
|
|
4231
|
+
{
|
|
4232
|
+
"data-slot": "breadcrumb-ellipsis",
|
|
4233
|
+
role: "presentation",
|
|
4234
|
+
"aria-hidden": "true",
|
|
4235
|
+
className: cn("flex size-9 items-center justify-center", className),
|
|
4236
|
+
...props,
|
|
3379
4237
|
children: [
|
|
3380
|
-
|
|
3381
|
-
|
|
4238
|
+
/* @__PURE__ */ jsx44(Ellipsis, { className: "size-4" }),
|
|
4239
|
+
/* @__PURE__ */ jsx44("span", { className: "sr-only", children: "More" })
|
|
3382
4240
|
]
|
|
3383
4241
|
}
|
|
3384
4242
|
);
|
|
3385
|
-
}
|
|
3386
|
-
|
|
4243
|
+
}
|
|
4244
|
+
|
|
4245
|
+
// src/components/Navigation/Breadcrumbs.tsx
|
|
4246
|
+
import { jsx as jsx45, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4247
|
+
var breadcrumbSeparatorVariants = "size-5 relative bottom-1 [&>svg]:text-secondary group-disabled:text-secondary";
|
|
4248
|
+
var breadcrumbItemBase = "h6-title text-secondary hover:text-primary-hover";
|
|
4249
|
+
var Breadcrumbs = React43.forwardRef(
|
|
4250
|
+
(props, ref) => {
|
|
4251
|
+
const { separator, ellipsis, children, className, ...rest } = props;
|
|
4252
|
+
const items = React43.Children.toArray(children).filter(Boolean);
|
|
4253
|
+
const shouldCollapse = Boolean(ellipsis) && items.length >= 5;
|
|
4254
|
+
const hiddenItems = shouldCollapse ? items.slice(1, -2) : [];
|
|
4255
|
+
const displayItems = shouldCollapse ? [items[0], "__ELLIPSIS__", items[items.length - 2], items[items.length - 1]] : items;
|
|
4256
|
+
return /* @__PURE__ */ jsx45(Breadcrumb, { ref, className, ...rest, children: /* @__PURE__ */ jsx45(BreadcrumbList, { children: displayItems.map((child, index) => {
|
|
4257
|
+
const isEllipsis = child === "__ELLIPSIS__";
|
|
4258
|
+
const key = isEllipsis ? "__ellipsis" : React43.isValidElement(child) && child.key != null ? String(child.key) : String(index);
|
|
4259
|
+
const isLast = index === displayItems.length - 1;
|
|
4260
|
+
return /* @__PURE__ */ jsxs32(React43.Fragment, { children: [
|
|
4261
|
+
isEllipsis ? /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase, props.breadcrumbItemClassName), children: /* @__PURE__ */ jsxs32(DropdownMenu, { children: [
|
|
4262
|
+
/* @__PURE__ */ jsx45(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx45(
|
|
4263
|
+
"button",
|
|
4264
|
+
{
|
|
4265
|
+
type: "button",
|
|
4266
|
+
className: "inline-flex size-8 items-center justify-center rounded-4 hover:bg-(--background-secondary) focus-ring-primary text-secondary",
|
|
4267
|
+
"aria-label": "Open breadcrumb menu",
|
|
4268
|
+
children: /* @__PURE__ */ jsx45(BreadcrumbEllipsis, {})
|
|
4269
|
+
}
|
|
4270
|
+
) }),
|
|
4271
|
+
/* @__PURE__ */ jsx45(
|
|
4272
|
+
DropdownMenuContent,
|
|
4273
|
+
{
|
|
4274
|
+
align: "start",
|
|
4275
|
+
className: "bg-(--background-neutral) border-(--border-secondary-hover) shadow-card-md rounded-4",
|
|
4276
|
+
children: /* @__PURE__ */ jsx45(DropdownMenuGroup, { children: hiddenItems.map((hidden, hiddenIndex) => {
|
|
4277
|
+
const hiddenKey = React43.isValidElement(hidden) && hidden.key != null ? String(hidden.key) : `hidden-${hiddenIndex}`;
|
|
4278
|
+
if (React43.isValidElement(hidden)) {
|
|
4279
|
+
return /* @__PURE__ */ jsx45(
|
|
4280
|
+
DropdownMenuItem,
|
|
4281
|
+
{
|
|
4282
|
+
asChild: true,
|
|
4283
|
+
className: "cursor-pointer paragraph-md text-primary focus:bg-(--background-secondary)",
|
|
4284
|
+
children: hidden
|
|
4285
|
+
},
|
|
4286
|
+
hiddenKey
|
|
4287
|
+
);
|
|
4288
|
+
}
|
|
4289
|
+
return /* @__PURE__ */ jsx45(
|
|
4290
|
+
DropdownMenuItem,
|
|
4291
|
+
{
|
|
4292
|
+
className: "cursor-pointer paragraph-md text-primary focus:bg-(--background-secondary)",
|
|
4293
|
+
children: String(hidden)
|
|
4294
|
+
},
|
|
4295
|
+
hiddenKey
|
|
4296
|
+
);
|
|
4297
|
+
}) })
|
|
4298
|
+
}
|
|
4299
|
+
)
|
|
4300
|
+
] }) }) : isLast ? /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase, props.breadcrumbItemClassName), children: /* @__PURE__ */ jsx45(
|
|
4301
|
+
BreadcrumbPage,
|
|
4302
|
+
{
|
|
4303
|
+
className: cn("h6-title-medium cursor-pointer", props.breadcrumbPageClassName),
|
|
4304
|
+
children: child
|
|
4305
|
+
}
|
|
4306
|
+
) }) : /* @__PURE__ */ jsx45(BreadcrumbItem, { className: cn(breadcrumbItemBase, props.breadcrumbItemClassName), children: child }),
|
|
4307
|
+
!isLast && /* @__PURE__ */ jsx45(BreadcrumbSeparator, { className: cn(breadcrumbSeparatorVariants, props.separatorClassName), children: separator })
|
|
4308
|
+
] }, key);
|
|
4309
|
+
}) }) });
|
|
4310
|
+
}
|
|
4311
|
+
);
|
|
4312
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
3387
4313
|
|
|
3388
4314
|
// src/components/Logo/LogoIcon.tsx
|
|
3389
|
-
import { cva as
|
|
3390
|
-
import { jsx as
|
|
3391
|
-
var LogoIconSvg = (props) => /* @__PURE__ */
|
|
3392
|
-
/* @__PURE__ */
|
|
3393
|
-
/* @__PURE__ */
|
|
3394
|
-
/* @__PURE__ */
|
|
3395
|
-
/* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
4315
|
+
import { cva as cva21 } from "class-variance-authority";
|
|
4316
|
+
import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4317
|
+
var LogoIconSvg = (props) => /* @__PURE__ */ jsxs33("svg", { width: "89", height: "88", viewBox: "0 0 89 88", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
4318
|
+
/* @__PURE__ */ jsx46("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M83.7156 3.88535C78.5352 -1.29512 70.136 -1.29512 64.9555 3.88535L43.9999 24.8409L43.9995 24.8405L62.3536 6.48637C52.2379 16.5949 35.8584 16.6179 25.7142 6.55523L23.4434 4.28438C18.2629 -0.896082 9.86373 -0.89608 4.68327 4.28438C-0.497191 9.46484 -0.49719 17.864 4.68327 23.0445L6.88526 25.2465C17.0191 35.3875 17.0168 51.8235 6.87859 61.9618L25.2395 43.6008L25.2398 43.601L3.88534 64.9555C-1.29512 70.136 -1.29511 78.5351 3.88535 83.7156C9.06581 88.8961 17.465 88.8961 22.6455 83.7156L25.6458 80.7151L25.6864 80.6747C35.7981 70.6137 52.1313 70.597 62.2636 80.6248L65.7534 84.1146C70.9339 89.2951 79.3331 89.2951 84.5135 84.1146C89.694 78.9342 89.694 70.535 84.5135 65.3545L62.76 43.601L62.7602 43.6009L81.1144 61.9552C70.9806 51.8142 70.9829 35.3782 81.1211 25.24L83.7156 22.6455C88.8961 17.465 88.8961 9.06581 83.7156 3.88535Z", fill: "#1685FF" }),
|
|
4319
|
+
/* @__PURE__ */ jsx46("path", { d: "M44.0667 50.4863C44.1213 50.4317 44.21 50.4317 44.2646 50.4863L48.6465 54.8682C48.6942 54.9158 48.7011 54.9907 48.663 55.0463L44.2812 61.4453C44.2256 61.5265 44.1057 61.5265 44.0501 61.4453L39.6683 55.0463C39.6302 54.9907 39.6371 54.9158 39.6848 54.8682L44.0667 50.4863Z", fill: "white" }),
|
|
4320
|
+
/* @__PURE__ */ jsx46("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M44.107 45.3938C44.0536 45.289 43.9013 45.289 43.8479 45.3938C41.8622 49.293 37.8104 51.9638 33.1347 51.9638C26.4991 51.9638 21.1199 46.5846 21.1199 39.9489C21.1199 33.3133 26.4991 27.9341 33.1347 27.9341C37.8104 27.9341 41.8622 30.6049 43.8479 34.5041C43.9013 34.6089 44.0536 34.6089 44.107 34.5041C46.0926 30.6049 50.1445 27.9341 54.8201 27.9341C61.4558 27.9341 66.835 33.3133 66.835 39.9489C66.835 46.5846 61.4558 51.9638 54.8201 51.9638C50.1445 51.9638 46.0926 49.293 44.107 45.3938Z", fill: "white" }),
|
|
4321
|
+
/* @__PURE__ */ jsx46("path", { d: "M60.1113 40.0006C60.1113 43.052 57.6377 45.5256 54.5863 45.5256C51.535 45.5256 49.0614 43.052 49.0614 40.0006C49.0614 36.9493 51.535 34.4757 54.5863 34.4757C57.6377 34.4757 60.1113 36.9493 60.1113 40.0006Z", fill: "#1685FF" }),
|
|
4322
|
+
/* @__PURE__ */ jsx46("path", { d: "M38.8954 40.0006C38.8954 43.052 36.4218 45.5256 33.3705 45.5256C30.3192 45.5256 27.8456 43.052 27.8456 40.0006C27.8456 36.9493 30.3192 34.4757 33.3705 34.4757C36.4218 34.4757 38.8954 36.9493 38.8954 40.0006Z", fill: "#1685FF" })
|
|
3397
4323
|
] });
|
|
3398
|
-
var logoIconVariants =
|
|
4324
|
+
var logoIconVariants = cva21(
|
|
3399
4325
|
"relative bg-linear-to-t from-gray-800 to-gray-950 overflow-hidden flex justify-center items-center",
|
|
3400
4326
|
{
|
|
3401
4327
|
variants: {
|
|
@@ -3420,28 +4346,28 @@ var logoIconSizeClass = {
|
|
|
3420
4346
|
xl: "size-96"
|
|
3421
4347
|
};
|
|
3422
4348
|
var LogoIcon = ({ className, size = "md" }) => {
|
|
3423
|
-
return /* @__PURE__ */
|
|
4349
|
+
return /* @__PURE__ */ jsx46("div", { className: cn(logoIconVariants({ size }), className), children: /* @__PURE__ */ jsx46(LogoIconSvg, { className: logoIconSizeClass[size] }) });
|
|
3424
4350
|
};
|
|
3425
4351
|
|
|
3426
4352
|
// src/components/Logo/Logo.tsx
|
|
3427
|
-
import { cva as
|
|
3428
|
-
import { jsx as
|
|
3429
|
-
var LogoIconSvg2 = (props) => /* @__PURE__ */
|
|
3430
|
-
/* @__PURE__ */
|
|
3431
|
-
/* @__PURE__ */
|
|
3432
|
-
/* @__PURE__ */
|
|
3433
|
-
/* @__PURE__ */
|
|
3434
|
-
/* @__PURE__ */
|
|
4353
|
+
import { cva as cva22 } from "class-variance-authority";
|
|
4354
|
+
import { jsx as jsx47, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4355
|
+
var LogoIconSvg2 = (props) => /* @__PURE__ */ jsxs34("svg", { width: "89", height: "88", viewBox: "0 0 89 88", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
4356
|
+
/* @__PURE__ */ jsx47("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M83.7156 3.88535C78.5352 -1.29512 70.136 -1.29512 64.9555 3.88535L43.9999 24.8409L43.9995 24.8405L62.3536 6.48637C52.2379 16.5949 35.8584 16.6179 25.7142 6.55523L23.4434 4.28438C18.2629 -0.896082 9.86373 -0.89608 4.68327 4.28438C-0.497191 9.46484 -0.49719 17.864 4.68327 23.0445L6.88526 25.2465C17.0191 35.3875 17.0168 51.8235 6.87859 61.9618L25.2395 43.6008L25.2398 43.601L3.88534 64.9555C-1.29512 70.136 -1.29511 78.5351 3.88535 83.7156C9.06581 88.8961 17.465 88.8961 22.6455 83.7156L25.6458 80.7151L25.6864 80.6747C35.7981 70.6137 52.1313 70.597 62.2636 80.6248L65.7534 84.1146C70.9339 89.2951 79.3331 89.2951 84.5135 84.1146C89.694 78.9342 89.694 70.535 84.5135 65.3545L62.76 43.601L62.7602 43.6009L81.1144 61.9552C70.9806 51.8142 70.9829 35.3782 81.1211 25.24L83.7156 22.6455C88.8961 17.465 88.8961 9.06581 83.7156 3.88535Z", fill: "#1685FF" }),
|
|
4357
|
+
/* @__PURE__ */ jsx47("path", { d: "M44.0667 50.4863C44.1213 50.4317 44.21 50.4317 44.2646 50.4863L48.6465 54.8682C48.6942 54.9158 48.7011 54.9907 48.663 55.0463L44.2812 61.4453C44.2256 61.5265 44.1057 61.5265 44.0501 61.4453L39.6683 55.0463C39.6302 54.9907 39.6371 54.9158 39.6848 54.8682L44.0667 50.4863Z", fill: "white" }),
|
|
4358
|
+
/* @__PURE__ */ jsx47("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M44.107 45.3938C44.0536 45.289 43.9013 45.289 43.8479 45.3938C41.8622 49.293 37.8104 51.9638 33.1347 51.9638C26.4991 51.9638 21.1199 46.5846 21.1199 39.9489C21.1199 33.3133 26.4991 27.9341 33.1347 27.9341C37.8104 27.9341 41.8622 30.6049 43.8479 34.5041C43.9013 34.6089 44.0536 34.6089 44.107 34.5041C46.0926 30.6049 50.1445 27.9341 54.8201 27.9341C61.4558 27.9341 66.835 33.3133 66.835 39.9489C66.835 46.5846 61.4558 51.9638 54.8201 51.9638C50.1445 51.9638 46.0926 49.293 44.107 45.3938Z", fill: "white" }),
|
|
4359
|
+
/* @__PURE__ */ jsx47("path", { d: "M60.1113 40.0006C60.1113 43.052 57.6377 45.5256 54.5863 45.5256C51.535 45.5256 49.0614 43.052 49.0614 40.0006C49.0614 36.9493 51.535 34.4757 54.5863 34.4757C57.6377 34.4757 60.1113 36.9493 60.1113 40.0006Z", fill: "#1685FF" }),
|
|
4360
|
+
/* @__PURE__ */ jsx47("path", { d: "M38.8954 40.0006C38.8954 43.052 36.4218 45.5256 33.3705 45.5256C30.3192 45.5256 27.8456 43.052 27.8456 40.0006C27.8456 36.9493 30.3192 34.4757 33.3705 34.4757C36.4218 34.4757 38.8954 36.9493 38.8954 40.0006Z", fill: "#1685FF" })
|
|
3435
4361
|
] });
|
|
3436
|
-
var LogoTextSvg = (props) => /* @__PURE__ */
|
|
3437
|
-
/* @__PURE__ */
|
|
3438
|
-
/* @__PURE__ */
|
|
3439
|
-
/* @__PURE__ */
|
|
3440
|
-
/* @__PURE__ */
|
|
3441
|
-
/* @__PURE__ */
|
|
3442
|
-
/* @__PURE__ */
|
|
4362
|
+
var LogoTextSvg = (props) => /* @__PURE__ */ jsxs34("svg", { width: "111", height: "32", viewBox: "0 0 111 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
4363
|
+
/* @__PURE__ */ jsx47("path", { d: "M72.7324 20.9658C72.7324 14.4559 77.4246 9.9751 83.8922 9.9751C90.3598 9.9751 95.052 14.4559 95.052 20.9658C95.052 27.4757 90.3598 31.9565 83.8922 31.9565C77.4246 31.9565 72.7324 27.4757 72.7324 20.9658ZM77.8896 20.9658C77.8896 24.7703 80.3414 27.3489 83.8922 27.3489C87.4431 27.3489 89.8948 24.7703 89.8948 20.9658C89.8948 17.1613 87.4431 14.5827 83.8922 14.5827C80.3414 14.5827 77.8896 17.1613 77.8896 20.9658Z", fill: "currentColor" }),
|
|
4364
|
+
/* @__PURE__ */ jsx47("path", { d: "M53.4056 31.4503H48.6289V0H53.7861V13.6116C55.1388 11.2866 57.9287 9.89163 61.0991 9.89163C67.0595 9.89163 70.6949 14.5415 70.6949 21.136C70.6949 27.5613 66.7636 31.9998 60.761 31.9998C57.6328 31.9998 54.9697 30.6049 53.7438 28.1954L53.4056 31.4503ZM53.8284 20.9246C53.8284 24.6868 56.1533 27.2654 59.7042 27.2654C63.3395 27.2654 65.4954 24.6445 65.4954 20.9246C65.4954 17.2047 63.3395 14.5415 59.7042 14.5415C56.1533 14.5415 53.8284 17.1624 53.8284 20.9246Z", fill: "currentColor" }),
|
|
4365
|
+
/* @__PURE__ */ jsx47("path", { d: "M38.9929 10.5681H44.15V31.4504H39.3733L38.9929 28.6605C37.7247 30.6473 35.0193 32 32.2293 32C27.4103 32 24.5781 28.745 24.5781 23.6301V10.5681H29.7353V21.8124C29.7353 25.786 31.2994 27.3923 34.1739 27.3923C37.4288 27.3923 38.9929 25.4901 38.9929 21.5165V10.5681Z", fill: "currentColor" }),
|
|
4366
|
+
/* @__PURE__ */ jsx47("path", { d: "M4.77673 31.4503H0V0H5.15718V13.6116C6.50988 11.2866 9.29983 9.89163 12.4702 9.89163C18.4306 9.89163 22.066 14.5415 22.066 21.136C22.066 27.5613 18.1347 31.9998 12.132 31.9998C9.00392 31.9998 6.34079 30.6049 5.1149 28.1954L4.77673 31.4503ZM5.19945 20.9246C5.19945 24.6868 7.52441 27.2654 11.0752 27.2654C14.7106 27.2654 16.8665 24.6445 16.8665 20.9246C16.8665 17.2047 14.7106 14.5415 11.0752 14.5415C7.52441 14.5415 5.19945 17.1624 5.19945 20.9246Z", fill: "currentColor" }),
|
|
4367
|
+
/* @__PURE__ */ jsx47("path", { d: "M103.555 0.5C107.084 0.5 109.944 3.36029 109.944 6.88867C109.944 10.4172 107.084 13.2773 103.555 13.2773C100.027 13.2772 97.1667 10.4171 97.1667 6.88867C97.1669 3.36036 100.027 0.500118 103.555 0.5Z", stroke: "currentColor" }),
|
|
4368
|
+
/* @__PURE__ */ jsx47("path", { d: "M105.778 9.98355L101.687 10.0001V9.00978L103.578 7.33457C104.19 6.79817 104.445 6.41856 104.445 5.91517C104.445 5.29625 104.159 4.96616 103.647 4.96616C103.113 4.96616 102.803 5.35402 102.803 6.03896H101.556C101.556 4.66908 102.377 3.77783 103.64 3.77783C104.949 3.77783 105.731 4.52879 105.731 5.83265C105.731 6.66613 105.259 7.34282 104.546 7.97825L103.686 8.74571H105.778V9.98355Z", fill: "currentColor" })
|
|
3443
4369
|
] });
|
|
3444
|
-
var logoWrapperVariants =
|
|
4370
|
+
var logoWrapperVariants = cva22("inline-flex", {
|
|
3445
4371
|
variants: {
|
|
3446
4372
|
variant: {
|
|
3447
4373
|
inline: ["w-44", "h-12", "justify-start", "items-center", "gap-4"],
|
|
@@ -3453,7 +4379,7 @@ var logoWrapperVariants = cva21("inline-flex", {
|
|
|
3453
4379
|
variant: "inline"
|
|
3454
4380
|
}
|
|
3455
4381
|
});
|
|
3456
|
-
var logoIconSizeVariants =
|
|
4382
|
+
var logoIconSizeVariants = cva22("", {
|
|
3457
4383
|
variants: {
|
|
3458
4384
|
variant: {
|
|
3459
4385
|
inline: "size-12",
|
|
@@ -3465,7 +4391,7 @@ var logoIconSizeVariants = cva21("", {
|
|
|
3465
4391
|
variant: "inline"
|
|
3466
4392
|
}
|
|
3467
4393
|
});
|
|
3468
|
-
var logoTextSizeVariants =
|
|
4394
|
+
var logoTextSizeVariants = cva22("", {
|
|
3469
4395
|
variants: {
|
|
3470
4396
|
variant: {
|
|
3471
4397
|
inline: "h-8 w-27.5",
|
|
@@ -3479,29 +4405,40 @@ var logoTextSizeVariants = cva21("", {
|
|
|
3479
4405
|
});
|
|
3480
4406
|
var Logo = ({ className, textColor, variant = "inline" }) => {
|
|
3481
4407
|
const textColorClass = textColor === "light" ? "text-(--color-b-white)" : textColor === "dark" ? "text-(--color-b-black)" : "text-primary";
|
|
3482
|
-
return /* @__PURE__ */
|
|
3483
|
-
/* @__PURE__ */
|
|
3484
|
-
/* @__PURE__ */
|
|
4408
|
+
return /* @__PURE__ */ jsxs34("div", { className: cn(logoWrapperVariants({ variant }), className), children: [
|
|
4409
|
+
/* @__PURE__ */ jsx47(LogoIconSvg2, { className: logoIconSizeVariants({ variant }) }),
|
|
4410
|
+
/* @__PURE__ */ jsx47(LogoTextSvg, { className: cn(logoTextSizeVariants({ variant }), textColorClass) })
|
|
3485
4411
|
] });
|
|
3486
4412
|
};
|
|
3487
4413
|
export {
|
|
4414
|
+
Accordion,
|
|
4415
|
+
Autocomplete,
|
|
3488
4416
|
Avatar,
|
|
3489
4417
|
Badge,
|
|
3490
4418
|
BadgeDigit,
|
|
3491
4419
|
BadgeDot,
|
|
3492
4420
|
BadgeStatus,
|
|
3493
|
-
|
|
4421
|
+
Breadcrumbs,
|
|
3494
4422
|
Button,
|
|
3495
4423
|
ButtonGroup,
|
|
3496
4424
|
Checkbox,
|
|
3497
4425
|
Divider,
|
|
3498
|
-
Dropdown,
|
|
3499
4426
|
Field,
|
|
3500
4427
|
IconButton,
|
|
3501
4428
|
IconButtonGroup,
|
|
3502
4429
|
LinkButton,
|
|
3503
4430
|
Logo,
|
|
3504
4431
|
LogoIcon,
|
|
4432
|
+
Menu,
|
|
4433
|
+
MenuGroup,
|
|
4434
|
+
MenuItem,
|
|
4435
|
+
MenuLabel,
|
|
4436
|
+
MenuPortal,
|
|
4437
|
+
MenuSeparator,
|
|
4438
|
+
MenuShortcut,
|
|
4439
|
+
MenuSub,
|
|
4440
|
+
MenuSubContent,
|
|
4441
|
+
MenuSubTrigger,
|
|
3505
4442
|
MessageButton,
|
|
3506
4443
|
PasswordInput,
|
|
3507
4444
|
PhoneInput,
|
|
@@ -3509,14 +4446,33 @@ export {
|
|
|
3509
4446
|
Progress,
|
|
3510
4447
|
RadioGroup,
|
|
3511
4448
|
SearchInput,
|
|
4449
|
+
Select,
|
|
3512
4450
|
Slider,
|
|
3513
4451
|
StatusAvatar,
|
|
3514
4452
|
Tag,
|
|
3515
4453
|
TextArea,
|
|
3516
4454
|
TextInput,
|
|
3517
4455
|
Toggle,
|
|
4456
|
+
Tooltip,
|
|
4457
|
+
TooltipProvider,
|
|
3518
4458
|
Typography,
|
|
3519
4459
|
WebsiteInput,
|
|
3520
4460
|
cn
|
|
3521
4461
|
};
|
|
4462
|
+
/*! Bundled license information:
|
|
4463
|
+
|
|
4464
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
|
4465
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
4466
|
+
lucide-react/dist/esm/Icon.js:
|
|
4467
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
4468
|
+
lucide-react/dist/esm/icons/chevron-right.js:
|
|
4469
|
+
lucide-react/dist/esm/icons/ellipsis.js:
|
|
4470
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
4471
|
+
(**
|
|
4472
|
+
* @license lucide-react v0.555.0 - ISC
|
|
4473
|
+
*
|
|
4474
|
+
* This source code is licensed under the ISC license.
|
|
4475
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
4476
|
+
*)
|
|
4477
|
+
*/
|
|
3522
4478
|
//# sourceMappingURL=index.js.map
|