@refinn/core-ui 0.1.8 → 0.1.10
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 +1041 -735
- package/dist/index.d.mts +69 -58
- package/dist/index.d.ts +69 -58
- package/dist/index.js +1030 -709
- package/dist/theme.css +11 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -590,7 +590,7 @@ var Loading = forwardRef6(
|
|
|
590
590
|
{
|
|
591
591
|
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",
|
|
592
592
|
stroke: "#F3F4F6",
|
|
593
|
-
|
|
593
|
+
strokeWidth: "2"
|
|
594
594
|
}
|
|
595
595
|
),
|
|
596
596
|
/* @__PURE__ */ jsx6(
|
|
@@ -598,7 +598,7 @@ var Loading = forwardRef6(
|
|
|
598
598
|
{
|
|
599
599
|
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",
|
|
600
600
|
stroke: "#0193D7",
|
|
601
|
-
|
|
601
|
+
strokeWidth: "2"
|
|
602
602
|
}
|
|
603
603
|
)
|
|
604
604
|
]
|
|
@@ -715,163 +715,22 @@ var Button = forwardRef7(
|
|
|
715
715
|
);
|
|
716
716
|
Button.displayName = "Button";
|
|
717
717
|
|
|
718
|
-
// src/components/BottomSheet/BottomSheet.tsx
|
|
719
|
-
import React, { useEffect, useState as useState2, useCallback as useCallback2, forwardRef as forwardRef8 } from "react";
|
|
720
|
-
import { createPortal } from "react-dom";
|
|
721
|
-
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
722
|
-
var BottomSheet = forwardRef8(
|
|
723
|
-
(_a, ref) => {
|
|
724
|
-
var _b = _a, {
|
|
725
|
-
isForceOpen = false,
|
|
726
|
-
setIsForceOpen,
|
|
727
|
-
isClosedAble = true,
|
|
728
|
-
children,
|
|
729
|
-
startModalBtn,
|
|
730
|
-
stopModalBtn,
|
|
731
|
-
afterStopBtn,
|
|
732
|
-
size = "md",
|
|
733
|
-
modalTitle = "\u0E2B\u0E31\u0E27\u0E02\u0E49\u0E2D",
|
|
734
|
-
modalDesc = "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22",
|
|
735
|
-
className = ""
|
|
736
|
-
} = _b, rest = __objRest(_b, [
|
|
737
|
-
"isForceOpen",
|
|
738
|
-
"setIsForceOpen",
|
|
739
|
-
"isClosedAble",
|
|
740
|
-
"children",
|
|
741
|
-
"startModalBtn",
|
|
742
|
-
"stopModalBtn",
|
|
743
|
-
"afterStopBtn",
|
|
744
|
-
"size",
|
|
745
|
-
"modalTitle",
|
|
746
|
-
"modalDesc",
|
|
747
|
-
"className"
|
|
748
|
-
]);
|
|
749
|
-
const [isOpen, setIsOpen] = useState2(false);
|
|
750
|
-
const [shouldRender, setShouldRender] = useState2(false);
|
|
751
|
-
const [animate, setAnimate] = useState2(false);
|
|
752
|
-
useEffect(() => {
|
|
753
|
-
if (isOpen) {
|
|
754
|
-
setShouldRender(true);
|
|
755
|
-
setTimeout(() => setAnimate(true), 10);
|
|
756
|
-
} else {
|
|
757
|
-
setAnimate(false);
|
|
758
|
-
const timer = setTimeout(() => setShouldRender(false), 300);
|
|
759
|
-
return () => clearTimeout(timer);
|
|
760
|
-
}
|
|
761
|
-
}, [isOpen]);
|
|
762
|
-
useEffect(() => {
|
|
763
|
-
if (isForceOpen) {
|
|
764
|
-
setIsOpen(true);
|
|
765
|
-
} else {
|
|
766
|
-
setIsOpen(false);
|
|
767
|
-
}
|
|
768
|
-
}, [isForceOpen]);
|
|
769
|
-
const handleStartClick = useCallback2(
|
|
770
|
-
(e) => {
|
|
771
|
-
var _a2, _b2;
|
|
772
|
-
(_b2 = startModalBtn == null ? void 0 : (_a2 = startModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
773
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(true);
|
|
774
|
-
setIsOpen(true);
|
|
775
|
-
},
|
|
776
|
-
[startModalBtn]
|
|
777
|
-
);
|
|
778
|
-
const handleStopClick = useCallback2(
|
|
779
|
-
(e) => {
|
|
780
|
-
var _a2, _b2;
|
|
781
|
-
(_b2 = stopModalBtn == null ? void 0 : (_a2 = stopModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
782
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
783
|
-
setIsOpen(false);
|
|
784
|
-
},
|
|
785
|
-
[stopModalBtn]
|
|
786
|
-
);
|
|
787
|
-
const handleCloseClick = () => {
|
|
788
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
789
|
-
setIsOpen(false);
|
|
790
|
-
};
|
|
791
|
-
return /* @__PURE__ */ jsxs8("span", { ref, style: { display: "contents" }, children: [
|
|
792
|
-
startModalBtn && React.cloneElement(startModalBtn, {
|
|
793
|
-
onClick: handleStartClick
|
|
794
|
-
}),
|
|
795
|
-
shouldRender && createPortal(
|
|
796
|
-
/* @__PURE__ */ jsxs8(
|
|
797
|
-
"div",
|
|
798
|
-
{
|
|
799
|
-
className: `fixed inset-0 z-50 flex items-end justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
800
|
-
"aria-modal": "true",
|
|
801
|
-
role: "dialog",
|
|
802
|
-
children: [
|
|
803
|
-
/* @__PURE__ */ jsx8(
|
|
804
|
-
"div",
|
|
805
|
-
{
|
|
806
|
-
className: "absolute inset-0 bg-black/40",
|
|
807
|
-
onClick: () => isClosedAble ? handleCloseClick() : null,
|
|
808
|
-
"aria-label": "Close modal"
|
|
809
|
-
}
|
|
810
|
-
),
|
|
811
|
-
/* @__PURE__ */ jsxs8(
|
|
812
|
-
"div",
|
|
813
|
-
{
|
|
814
|
-
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
|
|
815
|
-
${size === "sm" ? "h-auto max-h-auto" : size === "md" ? "h-full max-h-[85vh]" : "h-full max-h-screen rounded-t-none!"}
|
|
816
|
-
${animate ? "scale-100 translate-y-0" : "scale-95 translate-y-full"}`,
|
|
817
|
-
children: [
|
|
818
|
-
/* @__PURE__ */ jsxs8("div", { className: "w-full flex flex-row relative items-center pt-8 pb-16", children: [
|
|
819
|
-
/* @__PURE__ */ jsxs8("div", { className: "flex flex-col px-8 max-w-225", children: [
|
|
820
|
-
/* @__PURE__ */ jsx8("p", { className: "text-heading-3 text-button-sheet-text-primary", children: modalTitle }),
|
|
821
|
-
/* @__PURE__ */ jsx8("p", { className: "text-body-small text-button-sheet-text-secondary", children: modalDesc })
|
|
822
|
-
] }),
|
|
823
|
-
/* @__PURE__ */ jsx8(
|
|
824
|
-
"i",
|
|
825
|
-
{
|
|
826
|
-
className: "fi fi-br-cross-small flex text-xl text-gray-600 w-44 h-44 absolute top-0 right-0 p-12",
|
|
827
|
-
onClick: () => handleCloseClick()
|
|
828
|
-
}
|
|
829
|
-
),
|
|
830
|
-
/* @__PURE__ */ jsx8(
|
|
831
|
-
"div",
|
|
832
|
-
{
|
|
833
|
-
className: "text-gray-600 text-xl absolute top-0 right-0 p-12",
|
|
834
|
-
onClick: () => handleCloseClick(),
|
|
835
|
-
children: "x"
|
|
836
|
-
}
|
|
837
|
-
)
|
|
838
|
-
] }),
|
|
839
|
-
/* @__PURE__ */ jsxs8("div", { className: "w-full h-full grow overflow-y-auto overflow-x-visible", children: [
|
|
840
|
-
children,
|
|
841
|
-
stopModalBtn && React.cloneElement(stopModalBtn, {
|
|
842
|
-
onClick: handleStopClick
|
|
843
|
-
}),
|
|
844
|
-
afterStopBtn && afterStopBtn
|
|
845
|
-
] })
|
|
846
|
-
]
|
|
847
|
-
}
|
|
848
|
-
)
|
|
849
|
-
]
|
|
850
|
-
}
|
|
851
|
-
),
|
|
852
|
-
document.body
|
|
853
|
-
)
|
|
854
|
-
] });
|
|
855
|
-
}
|
|
856
|
-
);
|
|
857
|
-
BottomSheet.displayName = "BottomSheet";
|
|
858
|
-
|
|
859
718
|
// src/components/Checkbox/Checkbox.tsx
|
|
860
719
|
import {
|
|
861
|
-
forwardRef as
|
|
720
|
+
forwardRef as forwardRef8,
|
|
862
721
|
useId as useId2,
|
|
863
|
-
useState as
|
|
722
|
+
useState as useState2
|
|
864
723
|
} from "react";
|
|
865
|
-
import { jsx as
|
|
724
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
866
725
|
function CheckIcon({ className }) {
|
|
867
|
-
return /* @__PURE__ */
|
|
726
|
+
return /* @__PURE__ */ jsx8(
|
|
868
727
|
"svg",
|
|
869
728
|
{
|
|
870
729
|
className,
|
|
871
730
|
viewBox: "0 0 16 16",
|
|
872
731
|
fill: "none",
|
|
873
732
|
"aria-hidden": "true",
|
|
874
|
-
children: /* @__PURE__ */
|
|
733
|
+
children: /* @__PURE__ */ jsx8(
|
|
875
734
|
"path",
|
|
876
735
|
{
|
|
877
736
|
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
@@ -885,14 +744,14 @@ function CheckIcon({ className }) {
|
|
|
885
744
|
);
|
|
886
745
|
}
|
|
887
746
|
function IndeterminateIcon({ className }) {
|
|
888
|
-
return /* @__PURE__ */
|
|
747
|
+
return /* @__PURE__ */ jsx8(
|
|
889
748
|
"svg",
|
|
890
749
|
{
|
|
891
750
|
className,
|
|
892
751
|
viewBox: "0 0 16 16",
|
|
893
752
|
fill: "none",
|
|
894
753
|
"aria-hidden": "true",
|
|
895
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ jsx8(
|
|
896
755
|
"path",
|
|
897
756
|
{
|
|
898
757
|
d: "M3.333 8h9.334",
|
|
@@ -904,7 +763,7 @@ function IndeterminateIcon({ className }) {
|
|
|
904
763
|
}
|
|
905
764
|
);
|
|
906
765
|
}
|
|
907
|
-
var Checkbox =
|
|
766
|
+
var Checkbox = forwardRef8(
|
|
908
767
|
(_a, ref) => {
|
|
909
768
|
var _b = _a, {
|
|
910
769
|
label,
|
|
@@ -929,15 +788,15 @@ var Checkbox = forwardRef9(
|
|
|
929
788
|
]);
|
|
930
789
|
const reactId = useId2();
|
|
931
790
|
const inputId = id != null ? id : reactId;
|
|
932
|
-
const [isChecked, setIsChecked] =
|
|
933
|
-
return /* @__PURE__ */
|
|
791
|
+
const [isChecked, setIsChecked] = useState2(defaultChecked != null ? defaultChecked : false);
|
|
792
|
+
return /* @__PURE__ */ jsxs8(
|
|
934
793
|
"label",
|
|
935
794
|
{
|
|
936
795
|
htmlFor: inputId,
|
|
937
796
|
className: `flex select-none font-sans ${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
938
797
|
children: [
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
/* @__PURE__ */
|
|
798
|
+
/* @__PURE__ */ jsxs8("div", { className: "relative mr-16", children: [
|
|
799
|
+
/* @__PURE__ */ jsx8(
|
|
941
800
|
"input",
|
|
942
801
|
__spreadValues({
|
|
943
802
|
ref,
|
|
@@ -954,16 +813,16 @@ var Checkbox = forwardRef9(
|
|
|
954
813
|
className: "sr-only"
|
|
955
814
|
}, rest)
|
|
956
815
|
),
|
|
957
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ jsx8(
|
|
958
817
|
"div",
|
|
959
818
|
{
|
|
960
819
|
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"}`,
|
|
961
|
-
children: isChecked ? /* @__PURE__ */
|
|
820
|
+
children: isChecked ? /* @__PURE__ */ jsx8(
|
|
962
821
|
CheckIcon,
|
|
963
822
|
{
|
|
964
823
|
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
965
824
|
}
|
|
966
|
-
) : indeterminate ? /* @__PURE__ */
|
|
825
|
+
) : indeterminate ? /* @__PURE__ */ jsx8(
|
|
967
826
|
IndeterminateIcon,
|
|
968
827
|
{
|
|
969
828
|
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
@@ -972,15 +831,15 @@ var Checkbox = forwardRef9(
|
|
|
972
831
|
}
|
|
973
832
|
)
|
|
974
833
|
] }),
|
|
975
|
-
(label || description) && /* @__PURE__ */
|
|
976
|
-
label && /* @__PURE__ */
|
|
834
|
+
(label || description) && /* @__PURE__ */ jsxs8("span", { className: "flex flex-col", children: [
|
|
835
|
+
label && /* @__PURE__ */ jsx8(
|
|
977
836
|
"span",
|
|
978
837
|
{
|
|
979
838
|
className: `text-label-large ${disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-primary"}`,
|
|
980
839
|
children: label
|
|
981
840
|
}
|
|
982
841
|
),
|
|
983
|
-
description && /* @__PURE__ */
|
|
842
|
+
description && /* @__PURE__ */ jsx8(
|
|
984
843
|
"span",
|
|
985
844
|
{
|
|
986
845
|
className: `text-body-small ${error ? "text-checkbox-text-danger" : disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-secondary"}`,
|
|
@@ -997,9 +856,9 @@ Checkbox.displayName = "Checkbox";
|
|
|
997
856
|
|
|
998
857
|
// src/components/Chip/Chip.tsx
|
|
999
858
|
import {
|
|
1000
|
-
forwardRef as
|
|
859
|
+
forwardRef as forwardRef9
|
|
1001
860
|
} from "react";
|
|
1002
|
-
import { jsx as
|
|
861
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1003
862
|
var sizeClasses4 = {
|
|
1004
863
|
sm: "h-32 text-label-medium px-12 py-6",
|
|
1005
864
|
md: "h-40 text-label-large px-16 py-10",
|
|
@@ -1018,7 +877,7 @@ var isDarkClasses = {
|
|
|
1018
877
|
true: "!bg-chip-background-black-active !text-chip-text-inverse",
|
|
1019
878
|
false: "!bg-chip-background-active !text-chip-text-inverse"
|
|
1020
879
|
};
|
|
1021
|
-
var Chip =
|
|
880
|
+
var Chip = forwardRef9(
|
|
1022
881
|
(_a, ref) => {
|
|
1023
882
|
var _b = _a, {
|
|
1024
883
|
size = "md",
|
|
@@ -1054,14 +913,14 @@ var Chip = forwardRef10(
|
|
|
1054
913
|
className,
|
|
1055
914
|
isSelected ? darkClass : ""
|
|
1056
915
|
].filter(Boolean).join(" ");
|
|
1057
|
-
return /* @__PURE__ */
|
|
916
|
+
return /* @__PURE__ */ jsxs9(
|
|
1058
917
|
"div",
|
|
1059
918
|
__spreadProps(__spreadValues({
|
|
1060
919
|
ref,
|
|
1061
920
|
className: containerClasses
|
|
1062
921
|
}, rest), {
|
|
1063
922
|
children: [
|
|
1064
|
-
icon ? icon : src && /* @__PURE__ */
|
|
923
|
+
icon ? icon : src && /* @__PURE__ */ jsx9("img", { src, alt, className: `${marginImgClasses[size]} rounded-full` }),
|
|
1065
924
|
label
|
|
1066
925
|
]
|
|
1067
926
|
})
|
|
@@ -1071,143 +930,423 @@ var Chip = forwardRef10(
|
|
|
1071
930
|
Chip.displayName = "Chip";
|
|
1072
931
|
|
|
1073
932
|
// src/components/Dialog/Dialog.tsx
|
|
1074
|
-
import
|
|
933
|
+
import {
|
|
934
|
+
forwardRef as forwardRef11,
|
|
935
|
+
useEffect,
|
|
936
|
+
useState as useState4
|
|
937
|
+
} from "react";
|
|
938
|
+
import { createPortal } from "react-dom";
|
|
939
|
+
|
|
940
|
+
// src/components/IconButton/IconButton.tsx
|
|
941
|
+
import { forwardRef as forwardRef10 } from "react";
|
|
942
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
943
|
+
var sizeClasses5 = {
|
|
944
|
+
xs: "h-24 w-24",
|
|
945
|
+
s: "h-32 w-32",
|
|
946
|
+
m: "h-40 w-40",
|
|
947
|
+
l: "h-48 w-48"
|
|
948
|
+
};
|
|
949
|
+
var iconSizeClasses2 = {
|
|
950
|
+
xs: "h-16 w-16",
|
|
951
|
+
s: "h-20 w-20",
|
|
952
|
+
m: "h-20 w-20",
|
|
953
|
+
l: "h-24 w-24"
|
|
954
|
+
};
|
|
955
|
+
var IconButton = forwardRef10(
|
|
956
|
+
(_a, ref) => {
|
|
957
|
+
var _b = _a, { icon, size = "s", danger = false, disabled = false, className = "" } = _b, rest = __objRest(_b, ["icon", "size", "danger", "disabled", "className"]);
|
|
958
|
+
const classes = [
|
|
959
|
+
"inline-flex shrink-0 items-center justify-center rounded-full transition-colors",
|
|
960
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-icon-button-border-focus",
|
|
961
|
+
sizeClasses5[size],
|
|
962
|
+
disabled ? "cursor-not-allowed text-icon-button-icon-disabled" : danger ? "cursor-pointer text-icon-button-icon-danger hover:bg-icon-button-background-hover active:bg-icon-button-background-active" : "cursor-pointer text-icon-button-icon-primary hover:bg-icon-button-background-hover active:bg-icon-button-background-active",
|
|
963
|
+
className
|
|
964
|
+
].filter(Boolean).join(" ");
|
|
965
|
+
return /* @__PURE__ */ jsx10("button", __spreadProps(__spreadValues({ ref, type: "button", disabled, className: classes }, rest), { children: /* @__PURE__ */ jsx10("span", { className: `shrink-0 flex items-center justify-center ${iconSizeClasses2[size]}`, children: icon }) }));
|
|
966
|
+
}
|
|
967
|
+
);
|
|
968
|
+
IconButton.displayName = "IconButton";
|
|
969
|
+
|
|
970
|
+
// src/components/Dialog/Dialog.tsx
|
|
971
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
972
|
+
function CloseIcon2({ className }) {
|
|
973
|
+
return /* @__PURE__ */ jsx11("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx11("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
974
|
+
}
|
|
975
|
+
function WarningIcon2({ className }) {
|
|
976
|
+
return /* @__PURE__ */ jsx11("svg", { className, width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ jsx11("path", { d: "M1 21h22L12 2 1 21Zm12-3h-2v-2h2v2Zm0-4h-2v-4h2v4Z" }) });
|
|
977
|
+
}
|
|
978
|
+
function useMountTransition(open, duration = 300) {
|
|
979
|
+
const [mounted, setMounted] = useState4(open);
|
|
980
|
+
const [animate, setAnimate] = useState4(open);
|
|
981
|
+
useEffect(() => {
|
|
982
|
+
if (open) {
|
|
983
|
+
setMounted(true);
|
|
984
|
+
let raf2 = 0;
|
|
985
|
+
const raf1 = requestAnimationFrame(() => {
|
|
986
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
987
|
+
});
|
|
988
|
+
return () => {
|
|
989
|
+
cancelAnimationFrame(raf1);
|
|
990
|
+
cancelAnimationFrame(raf2);
|
|
991
|
+
};
|
|
992
|
+
}
|
|
993
|
+
setAnimate(false);
|
|
994
|
+
const timer = setTimeout(() => setMounted(false), duration);
|
|
995
|
+
return () => clearTimeout(timer);
|
|
996
|
+
}, [open, duration]);
|
|
997
|
+
return { mounted, animate };
|
|
998
|
+
}
|
|
999
|
+
function DialogAction({
|
|
1000
|
+
action,
|
|
1001
|
+
variant,
|
|
1002
|
+
orderClass
|
|
1003
|
+
}) {
|
|
1004
|
+
if (!action) return null;
|
|
1005
|
+
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1006
|
+
return /* @__PURE__ */ jsx11(Button, __spreadProps(__spreadValues({ variant, size: "lg", className: `w-full lg:w-auto ${orderClass} ${className}` }, rest), { children: label }));
|
|
1007
|
+
}
|
|
1008
|
+
var Dialog = forwardRef11(
|
|
1009
|
+
(_a, ref) => {
|
|
1010
|
+
var _b = _a, {
|
|
1011
|
+
open,
|
|
1012
|
+
onOpenChange,
|
|
1013
|
+
display = "centered",
|
|
1014
|
+
artwork,
|
|
1015
|
+
title,
|
|
1016
|
+
subtitle,
|
|
1017
|
+
warning = false,
|
|
1018
|
+
closable = true,
|
|
1019
|
+
backdrop = true,
|
|
1020
|
+
children,
|
|
1021
|
+
dismiss,
|
|
1022
|
+
secondary,
|
|
1023
|
+
confirm,
|
|
1024
|
+
className = ""
|
|
1025
|
+
} = _b, rest = __objRest(_b, [
|
|
1026
|
+
"open",
|
|
1027
|
+
"onOpenChange",
|
|
1028
|
+
"display",
|
|
1029
|
+
"artwork",
|
|
1030
|
+
"title",
|
|
1031
|
+
"subtitle",
|
|
1032
|
+
"warning",
|
|
1033
|
+
"closable",
|
|
1034
|
+
"backdrop",
|
|
1035
|
+
"children",
|
|
1036
|
+
"dismiss",
|
|
1037
|
+
"secondary",
|
|
1038
|
+
"confirm",
|
|
1039
|
+
"className"
|
|
1040
|
+
]);
|
|
1041
|
+
const { mounted, animate } = useMountTransition(open);
|
|
1042
|
+
useEffect(() => {
|
|
1043
|
+
if (!open || !closable) return;
|
|
1044
|
+
const handleKeyDown = (e) => {
|
|
1045
|
+
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1046
|
+
};
|
|
1047
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1048
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1049
|
+
}, [open, closable, onOpenChange]);
|
|
1050
|
+
if (!mounted) return null;
|
|
1051
|
+
const handleClose = () => onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1052
|
+
const handleBackdropMouseDown = (e) => {
|
|
1053
|
+
if (closable && e.target === e.currentTarget) handleClose();
|
|
1054
|
+
};
|
|
1055
|
+
const showHeader = Boolean(title || subtitle || warning || closable);
|
|
1056
|
+
const footerCount = [dismiss, secondary, confirm].filter(Boolean).length;
|
|
1057
|
+
const showFooter = footerCount > 0;
|
|
1058
|
+
const splitDismissLeft = footerCount === 3;
|
|
1059
|
+
const mobileTransition = display === "centered" ? animate ? "scale-100 opacity-100" : "scale-95 opacity-0" : animate ? "translate-y-0" : "translate-y-full";
|
|
1060
|
+
const desktopTransition = animate ? "lg:scale-100 lg:opacity-100 lg:translate-y-0" : "lg:scale-95 lg:opacity-0 lg:translate-y-0";
|
|
1061
|
+
return createPortal(
|
|
1062
|
+
/* @__PURE__ */ jsx11(
|
|
1063
|
+
"div",
|
|
1064
|
+
{
|
|
1065
|
+
className: [
|
|
1066
|
+
"fixed inset-0 z-15000 flex flex-col",
|
|
1067
|
+
backdrop ? "bg-dialog-background-backdrop" : "",
|
|
1068
|
+
"transition-opacity duration-300",
|
|
1069
|
+
animate ? "opacity-100" : "opacity-0",
|
|
1070
|
+
display === "slide-up" ? "items-center justify-end" : "",
|
|
1071
|
+
display === "full" ? "items-start justify-end" : "",
|
|
1072
|
+
display === "centered" ? "items-center justify-center px-24" : "",
|
|
1073
|
+
"lg:items-center lg:justify-center lg:px-0"
|
|
1074
|
+
].filter(Boolean).join(" "),
|
|
1075
|
+
role: "presentation",
|
|
1076
|
+
onMouseDown: handleBackdropMouseDown,
|
|
1077
|
+
children: /* @__PURE__ */ jsxs10(
|
|
1078
|
+
"div",
|
|
1079
|
+
__spreadProps(__spreadValues({
|
|
1080
|
+
ref,
|
|
1081
|
+
role: "dialog",
|
|
1082
|
+
"aria-modal": "true",
|
|
1083
|
+
className: [
|
|
1084
|
+
"relative flex w-full flex-col overflow-hidden bg-dialog-background-primary",
|
|
1085
|
+
display === "centered" ? "rounded-12" : "rounded-t-12",
|
|
1086
|
+
"max-h-[85vh]",
|
|
1087
|
+
display === "full" ? "max-w-479 flex-1" : "max-w-479",
|
|
1088
|
+
"lg:min-w-0 lg:w-480 lg:max-w-480 lg:flex-none lg:rounded-16 lg:max-h-[85vh]",
|
|
1089
|
+
"transition-all duration-300",
|
|
1090
|
+
mobileTransition,
|
|
1091
|
+
desktopTransition,
|
|
1092
|
+
className
|
|
1093
|
+
].filter(Boolean).join(" "),
|
|
1094
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
1095
|
+
}, rest), {
|
|
1096
|
+
children: [
|
|
1097
|
+
artwork ? /* @__PURE__ */ jsxs10("div", { className: "relative shrink-0 bg-background-tertiary", children: [
|
|
1098
|
+
closable && /* @__PURE__ */ jsx11("div", { className: "absolute right-24 top-20", children: /* @__PURE__ */ jsx11(
|
|
1099
|
+
IconButton,
|
|
1100
|
+
{
|
|
1101
|
+
icon: /* @__PURE__ */ jsx11(CloseIcon2, { className: "h-24 w-24" }),
|
|
1102
|
+
size: "m",
|
|
1103
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1104
|
+
onClick: handleClose,
|
|
1105
|
+
className: "bg-icon-button-background-dark-transparent-enabled hover:bg-icon-button-background-dark-transparent-hover active:bg-icon-button-background-dark-transparent-active text-icon-button-icon-inverse!"
|
|
1106
|
+
}
|
|
1107
|
+
) }),
|
|
1108
|
+
artwork
|
|
1109
|
+
] }) : null,
|
|
1110
|
+
showHeader && /* @__PURE__ */ jsxs10("div", { className: "flex shrink-0 items-center gap-8 bg-dialog-background-primary px-16 pb-12 pt-16 lg:px-24 lg:pb-12 lg:pt-20", children: [
|
|
1111
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-1 items-start gap-8", children: [
|
|
1112
|
+
warning && /* @__PURE__ */ jsx11("span", { className: "flex shrink-0 items-center pt-2", children: /* @__PURE__ */ jsx11(WarningIcon2, { className: "h-20 w-20 text-dialog-icon-warning lg:h-24 lg:w-24" }) }),
|
|
1113
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1114
|
+
title && /* @__PURE__ */ jsx11("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1115
|
+
subtitle && !artwork && /* @__PURE__ */ jsx11("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1116
|
+
] })
|
|
1117
|
+
] }),
|
|
1118
|
+
closable && !artwork && /* @__PURE__ */ jsxs10(Fragment2, { children: [
|
|
1119
|
+
/* @__PURE__ */ jsx11(
|
|
1120
|
+
IconButton,
|
|
1121
|
+
{
|
|
1122
|
+
icon: /* @__PURE__ */ jsx11(CloseIcon2, { className: "h-20 w-20" }),
|
|
1123
|
+
size: "s",
|
|
1124
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1125
|
+
onClick: handleClose,
|
|
1126
|
+
className: "bg-icon-button-background-enabled lg:hidden!"
|
|
1127
|
+
}
|
|
1128
|
+
),
|
|
1129
|
+
/* @__PURE__ */ jsx11(
|
|
1130
|
+
IconButton,
|
|
1131
|
+
{
|
|
1132
|
+
icon: /* @__PURE__ */ jsx11(CloseIcon2, { className: "h-24 w-24" }),
|
|
1133
|
+
size: "m",
|
|
1134
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1135
|
+
onClick: handleClose,
|
|
1136
|
+
className: "hidden! bg-icon-button-background-enabled lg:inline-flex!"
|
|
1137
|
+
}
|
|
1138
|
+
)
|
|
1139
|
+
] })
|
|
1140
|
+
] }),
|
|
1141
|
+
/* @__PURE__ */ jsx11("div", { className: "flex-1 overflow-y-auto bg-dialog-background-primary px-16 py-12 text-body-small text-dialog-text-primary lg:px-24 lg:text-body-regular", children }),
|
|
1142
|
+
showFooter && /* @__PURE__ */ jsxs10("div", { className: "flex shrink-0 flex-col gap-8 bg-dialog-background-primary px-16 pb-16 pt-12 lg:flex-row lg:items-center lg:justify-end lg:px-24 lg:pb-24", children: [
|
|
1143
|
+
/* @__PURE__ */ jsx11(
|
|
1144
|
+
DialogAction,
|
|
1145
|
+
{
|
|
1146
|
+
action: dismiss,
|
|
1147
|
+
variant: "tertiary",
|
|
1148
|
+
orderClass: `order-3 lg:order-1 ${splitDismissLeft ? "lg:mr-auto" : ""}`
|
|
1149
|
+
}
|
|
1150
|
+
),
|
|
1151
|
+
/* @__PURE__ */ jsx11(DialogAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1152
|
+
/* @__PURE__ */ jsx11(DialogAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" })
|
|
1153
|
+
] })
|
|
1154
|
+
]
|
|
1155
|
+
})
|
|
1156
|
+
)
|
|
1157
|
+
}
|
|
1158
|
+
),
|
|
1159
|
+
document.body
|
|
1160
|
+
);
|
|
1161
|
+
}
|
|
1162
|
+
);
|
|
1163
|
+
Dialog.displayName = "Dialog";
|
|
1164
|
+
|
|
1165
|
+
// src/components/Drawer/Drawer.tsx
|
|
1166
|
+
import {
|
|
1167
|
+
forwardRef as forwardRef12,
|
|
1075
1168
|
useEffect as useEffect2,
|
|
1076
|
-
useState as useState5
|
|
1077
|
-
useCallback as useCallback3,
|
|
1078
|
-
forwardRef as forwardRef11
|
|
1169
|
+
useState as useState5
|
|
1079
1170
|
} from "react";
|
|
1080
1171
|
import { createPortal as createPortal2 } from "react-dom";
|
|
1081
|
-
import { jsx as
|
|
1082
|
-
|
|
1083
|
-
({
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1172
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1173
|
+
function CloseIcon3({ className }) {
|
|
1174
|
+
return /* @__PURE__ */ jsx12("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx12("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1175
|
+
}
|
|
1176
|
+
function useMountTransition2(open, duration = 300) {
|
|
1177
|
+
const [mounted, setMounted] = useState5(open);
|
|
1178
|
+
const [animate, setAnimate] = useState5(open);
|
|
1179
|
+
useEffect2(() => {
|
|
1180
|
+
if (open) {
|
|
1181
|
+
setMounted(true);
|
|
1182
|
+
let raf2 = 0;
|
|
1183
|
+
const raf1 = requestAnimationFrame(() => {
|
|
1184
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
1185
|
+
});
|
|
1186
|
+
return () => {
|
|
1187
|
+
cancelAnimationFrame(raf1);
|
|
1188
|
+
cancelAnimationFrame(raf2);
|
|
1189
|
+
};
|
|
1190
|
+
}
|
|
1191
|
+
setAnimate(false);
|
|
1192
|
+
const timer = setTimeout(() => setMounted(false), duration);
|
|
1193
|
+
return () => clearTimeout(timer);
|
|
1194
|
+
}, [open, duration]);
|
|
1195
|
+
return { mounted, animate };
|
|
1196
|
+
}
|
|
1197
|
+
function DrawerAction({
|
|
1198
|
+
action,
|
|
1199
|
+
variant,
|
|
1200
|
+
orderClass
|
|
1201
|
+
}) {
|
|
1202
|
+
if (!action) return null;
|
|
1203
|
+
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1204
|
+
return /* @__PURE__ */ jsx12(
|
|
1205
|
+
Button,
|
|
1206
|
+
__spreadProps(__spreadValues({
|
|
1207
|
+
variant,
|
|
1208
|
+
size: "lg",
|
|
1209
|
+
className: `w-full lg:w-auto ${orderClass} ${className}`
|
|
1210
|
+
}, rest), {
|
|
1211
|
+
children: label
|
|
1212
|
+
})
|
|
1213
|
+
);
|
|
1214
|
+
}
|
|
1215
|
+
var Drawer = forwardRef12(
|
|
1216
|
+
(_a, ref) => {
|
|
1217
|
+
var _b = _a, {
|
|
1218
|
+
open,
|
|
1219
|
+
onOpenChange,
|
|
1220
|
+
title,
|
|
1221
|
+
subtitle,
|
|
1222
|
+
closable = true,
|
|
1223
|
+
backdrop = true,
|
|
1224
|
+
children,
|
|
1225
|
+
dismiss,
|
|
1226
|
+
secondary,
|
|
1227
|
+
confirm,
|
|
1228
|
+
className = ""
|
|
1229
|
+
} = _b, rest = __objRest(_b, [
|
|
1230
|
+
"open",
|
|
1231
|
+
"onOpenChange",
|
|
1232
|
+
"title",
|
|
1233
|
+
"subtitle",
|
|
1234
|
+
"closable",
|
|
1235
|
+
"backdrop",
|
|
1236
|
+
"children",
|
|
1237
|
+
"dismiss",
|
|
1238
|
+
"secondary",
|
|
1239
|
+
"confirm",
|
|
1240
|
+
"className"
|
|
1241
|
+
]);
|
|
1242
|
+
const { mounted, animate } = useMountTransition2(open);
|
|
1108
1243
|
useEffect2(() => {
|
|
1109
|
-
if (
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
setIsOpen(true);
|
|
1121
|
-
},
|
|
1122
|
-
[startModalBtn]
|
|
1123
|
-
);
|
|
1124
|
-
const handleStopClick = useCallback3(
|
|
1125
|
-
(e) => {
|
|
1126
|
-
var _a, _b;
|
|
1127
|
-
(_b = stopModalBtn == null ? void 0 : (_a = stopModalBtn.props).onClick) == null ? void 0 : _b.call(_a, e);
|
|
1128
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
1129
|
-
setIsOpen(false);
|
|
1130
|
-
},
|
|
1131
|
-
[stopModalBtn]
|
|
1132
|
-
);
|
|
1133
|
-
const handleCloseClick = () => {
|
|
1134
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
1135
|
-
setIsOpen(false);
|
|
1244
|
+
if (!open || !closable) return;
|
|
1245
|
+
const handleKeyDown = (e) => {
|
|
1246
|
+
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1247
|
+
};
|
|
1248
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1249
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1250
|
+
}, [open, closable, onOpenChange]);
|
|
1251
|
+
if (!mounted) return null;
|
|
1252
|
+
const handleClose = () => onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1253
|
+
const handleBackdropMouseDown = (e) => {
|
|
1254
|
+
if (closable && e.target === e.currentTarget) handleClose();
|
|
1136
1255
|
};
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
"
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1256
|
+
const showHeader = Boolean(title || subtitle || closable);
|
|
1257
|
+
const showFooter = Boolean(dismiss || secondary || confirm);
|
|
1258
|
+
const allActions = Boolean(dismiss && secondary && confirm);
|
|
1259
|
+
return createPortal2(
|
|
1260
|
+
/* @__PURE__ */ jsx12(
|
|
1261
|
+
"div",
|
|
1262
|
+
{
|
|
1263
|
+
className: [
|
|
1264
|
+
"fixed inset-0 z-15000 flex flex-col items-end justify-center",
|
|
1265
|
+
backdrop ? "bg-dialog-background-backdrop" : "",
|
|
1266
|
+
"transition-opacity duration-300",
|
|
1267
|
+
animate ? "opacity-100" : "opacity-0"
|
|
1268
|
+
].filter(Boolean).join(" "),
|
|
1269
|
+
role: "presentation",
|
|
1270
|
+
onMouseDown: handleBackdropMouseDown,
|
|
1271
|
+
children: /* @__PURE__ */ jsxs11(
|
|
1272
|
+
"div",
|
|
1273
|
+
__spreadProps(__spreadValues({
|
|
1274
|
+
ref,
|
|
1275
|
+
role: "dialog",
|
|
1276
|
+
"aria-modal": "true",
|
|
1277
|
+
className: [
|
|
1278
|
+
"relative flex h-full w-full flex-col overflow-hidden bg-dialog-background-primary",
|
|
1279
|
+
"transition-transform duration-300",
|
|
1280
|
+
animate ? "translate-y-0" : "translate-y-full",
|
|
1281
|
+
"lg:translate-y-0",
|
|
1282
|
+
animate ? "lg:translate-x-0" : "lg:translate-x-full",
|
|
1283
|
+
"lg:w-480 lg:min-w-480 lg:max-w-640",
|
|
1284
|
+
className
|
|
1285
|
+
].filter(Boolean).join(" "),
|
|
1286
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
1287
|
+
}, rest), {
|
|
1288
|
+
children: [
|
|
1289
|
+
showHeader && /* @__PURE__ */ jsxs11("div", { className: "flex shrink-0 items-center gap-8 border-b border-border-subtle bg-dialog-background-primary px-16 pb-12 pt-16 lg:px-24 lg:pb-16 lg:pt-20", children: [
|
|
1290
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1291
|
+
title && /* @__PURE__ */ jsx12("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1292
|
+
subtitle && /* @__PURE__ */ jsx12("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1293
|
+
] }),
|
|
1294
|
+
closable && /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
1295
|
+
/* @__PURE__ */ jsx12(
|
|
1296
|
+
IconButton,
|
|
1164
1297
|
{
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-16 cursor-pointer",
|
|
1171
|
-
onMouseDown: (e) => {
|
|
1172
|
-
e.preventDefault();
|
|
1173
|
-
handleCloseClick();
|
|
1174
|
-
},
|
|
1175
|
-
children: /* @__PURE__ */ jsx11(
|
|
1176
|
-
"path",
|
|
1177
|
-
{
|
|
1178
|
-
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",
|
|
1179
|
-
fill: "#111827"
|
|
1180
|
-
}
|
|
1181
|
-
)
|
|
1298
|
+
icon: /* @__PURE__ */ jsx12(CloseIcon3, { className: "h-20 w-20" }),
|
|
1299
|
+
size: "s",
|
|
1300
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1301
|
+
onClick: handleClose,
|
|
1302
|
+
className: "bg-icon-button-background-enabled lg:hidden!"
|
|
1182
1303
|
}
|
|
1183
1304
|
),
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1305
|
+
/* @__PURE__ */ jsx12(
|
|
1306
|
+
IconButton,
|
|
1307
|
+
{
|
|
1308
|
+
icon: /* @__PURE__ */ jsx12(CloseIcon3, { className: "h-24 w-24" }),
|
|
1309
|
+
size: "m",
|
|
1310
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1311
|
+
onClick: handleClose,
|
|
1312
|
+
className: "hidden! bg-icon-button-background-enabled lg:inline-flex!"
|
|
1313
|
+
}
|
|
1314
|
+
)
|
|
1315
|
+
] })
|
|
1316
|
+
] }),
|
|
1317
|
+
/* @__PURE__ */ jsx12("div", { className: "flex-1 overflow-y-auto bg-dialog-background-primary p-16 text-body-regular text-dialog-text-primary lg:p-24", children }),
|
|
1318
|
+
showFooter && /* @__PURE__ */ jsx12("div", { className: "flex shrink-0 flex-col gap-8 border-t border-border-subtle bg-dialog-background-primary px-16 pb-16 pt-12 lg:flex-row lg:items-center lg:justify-end lg:px-24 lg:pb-24 lg:pt-16", children: allActions ? /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
1319
|
+
/* @__PURE__ */ jsx12(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" }),
|
|
1320
|
+
/* @__PURE__ */ jsxs11("div", { className: "contents gap-8 lg:order-2 lg:ml-auto lg:flex lg:items-center", children: [
|
|
1321
|
+
/* @__PURE__ */ jsx12(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1" }),
|
|
1322
|
+
/* @__PURE__ */ jsx12(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2" })
|
|
1323
|
+
] })
|
|
1324
|
+
] }) : /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
1325
|
+
/* @__PURE__ */ jsx12(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1326
|
+
/* @__PURE__ */ jsx12(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" }),
|
|
1327
|
+
/* @__PURE__ */ jsx12(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" })
|
|
1328
|
+
] }) })
|
|
1329
|
+
]
|
|
1330
|
+
})
|
|
1331
|
+
)
|
|
1332
|
+
}
|
|
1333
|
+
),
|
|
1334
|
+
document.body
|
|
1335
|
+
);
|
|
1198
1336
|
}
|
|
1199
1337
|
);
|
|
1200
|
-
|
|
1338
|
+
Drawer.displayName = "Drawer";
|
|
1201
1339
|
|
|
1202
1340
|
// src/components/Dropdown/Dropdown.tsx
|
|
1203
1341
|
import {
|
|
1204
|
-
useState as useState6,
|
|
1205
|
-
useRef,
|
|
1206
1342
|
useEffect as useEffect3,
|
|
1207
|
-
|
|
1343
|
+
useId as useId3,
|
|
1344
|
+
useRef,
|
|
1345
|
+
useState as useState6,
|
|
1346
|
+
forwardRef as forwardRef13
|
|
1208
1347
|
} from "react";
|
|
1209
|
-
import { Fragment as
|
|
1210
|
-
var IconDanger = () => /* @__PURE__ */
|
|
1348
|
+
import { Fragment as Fragment4, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1349
|
+
var IconDanger = () => /* @__PURE__ */ jsx13(
|
|
1211
1350
|
"svg",
|
|
1212
1351
|
{
|
|
1213
1352
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1215,7 +1354,7 @@ var IconDanger = () => /* @__PURE__ */ jsx12(
|
|
|
1215
1354
|
height: "20",
|
|
1216
1355
|
viewBox: "0 0 20 20",
|
|
1217
1356
|
fill: "none",
|
|
1218
|
-
children: /* @__PURE__ */
|
|
1357
|
+
children: /* @__PURE__ */ jsx13(
|
|
1219
1358
|
"path",
|
|
1220
1359
|
{
|
|
1221
1360
|
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
@@ -1225,7 +1364,7 @@ var IconDanger = () => /* @__PURE__ */ jsx12(
|
|
|
1225
1364
|
}
|
|
1226
1365
|
);
|
|
1227
1366
|
function IconCheck({ className }) {
|
|
1228
|
-
return /* @__PURE__ */
|
|
1367
|
+
return /* @__PURE__ */ jsx13(
|
|
1229
1368
|
"svg",
|
|
1230
1369
|
{
|
|
1231
1370
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1234,7 +1373,7 @@ function IconCheck({ className }) {
|
|
|
1234
1373
|
viewBox: "0 0 20 20",
|
|
1235
1374
|
fill: "none",
|
|
1236
1375
|
className,
|
|
1237
|
-
children: /* @__PURE__ */
|
|
1376
|
+
children: /* @__PURE__ */ jsx13(
|
|
1238
1377
|
"path",
|
|
1239
1378
|
{
|
|
1240
1379
|
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
@@ -1245,7 +1384,7 @@ function IconCheck({ className }) {
|
|
|
1245
1384
|
);
|
|
1246
1385
|
}
|
|
1247
1386
|
function ChevronDown({ className }) {
|
|
1248
|
-
return /* @__PURE__ */
|
|
1387
|
+
return /* @__PURE__ */ jsx13(
|
|
1249
1388
|
"svg",
|
|
1250
1389
|
{
|
|
1251
1390
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1254,7 +1393,7 @@ function ChevronDown({ className }) {
|
|
|
1254
1393
|
viewBox: "0 0 20 20",
|
|
1255
1394
|
fill: "none",
|
|
1256
1395
|
className,
|
|
1257
|
-
children: /* @__PURE__ */
|
|
1396
|
+
children: /* @__PURE__ */ jsx13(
|
|
1258
1397
|
"path",
|
|
1259
1398
|
{
|
|
1260
1399
|
d: "M14.7119 8.0625L10 12.7744L5.28809 8.0625L6.0625 7.28809L10 11.2256L13.9375 7.28809L14.7119 8.0625Z",
|
|
@@ -1264,16 +1403,17 @@ function ChevronDown({ className }) {
|
|
|
1264
1403
|
}
|
|
1265
1404
|
);
|
|
1266
1405
|
}
|
|
1267
|
-
var Dropdown =
|
|
1406
|
+
var Dropdown = forwardRef13(
|
|
1268
1407
|
(_a, ref) => {
|
|
1269
1408
|
var _b = _a, {
|
|
1270
1409
|
size = "md",
|
|
1410
|
+
variant = "default",
|
|
1271
1411
|
error,
|
|
1272
1412
|
label,
|
|
1273
1413
|
placeholder,
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1414
|
+
helperText,
|
|
1415
|
+
disabled = false,
|
|
1416
|
+
textCenter = false,
|
|
1277
1417
|
value,
|
|
1278
1418
|
setValue,
|
|
1279
1419
|
dropDownItems = [
|
|
@@ -1286,168 +1426,248 @@ var Dropdown = forwardRef12(
|
|
|
1286
1426
|
className = ""
|
|
1287
1427
|
} = _b, rest = __objRest(_b, [
|
|
1288
1428
|
"size",
|
|
1429
|
+
"variant",
|
|
1289
1430
|
"error",
|
|
1290
1431
|
"label",
|
|
1291
1432
|
"placeholder",
|
|
1292
|
-
"
|
|
1293
|
-
"
|
|
1294
|
-
"
|
|
1433
|
+
"helperText",
|
|
1434
|
+
"disabled",
|
|
1435
|
+
"textCenter",
|
|
1295
1436
|
"value",
|
|
1296
1437
|
"setValue",
|
|
1297
1438
|
"dropDownItems",
|
|
1298
1439
|
"className"
|
|
1299
1440
|
]);
|
|
1441
|
+
const isCombobox = variant === "combobox";
|
|
1442
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
1300
1443
|
const [isOpen, setIsOpen] = useState6(false);
|
|
1301
|
-
const [
|
|
1444
|
+
const [isFocused, setIsFocused] = useState6(false);
|
|
1445
|
+
const [query, setQuery] = useState6(value.label || "");
|
|
1446
|
+
const [filterText, setFilterText] = useState6("");
|
|
1302
1447
|
const dropdownRef = useRef(null);
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1305
|
-
);
|
|
1448
|
+
const inputRef = useRef(null);
|
|
1449
|
+
const listboxId = useId3();
|
|
1450
|
+
const [prevLabel, setPrevLabel] = useState6(value.label);
|
|
1451
|
+
if (value.label !== prevLabel) {
|
|
1452
|
+
setPrevLabel(value.label);
|
|
1453
|
+
setQuery(value.label || "");
|
|
1454
|
+
}
|
|
1455
|
+
const filteredItems = isCombobox ? dropDownItems.filter(
|
|
1456
|
+
(item) => item.label.toLowerCase().includes(filterText.toLowerCase())
|
|
1457
|
+
) : dropDownItems;
|
|
1306
1458
|
useEffect3(() => {
|
|
1307
1459
|
function handleClickOutside(event) {
|
|
1308
1460
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1309
1461
|
setIsOpen(false);
|
|
1462
|
+
if (isCombobox) setQuery(value.label || "");
|
|
1310
1463
|
}
|
|
1311
1464
|
}
|
|
1312
1465
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1313
1466
|
return () => {
|
|
1314
1467
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1315
1468
|
};
|
|
1316
|
-
}, []);
|
|
1317
|
-
|
|
1318
|
-
|
|
1469
|
+
}, [isCombobox, value.label]);
|
|
1470
|
+
const triggerClassName = `w-full rounded-6 text-body-small px-16 inline-flex gap-8 items-center border
|
|
1471
|
+
${size === "lg" ? "h-48 py-16" : "h-40 py-12"}
|
|
1472
|
+
${!isCombobox ? disabled ? "text-dropdown-text-disabled cursor-not-allowed" : value ? "text-dropdown-text-primary cursor-pointer" : "text-dropdown-text-secondary cursor-pointer" : ""}
|
|
1473
|
+
${disabled ? "pointer-events-none bg-dropdown-background-disabled border-dropdown-border-disabled" : error ? "bg-dropdown-background-enabled border-dropdown-border-danger ring-1 ring-inset ring-dropdown-border-danger" : isOpen ? "bg-dropdown-background-enabled border-dropdown-border-active ring-1 ring-inset ring-dropdown-border-active" : isFocused ? "bg-dropdown-background-enabled border-dropdown-border-focus ring-1 ring-inset ring-dropdown-border-focus" : "bg-dropdown-background-enabled border-dropdown-border-enabled hover:border-dropdown-border-hover"}
|
|
1474
|
+
${className}`;
|
|
1475
|
+
return /* @__PURE__ */ jsxs12("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1476
|
+
label ? /* @__PURE__ */ jsx13(
|
|
1319
1477
|
"p",
|
|
1320
1478
|
{
|
|
1321
|
-
className: `text-label-medium text-left items-left font-medium
|
|
1479
|
+
className: `text-label-medium text-left items-left font-medium ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
|
|
1322
1480
|
children: label
|
|
1323
1481
|
}
|
|
1324
|
-
) : /* @__PURE__ */
|
|
1482
|
+
) : /* @__PURE__ */ jsx13(Fragment4, {}),
|
|
1325
1483
|
/* @__PURE__ */ jsxs12("div", { className: "w-full flex flex-col relative", ref: dropdownRef, children: [
|
|
1326
|
-
/* @__PURE__ */ jsxs12(
|
|
1484
|
+
isCombobox ? /* @__PURE__ */ jsxs12(
|
|
1327
1485
|
"div",
|
|
1328
1486
|
__spreadProps(__spreadValues({
|
|
1329
1487
|
ref
|
|
1330
1488
|
}, rest), {
|
|
1331
|
-
onClick: () =>
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
${className}`,
|
|
1489
|
+
onClick: () => {
|
|
1490
|
+
var _a2;
|
|
1491
|
+
return !disabled && ((_a2 = inputRef.current) == null ? void 0 : _a2.focus());
|
|
1492
|
+
},
|
|
1493
|
+
className: triggerClassName,
|
|
1337
1494
|
children: [
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
"
|
|
1495
|
+
/* @__PURE__ */ jsx13(
|
|
1496
|
+
"input",
|
|
1340
1497
|
{
|
|
1341
|
-
|
|
1342
|
-
|
|
1498
|
+
ref: inputRef,
|
|
1499
|
+
type: "text",
|
|
1500
|
+
role: "combobox",
|
|
1501
|
+
"aria-autocomplete": "list",
|
|
1502
|
+
"aria-haspopup": "listbox",
|
|
1503
|
+
"aria-expanded": isOpen,
|
|
1504
|
+
"aria-controls": listboxId,
|
|
1505
|
+
disabled,
|
|
1506
|
+
placeholder,
|
|
1507
|
+
value: query,
|
|
1508
|
+
onChange: (e) => {
|
|
1509
|
+
setQuery(e.target.value);
|
|
1510
|
+
setFilterText(e.target.value);
|
|
1511
|
+
setIsOpen(true);
|
|
1512
|
+
},
|
|
1513
|
+
onFocus: () => {
|
|
1514
|
+
setIsFocused(true);
|
|
1515
|
+
setIsOpen(true);
|
|
1516
|
+
setFilterText("");
|
|
1517
|
+
},
|
|
1518
|
+
onBlur: () => setIsFocused(false),
|
|
1519
|
+
onKeyDown: (e) => {
|
|
1520
|
+
if (!disabled && e.key === "Escape") {
|
|
1521
|
+
setIsOpen(false);
|
|
1522
|
+
setQuery(value.label || "");
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
className: `grow w-full min-w-0 bg-transparent focus:outline-none ${disabled ? "text-dropdown-text-disabled cursor-not-allowed" : "text-dropdown-text-primary cursor-text"}`
|
|
1343
1526
|
}
|
|
1344
1527
|
),
|
|
1345
|
-
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-
|
|
1346
|
-
|
|
1347
|
-
/* @__PURE__ */
|
|
1348
|
-
|
|
1528
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-4", children: [
|
|
1529
|
+
disabled ? /* @__PURE__ */ jsx13(Fragment4, {}) : error ? /* @__PURE__ */ jsx13(IconDanger, {}) : /* @__PURE__ */ jsx13(Fragment4, {}),
|
|
1530
|
+
/* @__PURE__ */ jsx13(
|
|
1531
|
+
IconButton,
|
|
1349
1532
|
{
|
|
1350
|
-
|
|
1533
|
+
size: iconButtonSize,
|
|
1534
|
+
disabled,
|
|
1535
|
+
tabIndex: -1,
|
|
1536
|
+
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1537
|
+
icon: /* @__PURE__ */ jsx13(
|
|
1538
|
+
ChevronDown,
|
|
1539
|
+
{
|
|
1540
|
+
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
1541
|
+
}
|
|
1542
|
+
),
|
|
1543
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1544
|
+
onClick: (e) => {
|
|
1545
|
+
var _a2;
|
|
1546
|
+
e.stopPropagation();
|
|
1547
|
+
if (disabled) return;
|
|
1548
|
+
if (isOpen) {
|
|
1549
|
+
setIsOpen(false);
|
|
1550
|
+
setQuery(value.label || "");
|
|
1551
|
+
} else {
|
|
1552
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1351
1555
|
}
|
|
1352
1556
|
)
|
|
1353
1557
|
] })
|
|
1354
1558
|
]
|
|
1355
1559
|
})
|
|
1356
|
-
)
|
|
1357
|
-
/* @__PURE__ */ jsxs12(
|
|
1560
|
+
) : /* @__PURE__ */ jsxs12(
|
|
1358
1561
|
"div",
|
|
1359
|
-
{
|
|
1360
|
-
|
|
1361
|
-
|
|
1562
|
+
__spreadProps(__spreadValues({
|
|
1563
|
+
ref
|
|
1564
|
+
}, rest), {
|
|
1565
|
+
tabIndex: disabled ? -1 : 0,
|
|
1566
|
+
role: "button",
|
|
1567
|
+
"aria-haspopup": "listbox",
|
|
1568
|
+
"aria-expanded": isOpen,
|
|
1569
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
1570
|
+
onFocus: (e) => {
|
|
1571
|
+
var _a2;
|
|
1572
|
+
setIsFocused(true);
|
|
1573
|
+
(_a2 = rest.onFocus) == null ? void 0 : _a2.call(rest, e);
|
|
1574
|
+
},
|
|
1575
|
+
onBlur: (e) => {
|
|
1576
|
+
var _a2;
|
|
1577
|
+
setIsFocused(false);
|
|
1578
|
+
(_a2 = rest.onBlur) == null ? void 0 : _a2.call(rest, e);
|
|
1579
|
+
},
|
|
1580
|
+
onKeyDown: (e) => {
|
|
1581
|
+
var _a2;
|
|
1582
|
+
if (disabled) return;
|
|
1583
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1584
|
+
e.preventDefault();
|
|
1585
|
+
setIsOpen((prev) => !prev);
|
|
1586
|
+
} else if (e.key === "Escape") {
|
|
1587
|
+
setIsOpen(false);
|
|
1588
|
+
}
|
|
1589
|
+
(_a2 = rest.onKeyDown) == null ? void 0 : _a2.call(rest, e);
|
|
1590
|
+
},
|
|
1591
|
+
className: `focus:outline-none ${triggerClassName}`,
|
|
1362
1592
|
children: [
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
/* @__PURE__ */ jsxs12("div", { className: "relative", children: [
|
|
1366
|
-
/* @__PURE__ */ jsx12("div", { className: "absolute inset-y-0 rtl:inset-r-0 inset-s-0 flex items-center ps-12 pointer-events-none", children: /* @__PURE__ */ jsxs12(
|
|
1367
|
-
"svg",
|
|
1368
|
-
{
|
|
1369
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1370
|
-
width: "20",
|
|
1371
|
-
height: "20",
|
|
1372
|
-
viewBox: "0 0 20 20",
|
|
1373
|
-
fill: "none",
|
|
1374
|
-
children: [
|
|
1375
|
-
/* @__PURE__ */ jsx12(
|
|
1376
|
-
"mask",
|
|
1377
|
-
{
|
|
1378
|
-
id: "mask0_3218_5077",
|
|
1379
|
-
style: { maskType: "alpha" },
|
|
1380
|
-
maskUnits: "userSpaceOnUse",
|
|
1381
|
-
x: "0",
|
|
1382
|
-
y: "0",
|
|
1383
|
-
width: "20",
|
|
1384
|
-
height: "20",
|
|
1385
|
-
children: /* @__PURE__ */ jsx12("rect", { width: "20", height: "20", fill: "#D9D9D9" })
|
|
1386
|
-
}
|
|
1387
|
-
),
|
|
1388
|
-
/* @__PURE__ */ jsx12("g", { mask: "url(#mask0_3218_5077)", children: /* @__PURE__ */ jsx12(
|
|
1389
|
-
"path",
|
|
1390
|
-
{
|
|
1391
|
-
d: "M15.8894 16.6476L10.9263 11.6842C10.5096 12.0005 10.0527 12.2454 9.55563 12.419C9.05855 12.5926 8.54556 12.6794 8.01667 12.6794C6.7182 12.6794 5.61354 12.2241 4.70271 11.3134C3.79202 10.4026 3.33667 9.29811 3.33667 8.00005C3.33667 6.702 3.79202 5.59755 4.70271 4.68672C5.61354 3.77603 6.71799 3.32068 8.01604 3.32068C9.3141 3.32068 10.4185 3.77603 11.3294 4.68672C12.2401 5.59755 12.6954 6.70221 12.6954 8.00068C12.6954 8.54554 12.606 9.06651 12.4271 9.56359C12.2481 10.0608 12.0058 10.5097 11.7002 10.9103L16.6633 15.8734L15.8894 16.6476ZM8.01604 11.5963C9.02035 11.5963 9.87077 11.248 10.5673 10.5513C11.264 9.85478 11.6123 9.00436 11.6123 8.00005C11.6123 6.99575 11.264 6.14533 10.5673 5.4488C9.87077 4.75214 9.02035 4.4038 8.01604 4.4038C7.01174 4.4038 6.16132 4.75214 5.46479 5.4488C4.76813 6.14533 4.41979 6.99575 4.41979 8.00005C4.41979 9.00436 4.76813 9.85478 5.46479 10.5513C6.16132 11.248 7.01174 11.5963 8.01604 11.5963Z",
|
|
1392
|
-
fill: "#111827"
|
|
1393
|
-
}
|
|
1394
|
-
) })
|
|
1395
|
-
]
|
|
1396
|
-
}
|
|
1397
|
-
) }),
|
|
1398
|
-
/* @__PURE__ */ jsx12(
|
|
1399
|
-
"input",
|
|
1400
|
-
{
|
|
1401
|
-
type: "text",
|
|
1402
|
-
className: "block w-full p-8 ps-40 text-body-small text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-bubblegum focus:border-bubblegum",
|
|
1403
|
-
placeholder: "Search...",
|
|
1404
|
-
value: search,
|
|
1405
|
-
onChange: (e) => setSearch(e.target.value)
|
|
1406
|
-
}
|
|
1407
|
-
)
|
|
1408
|
-
] })
|
|
1409
|
-
] }) : /* @__PURE__ */ jsx12(Fragment2, {}),
|
|
1410
|
-
/* @__PURE__ */ jsx12(
|
|
1411
|
-
"ul",
|
|
1593
|
+
/* @__PURE__ */ jsx13(
|
|
1594
|
+
"p",
|
|
1412
1595
|
{
|
|
1413
|
-
className: "
|
|
1414
|
-
|
|
1415
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ jsx12("li", { children: /* @__PURE__ */ jsxs12(
|
|
1416
|
-
"div",
|
|
1417
|
-
{
|
|
1418
|
-
onClick: () => {
|
|
1419
|
-
setValue(item);
|
|
1420
|
-
setSearch("");
|
|
1421
|
-
setIsOpen(false);
|
|
1422
|
-
},
|
|
1423
|
-
className: "relative text-gray-900 py-12 px-16 rounded-sm text-label-medium hover:bg-gray-100 flex items-center justify-between gap-12",
|
|
1424
|
-
children: [
|
|
1425
|
-
/* @__PURE__ */ jsx12("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
|
|
1426
|
-
value.value === item.value && /* @__PURE__ */ jsx12(IconCheck, { className: "h-20 w-20" })
|
|
1427
|
-
]
|
|
1428
|
-
}
|
|
1429
|
-
) }, idx)) : /* @__PURE__ */ jsx12("li", { className: "px-8 py-8 text-label-medium text-gray-900", children: "No results found" })
|
|
1596
|
+
className: `grow truncate ${textCenter ? "text-center" : "text-start"}`,
|
|
1597
|
+
children: value.label || placeholder
|
|
1430
1598
|
}
|
|
1431
|
-
)
|
|
1599
|
+
),
|
|
1600
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-4", children: [
|
|
1601
|
+
disabled ? /* @__PURE__ */ jsx13(Fragment4, {}) : error ? /* @__PURE__ */ jsx13(IconDanger, {}) : /* @__PURE__ */ jsx13(Fragment4, {}),
|
|
1602
|
+
/* @__PURE__ */ jsx13(
|
|
1603
|
+
IconButton,
|
|
1604
|
+
{
|
|
1605
|
+
size: iconButtonSize,
|
|
1606
|
+
disabled,
|
|
1607
|
+
tabIndex: -1,
|
|
1608
|
+
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1609
|
+
icon: /* @__PURE__ */ jsx13(
|
|
1610
|
+
ChevronDown,
|
|
1611
|
+
{
|
|
1612
|
+
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
1613
|
+
}
|
|
1614
|
+
),
|
|
1615
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1616
|
+
onClick: (e) => {
|
|
1617
|
+
e.stopPropagation();
|
|
1618
|
+
if (!disabled) setIsOpen((prev) => !prev);
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
)
|
|
1622
|
+
] })
|
|
1432
1623
|
]
|
|
1624
|
+
})
|
|
1625
|
+
),
|
|
1626
|
+
/* @__PURE__ */ jsx13(
|
|
1627
|
+
"div",
|
|
1628
|
+
{
|
|
1629
|
+
className: `${isOpen ? "flex" : "hidden"} top-[calc(100%+4px)] left-0 absolute z-10000 bg-dropdown-background-enabled rounded-6 shadow-base w-full flex-col pt-4 overflow-hidden`,
|
|
1630
|
+
children: /* @__PURE__ */ jsx13(
|
|
1631
|
+
"ul",
|
|
1632
|
+
{
|
|
1633
|
+
id: isCombobox ? listboxId : void 0,
|
|
1634
|
+
role: isCombobox ? "listbox" : void 0,
|
|
1635
|
+
className: "h-auto max-h-200 overflow-y-auto cursor-pointer",
|
|
1636
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs12(
|
|
1637
|
+
"div",
|
|
1638
|
+
{
|
|
1639
|
+
onClick: () => {
|
|
1640
|
+
setValue(item);
|
|
1641
|
+
if (isCombobox) setQuery(item.label);
|
|
1642
|
+
setIsOpen(false);
|
|
1643
|
+
},
|
|
1644
|
+
className: "relative h-48 py-8 px-16 border-t border-gray-50 text-label-medium hover:bg-dropdown-background-hover active:bg-dropdown-background-active flex items-center justify-between gap-12",
|
|
1645
|
+
children: [
|
|
1646
|
+
/* @__PURE__ */ jsx13("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
|
|
1647
|
+
value.value === item.value && /* @__PURE__ */ jsx13(IconCheck, { className: "h-20 w-20" })
|
|
1648
|
+
]
|
|
1649
|
+
}
|
|
1650
|
+
) }, idx)) : /* @__PURE__ */ jsx13("li", { className: "px-16 py-8 text-label-medium text-dropdown-text-secondary", children: "\u0E44\u0E21\u0E48\u0E1E\u0E1A\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23" })
|
|
1651
|
+
}
|
|
1652
|
+
)
|
|
1433
1653
|
}
|
|
1434
1654
|
)
|
|
1435
1655
|
] }),
|
|
1436
|
-
error ? /* @__PURE__ */
|
|
1656
|
+
error ? /* @__PURE__ */ jsx13("p", { className: "text-caption-caption text-left items-left text-dropdown-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx13(
|
|
1437
1657
|
"p",
|
|
1438
1658
|
{
|
|
1439
|
-
className: `text-caption-caption text-left items-left text-dropdown-text-
|
|
1440
|
-
children:
|
|
1659
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-secondary"}`,
|
|
1660
|
+
children: helperText
|
|
1441
1661
|
}
|
|
1442
|
-
) : /* @__PURE__ */
|
|
1662
|
+
) : /* @__PURE__ */ jsx13(Fragment4, {})
|
|
1443
1663
|
] });
|
|
1444
1664
|
}
|
|
1445
1665
|
);
|
|
1446
1666
|
Dropdown.displayName = "Dropdown";
|
|
1447
1667
|
|
|
1448
1668
|
// src/components/FinancialLogo/FinancialLogo.tsx
|
|
1449
|
-
import { forwardRef as
|
|
1450
|
-
import { jsx as
|
|
1669
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
1670
|
+
import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1451
1671
|
var inlineClasses2 = {
|
|
1452
1672
|
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
1453
1673
|
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
@@ -1477,34 +1697,34 @@ var inlineIconClasses2 = {
|
|
|
1477
1697
|
common: "text-alert-inline-common-icon"
|
|
1478
1698
|
};
|
|
1479
1699
|
function InfoIcon2({ className }) {
|
|
1480
|
-
return /* @__PURE__ */
|
|
1700
|
+
return /* @__PURE__ */ jsx14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6h.01M9 10h1v4h1", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1481
1701
|
}
|
|
1482
1702
|
function SuccessIcon2({ className }) {
|
|
1483
1703
|
return /* @__PURE__ */ jsxs13("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1704
|
+
/* @__PURE__ */ jsx14("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1705
|
+
/* @__PURE__ */ jsx14("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1486
1706
|
] });
|
|
1487
1707
|
}
|
|
1488
|
-
function
|
|
1489
|
-
return /* @__PURE__ */
|
|
1708
|
+
function WarningIcon3({ className }) {
|
|
1709
|
+
return /* @__PURE__ */ jsx14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M8.57 3.22 1.53 15.5a1.67 1.67 0 0 0 1.43 2.5h14.08a1.67 1.67 0 0 0 1.43-2.5L11.43 3.22a1.67 1.67 0 0 0-2.86 0ZM10 7.5v3.33M10 14.17h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1490
1710
|
}
|
|
1491
1711
|
function DangerIcon2({ className }) {
|
|
1492
|
-
return /* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ jsx14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM12.5 7.5l-5 5M7.5 7.5l5 5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1493
1713
|
}
|
|
1494
1714
|
function CommonIcon({ className }) {
|
|
1495
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ jsx14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM10 6v4M10 14h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1496
1716
|
}
|
|
1497
|
-
function
|
|
1498
|
-
return /* @__PURE__ */
|
|
1717
|
+
function CloseIcon4({ className }) {
|
|
1718
|
+
return /* @__PURE__ */ jsx14("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx14("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1499
1719
|
}
|
|
1500
1720
|
var defaultIcons2 = {
|
|
1501
1721
|
info: InfoIcon2,
|
|
1502
1722
|
success: SuccessIcon2,
|
|
1503
|
-
warning:
|
|
1723
|
+
warning: WarningIcon3,
|
|
1504
1724
|
danger: DangerIcon2,
|
|
1505
1725
|
common: CommonIcon
|
|
1506
1726
|
};
|
|
1507
|
-
var FinancialLogo =
|
|
1727
|
+
var FinancialLogo = forwardRef14(
|
|
1508
1728
|
(_a, ref) => {
|
|
1509
1729
|
var _b = _a, {
|
|
1510
1730
|
variant = "info",
|
|
@@ -1541,21 +1761,21 @@ var FinancialLogo = forwardRef13(
|
|
|
1541
1761
|
className
|
|
1542
1762
|
].filter(Boolean).join(" ");
|
|
1543
1763
|
return /* @__PURE__ */ jsxs13("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
1544
|
-
/* @__PURE__ */
|
|
1764
|
+
/* @__PURE__ */ jsx14("span", { className: `shrink-0 mt-2 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ jsx14(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
1545
1765
|
/* @__PURE__ */ jsxs13("div", { className: "flex-1 min-w-0", children: [
|
|
1546
|
-
title && /* @__PURE__ */
|
|
1547
|
-
description && /* @__PURE__ */
|
|
1766
|
+
title && /* @__PURE__ */ jsx14("p", { className: "text-sm font-medium leading-20", children: title }),
|
|
1767
|
+
description && /* @__PURE__ */ jsx14("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
|
|
1548
1768
|
children
|
|
1549
1769
|
] }),
|
|
1550
|
-
action && /* @__PURE__ */
|
|
1551
|
-
onClose && /* @__PURE__ */
|
|
1770
|
+
action && /* @__PURE__ */ jsx14("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
|
|
1771
|
+
onClose && /* @__PURE__ */ jsx14(
|
|
1552
1772
|
"button",
|
|
1553
1773
|
{
|
|
1554
1774
|
type: "button",
|
|
1555
1775
|
onClick: onClose,
|
|
1556
1776
|
className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
|
|
1557
1777
|
"aria-label": "Close",
|
|
1558
|
-
children: /* @__PURE__ */
|
|
1778
|
+
children: /* @__PURE__ */ jsx14(CloseIcon4, { className: "h-16 w-16" })
|
|
1559
1779
|
}
|
|
1560
1780
|
)
|
|
1561
1781
|
] }));
|
|
@@ -1564,9 +1784,9 @@ var FinancialLogo = forwardRef13(
|
|
|
1564
1784
|
FinancialLogo.displayName = "FinancialLogo";
|
|
1565
1785
|
|
|
1566
1786
|
// src/components/Icon/Icon.tsx
|
|
1567
|
-
import { forwardRef as
|
|
1568
|
-
import { jsx as
|
|
1569
|
-
var Icon =
|
|
1787
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
1788
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1789
|
+
var Icon = forwardRef15(
|
|
1570
1790
|
(_a, ref) => {
|
|
1571
1791
|
var _b = _a, {
|
|
1572
1792
|
name,
|
|
@@ -1594,7 +1814,7 @@ var Icon = forwardRef14(
|
|
|
1594
1814
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
1595
1815
|
className
|
|
1596
1816
|
].filter(Boolean).join(" ");
|
|
1597
|
-
return /* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ jsx15(
|
|
1598
1818
|
"span",
|
|
1599
1819
|
__spreadProps(__spreadValues({
|
|
1600
1820
|
ref,
|
|
@@ -1617,8 +1837,8 @@ var Icon = forwardRef14(
|
|
|
1617
1837
|
Icon.displayName = "Icon";
|
|
1618
1838
|
|
|
1619
1839
|
// src/components/Link/Link.tsx
|
|
1620
|
-
import { forwardRef as
|
|
1621
|
-
import { jsx as
|
|
1840
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
1841
|
+
import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1622
1842
|
var linkStyleClasses = {
|
|
1623
1843
|
brand: "font-sans text-link-text-enabled",
|
|
1624
1844
|
white: "font-sans text-link-text-enabled-inverse",
|
|
@@ -1641,11 +1861,11 @@ var iconVariantClasses = {
|
|
|
1641
1861
|
};
|
|
1642
1862
|
function SuccessIcon3({ className }) {
|
|
1643
1863
|
return /* @__PURE__ */ jsxs14("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1644
|
-
/* @__PURE__ */
|
|
1645
|
-
/* @__PURE__ */
|
|
1864
|
+
/* @__PURE__ */ jsx16("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1865
|
+
/* @__PURE__ */ jsx16("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1646
1866
|
] });
|
|
1647
1867
|
}
|
|
1648
|
-
var Link =
|
|
1868
|
+
var Link = forwardRef16(
|
|
1649
1869
|
(_a, ref) => {
|
|
1650
1870
|
var _b = _a, {
|
|
1651
1871
|
variant = "sm",
|
|
@@ -1677,8 +1897,8 @@ var Link = forwardRef15(
|
|
|
1677
1897
|
className
|
|
1678
1898
|
].filter(Boolean).join(" ");
|
|
1679
1899
|
return /* @__PURE__ */ jsxs14("div", __spreadProps(__spreadValues({ ref, role: "link", className: classes }, rest), { children: [
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
icon && !isInline ? /* @__PURE__ */
|
|
1900
|
+
/* @__PURE__ */ jsx16("a", { href, target: "_blank", rel: "noopener noreferrer", children: text }),
|
|
1901
|
+
icon && !isInline ? /* @__PURE__ */ jsx16(SuccessIcon3, { className: iconClass }) : null
|
|
1682
1902
|
] }));
|
|
1683
1903
|
}
|
|
1684
1904
|
);
|
|
@@ -1686,11 +1906,11 @@ Link.displayName = "Link";
|
|
|
1686
1906
|
|
|
1687
1907
|
// src/components/Radio/Radio.tsx
|
|
1688
1908
|
import {
|
|
1689
|
-
forwardRef as
|
|
1690
|
-
useId as
|
|
1909
|
+
forwardRef as forwardRef17,
|
|
1910
|
+
useId as useId4
|
|
1691
1911
|
} from "react";
|
|
1692
|
-
import { jsx as
|
|
1693
|
-
var Radio =
|
|
1912
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1913
|
+
var Radio = forwardRef17(
|
|
1694
1914
|
(_a, ref) => {
|
|
1695
1915
|
var _b = _a, {
|
|
1696
1916
|
size = "sm",
|
|
@@ -1715,9 +1935,9 @@ var Radio = forwardRef16(
|
|
|
1715
1935
|
"id",
|
|
1716
1936
|
"name"
|
|
1717
1937
|
]);
|
|
1718
|
-
const reactId =
|
|
1938
|
+
const reactId = useId4();
|
|
1719
1939
|
const inputId = id != null ? id : reactId;
|
|
1720
|
-
return /* @__PURE__ */
|
|
1940
|
+
return /* @__PURE__ */ jsx17(
|
|
1721
1941
|
"div",
|
|
1722
1942
|
{
|
|
1723
1943
|
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
@@ -1728,7 +1948,7 @@ var Radio = forwardRef16(
|
|
|
1728
1948
|
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
1729
1949
|
children: [
|
|
1730
1950
|
/* @__PURE__ */ jsxs15("div", { children: [
|
|
1731
|
-
/* @__PURE__ */
|
|
1951
|
+
/* @__PURE__ */ jsx17(
|
|
1732
1952
|
"input",
|
|
1733
1953
|
__spreadValues({
|
|
1734
1954
|
ref,
|
|
@@ -1741,14 +1961,14 @@ var Radio = forwardRef16(
|
|
|
1741
1961
|
name
|
|
1742
1962
|
}, rest)
|
|
1743
1963
|
),
|
|
1744
|
-
/* @__PURE__ */
|
|
1964
|
+
/* @__PURE__ */ jsx17(
|
|
1745
1965
|
"div",
|
|
1746
1966
|
{
|
|
1747
1967
|
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
1748
1968
|
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
1749
1969
|
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
1750
1970
|
`,
|
|
1751
|
-
children: /* @__PURE__ */
|
|
1971
|
+
children: /* @__PURE__ */ jsx17(
|
|
1752
1972
|
"span",
|
|
1753
1973
|
{
|
|
1754
1974
|
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
@@ -1764,7 +1984,7 @@ var Radio = forwardRef16(
|
|
|
1764
1984
|
{
|
|
1765
1985
|
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
1766
1986
|
children: [
|
|
1767
|
-
/* @__PURE__ */
|
|
1987
|
+
/* @__PURE__ */ jsx17(
|
|
1768
1988
|
"p",
|
|
1769
1989
|
{
|
|
1770
1990
|
className: `
|
|
@@ -1774,7 +1994,7 @@ var Radio = forwardRef16(
|
|
|
1774
1994
|
children: label
|
|
1775
1995
|
}
|
|
1776
1996
|
),
|
|
1777
|
-
/* @__PURE__ */
|
|
1997
|
+
/* @__PURE__ */ jsx17(
|
|
1778
1998
|
"p",
|
|
1779
1999
|
{
|
|
1780
2000
|
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
@@ -1795,19 +2015,19 @@ Radio.displayName = "Radio";
|
|
|
1795
2015
|
|
|
1796
2016
|
// src/components/SegmentControl/SegmentControl.tsx
|
|
1797
2017
|
import {
|
|
1798
|
-
forwardRef as
|
|
2018
|
+
forwardRef as forwardRef18
|
|
1799
2019
|
} from "react";
|
|
1800
|
-
import { jsx as
|
|
1801
|
-
var SegmentControl =
|
|
2020
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2021
|
+
var SegmentControl = forwardRef18(
|
|
1802
2022
|
(_a, ref) => {
|
|
1803
2023
|
var _b = _a, { size = "md", items, selected, setSelected, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "className"]);
|
|
1804
|
-
return /* @__PURE__ */
|
|
2024
|
+
return /* @__PURE__ */ jsx18(
|
|
1805
2025
|
"div",
|
|
1806
2026
|
__spreadProps(__spreadValues({
|
|
1807
2027
|
ref,
|
|
1808
2028
|
className: `bg-background-tertiary rounded-full flex flex-row items-center justify-center p-4 gap-4 ${className}`
|
|
1809
2029
|
}, rest), {
|
|
1810
|
-
children: items.map((item) => /* @__PURE__ */
|
|
2030
|
+
children: items.map((item) => /* @__PURE__ */ jsx18(
|
|
1811
2031
|
"div",
|
|
1812
2032
|
{
|
|
1813
2033
|
onClick: () => setSelected == null ? void 0 : setSelected(item.value),
|
|
@@ -1825,12 +2045,12 @@ SegmentControl.displayName = "SegmentControl";
|
|
|
1825
2045
|
|
|
1826
2046
|
// src/components/Slider/Slider.tsx
|
|
1827
2047
|
import {
|
|
1828
|
-
forwardRef as
|
|
1829
|
-
useCallback as
|
|
1830
|
-
useId as
|
|
2048
|
+
forwardRef as forwardRef19,
|
|
2049
|
+
useCallback as useCallback2,
|
|
2050
|
+
useId as useId5,
|
|
1831
2051
|
useState as useState8
|
|
1832
2052
|
} from "react";
|
|
1833
|
-
import { jsx as
|
|
2053
|
+
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1834
2054
|
var sizeConfig = {
|
|
1835
2055
|
small: {
|
|
1836
2056
|
trackH: "h-4",
|
|
@@ -1871,7 +2091,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1871
2091
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1872
2092
|
"aria-hidden": "true",
|
|
1873
2093
|
children: [
|
|
1874
|
-
/* @__PURE__ */
|
|
2094
|
+
/* @__PURE__ */ jsx19(
|
|
1875
2095
|
"path",
|
|
1876
2096
|
{
|
|
1877
2097
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -1881,7 +2101,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1881
2101
|
strokeLinejoin: "round"
|
|
1882
2102
|
}
|
|
1883
2103
|
),
|
|
1884
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ jsx19(
|
|
1885
2105
|
"path",
|
|
1886
2106
|
{
|
|
1887
2107
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -1895,7 +2115,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1895
2115
|
}
|
|
1896
2116
|
);
|
|
1897
2117
|
}
|
|
1898
|
-
var Slider =
|
|
2118
|
+
var Slider = forwardRef19(
|
|
1899
2119
|
(_a, ref) => {
|
|
1900
2120
|
var _b = _a, {
|
|
1901
2121
|
size = "medium",
|
|
@@ -1930,7 +2150,7 @@ var Slider = forwardRef18(
|
|
|
1930
2150
|
"onChange",
|
|
1931
2151
|
"aria-label"
|
|
1932
2152
|
]);
|
|
1933
|
-
const reactId =
|
|
2153
|
+
const reactId = useId5();
|
|
1934
2154
|
const inputId = id != null ? id : reactId;
|
|
1935
2155
|
const sz = sizeConfig[size];
|
|
1936
2156
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
@@ -1938,7 +2158,7 @@ var Slider = forwardRef18(
|
|
|
1938
2158
|
const isControlled = controlledValue !== void 0;
|
|
1939
2159
|
const [internalValue, setInternalValue] = useState8(defaultValue != null ? defaultValue : min);
|
|
1940
2160
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
1941
|
-
const handleChange =
|
|
2161
|
+
const handleChange = useCallback2(
|
|
1942
2162
|
(e) => {
|
|
1943
2163
|
const val = Number(e.target.value);
|
|
1944
2164
|
if (!isControlled) {
|
|
@@ -1964,7 +2184,7 @@ var Slider = forwardRef18(
|
|
|
1964
2184
|
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
1965
2185
|
children: [
|
|
1966
2186
|
(label || showValue && !disabled) && /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
|
|
1967
|
-
label && /* @__PURE__ */
|
|
2187
|
+
label && /* @__PURE__ */ jsx19(
|
|
1968
2188
|
"label",
|
|
1969
2189
|
{
|
|
1970
2190
|
htmlFor: inputId,
|
|
@@ -1977,7 +2197,7 @@ var Slider = forwardRef18(
|
|
|
1977
2197
|
children: label
|
|
1978
2198
|
}
|
|
1979
2199
|
),
|
|
1980
|
-
showValue && /* @__PURE__ */
|
|
2200
|
+
showValue && /* @__PURE__ */ jsx19(
|
|
1981
2201
|
"span",
|
|
1982
2202
|
{
|
|
1983
2203
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -1994,7 +2214,7 @@ var Slider = forwardRef18(
|
|
|
1994
2214
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
1995
2215
|
].join(" "),
|
|
1996
2216
|
children: [
|
|
1997
|
-
/* @__PURE__ */
|
|
2217
|
+
/* @__PURE__ */ jsx19(
|
|
1998
2218
|
"div",
|
|
1999
2219
|
{
|
|
2000
2220
|
className: [
|
|
@@ -2004,14 +2224,14 @@ var Slider = forwardRef18(
|
|
|
2004
2224
|
].join(" ")
|
|
2005
2225
|
}
|
|
2006
2226
|
),
|
|
2007
|
-
/* @__PURE__ */
|
|
2227
|
+
/* @__PURE__ */ jsx19(
|
|
2008
2228
|
"div",
|
|
2009
2229
|
{
|
|
2010
2230
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
2011
2231
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
2012
2232
|
}
|
|
2013
2233
|
),
|
|
2014
|
-
/* @__PURE__ */
|
|
2234
|
+
/* @__PURE__ */ jsx19(
|
|
2015
2235
|
"input",
|
|
2016
2236
|
__spreadValues({
|
|
2017
2237
|
ref,
|
|
@@ -2032,7 +2252,7 @@ var Slider = forwardRef18(
|
|
|
2032
2252
|
].join(" ")
|
|
2033
2253
|
}, rest)
|
|
2034
2254
|
),
|
|
2035
|
-
/* @__PURE__ */
|
|
2255
|
+
/* @__PURE__ */ jsx19(
|
|
2036
2256
|
"div",
|
|
2037
2257
|
{
|
|
2038
2258
|
className: [
|
|
@@ -2045,13 +2265,13 @@ var Slider = forwardRef18(
|
|
|
2045
2265
|
!disabled && "peer-hover:shadow-medium"
|
|
2046
2266
|
].filter(Boolean).join(" "),
|
|
2047
2267
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
2048
|
-
children: /* @__PURE__ */
|
|
2268
|
+
children: /* @__PURE__ */ jsx19(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
2049
2269
|
}
|
|
2050
2270
|
)
|
|
2051
2271
|
]
|
|
2052
2272
|
}
|
|
2053
2273
|
),
|
|
2054
|
-
description && /* @__PURE__ */
|
|
2274
|
+
description && /* @__PURE__ */ jsx19(
|
|
2055
2275
|
"span",
|
|
2056
2276
|
{
|
|
2057
2277
|
id: ariaDescriptionId,
|
|
@@ -2067,9 +2287,9 @@ var Slider = forwardRef18(
|
|
|
2067
2287
|
Slider.displayName = "Slider";
|
|
2068
2288
|
|
|
2069
2289
|
// src/components/Tab/Tab.tsx
|
|
2070
|
-
import { forwardRef as
|
|
2071
|
-
import { jsx as
|
|
2072
|
-
var Tab =
|
|
2290
|
+
import { forwardRef as forwardRef20 } from "react";
|
|
2291
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2292
|
+
var Tab = forwardRef20(
|
|
2073
2293
|
(_a, ref) => {
|
|
2074
2294
|
var _b = _a, {
|
|
2075
2295
|
size = "md",
|
|
@@ -2088,7 +2308,7 @@ var Tab = forwardRef19(
|
|
|
2088
2308
|
"setSelected",
|
|
2089
2309
|
"className"
|
|
2090
2310
|
]);
|
|
2091
|
-
return /* @__PURE__ */
|
|
2311
|
+
return /* @__PURE__ */ jsx20(
|
|
2092
2312
|
"div",
|
|
2093
2313
|
__spreadProps(__spreadValues({
|
|
2094
2314
|
ref,
|
|
@@ -2108,140 +2328,180 @@ Tab.displayName = "Tab";
|
|
|
2108
2328
|
// src/components/TextArea/TextArea.tsx
|
|
2109
2329
|
import {
|
|
2110
2330
|
useState as useState9,
|
|
2111
|
-
forwardRef as
|
|
2331
|
+
forwardRef as forwardRef21
|
|
2112
2332
|
} from "react";
|
|
2113
|
-
import { Fragment as
|
|
2114
|
-
var TextArea =
|
|
2333
|
+
import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2334
|
+
var TextArea = forwardRef21(
|
|
2115
2335
|
(_a, ref) => {
|
|
2116
2336
|
var _b = _a, {
|
|
2117
|
-
maxText = 500,
|
|
2118
|
-
height = 100,
|
|
2119
2337
|
error,
|
|
2120
2338
|
label,
|
|
2121
2339
|
placeholder,
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2340
|
+
helperText,
|
|
2341
|
+
optional = false,
|
|
2342
|
+
success = false,
|
|
2343
|
+
pending = false,
|
|
2344
|
+
clearable = true,
|
|
2345
|
+
disabled = false,
|
|
2346
|
+
showCounter = true,
|
|
2347
|
+
maxLength = 500,
|
|
2348
|
+
height = 100,
|
|
2129
2349
|
value,
|
|
2130
|
-
onChange
|
|
2350
|
+
onChange,
|
|
2351
|
+
onFocus,
|
|
2352
|
+
onBlur,
|
|
2353
|
+
className
|
|
2131
2354
|
} = _b, props = __objRest(_b, [
|
|
2132
|
-
"maxText",
|
|
2133
|
-
"height",
|
|
2134
2355
|
"error",
|
|
2135
2356
|
"label",
|
|
2136
2357
|
"placeholder",
|
|
2137
|
-
"
|
|
2138
|
-
"
|
|
2139
|
-
"
|
|
2140
|
-
"
|
|
2141
|
-
"
|
|
2142
|
-
"isClearable",
|
|
2358
|
+
"helperText",
|
|
2359
|
+
"optional",
|
|
2360
|
+
"success",
|
|
2361
|
+
"pending",
|
|
2362
|
+
"clearable",
|
|
2143
2363
|
"disabled",
|
|
2364
|
+
"showCounter",
|
|
2365
|
+
"maxLength",
|
|
2366
|
+
"height",
|
|
2144
2367
|
"value",
|
|
2145
|
-
"onChange"
|
|
2368
|
+
"onChange",
|
|
2369
|
+
"onFocus",
|
|
2370
|
+
"onBlur",
|
|
2371
|
+
"className"
|
|
2146
2372
|
]);
|
|
2373
|
+
var _a2;
|
|
2147
2374
|
const [isFocused, setIsFocused] = useState9(false);
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2375
|
+
const isActive = isFocused && !!value;
|
|
2376
|
+
return /* @__PURE__ */ jsxs17("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2377
|
+
label || showCounter ? /* @__PURE__ */ jsxs17("div", { className: "w-full flex justify-between items-center gap-8", children: [
|
|
2378
|
+
label ? /* @__PURE__ */ jsxs17(
|
|
2151
2379
|
"p",
|
|
2152
2380
|
{
|
|
2153
|
-
className: `text-label-medium text-left items-left ${
|
|
2154
|
-
children:
|
|
2381
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-primary"}`,
|
|
2382
|
+
children: [
|
|
2383
|
+
label,
|
|
2384
|
+
optional && /* @__PURE__ */ jsx21("span", { className: "text-text-area-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2385
|
+
]
|
|
2155
2386
|
}
|
|
2156
|
-
) : /* @__PURE__ */
|
|
2157
|
-
|
|
2158
|
-
"
|
|
2159
|
-
(value == null ? void 0 : value.length) || 0,
|
|
2160
|
-
" / ",
|
|
2161
|
-
maxText
|
|
2162
|
-
] }) : /* @__PURE__ */ jsx20(Fragment3, {})
|
|
2163
|
-
] }),
|
|
2164
|
-
/* @__PURE__ */ jsxs17("div", { className: "relative w-full", children: [
|
|
2165
|
-
/* @__PURE__ */ jsx20(
|
|
2166
|
-
"textarea",
|
|
2167
|
-
__spreadValues({
|
|
2168
|
-
ref,
|
|
2169
|
-
name: "text-input",
|
|
2170
|
-
placeholder,
|
|
2171
|
-
disabled: isDisabled || disabled || isLoading,
|
|
2172
|
-
onFocus: () => setIsFocused(true),
|
|
2173
|
-
onBlur: () => setIsFocused(false),
|
|
2174
|
-
value,
|
|
2175
|
-
onChange,
|
|
2176
|
-
className: `w-full min-h-${height} focus:min-h-${height - 2} pt-12 pb-8 pr-44 pl-16 focus:pt-11 focus:pb-7 focus:pr-43 focus:pl-15 border border-gray-300 text-base rounded-md focus:outline-none focus:ring-1 focus:m-1 focus:w-[calc(100%-2px)] ${isDisabled || disabled ? "bg-gray-50 text-gray-400" : error ? "bg-white text-gray-900 border-red-500 focus:border-red-500 focus:ring-red-500" : "bg-white text-gray-900 focus:border-blue-600 focus:ring-blue-600"}`
|
|
2177
|
-
}, props)
|
|
2178
|
-
),
|
|
2179
|
-
isLoading ? /* @__PURE__ */ jsx20(
|
|
2180
|
-
Loading,
|
|
2387
|
+
) : /* @__PURE__ */ jsx21("span", {}),
|
|
2388
|
+
showCounter && /* @__PURE__ */ jsxs17(
|
|
2389
|
+
"p",
|
|
2181
2390
|
{
|
|
2182
|
-
|
|
2183
|
-
|
|
2391
|
+
className: `shrink-0 text-caption-caption ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-tertiary"}`,
|
|
2392
|
+
children: [
|
|
2393
|
+
(_a2 = value == null ? void 0 : value.length) != null ? _a2 : 0,
|
|
2394
|
+
"/",
|
|
2395
|
+
maxLength
|
|
2396
|
+
]
|
|
2184
2397
|
}
|
|
2185
|
-
)
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2398
|
+
)
|
|
2399
|
+
] }) : /* @__PURE__ */ jsx21(Fragment5, {}),
|
|
2400
|
+
/* @__PURE__ */ jsxs17(
|
|
2401
|
+
"div",
|
|
2402
|
+
{
|
|
2403
|
+
className: `relative w-full rounded-6 border ${disabled ? "bg-text-area-background-disabled border-text-area-border-disabled" : error ? `bg-text-area-background-enabled border-text-area-border-danger ${isFocused ? "ring-1 ring-inset ring-text-area-border-danger" : ""}` : isActive ? "bg-text-area-background-enabled border-text-area-border-active ring-1 ring-inset ring-text-area-border-active" : isFocused ? "bg-text-area-background-enabled border-text-area-border-focus ring-1 ring-inset ring-text-area-border-focus" : "bg-text-area-background-enabled border-text-area-border-enabled hover:border-text-area-border-hover"} ${className != null ? className : ""}`,
|
|
2404
|
+
children: [
|
|
2405
|
+
/* @__PURE__ */ jsx21(
|
|
2406
|
+
"textarea",
|
|
2407
|
+
__spreadValues({
|
|
2408
|
+
ref,
|
|
2409
|
+
placeholder,
|
|
2410
|
+
disabled: disabled || pending,
|
|
2411
|
+
maxLength,
|
|
2412
|
+
style: { height },
|
|
2413
|
+
onFocus: (e) => {
|
|
2414
|
+
setIsFocused(true);
|
|
2415
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
2416
|
+
},
|
|
2417
|
+
onBlur: (e) => {
|
|
2418
|
+
setIsFocused(false);
|
|
2419
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
2420
|
+
},
|
|
2421
|
+
value,
|
|
2422
|
+
onChange,
|
|
2423
|
+
className: `block w-full min-w-0 pt-12 pb-8 pl-16 pr-48 text-body-small bg-transparent focus:outline-none placeholder:text-text-area-text-tertiary ${disabled ? "resize-none text-text-area-text-disabled" : "resize-y text-text-area-text-primary"}`
|
|
2424
|
+
}, props)
|
|
2425
|
+
),
|
|
2426
|
+
pending ? /* @__PURE__ */ jsx21(Loading, { size: "sm", className: "shrink-0 absolute right-12 top-12" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx21(
|
|
2427
|
+
IconButton,
|
|
2200
2428
|
{
|
|
2201
|
-
|
|
2202
|
-
|
|
2429
|
+
size: "s",
|
|
2430
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2431
|
+
className: "absolute right-6 top-6",
|
|
2432
|
+
icon: /* @__PURE__ */ jsx21(
|
|
2433
|
+
"svg",
|
|
2434
|
+
{
|
|
2435
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2436
|
+
width: "20",
|
|
2437
|
+
height: "20",
|
|
2438
|
+
viewBox: "0 0 20 20",
|
|
2439
|
+
fill: "none",
|
|
2440
|
+
children: /* @__PURE__ */ jsx21(
|
|
2441
|
+
"path",
|
|
2442
|
+
{
|
|
2443
|
+
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",
|
|
2444
|
+
fill: "currentColor"
|
|
2445
|
+
}
|
|
2446
|
+
)
|
|
2447
|
+
}
|
|
2448
|
+
),
|
|
2449
|
+
onMouseDown: (e) => {
|
|
2450
|
+
e.preventDefault();
|
|
2451
|
+
},
|
|
2452
|
+
onClick: () => {
|
|
2453
|
+
onChange == null ? void 0 : onChange({
|
|
2454
|
+
target: { value: "" }
|
|
2455
|
+
});
|
|
2456
|
+
}
|
|
2203
2457
|
}
|
|
2204
|
-
)
|
|
2205
|
-
|
|
2206
|
-
) : isVertify ? /* @__PURE__ */ jsx20(
|
|
2207
|
-
"svg",
|
|
2208
|
-
{
|
|
2209
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2210
|
-
width: "20",
|
|
2211
|
-
height: "20",
|
|
2212
|
-
viewBox: "0 0 20 20",
|
|
2213
|
-
fill: "none",
|
|
2214
|
-
className: "text-green-600 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2215
|
-
children: /* @__PURE__ */ jsx20(
|
|
2216
|
-
"path",
|
|
2458
|
+
) : success ? /* @__PURE__ */ jsx21(
|
|
2459
|
+
"svg",
|
|
2217
2460
|
{
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2461
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2462
|
+
width: "20",
|
|
2463
|
+
height: "20",
|
|
2464
|
+
viewBox: "0 0 20 20",
|
|
2465
|
+
fill: "none",
|
|
2466
|
+
className: "shrink-0 text-accent-success flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2467
|
+
children: /* @__PURE__ */ jsx21(
|
|
2468
|
+
"path",
|
|
2469
|
+
{
|
|
2470
|
+
fillRule: "evenodd",
|
|
2471
|
+
clipRule: "evenodd",
|
|
2472
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2473
|
+
fill: "currentColor"
|
|
2474
|
+
}
|
|
2475
|
+
)
|
|
2222
2476
|
}
|
|
2223
|
-
)
|
|
2224
|
-
|
|
2225
|
-
) : error ? /* @__PURE__ */ jsx20(
|
|
2226
|
-
"svg",
|
|
2227
|
-
{
|
|
2228
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2229
|
-
width: "20",
|
|
2230
|
-
height: "20",
|
|
2231
|
-
viewBox: "0 0 20 20",
|
|
2232
|
-
fill: "none",
|
|
2233
|
-
className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2234
|
-
children: /* @__PURE__ */ jsx20(
|
|
2235
|
-
"path",
|
|
2477
|
+
) : error ? /* @__PURE__ */ jsx21(
|
|
2478
|
+
"svg",
|
|
2236
2479
|
{
|
|
2237
|
-
|
|
2238
|
-
|
|
2480
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2481
|
+
width: "20",
|
|
2482
|
+
height: "20",
|
|
2483
|
+
viewBox: "0 0 20 20",
|
|
2484
|
+
fill: "none",
|
|
2485
|
+
className: "shrink-0 text-text-area-text-danger flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2486
|
+
children: /* @__PURE__ */ jsx21(
|
|
2487
|
+
"path",
|
|
2488
|
+
{
|
|
2489
|
+
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
2490
|
+
fill: "currentColor"
|
|
2491
|
+
}
|
|
2492
|
+
)
|
|
2239
2493
|
}
|
|
2240
|
-
)
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
error ? /* @__PURE__ */
|
|
2494
|
+
) : /* @__PURE__ */ jsx21(Fragment5, {})
|
|
2495
|
+
]
|
|
2496
|
+
}
|
|
2497
|
+
),
|
|
2498
|
+
error ? /* @__PURE__ */ jsx21("p", { className: "text-caption-caption text-left items-left text-text-area-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx21(
|
|
2499
|
+
"p",
|
|
2500
|
+
{
|
|
2501
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-secondary"}`,
|
|
2502
|
+
children: helperText
|
|
2503
|
+
}
|
|
2504
|
+
) : /* @__PURE__ */ jsx21(Fragment5, {})
|
|
2245
2505
|
] });
|
|
2246
2506
|
}
|
|
2247
2507
|
);
|
|
@@ -2250,163 +2510,223 @@ TextArea.displayName = "TextArea";
|
|
|
2250
2510
|
// src/components/TextField/TextField.tsx
|
|
2251
2511
|
import {
|
|
2252
2512
|
useState as useState10,
|
|
2253
|
-
|
|
2513
|
+
useRef as useRef2,
|
|
2514
|
+
useImperativeHandle,
|
|
2515
|
+
forwardRef as forwardRef22
|
|
2254
2516
|
} from "react";
|
|
2255
|
-
import { Fragment as
|
|
2256
|
-
var TextField =
|
|
2517
|
+
import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2518
|
+
var TextField = forwardRef22(
|
|
2257
2519
|
(_a, ref) => {
|
|
2258
2520
|
var _b = _a, {
|
|
2259
|
-
|
|
2521
|
+
size = "md",
|
|
2260
2522
|
error,
|
|
2261
2523
|
label,
|
|
2262
2524
|
placeholder,
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
disabled,
|
|
2525
|
+
helperText,
|
|
2526
|
+
prefix,
|
|
2527
|
+
suffix,
|
|
2528
|
+
optional = false,
|
|
2529
|
+
success = false,
|
|
2530
|
+
pending = false,
|
|
2531
|
+
clearable = true,
|
|
2532
|
+
disabled = false,
|
|
2271
2533
|
type,
|
|
2272
2534
|
value,
|
|
2273
|
-
onChange
|
|
2535
|
+
onChange,
|
|
2536
|
+
onFocus,
|
|
2537
|
+
onBlur,
|
|
2538
|
+
className
|
|
2274
2539
|
} = _b, props = __objRest(_b, [
|
|
2275
|
-
"
|
|
2540
|
+
"size",
|
|
2276
2541
|
"error",
|
|
2277
2542
|
"label",
|
|
2278
2543
|
"placeholder",
|
|
2279
|
-
"
|
|
2280
|
-
"
|
|
2281
|
-
"
|
|
2282
|
-
"
|
|
2283
|
-
"
|
|
2284
|
-
"
|
|
2285
|
-
"
|
|
2544
|
+
"helperText",
|
|
2545
|
+
"prefix",
|
|
2546
|
+
"suffix",
|
|
2547
|
+
"optional",
|
|
2548
|
+
"success",
|
|
2549
|
+
"pending",
|
|
2550
|
+
"clearable",
|
|
2286
2551
|
"disabled",
|
|
2287
2552
|
"type",
|
|
2288
2553
|
"value",
|
|
2289
|
-
"onChange"
|
|
2554
|
+
"onChange",
|
|
2555
|
+
"onFocus",
|
|
2556
|
+
"onBlur",
|
|
2557
|
+
"className"
|
|
2290
2558
|
]);
|
|
2291
2559
|
const [isFocused, setIsFocused] = useState10(false);
|
|
2292
|
-
|
|
2560
|
+
const isActive = isFocused && !!value;
|
|
2561
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
2562
|
+
const inputRef = useRef2(null);
|
|
2563
|
+
useImperativeHandle(ref, () => inputRef.current);
|
|
2564
|
+
return /* @__PURE__ */ jsxs18("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2293
2565
|
label ? /* @__PURE__ */ jsxs18(
|
|
2294
2566
|
"p",
|
|
2295
2567
|
{
|
|
2296
|
-
className: `text-label-medium text-left items-left ${
|
|
2568
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
|
|
2297
2569
|
children: [
|
|
2298
2570
|
label,
|
|
2299
|
-
" ",
|
|
2300
|
-
isUnrequired && /* @__PURE__ */ jsx21("span", { className: "text-gray-400", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2571
|
+
optional && /* @__PURE__ */ jsx22("span", { className: "text-text-field-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2301
2572
|
]
|
|
2302
2573
|
}
|
|
2303
|
-
) : /* @__PURE__ */
|
|
2304
|
-
/* @__PURE__ */ jsxs18(
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
disabled: isDisabled || disabled || isLoading,
|
|
2312
|
-
onFocus: () => setIsFocused(true),
|
|
2313
|
-
onBlur: () => setIsFocused(false),
|
|
2314
|
-
value,
|
|
2315
|
-
onChange,
|
|
2316
|
-
className: `w-full ${inputSize === "md" ? "px-16 py-12 focus:px-15 focus:py-11" : "p-16 focus:p-15"} border border-gray-300 text-base rounded-md focus:outline-none focus:ring-1 focus:m-1 focus:w-[calc(100%-2px)] ${isDisabled || disabled ? "bg-gray-50 text-gray-400" : error ? "bg-white text-gray-900 border-red-500 focus:border-red-500 focus:ring-red-500" : "bg-white text-gray-900 focus:border-blue-600 focus:ring-blue-600"}`
|
|
2317
|
-
}, props)
|
|
2318
|
-
),
|
|
2319
|
-
isLoading ? /* @__PURE__ */ jsx21(
|
|
2320
|
-
Loading,
|
|
2321
|
-
{
|
|
2322
|
-
size: "sm",
|
|
2323
|
-
className: `absolute right-16 top-1/2 -translate-y-1/2`
|
|
2324
|
-
}
|
|
2325
|
-
) : isClearable && isFocused && value ? /* @__PURE__ */ jsx21(
|
|
2326
|
-
"svg",
|
|
2327
|
-
{
|
|
2328
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2329
|
-
width: "20",
|
|
2330
|
-
height: "20",
|
|
2331
|
-
viewBox: "0 0 20 20",
|
|
2332
|
-
fill: "none",
|
|
2333
|
-
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2334
|
-
onMouseDown: (e) => {
|
|
2574
|
+
) : /* @__PURE__ */ jsx22(Fragment6, {}),
|
|
2575
|
+
/* @__PURE__ */ jsxs18(
|
|
2576
|
+
"div",
|
|
2577
|
+
{
|
|
2578
|
+
className: `flex items-center gap-8 w-full rounded-6 border ${size === "lg" ? "h-48 py-16" : "h-40 py-12"} px-16 ${disabled ? "cursor-not-allowed" : "cursor-text"} ${disabled ? "bg-text-field-background-disabled border-text-field-border-disabled" : error ? `bg-text-field-background-enabled border-text-field-border-danger ${isFocused ? "ring-1 ring-inset ring-text-field-border-danger" : ""}` : isActive ? "bg-text-field-background-enabled border-text-field-border-active ring-1 ring-inset ring-text-field-border-active" : isFocused ? "bg-text-field-background-enabled border-text-field-border-focus ring-1 ring-inset ring-text-field-border-focus" : "bg-text-field-background-enabled border-text-field-border-enabled hover:border-text-field-border-hover"} ${className != null ? className : ""}`,
|
|
2579
|
+
onMouseDown: (e) => {
|
|
2580
|
+
var _a2;
|
|
2581
|
+
if (e.target !== inputRef.current && !disabled) {
|
|
2335
2582
|
e.preventDefault();
|
|
2336
|
-
|
|
2337
|
-
}
|
|
2338
|
-
|
|
2339
|
-
|
|
2583
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
2584
|
+
}
|
|
2585
|
+
},
|
|
2586
|
+
children: [
|
|
2587
|
+
prefix && /* @__PURE__ */ jsx22(
|
|
2588
|
+
"span",
|
|
2340
2589
|
{
|
|
2341
|
-
|
|
2342
|
-
|
|
2590
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2591
|
+
children: prefix
|
|
2343
2592
|
}
|
|
2344
|
-
)
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2593
|
+
),
|
|
2594
|
+
/* @__PURE__ */ jsx22(
|
|
2595
|
+
"input",
|
|
2596
|
+
__spreadValues({
|
|
2597
|
+
ref: inputRef,
|
|
2598
|
+
type: type || "text",
|
|
2599
|
+
placeholder,
|
|
2600
|
+
disabled: disabled || pending,
|
|
2601
|
+
onFocus: (e) => {
|
|
2602
|
+
setIsFocused(true);
|
|
2603
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
2604
|
+
},
|
|
2605
|
+
onBlur: (e) => {
|
|
2606
|
+
setIsFocused(false);
|
|
2607
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
2608
|
+
},
|
|
2609
|
+
value,
|
|
2610
|
+
onChange,
|
|
2611
|
+
className: `w-full min-w-0 text-body-small bg-transparent focus:outline-none placeholder:text-text-field-text-tertiary ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`
|
|
2612
|
+
}, props)
|
|
2613
|
+
),
|
|
2614
|
+
suffix && /* @__PURE__ */ jsx22(
|
|
2615
|
+
"span",
|
|
2357
2616
|
{
|
|
2358
|
-
"
|
|
2359
|
-
|
|
2360
|
-
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2361
|
-
fill: "#16A34A"
|
|
2617
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2618
|
+
children: suffix
|
|
2362
2619
|
}
|
|
2363
|
-
)
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
"svg",
|
|
2367
|
-
{
|
|
2368
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2369
|
-
width: "20",
|
|
2370
|
-
height: "20",
|
|
2371
|
-
viewBox: "0 0 20 20",
|
|
2372
|
-
fill: "none",
|
|
2373
|
-
className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2374
|
-
children: /* @__PURE__ */ jsx21(
|
|
2375
|
-
"path",
|
|
2620
|
+
),
|
|
2621
|
+
(pending || clearable || success || error) && /* @__PURE__ */ jsx22(
|
|
2622
|
+
"span",
|
|
2376
2623
|
{
|
|
2377
|
-
|
|
2378
|
-
|
|
2624
|
+
className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
|
|
2625
|
+
children: pending ? /* @__PURE__ */ jsx22(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ jsx22(
|
|
2626
|
+
IconButton,
|
|
2627
|
+
{
|
|
2628
|
+
size: iconButtonSize,
|
|
2629
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2630
|
+
icon: /* @__PURE__ */ jsx22(
|
|
2631
|
+
"svg",
|
|
2632
|
+
{
|
|
2633
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2634
|
+
width: "20",
|
|
2635
|
+
height: "20",
|
|
2636
|
+
viewBox: "0 0 20 20",
|
|
2637
|
+
fill: "none",
|
|
2638
|
+
children: /* @__PURE__ */ jsx22(
|
|
2639
|
+
"path",
|
|
2640
|
+
{
|
|
2641
|
+
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",
|
|
2642
|
+
fill: "currentColor"
|
|
2643
|
+
}
|
|
2644
|
+
)
|
|
2645
|
+
}
|
|
2646
|
+
),
|
|
2647
|
+
onMouseDown: (e) => {
|
|
2648
|
+
e.preventDefault();
|
|
2649
|
+
},
|
|
2650
|
+
onClick: () => {
|
|
2651
|
+
onChange == null ? void 0 : onChange({
|
|
2652
|
+
target: { value: "" }
|
|
2653
|
+
});
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
) : success ? /* @__PURE__ */ jsx22(
|
|
2657
|
+
"svg",
|
|
2658
|
+
{
|
|
2659
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2660
|
+
width: "20",
|
|
2661
|
+
height: "20",
|
|
2662
|
+
viewBox: "0 0 20 20",
|
|
2663
|
+
fill: "none",
|
|
2664
|
+
className: "text-accent-success flex h-20 w-20 items-center justify-center",
|
|
2665
|
+
children: /* @__PURE__ */ jsx22(
|
|
2666
|
+
"path",
|
|
2667
|
+
{
|
|
2668
|
+
fillRule: "evenodd",
|
|
2669
|
+
clipRule: "evenodd",
|
|
2670
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2671
|
+
fill: "currentColor"
|
|
2672
|
+
}
|
|
2673
|
+
)
|
|
2674
|
+
}
|
|
2675
|
+
) : error ? /* @__PURE__ */ jsx22(
|
|
2676
|
+
"svg",
|
|
2677
|
+
{
|
|
2678
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2679
|
+
width: "20",
|
|
2680
|
+
height: "20",
|
|
2681
|
+
viewBox: "0 0 20 20",
|
|
2682
|
+
fill: "none",
|
|
2683
|
+
className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
|
|
2684
|
+
children: /* @__PURE__ */ jsx22(
|
|
2685
|
+
"path",
|
|
2686
|
+
{
|
|
2687
|
+
d: "M10.0078 2.41699C11.0548 2.41699 12.0363 2.61407 12.9512 3.00879C13.8657 3.40341 14.6687 3.94646 15.3604 4.6377C16.0522 5.32922 16.5962 6.13426 16.9912 7.05176C17.386 7.96936 17.583 8.95002 17.583 9.99316C17.583 11.0363 17.3859 12.0187 16.9912 12.9404C16.5966 13.862 16.0536 14.6687 15.3623 15.3604C14.6708 16.0522 13.8657 16.5962 12.9482 16.9912C12.0306 17.386 11.05 17.583 10.0068 17.583C8.96373 17.583 7.9813 17.3859 7.05957 16.9912C6.13798 16.5966 5.33135 16.0536 4.63965 15.3623C3.94784 14.6708 3.40379 13.8642 3.00879 12.9434C2.61398 12.0228 2.41703 11.039 2.41699 9.99219C2.41699 8.94524 2.61407 7.96369 3.00879 7.04883C3.40341 6.13429 3.94646 5.33128 4.6377 4.63965C5.32922 3.94784 6.13581 3.40379 7.05664 3.00879C7.97723 2.61398 8.961 2.41703 10.0078 2.41699ZM10.0039 12.5967C9.83828 12.5968 9.69804 12.6527 9.58301 12.7646C9.46793 12.8769 9.41016 13.0159 9.41016 13.1816C9.4102 13.3472 9.46621 13.4875 9.57812 13.6025C9.69035 13.7177 9.83026 13.7754 9.99609 13.7754C10.1617 13.7753 10.302 13.7195 10.417 13.6074C10.5321 13.4952 10.5898 13.3562 10.5898 13.1904C10.5898 13.0246 10.534 12.8837 10.4219 12.7686C10.3097 12.6536 10.1697 12.5967 10.0039 12.5967ZM9.45801 11.0645H10.542V6.06445H9.45801V11.0645Z",
|
|
2688
|
+
fill: "currentColor"
|
|
2689
|
+
}
|
|
2690
|
+
)
|
|
2691
|
+
}
|
|
2692
|
+
) : null
|
|
2379
2693
|
}
|
|
2380
2694
|
)
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
error ? /* @__PURE__ */
|
|
2695
|
+
]
|
|
2696
|
+
}
|
|
2697
|
+
),
|
|
2698
|
+
error ? /* @__PURE__ */ jsx22("p", { className: "text-caption-caption text-left items-left text-text-field-text-danger", children: error }) : helperText ? /* @__PURE__ */ jsx22(
|
|
2699
|
+
"p",
|
|
2700
|
+
{
|
|
2701
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
|
|
2702
|
+
children: helperText
|
|
2703
|
+
}
|
|
2704
|
+
) : /* @__PURE__ */ jsx22(Fragment6, {})
|
|
2385
2705
|
] });
|
|
2386
2706
|
}
|
|
2387
2707
|
);
|
|
2388
2708
|
TextField.displayName = "TextField";
|
|
2389
2709
|
|
|
2390
2710
|
// src/components/Toast/Toast.tsx
|
|
2391
|
-
import { forwardRef as
|
|
2392
|
-
import { jsx as
|
|
2711
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
2712
|
+
import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2393
2713
|
function CheckCircleIcon({ className }) {
|
|
2394
2714
|
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2395
|
-
/* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2715
|
+
/* @__PURE__ */ jsx23("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2716
|
+
/* @__PURE__ */ jsx23("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
2397
2717
|
] });
|
|
2398
2718
|
}
|
|
2399
2719
|
function ProgressIcon({ className }) {
|
|
2400
|
-
return /* @__PURE__ */
|
|
2720
|
+
return /* @__PURE__ */ jsx23(Loading, { size: "sm", className });
|
|
2401
2721
|
}
|
|
2402
2722
|
function ErrorIcon({ className }) {
|
|
2403
2723
|
return /* @__PURE__ */ jsxs19("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2404
|
-
/* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ jsx23("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2725
|
+
/* @__PURE__ */ jsx23("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
2406
2726
|
] });
|
|
2407
2727
|
}
|
|
2408
|
-
function
|
|
2409
|
-
return /* @__PURE__ */
|
|
2728
|
+
function CloseIcon5({ className }) {
|
|
2729
|
+
return /* @__PURE__ */ jsx23("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx23("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2410
2730
|
}
|
|
2411
2731
|
var defaultIcons3 = {
|
|
2412
2732
|
default: CheckCircleIcon,
|
|
@@ -2423,7 +2743,7 @@ var iconColorClasses = {
|
|
|
2423
2743
|
progress: "text-toast-progress-icon",
|
|
2424
2744
|
error: "text-toast-error-icon"
|
|
2425
2745
|
};
|
|
2426
|
-
var Toast =
|
|
2746
|
+
var Toast = forwardRef23(
|
|
2427
2747
|
(_a, ref) => {
|
|
2428
2748
|
var _b = _a, {
|
|
2429
2749
|
type = "default",
|
|
@@ -2452,9 +2772,9 @@ var Toast = forwardRef22(
|
|
|
2452
2772
|
className
|
|
2453
2773
|
].filter(Boolean).join(" ");
|
|
2454
2774
|
return /* @__PURE__ */ jsxs19("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2455
|
-
icon && /* @__PURE__ */
|
|
2456
|
-
/* @__PURE__ */
|
|
2457
|
-
actionLabel && onAction && /* @__PURE__ */
|
|
2775
|
+
icon && /* @__PURE__ */ jsx23("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ jsx23(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
2776
|
+
/* @__PURE__ */ jsx23("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
2777
|
+
actionLabel && onAction && /* @__PURE__ */ jsx23(
|
|
2458
2778
|
"button",
|
|
2459
2779
|
{
|
|
2460
2780
|
type: "button",
|
|
@@ -2463,14 +2783,14 @@ var Toast = forwardRef22(
|
|
|
2463
2783
|
children: actionLabel
|
|
2464
2784
|
}
|
|
2465
2785
|
),
|
|
2466
|
-
onDismiss && /* @__PURE__ */
|
|
2786
|
+
onDismiss && /* @__PURE__ */ jsx23(
|
|
2467
2787
|
"button",
|
|
2468
2788
|
{
|
|
2469
2789
|
type: "button",
|
|
2470
2790
|
onClick: onDismiss,
|
|
2471
2791
|
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
2472
2792
|
"aria-label": "Dismiss",
|
|
2473
|
-
children: /* @__PURE__ */
|
|
2793
|
+
children: /* @__PURE__ */ jsx23(CloseIcon5, { className: "h-16 w-16" })
|
|
2474
2794
|
}
|
|
2475
2795
|
)
|
|
2476
2796
|
] }));
|
|
@@ -2479,9 +2799,9 @@ var Toast = forwardRef22(
|
|
|
2479
2799
|
Toast.displayName = "Toast";
|
|
2480
2800
|
|
|
2481
2801
|
// src/components/ToggleSwitch/ToggleSwitch.tsx
|
|
2482
|
-
import { forwardRef as
|
|
2483
|
-
import { jsx as
|
|
2484
|
-
var ToggleSwitch =
|
|
2802
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
2803
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2804
|
+
var ToggleSwitch = forwardRef24(
|
|
2485
2805
|
(_a, ref) => {
|
|
2486
2806
|
var _b = _a, {
|
|
2487
2807
|
value,
|
|
@@ -2503,7 +2823,7 @@ var ToggleSwitch = forwardRef23(
|
|
|
2503
2823
|
className: `inline-flex items-center ${className}`
|
|
2504
2824
|
}, rest), {
|
|
2505
2825
|
children: [
|
|
2506
|
-
/* @__PURE__ */
|
|
2826
|
+
/* @__PURE__ */ jsx24(
|
|
2507
2827
|
"input",
|
|
2508
2828
|
{
|
|
2509
2829
|
type: "checkbox",
|
|
@@ -2513,7 +2833,7 @@ var ToggleSwitch = forwardRef23(
|
|
|
2513
2833
|
onChange: () => !isDisabled && (setIsSelected == null ? void 0 : setIsSelected(!isSelected))
|
|
2514
2834
|
}
|
|
2515
2835
|
),
|
|
2516
|
-
/* @__PURE__ */
|
|
2836
|
+
/* @__PURE__ */ jsx24(
|
|
2517
2837
|
"div",
|
|
2518
2838
|
{
|
|
2519
2839
|
className: `${isDisabled ? "opacity-40 cursor-not-allowed" : "cursor-pointer hover:bg-gray-300 hover:peer-checked:bg-green-700"} relative w-48 h-26 bg-gray-200 rounded-full peer-checked:after:translate-x-22 rtl:peer-checked:after:-translate-x-22 peer-checked:after:border-white after:content-[''] after:absolute after:top-4 after:left-4 after:bg-white after:border-gray-300 after:border after:rounded-full after:h-18 after:w-18 after:transition-all peer-checked:bg-green-600 `
|
|
@@ -2529,12 +2849,12 @@ ToggleSwitch.displayName = "ToggleSwitch";
|
|
|
2529
2849
|
// src/components/Tooltip/Tooltip.tsx
|
|
2530
2850
|
import {
|
|
2531
2851
|
useState as useState11,
|
|
2532
|
-
useEffect as
|
|
2533
|
-
useRef as
|
|
2534
|
-
forwardRef as
|
|
2852
|
+
useEffect as useEffect4,
|
|
2853
|
+
useRef as useRef3,
|
|
2854
|
+
forwardRef as forwardRef25
|
|
2535
2855
|
} from "react";
|
|
2536
|
-
import { Fragment as
|
|
2537
|
-
var Tooltip =
|
|
2856
|
+
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2857
|
+
var Tooltip = forwardRef25(
|
|
2538
2858
|
(_a, ref) => {
|
|
2539
2859
|
var _b = _a, {
|
|
2540
2860
|
size = "md",
|
|
@@ -2551,10 +2871,10 @@ var Tooltip = forwardRef24(
|
|
|
2551
2871
|
"position",
|
|
2552
2872
|
"className"
|
|
2553
2873
|
]);
|
|
2554
|
-
const wrapperRef =
|
|
2874
|
+
const wrapperRef = useRef3(null);
|
|
2555
2875
|
const [isVisible, setIsVisible] = useState11(false);
|
|
2556
2876
|
const [isHovered, setIsHovered] = useState11(false);
|
|
2557
|
-
|
|
2877
|
+
useEffect4(() => {
|
|
2558
2878
|
const handleClickOutside = (event) => {
|
|
2559
2879
|
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
2560
2880
|
setIsVisible(false);
|
|
@@ -2573,7 +2893,7 @@ var Tooltip = forwardRef24(
|
|
|
2573
2893
|
ref
|
|
2574
2894
|
}, rest), {
|
|
2575
2895
|
children: [
|
|
2576
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ jsx25(
|
|
2577
2897
|
"div",
|
|
2578
2898
|
{
|
|
2579
2899
|
ref: wrapperRef,
|
|
@@ -2595,20 +2915,20 @@ var Tooltip = forwardRef24(
|
|
|
2595
2915
|
{
|
|
2596
2916
|
className: `min-w-100 max-w-300 whitespace-nowrap rounded bg-gray-900 text-white ${size === "lg" ? "text-body-regular py-12 px-16" : size === "md" ? "text-body-small px-12 pt-10 pb-8" : "text-body-small px-8 pt-6 pb-4"} ${position === "right" && `absolute left-full top-1/2 z-20 ml-8 -translate-y-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "top" && `absolute bottom-full left-1/2 z-20 mb-8 -translate-x-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "left" && `absolute right-full top-1/2 z-20 mr-8 -translate-y-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}` || position === "bottom" && `absolute left-1/2 top-full z-20 mt-8 -translate-x-1/2 ${isVisible || isHovered ? "opacity-100" : "opacity-0"}`}`,
|
|
2597
2917
|
children: [
|
|
2598
|
-
/* @__PURE__ */
|
|
2918
|
+
/* @__PURE__ */ jsx25(
|
|
2599
2919
|
"span",
|
|
2600
2920
|
{
|
|
2601
2921
|
className: ` ${position === "right" && `absolute -left-3 top-1/2 -z-10 h-8 w-8 -translate-y-1/2 rotate-45 rounded-xs bg-black` || position === "top" && `absolute -bottom-3 left-1/2 -z-10 h-8 w-8 -translate-x-1/2 rotate-45 rounded-xs bg-black` || position === "left" && `absolute -right-3 top-1/2 -z-10 h-8 w-8 -translate-y-1/2 rotate-45 rounded-xs bg-black` || position === "bottom" && `absolute left-1/2 -top-3 -z-10 h-8 w-8 -translate-x-1/2 rotate-45 rounded-xs bg-black`} `
|
|
2602
2922
|
}
|
|
2603
2923
|
),
|
|
2604
|
-
headText ? /* @__PURE__ */
|
|
2924
|
+
headText ? /* @__PURE__ */ jsx25(
|
|
2605
2925
|
"p",
|
|
2606
2926
|
{
|
|
2607
2927
|
className: `text-sm text-white font-semibold text-center ${text ? "mb-5" : ""}`,
|
|
2608
2928
|
children: headText
|
|
2609
2929
|
}
|
|
2610
|
-
) : /* @__PURE__ */
|
|
2611
|
-
text ? /* @__PURE__ */
|
|
2930
|
+
) : /* @__PURE__ */ jsx25(Fragment7, {}),
|
|
2931
|
+
text ? /* @__PURE__ */ jsx25("p", { className: "text-xs text-white font-normal text-center text-wrap", children: text }) : /* @__PURE__ */ jsx25(Fragment7, {})
|
|
2612
2932
|
]
|
|
2613
2933
|
}
|
|
2614
2934
|
)
|
|
@@ -2623,15 +2943,16 @@ export {
|
|
|
2623
2943
|
AlertBanner,
|
|
2624
2944
|
Avatar,
|
|
2625
2945
|
Badge,
|
|
2626
|
-
BottomSheet,
|
|
2627
2946
|
Branding,
|
|
2628
2947
|
Button,
|
|
2629
2948
|
Checkbox,
|
|
2630
2949
|
Chip,
|
|
2631
2950
|
Dialog,
|
|
2951
|
+
Drawer,
|
|
2632
2952
|
Dropdown,
|
|
2633
2953
|
FinancialLogo,
|
|
2634
2954
|
Icon,
|
|
2955
|
+
IconButton,
|
|
2635
2956
|
Link,
|
|
2636
2957
|
Loading,
|
|
2637
2958
|
Radio,
|