@refinn/core-ui 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +307 -259
- package/dist/index.mjs +284 -236
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -466,77 +466,119 @@ var Badge = forwardRef4(
|
|
|
466
466
|
Badge.displayName = "Badge";
|
|
467
467
|
|
|
468
468
|
// src/components/Button/Button.tsx
|
|
469
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
470
|
+
|
|
471
|
+
// src/components/Loading/Loading.tsx
|
|
469
472
|
import { forwardRef as forwardRef5 } from "react";
|
|
470
473
|
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
474
|
+
var Loading = forwardRef5(
|
|
475
|
+
(_a, ref) => {
|
|
476
|
+
var _b = _a, { size = "sm", isDark = false, className = "" } = _b, rest = __objRest(_b, ["size", "isDark", "className"]);
|
|
477
|
+
const containerClasses = [
|
|
478
|
+
isDark ? "text-white-100" : "text-blue-600",
|
|
479
|
+
className
|
|
480
|
+
].filter(Boolean).join(" ");
|
|
481
|
+
return size === "sm" && !isDark ? /* @__PURE__ */ jsx5("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsxs5(
|
|
482
|
+
"svg",
|
|
483
|
+
{
|
|
484
|
+
className: "animate-spin",
|
|
485
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
486
|
+
width: "18",
|
|
487
|
+
height: "18",
|
|
488
|
+
viewBox: "0 0 18 18",
|
|
489
|
+
fill: "none",
|
|
490
|
+
children: [
|
|
491
|
+
/* @__PURE__ */ jsx5(
|
|
492
|
+
"path",
|
|
493
|
+
{
|
|
494
|
+
d: "M1 9C1 6.87827 1.84286 4.84344 3.34315 3.34315C4.84344 1.84285 6.87827 1 9 1C11.1217 1 13.1566 1.84286 14.6569 3.34315C16.1571 4.84344 17 6.87827 17 9C17 11.1217 16.1571 13.1566 14.6569 14.6569C13.1566 16.1571 11.1217 17 9 17C6.87827 17 4.84344 16.1571 3.34315 14.6569C1.84285 13.1566 1 11.1217 1 9L1 9Z",
|
|
495
|
+
stroke: "#F3F4F6",
|
|
496
|
+
"stroke-width": "2"
|
|
497
|
+
}
|
|
498
|
+
),
|
|
499
|
+
/* @__PURE__ */ jsx5(
|
|
500
|
+
"path",
|
|
501
|
+
{
|
|
502
|
+
d: "M1 9C1 7.31057 1.53484 5.6645 2.52786 4.29772C3.52089 2.93094 4.92112 1.91361 6.52787 1.39155C8.13461 0.869484 9.86539 0.869484 11.4721 1.39155C13.0789 1.91361 14.4791 2.93094 15.4721 4.29772",
|
|
503
|
+
stroke: "#0193D7",
|
|
504
|
+
"stroke-width": "2"
|
|
505
|
+
}
|
|
506
|
+
)
|
|
507
|
+
]
|
|
508
|
+
}
|
|
509
|
+
) })) : /* @__PURE__ */ jsx5("div", __spreadProps(__spreadValues({ ref, className: containerClasses }, rest), { children: /* @__PURE__ */ jsx5(
|
|
510
|
+
"svg",
|
|
511
|
+
{
|
|
512
|
+
className: "animate-spin",
|
|
513
|
+
width: size === "sm" ? 18 : 88,
|
|
514
|
+
height: size === "sm" ? 18 : 88,
|
|
515
|
+
viewBox: "0 0 20 20",
|
|
516
|
+
fill: "none",
|
|
517
|
+
children: /* @__PURE__ */ jsx5(
|
|
518
|
+
"path",
|
|
519
|
+
{
|
|
520
|
+
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
521
|
+
stroke: "currentColor",
|
|
522
|
+
strokeWidth: size === "sm" ? 2 : 1,
|
|
523
|
+
strokeLinecap: "round"
|
|
524
|
+
}
|
|
525
|
+
)
|
|
526
|
+
}
|
|
527
|
+
) }));
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
Loading.displayName = "Loading";
|
|
531
|
+
|
|
532
|
+
// src/components/Button/Button.tsx
|
|
533
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
471
534
|
var variantClasses = {
|
|
472
535
|
primary: [
|
|
473
|
-
"bg-
|
|
474
|
-
"hover:bg-
|
|
475
|
-
"active:bg-
|
|
476
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
477
|
-
"disabled:bg-
|
|
536
|
+
"bg-blue-600 text-white-100",
|
|
537
|
+
"hover:bg-blue-700",
|
|
538
|
+
"active:bg-blue-800",
|
|
539
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
540
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
478
541
|
].join(" "),
|
|
479
542
|
secondary: [
|
|
480
|
-
"bg-
|
|
481
|
-
"hover:bg-
|
|
482
|
-
"active:bg-
|
|
483
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
484
|
-
"disabled:bg-
|
|
543
|
+
"bg-gray-100 text-gray-900",
|
|
544
|
+
"hover:bg-gray-200",
|
|
545
|
+
"active:bg-gray-300",
|
|
546
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
547
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
485
548
|
].join(" "),
|
|
486
549
|
tertiary: [
|
|
487
|
-
"bg-
|
|
488
|
-
"hover:bg-
|
|
489
|
-
"active:bg-
|
|
490
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
491
|
-
"disabled:bg-
|
|
550
|
+
"bg-black-0 text-gray-900",
|
|
551
|
+
"hover:bg-gray-200",
|
|
552
|
+
"active:bg-gray-300",
|
|
553
|
+
"focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2",
|
|
554
|
+
"disabled:bg-gray-100 disabled:text-gray-400"
|
|
492
555
|
].join(" "),
|
|
493
556
|
contrast: [
|
|
494
|
-
"bg-
|
|
495
|
-
"hover:bg-
|
|
496
|
-
"active:bg-
|
|
497
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
498
|
-
"disabled:bg-
|
|
557
|
+
"bg-white-100 text-blue-600",
|
|
558
|
+
"hover:bg-white-90",
|
|
559
|
+
"active:bg-white-80",
|
|
560
|
+
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:ring-offset-2",
|
|
561
|
+
"disabled:bg-gray-50 disabled:text-gray-400"
|
|
499
562
|
].join(" "),
|
|
500
563
|
transparent: [
|
|
501
|
-
"bg-
|
|
502
|
-
"hover:bg-
|
|
503
|
-
"active:bg-
|
|
504
|
-
"focus-visible:ring-2 focus-visible:ring-
|
|
505
|
-
"disabled:bg-
|
|
564
|
+
"bg-black-0 text-white-100",
|
|
565
|
+
"hover:bg-white-20",
|
|
566
|
+
"active:bg-white-30",
|
|
567
|
+
"focus-visible:ring-2 focus-visible:ring-white-100 focus-visible:bg-black-0 focus-visible:ring-offset-2",
|
|
568
|
+
"disabled:bg-black-0 disabled:text-white-40"
|
|
506
569
|
].join(" ")
|
|
507
570
|
};
|
|
508
571
|
var sizeClasses3 = {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
572
|
+
sm: "px-16 py-6 text-label-medium",
|
|
573
|
+
md: "px-20 py-8 text-label-large",
|
|
574
|
+
lg: "px-24 py-12 text-label-large",
|
|
575
|
+
xl: "px-32 py-16 text-label-large"
|
|
513
576
|
};
|
|
514
|
-
|
|
515
|
-
return /* @__PURE__ */ jsx5(
|
|
516
|
-
"svg",
|
|
517
|
-
{
|
|
518
|
-
className,
|
|
519
|
-
width: "1em",
|
|
520
|
-
height: "1em",
|
|
521
|
-
viewBox: "0 0 20 20",
|
|
522
|
-
fill: "none",
|
|
523
|
-
children: /* @__PURE__ */ jsx5(
|
|
524
|
-
"path",
|
|
525
|
-
{
|
|
526
|
-
d: "M10 2.5a7.5 7.5 0 1 0 7.5 7.5",
|
|
527
|
-
stroke: "currentColor",
|
|
528
|
-
strokeWidth: "2",
|
|
529
|
-
strokeLinecap: "round"
|
|
530
|
-
}
|
|
531
|
-
)
|
|
532
|
-
}
|
|
533
|
-
);
|
|
534
|
-
}
|
|
535
|
-
var Button = forwardRef5(
|
|
577
|
+
var Button = forwardRef6(
|
|
536
578
|
(_a, ref) => {
|
|
537
579
|
var _b = _a, {
|
|
538
580
|
variant = "primary",
|
|
539
|
-
size = "
|
|
581
|
+
size = "md",
|
|
540
582
|
rounded = false,
|
|
541
583
|
loading = false,
|
|
542
584
|
disabled = false,
|
|
@@ -555,40 +597,32 @@ var Button = forwardRef5(
|
|
|
555
597
|
"children",
|
|
556
598
|
"className"
|
|
557
599
|
]);
|
|
558
|
-
const isDisabled = disabled
|
|
600
|
+
const isDisabled = disabled;
|
|
559
601
|
const classes = [
|
|
560
|
-
"inline-flex items-center justify-center
|
|
602
|
+
"inline-flex items-center justify-center gap-8",
|
|
561
603
|
"transition-colors duration-150",
|
|
562
604
|
"outline-none",
|
|
563
605
|
"disabled:cursor-not-allowed",
|
|
606
|
+
loading ? "pointer-events-none" : "cursor-pointer",
|
|
564
607
|
sizeClasses3[size],
|
|
565
608
|
variantClasses[variant],
|
|
566
|
-
rounded ? "rounded-full" : "rounded-
|
|
609
|
+
rounded ? "rounded-full" : size === "sm" ? "rounded-6" : size === "xl" ? "rounded-12" : "rounded-8",
|
|
567
610
|
className
|
|
568
611
|
].filter(Boolean).join(" ");
|
|
569
|
-
return /* @__PURE__ */
|
|
570
|
-
"
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
className: classes
|
|
575
|
-
}, rest), {
|
|
576
|
-
children: [
|
|
577
|
-
loading ? /* @__PURE__ */ jsx5(Spinner, { className: "animate-spin" }) : startIcon,
|
|
578
|
-
children,
|
|
579
|
-
!loading && endIcon
|
|
580
|
-
]
|
|
581
|
-
})
|
|
582
|
-
);
|
|
612
|
+
return /* @__PURE__ */ jsxs6("button", __spreadProps(__spreadValues({ ref, disabled: isDisabled, className: classes }, rest), { children: [
|
|
613
|
+
loading ? /* @__PURE__ */ jsx6(Loading, { size: "sm", isDark: variant === "primary" || variant === "transparent" }) : startIcon,
|
|
614
|
+
children,
|
|
615
|
+
!loading && endIcon
|
|
616
|
+
] }));
|
|
583
617
|
}
|
|
584
618
|
);
|
|
585
619
|
Button.displayName = "Button";
|
|
586
620
|
|
|
587
621
|
// src/components/BottomSheet/BottomSheet.tsx
|
|
588
|
-
import React, { useEffect, useState as useState2, useCallback as useCallback2, forwardRef as
|
|
622
|
+
import React, { useEffect, useState as useState2, useCallback as useCallback2, forwardRef as forwardRef7 } from "react";
|
|
589
623
|
import { createPortal } from "react-dom";
|
|
590
|
-
import { jsx as
|
|
591
|
-
var BottomSheet =
|
|
624
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
625
|
+
var BottomSheet = forwardRef7(
|
|
592
626
|
(_a, ref) => {
|
|
593
627
|
var _b = _a, {
|
|
594
628
|
isForceOpen = false,
|
|
@@ -657,19 +691,19 @@ var BottomSheet = forwardRef6(
|
|
|
657
691
|
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
658
692
|
setIsOpen(false);
|
|
659
693
|
};
|
|
660
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsxs7("span", { ref, style: { display: "contents" }, children: [
|
|
661
695
|
startModalBtn && React.cloneElement(startModalBtn, {
|
|
662
696
|
onClick: handleStartClick
|
|
663
697
|
}),
|
|
664
698
|
shouldRender && createPortal(
|
|
665
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ jsxs7(
|
|
666
700
|
"div",
|
|
667
701
|
{
|
|
668
702
|
className: `fixed inset-0 z-50 flex items-end justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
669
703
|
"aria-modal": "true",
|
|
670
704
|
role: "dialog",
|
|
671
705
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
706
|
+
/* @__PURE__ */ jsx7(
|
|
673
707
|
"div",
|
|
674
708
|
{
|
|
675
709
|
className: "absolute inset-0 bg-black/40",
|
|
@@ -677,26 +711,26 @@ var BottomSheet = forwardRef6(
|
|
|
677
711
|
"aria-label": "Close modal"
|
|
678
712
|
}
|
|
679
713
|
),
|
|
680
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ jsxs7(
|
|
681
715
|
"div",
|
|
682
716
|
{
|
|
683
717
|
className: `flex flex-col z-10 w-full rounded-t-xl bg-white pt-8 pb-16 px-16 shadow-lg transform transition-all duration-300
|
|
684
718
|
${size === "sm" ? "h-auto max-h-auto" : size === "md" ? "h-full max-h-[85vh]" : "h-full max-h-screen rounded-t-none!"}
|
|
685
719
|
${animate ? "scale-100 translate-y-0" : "scale-95 translate-y-full"}`,
|
|
686
720
|
children: [
|
|
687
|
-
/* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ jsxs7("div", { className: "w-full flex flex-row relative items-center pt-8 pb-16", children: [
|
|
722
|
+
/* @__PURE__ */ jsxs7("div", { className: "flex flex-col px-8 max-w-225", children: [
|
|
723
|
+
/* @__PURE__ */ jsx7("p", { className: "text-heading-3 text-button-sheet-text-primary", children: modalTitle }),
|
|
724
|
+
/* @__PURE__ */ jsx7("p", { className: "text-body-small text-button-sheet-text-secondary", children: modalDesc })
|
|
691
725
|
] }),
|
|
692
|
-
/* @__PURE__ */
|
|
726
|
+
/* @__PURE__ */ jsx7(
|
|
693
727
|
"i",
|
|
694
728
|
{
|
|
695
729
|
className: "fi fi-br-cross-small flex text-xl text-gray-600 w-44 h-44 absolute top-0 right-0 p-12",
|
|
696
730
|
onClick: () => handleCloseClick()
|
|
697
731
|
}
|
|
698
732
|
),
|
|
699
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ jsx7(
|
|
700
734
|
"div",
|
|
701
735
|
{
|
|
702
736
|
className: "text-gray-600 text-xl absolute top-0 right-0 p-12",
|
|
@@ -705,7 +739,7 @@ var BottomSheet = forwardRef6(
|
|
|
705
739
|
}
|
|
706
740
|
)
|
|
707
741
|
] }),
|
|
708
|
-
/* @__PURE__ */
|
|
742
|
+
/* @__PURE__ */ jsxs7("div", { className: "w-full h-full grow overflow-y-auto overflow-x-visible", children: [
|
|
709
743
|
children,
|
|
710
744
|
stopModalBtn && React.cloneElement(stopModalBtn, {
|
|
711
745
|
onClick: handleStopClick
|
|
@@ -727,20 +761,20 @@ BottomSheet.displayName = "BottomSheet";
|
|
|
727
761
|
|
|
728
762
|
// src/components/Checkbox/Checkbox.tsx
|
|
729
763
|
import {
|
|
730
|
-
forwardRef as
|
|
764
|
+
forwardRef as forwardRef8,
|
|
731
765
|
useId as useId2,
|
|
732
766
|
useState as useState3
|
|
733
767
|
} from "react";
|
|
734
|
-
import { jsx as
|
|
768
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
735
769
|
function CheckIcon({ className }) {
|
|
736
|
-
return /* @__PURE__ */
|
|
770
|
+
return /* @__PURE__ */ jsx8(
|
|
737
771
|
"svg",
|
|
738
772
|
{
|
|
739
773
|
className,
|
|
740
774
|
viewBox: "0 0 16 16",
|
|
741
775
|
fill: "none",
|
|
742
776
|
"aria-hidden": "true",
|
|
743
|
-
children: /* @__PURE__ */
|
|
777
|
+
children: /* @__PURE__ */ jsx8(
|
|
744
778
|
"path",
|
|
745
779
|
{
|
|
746
780
|
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
@@ -754,14 +788,14 @@ function CheckIcon({ className }) {
|
|
|
754
788
|
);
|
|
755
789
|
}
|
|
756
790
|
function IndeterminateIcon({ className }) {
|
|
757
|
-
return /* @__PURE__ */
|
|
791
|
+
return /* @__PURE__ */ jsx8(
|
|
758
792
|
"svg",
|
|
759
793
|
{
|
|
760
794
|
className,
|
|
761
795
|
viewBox: "0 0 16 16",
|
|
762
796
|
fill: "none",
|
|
763
797
|
"aria-hidden": "true",
|
|
764
|
-
children: /* @__PURE__ */
|
|
798
|
+
children: /* @__PURE__ */ jsx8(
|
|
765
799
|
"path",
|
|
766
800
|
{
|
|
767
801
|
d: "M3.333 8h9.334",
|
|
@@ -773,7 +807,7 @@ function IndeterminateIcon({ className }) {
|
|
|
773
807
|
}
|
|
774
808
|
);
|
|
775
809
|
}
|
|
776
|
-
var Checkbox =
|
|
810
|
+
var Checkbox = forwardRef8(
|
|
777
811
|
(_a, ref) => {
|
|
778
812
|
var _b = _a, {
|
|
779
813
|
label,
|
|
@@ -799,14 +833,14 @@ var Checkbox = forwardRef7(
|
|
|
799
833
|
const reactId = useId2();
|
|
800
834
|
const inputId = id != null ? id : reactId;
|
|
801
835
|
const [isChecked, setIsChecked] = useState3(defaultChecked != null ? defaultChecked : false);
|
|
802
|
-
return /* @__PURE__ */
|
|
836
|
+
return /* @__PURE__ */ jsxs8(
|
|
803
837
|
"label",
|
|
804
838
|
{
|
|
805
839
|
htmlFor: inputId,
|
|
806
840
|
className: `flex select-none font-sans ${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
807
841
|
children: [
|
|
808
|
-
/* @__PURE__ */
|
|
809
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ jsxs8("div", { className: "relative mr-16", children: [
|
|
843
|
+
/* @__PURE__ */ jsx8(
|
|
810
844
|
"input",
|
|
811
845
|
__spreadValues({
|
|
812
846
|
ref,
|
|
@@ -823,16 +857,16 @@ var Checkbox = forwardRef7(
|
|
|
823
857
|
className: "sr-only"
|
|
824
858
|
}, rest)
|
|
825
859
|
),
|
|
826
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx8(
|
|
827
861
|
"div",
|
|
828
862
|
{
|
|
829
863
|
className: `box m-6 flex h-20 w-20 rounded-md items-center justify-center border ${contrast ? isChecked || indeterminate ? "border-white bg-white" : "border-white" : isChecked || indeterminate ? "bg-static-icon-brand border-static-icon-brand" : "border-static-icon-primary"}`,
|
|
830
|
-
children: isChecked ? /* @__PURE__ */
|
|
864
|
+
children: isChecked ? /* @__PURE__ */ jsx8(
|
|
831
865
|
CheckIcon,
|
|
832
866
|
{
|
|
833
867
|
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
834
868
|
}
|
|
835
|
-
) : indeterminate ? /* @__PURE__ */
|
|
869
|
+
) : indeterminate ? /* @__PURE__ */ jsx8(
|
|
836
870
|
IndeterminateIcon,
|
|
837
871
|
{
|
|
838
872
|
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
@@ -841,15 +875,15 @@ var Checkbox = forwardRef7(
|
|
|
841
875
|
}
|
|
842
876
|
)
|
|
843
877
|
] }),
|
|
844
|
-
(label || description) && /* @__PURE__ */
|
|
845
|
-
label && /* @__PURE__ */
|
|
878
|
+
(label || description) && /* @__PURE__ */ jsxs8("span", { className: "flex flex-col", children: [
|
|
879
|
+
label && /* @__PURE__ */ jsx8(
|
|
846
880
|
"span",
|
|
847
881
|
{
|
|
848
882
|
className: `text-label-large ${disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-primary"}`,
|
|
849
883
|
children: label
|
|
850
884
|
}
|
|
851
885
|
),
|
|
852
|
-
description && /* @__PURE__ */
|
|
886
|
+
description && /* @__PURE__ */ jsx8(
|
|
853
887
|
"span",
|
|
854
888
|
{
|
|
855
889
|
className: `text-body-small ${error ? "text-checkbox-text-danger" : disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-secondary"}`,
|
|
@@ -869,15 +903,16 @@ import React2, {
|
|
|
869
903
|
useEffect as useEffect2,
|
|
870
904
|
useState as useState4,
|
|
871
905
|
useCallback as useCallback3,
|
|
872
|
-
forwardRef as
|
|
906
|
+
forwardRef as forwardRef9
|
|
873
907
|
} from "react";
|
|
874
908
|
import { createPortal as createPortal2 } from "react-dom";
|
|
875
|
-
import { jsx as
|
|
876
|
-
var Dialog =
|
|
909
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
910
|
+
var Dialog = forwardRef9(
|
|
877
911
|
({
|
|
878
912
|
isForceOpen = false,
|
|
879
913
|
setIsForceOpen,
|
|
880
914
|
isClosedAble = true,
|
|
915
|
+
isCloseIcon = true,
|
|
881
916
|
children,
|
|
882
917
|
startModalBtn,
|
|
883
918
|
stopModalBtn,
|
|
@@ -885,15 +920,15 @@ var Dialog = forwardRef8(
|
|
|
885
920
|
p = "20"
|
|
886
921
|
}, ref) => {
|
|
887
922
|
const [isOpen, setIsOpen] = useState4(false);
|
|
888
|
-
const [
|
|
923
|
+
const [isRender, setIsRender] = useState4(false);
|
|
889
924
|
const [animate, setAnimate] = useState4(false);
|
|
890
925
|
useEffect2(() => {
|
|
891
926
|
if (isOpen) {
|
|
892
|
-
|
|
927
|
+
setIsRender(true);
|
|
893
928
|
setTimeout(() => setAnimate(true), 10);
|
|
894
929
|
} else {
|
|
895
930
|
setAnimate(false);
|
|
896
|
-
const timer = setTimeout(() =>
|
|
931
|
+
const timer = setTimeout(() => setIsRender(false), 300);
|
|
897
932
|
return () => clearTimeout(timer);
|
|
898
933
|
}
|
|
899
934
|
}, [isOpen]);
|
|
@@ -926,19 +961,19 @@ var Dialog = forwardRef8(
|
|
|
926
961
|
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
927
962
|
setIsOpen(false);
|
|
928
963
|
};
|
|
929
|
-
return /* @__PURE__ */
|
|
964
|
+
return /* @__PURE__ */ jsxs9("span", { ref, style: { display: "contents" }, children: [
|
|
930
965
|
startModalBtn && React2.cloneElement(startModalBtn, {
|
|
931
966
|
onClick: handleStartClick
|
|
932
967
|
}),
|
|
933
|
-
|
|
934
|
-
/* @__PURE__ */
|
|
968
|
+
isRender && createPortal2(
|
|
969
|
+
/* @__PURE__ */ jsxs9(
|
|
935
970
|
"div",
|
|
936
971
|
{
|
|
937
972
|
className: `fixed inset-0 z-50 flex items-center justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
938
973
|
"aria-modal": "true",
|
|
939
974
|
role: "dialog",
|
|
940
975
|
children: [
|
|
941
|
-
/* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ jsx9(
|
|
942
977
|
"div",
|
|
943
978
|
{
|
|
944
979
|
className: "absolute inset-0 bg-black/40",
|
|
@@ -946,11 +981,33 @@ var Dialog = forwardRef8(
|
|
|
946
981
|
"aria-label": "Close modal"
|
|
947
982
|
}
|
|
948
983
|
),
|
|
949
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ jsxs9(
|
|
950
985
|
"div",
|
|
951
986
|
{
|
|
952
987
|
className: `relative z-10 w-[calc(100%-40px)] max-w-md rounded-xl bg-white p-${p || "20"} shadow-lg transform transition-all duration-300 ${animate ? "scale-100 opacity-100" : "scale-95 opacity-0"}`,
|
|
953
988
|
children: [
|
|
989
|
+
isCloseIcon && /* @__PURE__ */ jsx9(
|
|
990
|
+
"svg",
|
|
991
|
+
{
|
|
992
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
993
|
+
width: "20",
|
|
994
|
+
height: "20",
|
|
995
|
+
viewBox: "0 0 20 20",
|
|
996
|
+
fill: "none",
|
|
997
|
+
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-16 cursor-pointer",
|
|
998
|
+
onMouseDown: (e) => {
|
|
999
|
+
e.preventDefault();
|
|
1000
|
+
handleCloseClick();
|
|
1001
|
+
},
|
|
1002
|
+
children: /* @__PURE__ */ jsx9(
|
|
1003
|
+
"path",
|
|
1004
|
+
{
|
|
1005
|
+
d: "M14.7119 6.0625L10.7744 10L14.7119 13.9375L13.9375 14.7119L10 10.7744L6.0625 14.7119L5.28809 13.9375L9.22559 10L5.28809 6.0625L6.0625 5.28809L10 9.22559L13.9375 5.28809L14.7119 6.0625Z",
|
|
1006
|
+
fill: "#111827"
|
|
1007
|
+
}
|
|
1008
|
+
)
|
|
1009
|
+
}
|
|
1010
|
+
),
|
|
954
1011
|
children,
|
|
955
1012
|
stopModalBtn && React2.cloneElement(stopModalBtn, {
|
|
956
1013
|
onClick: handleStopClick
|
|
@@ -970,9 +1027,9 @@ var Dialog = forwardRef8(
|
|
|
970
1027
|
Dialog.displayName = "Dialog";
|
|
971
1028
|
|
|
972
1029
|
// src/components/Icon/Icon.tsx
|
|
973
|
-
import { forwardRef as
|
|
974
|
-
import { jsx as
|
|
975
|
-
var Icon =
|
|
1030
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
1031
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1032
|
+
var Icon = forwardRef10(
|
|
976
1033
|
(_a, ref) => {
|
|
977
1034
|
var _b = _a, {
|
|
978
1035
|
name,
|
|
@@ -1000,7 +1057,7 @@ var Icon = forwardRef9(
|
|
|
1000
1057
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
1001
1058
|
className
|
|
1002
1059
|
].filter(Boolean).join(" ");
|
|
1003
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ jsx10(
|
|
1004
1061
|
"span",
|
|
1005
1062
|
__spreadProps(__spreadValues({
|
|
1006
1063
|
ref,
|
|
@@ -1024,116 +1081,107 @@ Icon.displayName = "Icon";
|
|
|
1024
1081
|
|
|
1025
1082
|
// src/components/Radio/Radio.tsx
|
|
1026
1083
|
import {
|
|
1027
|
-
forwardRef as
|
|
1084
|
+
forwardRef as forwardRef11,
|
|
1028
1085
|
useId as useId3
|
|
1029
1086
|
} from "react";
|
|
1030
|
-
import { jsx as
|
|
1031
|
-
var
|
|
1032
|
-
small: {
|
|
1033
|
-
box: "h-4 w-4",
|
|
1034
|
-
dot: "h-1.5 w-1.5",
|
|
1035
|
-
label: "text-sm leading-5",
|
|
1036
|
-
description: "text-xs leading-4",
|
|
1037
|
-
gap: "gap-2"
|
|
1038
|
-
},
|
|
1039
|
-
medium: {
|
|
1040
|
-
box: "h-5 w-5",
|
|
1041
|
-
dot: "h-2 w-2",
|
|
1042
|
-
label: "text-base leading-6",
|
|
1043
|
-
description: "text-sm leading-5",
|
|
1044
|
-
gap: "gap-2.5"
|
|
1045
|
-
}
|
|
1046
|
-
};
|
|
1047
|
-
var Radio = forwardRef10(
|
|
1087
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1088
|
+
var Radio = forwardRef11(
|
|
1048
1089
|
(_a, ref) => {
|
|
1049
1090
|
var _b = _a, {
|
|
1050
|
-
size = "
|
|
1091
|
+
size = "sm",
|
|
1051
1092
|
label,
|
|
1052
1093
|
description,
|
|
1053
1094
|
error = false,
|
|
1054
|
-
contrast = false,
|
|
1055
1095
|
checked,
|
|
1056
1096
|
defaultChecked,
|
|
1057
1097
|
disabled = false,
|
|
1058
1098
|
className = "",
|
|
1059
|
-
id
|
|
1099
|
+
id,
|
|
1100
|
+
name
|
|
1060
1101
|
} = _b, rest = __objRest(_b, [
|
|
1061
1102
|
"size",
|
|
1062
1103
|
"label",
|
|
1063
1104
|
"description",
|
|
1064
1105
|
"error",
|
|
1065
|
-
"contrast",
|
|
1066
1106
|
"checked",
|
|
1067
1107
|
"defaultChecked",
|
|
1068
1108
|
"disabled",
|
|
1069
1109
|
"className",
|
|
1070
|
-
"id"
|
|
1110
|
+
"id",
|
|
1111
|
+
"name"
|
|
1071
1112
|
]);
|
|
1072
1113
|
const reactId = useId3();
|
|
1073
1114
|
const inputId = id != null ? id : reactId;
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
"relative inline-flex items-center justify-center shrink-0",
|
|
1077
|
-
"rounded-full",
|
|
1078
|
-
"border",
|
|
1079
|
-
"transition-colors duration-150",
|
|
1080
|
-
sz.box
|
|
1081
|
-
].join(" ");
|
|
1082
|
-
let circleState;
|
|
1083
|
-
if (disabled) {
|
|
1084
|
-
circleState = checked ? "bg-radio-disabled-selected-bg border-radio-disabled-border" : "bg-radio-disabled-bg border-radio-disabled-border";
|
|
1085
|
-
} else if (contrast) {
|
|
1086
|
-
circleState = checked ? "bg-radio-contrast-selected-bg border-radio-contrast-selected-bg" : "bg-radio-contrast-bg border-radio-contrast-border";
|
|
1087
|
-
} else if (error) {
|
|
1088
|
-
circleState = checked ? "bg-radio-selected-bg border-radio-error-border" : "bg-radio-error-bg border-radio-error-border";
|
|
1089
|
-
} else if (checked) {
|
|
1090
|
-
circleState = "bg-radio-selected-bg border-radio-selected-border";
|
|
1091
|
-
} else {
|
|
1092
|
-
circleState = "bg-radio-bg border-radio-border hover:border-radio-hover-border";
|
|
1093
|
-
}
|
|
1094
|
-
const ringColor = error ? "peer-focus-visible:ring-radio-error-ring" : contrast ? "peer-focus-visible:ring-radio-contrast-ring" : "peer-focus-visible:ring-radio-ring";
|
|
1095
|
-
const ringClasses = `peer-focus-visible:ring-2 peer-focus-visible:ring-offset-2 ${ringColor}`;
|
|
1096
|
-
let dotColor;
|
|
1097
|
-
if (disabled) {
|
|
1098
|
-
dotColor = "bg-radio-disabled-dot";
|
|
1099
|
-
} else if (contrast) {
|
|
1100
|
-
dotColor = "bg-radio-contrast-selected-dot";
|
|
1101
|
-
} else {
|
|
1102
|
-
dotColor = "bg-radio-selected-dot";
|
|
1103
|
-
}
|
|
1104
|
-
const labelColor = disabled ? "text-radio-label-disabled" : contrast ? "text-radio-contrast-label" : error ? "text-radio-label-error" : "text-radio-label";
|
|
1105
|
-
const descriptionColor = disabled ? "text-radio-label-disabled" : contrast ? "text-radio-contrast-description" : "text-radio-description";
|
|
1106
|
-
return /* @__PURE__ */ jsxs9(
|
|
1107
|
-
"label",
|
|
1115
|
+
return /* @__PURE__ */ jsx11(
|
|
1116
|
+
"div",
|
|
1108
1117
|
{
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
"
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1118
|
+
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
1119
|
+
children: /* @__PURE__ */ jsxs10(
|
|
1120
|
+
"label",
|
|
1121
|
+
{
|
|
1122
|
+
htmlFor: inputId,
|
|
1123
|
+
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
1124
|
+
children: [
|
|
1125
|
+
/* @__PURE__ */ jsxs10("div", { children: [
|
|
1126
|
+
/* @__PURE__ */ jsx11(
|
|
1127
|
+
"input",
|
|
1128
|
+
__spreadValues({
|
|
1129
|
+
ref,
|
|
1130
|
+
id: inputId,
|
|
1131
|
+
type: "radio",
|
|
1132
|
+
className: "sr-only peer",
|
|
1133
|
+
checked,
|
|
1134
|
+
defaultChecked,
|
|
1135
|
+
disabled,
|
|
1136
|
+
name
|
|
1137
|
+
}, rest)
|
|
1138
|
+
),
|
|
1139
|
+
/* @__PURE__ */ jsx11(
|
|
1140
|
+
"div",
|
|
1141
|
+
{
|
|
1142
|
+
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
1143
|
+
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
1144
|
+
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
1145
|
+
`,
|
|
1146
|
+
children: /* @__PURE__ */ jsx11(
|
|
1147
|
+
"span",
|
|
1148
|
+
{
|
|
1149
|
+
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
1150
|
+
${size === "sm" ? "h-8 w-8" : "h-10 w-10"}
|
|
1151
|
+
rounded-full bg-white group-peer-checked:bg-blue-600 group-peer-disabled:bg-white`
|
|
1152
|
+
}
|
|
1153
|
+
)
|
|
1154
|
+
}
|
|
1155
|
+
)
|
|
1156
|
+
] }),
|
|
1157
|
+
/* @__PURE__ */ jsxs10(
|
|
1158
|
+
"div",
|
|
1159
|
+
{
|
|
1160
|
+
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
1161
|
+
children: [
|
|
1162
|
+
/* @__PURE__ */ jsx11(
|
|
1163
|
+
"p",
|
|
1164
|
+
{
|
|
1165
|
+
className: `
|
|
1166
|
+
${size === "sm" ? "text-label-medium" : "text-label-large"}
|
|
1167
|
+
${disabled ? "text-gray-400" : "text-gray-900"}
|
|
1168
|
+
`,
|
|
1169
|
+
children: label
|
|
1170
|
+
}
|
|
1171
|
+
),
|
|
1172
|
+
/* @__PURE__ */ jsx11(
|
|
1173
|
+
"p",
|
|
1174
|
+
{
|
|
1175
|
+
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
1176
|
+
children: description
|
|
1177
|
+
}
|
|
1178
|
+
)
|
|
1179
|
+
]
|
|
1180
|
+
}
|
|
1181
|
+
)
|
|
1182
|
+
]
|
|
1183
|
+
}
|
|
1184
|
+
)
|
|
1137
1185
|
}
|
|
1138
1186
|
);
|
|
1139
1187
|
}
|
|
@@ -1142,12 +1190,12 @@ Radio.displayName = "Radio";
|
|
|
1142
1190
|
|
|
1143
1191
|
// src/components/Slider/Slider.tsx
|
|
1144
1192
|
import {
|
|
1145
|
-
forwardRef as
|
|
1193
|
+
forwardRef as forwardRef12,
|
|
1146
1194
|
useCallback as useCallback4,
|
|
1147
1195
|
useId as useId4,
|
|
1148
1196
|
useState as useState5
|
|
1149
1197
|
} from "react";
|
|
1150
|
-
import { jsx as
|
|
1198
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1151
1199
|
var sizeConfig = {
|
|
1152
1200
|
small: {
|
|
1153
1201
|
trackH: "h-4",
|
|
@@ -1178,7 +1226,7 @@ var sizeConfig = {
|
|
|
1178
1226
|
}
|
|
1179
1227
|
};
|
|
1180
1228
|
function ChevronGlyphs({ size, color }) {
|
|
1181
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsxs11(
|
|
1182
1230
|
"svg",
|
|
1183
1231
|
{
|
|
1184
1232
|
width: size,
|
|
@@ -1188,7 +1236,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1188
1236
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1189
1237
|
"aria-hidden": "true",
|
|
1190
1238
|
children: [
|
|
1191
|
-
/* @__PURE__ */
|
|
1239
|
+
/* @__PURE__ */ jsx12(
|
|
1192
1240
|
"path",
|
|
1193
1241
|
{
|
|
1194
1242
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -1198,7 +1246,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1198
1246
|
strokeLinejoin: "round"
|
|
1199
1247
|
}
|
|
1200
1248
|
),
|
|
1201
|
-
/* @__PURE__ */
|
|
1249
|
+
/* @__PURE__ */ jsx12(
|
|
1202
1250
|
"path",
|
|
1203
1251
|
{
|
|
1204
1252
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -1212,7 +1260,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1212
1260
|
}
|
|
1213
1261
|
);
|
|
1214
1262
|
}
|
|
1215
|
-
var Slider =
|
|
1263
|
+
var Slider = forwardRef12(
|
|
1216
1264
|
(_a, ref) => {
|
|
1217
1265
|
var _b = _a, {
|
|
1218
1266
|
size = "medium",
|
|
@@ -1275,13 +1323,13 @@ var Slider = forwardRef11(
|
|
|
1275
1323
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
1276
1324
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
1277
1325
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
1278
|
-
return /* @__PURE__ */
|
|
1326
|
+
return /* @__PURE__ */ jsxs11(
|
|
1279
1327
|
"div",
|
|
1280
1328
|
{
|
|
1281
1329
|
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
1282
1330
|
children: [
|
|
1283
|
-
(label || showValue && !disabled) && /* @__PURE__ */
|
|
1284
|
-
label && /* @__PURE__ */
|
|
1331
|
+
(label || showValue && !disabled) && /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between", children: [
|
|
1332
|
+
label && /* @__PURE__ */ jsx12(
|
|
1285
1333
|
"label",
|
|
1286
1334
|
{
|
|
1287
1335
|
htmlFor: inputId,
|
|
@@ -1294,7 +1342,7 @@ var Slider = forwardRef11(
|
|
|
1294
1342
|
children: label
|
|
1295
1343
|
}
|
|
1296
1344
|
),
|
|
1297
|
-
showValue && /* @__PURE__ */
|
|
1345
|
+
showValue && /* @__PURE__ */ jsx12(
|
|
1298
1346
|
"span",
|
|
1299
1347
|
{
|
|
1300
1348
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -1302,7 +1350,7 @@ var Slider = forwardRef11(
|
|
|
1302
1350
|
}
|
|
1303
1351
|
)
|
|
1304
1352
|
] }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1353
|
+
/* @__PURE__ */ jsxs11(
|
|
1306
1354
|
"div",
|
|
1307
1355
|
{
|
|
1308
1356
|
className: [
|
|
@@ -1311,7 +1359,7 @@ var Slider = forwardRef11(
|
|
|
1311
1359
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1312
1360
|
].join(" "),
|
|
1313
1361
|
children: [
|
|
1314
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ jsx12(
|
|
1315
1363
|
"div",
|
|
1316
1364
|
{
|
|
1317
1365
|
className: [
|
|
@@ -1321,14 +1369,14 @@ var Slider = forwardRef11(
|
|
|
1321
1369
|
].join(" ")
|
|
1322
1370
|
}
|
|
1323
1371
|
),
|
|
1324
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ jsx12(
|
|
1325
1373
|
"div",
|
|
1326
1374
|
{
|
|
1327
1375
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
1328
1376
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
1329
1377
|
}
|
|
1330
1378
|
),
|
|
1331
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ jsx12(
|
|
1332
1380
|
"input",
|
|
1333
1381
|
__spreadValues({
|
|
1334
1382
|
ref,
|
|
@@ -1349,7 +1397,7 @@ var Slider = forwardRef11(
|
|
|
1349
1397
|
].join(" ")
|
|
1350
1398
|
}, rest)
|
|
1351
1399
|
),
|
|
1352
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ jsx12(
|
|
1353
1401
|
"div",
|
|
1354
1402
|
{
|
|
1355
1403
|
className: [
|
|
@@ -1362,13 +1410,13 @@ var Slider = forwardRef11(
|
|
|
1362
1410
|
!disabled && "peer-hover:shadow-medium"
|
|
1363
1411
|
].filter(Boolean).join(" "),
|
|
1364
1412
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
1365
|
-
children: /* @__PURE__ */
|
|
1413
|
+
children: /* @__PURE__ */ jsx12(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
1366
1414
|
}
|
|
1367
1415
|
)
|
|
1368
1416
|
]
|
|
1369
1417
|
}
|
|
1370
1418
|
),
|
|
1371
|
-
description && /* @__PURE__ */
|
|
1419
|
+
description && /* @__PURE__ */ jsx12(
|
|
1372
1420
|
"span",
|
|
1373
1421
|
{
|
|
1374
1422
|
id: ariaDescriptionId,
|
|
@@ -1384,28 +1432,28 @@ var Slider = forwardRef11(
|
|
|
1384
1432
|
Slider.displayName = "Slider";
|
|
1385
1433
|
|
|
1386
1434
|
// src/components/Toast/Toast.tsx
|
|
1387
|
-
import { forwardRef as
|
|
1388
|
-
import { jsx as
|
|
1435
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
1436
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1389
1437
|
function CheckCircleIcon({ className }) {
|
|
1390
|
-
return /* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1438
|
+
return /* @__PURE__ */ jsxs12("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1439
|
+
/* @__PURE__ */ jsx13("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1440
|
+
/* @__PURE__ */ jsx13("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1393
1441
|
] });
|
|
1394
1442
|
}
|
|
1395
1443
|
function ProgressIcon({ className }) {
|
|
1396
|
-
return /* @__PURE__ */
|
|
1397
|
-
/* @__PURE__ */
|
|
1398
|
-
/* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ jsxs12("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1445
|
+
/* @__PURE__ */ jsx13("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5", opacity: "0.3" }),
|
|
1446
|
+
/* @__PURE__ */ jsx13("path", { d: "M10 2a8 8 0 0 1 8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", children: /* @__PURE__ */ jsx13("animateTransform", { attributeName: "transform", type: "rotate", from: "0 10 10", to: "360 10 10", dur: "1s", repeatCount: "indefinite" }) })
|
|
1399
1447
|
] });
|
|
1400
1448
|
}
|
|
1401
1449
|
function ErrorIcon({ className }) {
|
|
1402
|
-
return /* @__PURE__ */
|
|
1403
|
-
/* @__PURE__ */
|
|
1404
|
-
/* @__PURE__ */
|
|
1450
|
+
return /* @__PURE__ */ jsxs12("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1451
|
+
/* @__PURE__ */ jsx13("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1452
|
+
/* @__PURE__ */ jsx13("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
1405
1453
|
] });
|
|
1406
1454
|
}
|
|
1407
1455
|
function CloseIcon2({ className }) {
|
|
1408
|
-
return /* @__PURE__ */
|
|
1456
|
+
return /* @__PURE__ */ jsx13("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1409
1457
|
}
|
|
1410
1458
|
var defaultIcons2 = {
|
|
1411
1459
|
default: CheckCircleIcon,
|
|
@@ -1422,7 +1470,7 @@ var iconColorClasses = {
|
|
|
1422
1470
|
progress: "text-toast-progress-icon",
|
|
1423
1471
|
error: "text-toast-error-icon"
|
|
1424
1472
|
};
|
|
1425
|
-
var Toast =
|
|
1473
|
+
var Toast = forwardRef13(
|
|
1426
1474
|
(_a, ref) => {
|
|
1427
1475
|
var _b = _a, {
|
|
1428
1476
|
type = "default",
|
|
@@ -1450,10 +1498,10 @@ var Toast = forwardRef12(
|
|
|
1450
1498
|
typeClasses[type],
|
|
1451
1499
|
className
|
|
1452
1500
|
].filter(Boolean).join(" ");
|
|
1453
|
-
return /* @__PURE__ */
|
|
1454
|
-
icon && /* @__PURE__ */
|
|
1455
|
-
/* @__PURE__ */
|
|
1456
|
-
actionLabel && onAction && /* @__PURE__ */
|
|
1501
|
+
return /* @__PURE__ */ jsxs12("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
1502
|
+
icon && /* @__PURE__ */ jsx13("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx13(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
1503
|
+
/* @__PURE__ */ jsx13("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
1504
|
+
actionLabel && onAction && /* @__PURE__ */ jsx13(
|
|
1457
1505
|
"button",
|
|
1458
1506
|
{
|
|
1459
1507
|
type: "button",
|
|
@@ -1462,14 +1510,14 @@ var Toast = forwardRef12(
|
|
|
1462
1510
|
children: actionLabel
|
|
1463
1511
|
}
|
|
1464
1512
|
),
|
|
1465
|
-
onDismiss && /* @__PURE__ */
|
|
1513
|
+
onDismiss && /* @__PURE__ */ jsx13(
|
|
1466
1514
|
"button",
|
|
1467
1515
|
{
|
|
1468
1516
|
type: "button",
|
|
1469
1517
|
onClick: onDismiss,
|
|
1470
1518
|
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
1471
1519
|
"aria-label": "Dismiss",
|
|
1472
|
-
children: /* @__PURE__ */
|
|
1520
|
+
children: /* @__PURE__ */ jsx13(CloseIcon2, { className: "h-16 w-16" })
|
|
1473
1521
|
}
|
|
1474
1522
|
)
|
|
1475
1523
|
] }));
|