@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.cjs
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
5
4
|
var __defProps = Object.defineProperties;
|
|
6
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
6
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
8
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
11
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
10
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
11
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -47,14 +45,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
47
45
|
}
|
|
48
46
|
return to;
|
|
49
47
|
};
|
|
50
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
51
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
52
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
53
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
54
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
55
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
56
|
-
mod
|
|
57
|
-
));
|
|
58
48
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
59
49
|
|
|
60
50
|
// src/components/index.ts
|
|
@@ -64,15 +54,16 @@ __export(index_exports, {
|
|
|
64
54
|
AlertBanner: () => AlertBanner,
|
|
65
55
|
Avatar: () => Avatar,
|
|
66
56
|
Badge: () => Badge,
|
|
67
|
-
BottomSheet: () => BottomSheet,
|
|
68
57
|
Branding: () => Branding,
|
|
69
58
|
Button: () => Button,
|
|
70
59
|
Checkbox: () => Checkbox,
|
|
71
60
|
Chip: () => Chip,
|
|
72
61
|
Dialog: () => Dialog,
|
|
62
|
+
Drawer: () => Drawer,
|
|
73
63
|
Dropdown: () => Dropdown,
|
|
74
64
|
FinancialLogo: () => FinancialLogo,
|
|
75
65
|
Icon: () => Icon,
|
|
66
|
+
IconButton: () => IconButton,
|
|
76
67
|
Link: () => Link,
|
|
77
68
|
Loading: () => Loading,
|
|
78
69
|
Radio: () => Radio,
|
|
@@ -639,7 +630,7 @@ var Loading = (0, import_react6.forwardRef)(
|
|
|
639
630
|
{
|
|
640
631
|
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",
|
|
641
632
|
stroke: "#F3F4F6",
|
|
642
|
-
|
|
633
|
+
strokeWidth: "2"
|
|
643
634
|
}
|
|
644
635
|
),
|
|
645
636
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -647,7 +638,7 @@ var Loading = (0, import_react6.forwardRef)(
|
|
|
647
638
|
{
|
|
648
639
|
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",
|
|
649
640
|
stroke: "#0193D7",
|
|
650
|
-
|
|
641
|
+
strokeWidth: "2"
|
|
651
642
|
}
|
|
652
643
|
)
|
|
653
644
|
]
|
|
@@ -764,159 +755,18 @@ var Button = (0, import_react7.forwardRef)(
|
|
|
764
755
|
);
|
|
765
756
|
Button.displayName = "Button";
|
|
766
757
|
|
|
767
|
-
// src/components/BottomSheet/BottomSheet.tsx
|
|
768
|
-
var import_react8 = __toESM(require("react"));
|
|
769
|
-
var import_react_dom = require("react-dom");
|
|
770
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
771
|
-
var BottomSheet = (0, import_react8.forwardRef)(
|
|
772
|
-
(_a, ref) => {
|
|
773
|
-
var _b = _a, {
|
|
774
|
-
isForceOpen = false,
|
|
775
|
-
setIsForceOpen,
|
|
776
|
-
isClosedAble = true,
|
|
777
|
-
children,
|
|
778
|
-
startModalBtn,
|
|
779
|
-
stopModalBtn,
|
|
780
|
-
afterStopBtn,
|
|
781
|
-
size = "md",
|
|
782
|
-
modalTitle = "\u0E2B\u0E31\u0E27\u0E02\u0E49\u0E2D",
|
|
783
|
-
modalDesc = "\u0E04\u0E33\u0E2D\u0E18\u0E34\u0E1A\u0E32\u0E22",
|
|
784
|
-
className = ""
|
|
785
|
-
} = _b, rest = __objRest(_b, [
|
|
786
|
-
"isForceOpen",
|
|
787
|
-
"setIsForceOpen",
|
|
788
|
-
"isClosedAble",
|
|
789
|
-
"children",
|
|
790
|
-
"startModalBtn",
|
|
791
|
-
"stopModalBtn",
|
|
792
|
-
"afterStopBtn",
|
|
793
|
-
"size",
|
|
794
|
-
"modalTitle",
|
|
795
|
-
"modalDesc",
|
|
796
|
-
"className"
|
|
797
|
-
]);
|
|
798
|
-
const [isOpen, setIsOpen] = (0, import_react8.useState)(false);
|
|
799
|
-
const [shouldRender, setShouldRender] = (0, import_react8.useState)(false);
|
|
800
|
-
const [animate, setAnimate] = (0, import_react8.useState)(false);
|
|
801
|
-
(0, import_react8.useEffect)(() => {
|
|
802
|
-
if (isOpen) {
|
|
803
|
-
setShouldRender(true);
|
|
804
|
-
setTimeout(() => setAnimate(true), 10);
|
|
805
|
-
} else {
|
|
806
|
-
setAnimate(false);
|
|
807
|
-
const timer = setTimeout(() => setShouldRender(false), 300);
|
|
808
|
-
return () => clearTimeout(timer);
|
|
809
|
-
}
|
|
810
|
-
}, [isOpen]);
|
|
811
|
-
(0, import_react8.useEffect)(() => {
|
|
812
|
-
if (isForceOpen) {
|
|
813
|
-
setIsOpen(true);
|
|
814
|
-
} else {
|
|
815
|
-
setIsOpen(false);
|
|
816
|
-
}
|
|
817
|
-
}, [isForceOpen]);
|
|
818
|
-
const handleStartClick = (0, import_react8.useCallback)(
|
|
819
|
-
(e) => {
|
|
820
|
-
var _a2, _b2;
|
|
821
|
-
(_b2 = startModalBtn == null ? void 0 : (_a2 = startModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
822
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(true);
|
|
823
|
-
setIsOpen(true);
|
|
824
|
-
},
|
|
825
|
-
[startModalBtn]
|
|
826
|
-
);
|
|
827
|
-
const handleStopClick = (0, import_react8.useCallback)(
|
|
828
|
-
(e) => {
|
|
829
|
-
var _a2, _b2;
|
|
830
|
-
(_b2 = stopModalBtn == null ? void 0 : (_a2 = stopModalBtn.props).onClick) == null ? void 0 : _b2.call(_a2, e);
|
|
831
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
832
|
-
setIsOpen(false);
|
|
833
|
-
},
|
|
834
|
-
[stopModalBtn]
|
|
835
|
-
);
|
|
836
|
-
const handleCloseClick = () => {
|
|
837
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
838
|
-
setIsOpen(false);
|
|
839
|
-
};
|
|
840
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { ref, style: { display: "contents" }, children: [
|
|
841
|
-
startModalBtn && import_react8.default.cloneElement(startModalBtn, {
|
|
842
|
-
onClick: handleStartClick
|
|
843
|
-
}),
|
|
844
|
-
shouldRender && (0, import_react_dom.createPortal)(
|
|
845
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
846
|
-
"div",
|
|
847
|
-
{
|
|
848
|
-
className: `fixed inset-0 z-50 flex items-end justify-center transition-opacity duration-300 ${animate ? "opacity-100" : "opacity-0"}`,
|
|
849
|
-
"aria-modal": "true",
|
|
850
|
-
role: "dialog",
|
|
851
|
-
children: [
|
|
852
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
853
|
-
"div",
|
|
854
|
-
{
|
|
855
|
-
className: "absolute inset-0 bg-black/40",
|
|
856
|
-
onClick: () => isClosedAble ? handleCloseClick() : null,
|
|
857
|
-
"aria-label": "Close modal"
|
|
858
|
-
}
|
|
859
|
-
),
|
|
860
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
861
|
-
"div",
|
|
862
|
-
{
|
|
863
|
-
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
|
|
864
|
-
${size === "sm" ? "h-auto max-h-auto" : size === "md" ? "h-full max-h-[85vh]" : "h-full max-h-screen rounded-t-none!"}
|
|
865
|
-
${animate ? "scale-100 translate-y-0" : "scale-95 translate-y-full"}`,
|
|
866
|
-
children: [
|
|
867
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w-full flex flex-row relative items-center pt-8 pb-16", children: [
|
|
868
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col px-8 max-w-225", children: [
|
|
869
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-heading-3 text-button-sheet-text-primary", children: modalTitle }),
|
|
870
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-body-small text-button-sheet-text-secondary", children: modalDesc })
|
|
871
|
-
] }),
|
|
872
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
873
|
-
"i",
|
|
874
|
-
{
|
|
875
|
-
className: "fi fi-br-cross-small flex text-xl text-gray-600 w-44 h-44 absolute top-0 right-0 p-12",
|
|
876
|
-
onClick: () => handleCloseClick()
|
|
877
|
-
}
|
|
878
|
-
),
|
|
879
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
880
|
-
"div",
|
|
881
|
-
{
|
|
882
|
-
className: "text-gray-600 text-xl absolute top-0 right-0 p-12",
|
|
883
|
-
onClick: () => handleCloseClick(),
|
|
884
|
-
children: "x"
|
|
885
|
-
}
|
|
886
|
-
)
|
|
887
|
-
] }),
|
|
888
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "w-full h-full grow overflow-y-auto overflow-x-visible", children: [
|
|
889
|
-
children,
|
|
890
|
-
stopModalBtn && import_react8.default.cloneElement(stopModalBtn, {
|
|
891
|
-
onClick: handleStopClick
|
|
892
|
-
}),
|
|
893
|
-
afterStopBtn && afterStopBtn
|
|
894
|
-
] })
|
|
895
|
-
]
|
|
896
|
-
}
|
|
897
|
-
)
|
|
898
|
-
]
|
|
899
|
-
}
|
|
900
|
-
),
|
|
901
|
-
document.body
|
|
902
|
-
)
|
|
903
|
-
] });
|
|
904
|
-
}
|
|
905
|
-
);
|
|
906
|
-
BottomSheet.displayName = "BottomSheet";
|
|
907
|
-
|
|
908
758
|
// src/components/Checkbox/Checkbox.tsx
|
|
909
|
-
var
|
|
910
|
-
var
|
|
759
|
+
var import_react8 = require("react");
|
|
760
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
911
761
|
function CheckIcon({ className }) {
|
|
912
|
-
return /* @__PURE__ */ (0,
|
|
762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
913
763
|
"svg",
|
|
914
764
|
{
|
|
915
765
|
className,
|
|
916
766
|
viewBox: "0 0 16 16",
|
|
917
767
|
fill: "none",
|
|
918
768
|
"aria-hidden": "true",
|
|
919
|
-
children: /* @__PURE__ */ (0,
|
|
769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
920
770
|
"path",
|
|
921
771
|
{
|
|
922
772
|
d: "M13.333 4.667 6 12l-3.333-3.333",
|
|
@@ -930,14 +780,14 @@ function CheckIcon({ className }) {
|
|
|
930
780
|
);
|
|
931
781
|
}
|
|
932
782
|
function IndeterminateIcon({ className }) {
|
|
933
|
-
return /* @__PURE__ */ (0,
|
|
783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
934
784
|
"svg",
|
|
935
785
|
{
|
|
936
786
|
className,
|
|
937
787
|
viewBox: "0 0 16 16",
|
|
938
788
|
fill: "none",
|
|
939
789
|
"aria-hidden": "true",
|
|
940
|
-
children: /* @__PURE__ */ (0,
|
|
790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
941
791
|
"path",
|
|
942
792
|
{
|
|
943
793
|
d: "M3.333 8h9.334",
|
|
@@ -949,7 +799,7 @@ function IndeterminateIcon({ className }) {
|
|
|
949
799
|
}
|
|
950
800
|
);
|
|
951
801
|
}
|
|
952
|
-
var Checkbox = (0,
|
|
802
|
+
var Checkbox = (0, import_react8.forwardRef)(
|
|
953
803
|
(_a, ref) => {
|
|
954
804
|
var _b = _a, {
|
|
955
805
|
label,
|
|
@@ -972,17 +822,17 @@ var Checkbox = (0, import_react9.forwardRef)(
|
|
|
972
822
|
"id",
|
|
973
823
|
"defaultChecked"
|
|
974
824
|
]);
|
|
975
|
-
const reactId = (0,
|
|
825
|
+
const reactId = (0, import_react8.useId)();
|
|
976
826
|
const inputId = id != null ? id : reactId;
|
|
977
|
-
const [isChecked, setIsChecked] = (0,
|
|
978
|
-
return /* @__PURE__ */ (0,
|
|
827
|
+
const [isChecked, setIsChecked] = (0, import_react8.useState)(defaultChecked != null ? defaultChecked : false);
|
|
828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
979
829
|
"label",
|
|
980
830
|
{
|
|
981
831
|
htmlFor: inputId,
|
|
982
832
|
className: `flex select-none font-sans ${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
983
833
|
children: [
|
|
984
|
-
/* @__PURE__ */ (0,
|
|
985
|
-
/* @__PURE__ */ (0,
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative mr-16", children: [
|
|
835
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
986
836
|
"input",
|
|
987
837
|
__spreadValues({
|
|
988
838
|
ref,
|
|
@@ -999,16 +849,16 @@ var Checkbox = (0, import_react9.forwardRef)(
|
|
|
999
849
|
className: "sr-only"
|
|
1000
850
|
}, rest)
|
|
1001
851
|
),
|
|
1002
|
-
/* @__PURE__ */ (0,
|
|
852
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1003
853
|
"div",
|
|
1004
854
|
{
|
|
1005
855
|
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"}`,
|
|
1006
|
-
children: isChecked ? /* @__PURE__ */ (0,
|
|
856
|
+
children: isChecked ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1007
857
|
CheckIcon,
|
|
1008
858
|
{
|
|
1009
859
|
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
1010
860
|
}
|
|
1011
|
-
) : indeterminate ? /* @__PURE__ */ (0,
|
|
861
|
+
) : indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1012
862
|
IndeterminateIcon,
|
|
1013
863
|
{
|
|
1014
864
|
className: `h-20 ${contrast ? "text-static-icon-brand" : "text-white"}`
|
|
@@ -1017,15 +867,15 @@ var Checkbox = (0, import_react9.forwardRef)(
|
|
|
1017
867
|
}
|
|
1018
868
|
)
|
|
1019
869
|
] }),
|
|
1020
|
-
(label || description) && /* @__PURE__ */ (0,
|
|
1021
|
-
label && /* @__PURE__ */ (0,
|
|
870
|
+
(label || description) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "flex flex-col", children: [
|
|
871
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1022
872
|
"span",
|
|
1023
873
|
{
|
|
1024
874
|
className: `text-label-large ${disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-primary"}`,
|
|
1025
875
|
children: label
|
|
1026
876
|
}
|
|
1027
877
|
),
|
|
1028
|
-
description && /* @__PURE__ */ (0,
|
|
878
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1029
879
|
"span",
|
|
1030
880
|
{
|
|
1031
881
|
className: `text-body-small ${error ? "text-checkbox-text-danger" : disabled ? "text-checkbox-text-disabled" : contrast ? "text-checkbox-text-primary-inverse" : "text-checkbox-text-secondary"}`,
|
|
@@ -1041,8 +891,8 @@ var Checkbox = (0, import_react9.forwardRef)(
|
|
|
1041
891
|
Checkbox.displayName = "Checkbox";
|
|
1042
892
|
|
|
1043
893
|
// src/components/Chip/Chip.tsx
|
|
1044
|
-
var
|
|
1045
|
-
var
|
|
894
|
+
var import_react9 = require("react");
|
|
895
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1046
896
|
var sizeClasses4 = {
|
|
1047
897
|
sm: "h-32 text-label-medium px-12 py-6",
|
|
1048
898
|
md: "h-40 text-label-large px-16 py-10",
|
|
@@ -1061,7 +911,7 @@ var isDarkClasses = {
|
|
|
1061
911
|
true: "!bg-chip-background-black-active !text-chip-text-inverse",
|
|
1062
912
|
false: "!bg-chip-background-active !text-chip-text-inverse"
|
|
1063
913
|
};
|
|
1064
|
-
var Chip = (0,
|
|
914
|
+
var Chip = (0, import_react9.forwardRef)(
|
|
1065
915
|
(_a, ref) => {
|
|
1066
916
|
var _b = _a, {
|
|
1067
917
|
size = "md",
|
|
@@ -1097,14 +947,14 @@ var Chip = (0, import_react10.forwardRef)(
|
|
|
1097
947
|
className,
|
|
1098
948
|
isSelected ? darkClass : ""
|
|
1099
949
|
].filter(Boolean).join(" ");
|
|
1100
|
-
return /* @__PURE__ */ (0,
|
|
950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1101
951
|
"div",
|
|
1102
952
|
__spreadProps(__spreadValues({
|
|
1103
953
|
ref,
|
|
1104
954
|
className: containerClasses
|
|
1105
955
|
}, rest), {
|
|
1106
956
|
children: [
|
|
1107
|
-
icon ? icon : src && /* @__PURE__ */ (0,
|
|
957
|
+
icon ? icon : src && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src, alt, className: `${marginImgClasses[size]} rounded-full` }),
|
|
1108
958
|
label
|
|
1109
959
|
]
|
|
1110
960
|
})
|
|
@@ -1114,133 +964,409 @@ var Chip = (0, import_react10.forwardRef)(
|
|
|
1114
964
|
Chip.displayName = "Chip";
|
|
1115
965
|
|
|
1116
966
|
// src/components/Dialog/Dialog.tsx
|
|
1117
|
-
var import_react11 =
|
|
1118
|
-
var
|
|
967
|
+
var import_react11 = require("react");
|
|
968
|
+
var import_react_dom = require("react-dom");
|
|
969
|
+
|
|
970
|
+
// src/components/IconButton/IconButton.tsx
|
|
971
|
+
var import_react10 = require("react");
|
|
972
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
973
|
+
var sizeClasses5 = {
|
|
974
|
+
xs: "h-24 w-24",
|
|
975
|
+
s: "h-32 w-32",
|
|
976
|
+
m: "h-40 w-40",
|
|
977
|
+
l: "h-48 w-48"
|
|
978
|
+
};
|
|
979
|
+
var iconSizeClasses2 = {
|
|
980
|
+
xs: "h-16 w-16",
|
|
981
|
+
s: "h-20 w-20",
|
|
982
|
+
m: "h-20 w-20",
|
|
983
|
+
l: "h-24 w-24"
|
|
984
|
+
};
|
|
985
|
+
var IconButton = (0, import_react10.forwardRef)(
|
|
986
|
+
(_a, ref) => {
|
|
987
|
+
var _b = _a, { icon, size = "s", danger = false, disabled = false, className = "" } = _b, rest = __objRest(_b, ["icon", "size", "danger", "disabled", "className"]);
|
|
988
|
+
const classes = [
|
|
989
|
+
"inline-flex shrink-0 items-center justify-center rounded-full transition-colors",
|
|
990
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-icon-button-border-focus",
|
|
991
|
+
sizeClasses5[size],
|
|
992
|
+
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",
|
|
993
|
+
className
|
|
994
|
+
].filter(Boolean).join(" ");
|
|
995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", __spreadProps(__spreadValues({ ref, type: "button", disabled, className: classes }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: `shrink-0 flex items-center justify-center ${iconSizeClasses2[size]}`, children: icon }) }));
|
|
996
|
+
}
|
|
997
|
+
);
|
|
998
|
+
IconButton.displayName = "IconButton";
|
|
999
|
+
|
|
1000
|
+
// src/components/Dialog/Dialog.tsx
|
|
1119
1001
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1002
|
+
function CloseIcon2({ className }) {
|
|
1003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1004
|
+
}
|
|
1005
|
+
function WarningIcon2({ className }) {
|
|
1006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M1 21h22L12 2 1 21Zm12-3h-2v-2h2v2Zm0-4h-2v-4h2v4Z" }) });
|
|
1007
|
+
}
|
|
1008
|
+
function useMountTransition(open, duration = 300) {
|
|
1009
|
+
const [mounted, setMounted] = (0, import_react11.useState)(open);
|
|
1010
|
+
const [animate, setAnimate] = (0, import_react11.useState)(open);
|
|
1011
|
+
(0, import_react11.useEffect)(() => {
|
|
1012
|
+
if (open) {
|
|
1013
|
+
setMounted(true);
|
|
1014
|
+
let raf2 = 0;
|
|
1015
|
+
const raf1 = requestAnimationFrame(() => {
|
|
1016
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
1017
|
+
});
|
|
1018
|
+
return () => {
|
|
1019
|
+
cancelAnimationFrame(raf1);
|
|
1020
|
+
cancelAnimationFrame(raf2);
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
setAnimate(false);
|
|
1024
|
+
const timer = setTimeout(() => setMounted(false), duration);
|
|
1025
|
+
return () => clearTimeout(timer);
|
|
1026
|
+
}, [open, duration]);
|
|
1027
|
+
return { mounted, animate };
|
|
1028
|
+
}
|
|
1029
|
+
function DialogAction({
|
|
1030
|
+
action,
|
|
1031
|
+
variant,
|
|
1032
|
+
orderClass
|
|
1033
|
+
}) {
|
|
1034
|
+
if (!action) return null;
|
|
1035
|
+
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1036
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Button, __spreadProps(__spreadValues({ variant, size: "lg", className: `w-full lg:w-auto ${orderClass} ${className}` }, rest), { children: label }));
|
|
1037
|
+
}
|
|
1120
1038
|
var Dialog = (0, import_react11.forwardRef)(
|
|
1121
|
-
({
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1039
|
+
(_a, ref) => {
|
|
1040
|
+
var _b = _a, {
|
|
1041
|
+
open,
|
|
1042
|
+
onOpenChange,
|
|
1043
|
+
display = "centered",
|
|
1044
|
+
artwork,
|
|
1045
|
+
title,
|
|
1046
|
+
subtitle,
|
|
1047
|
+
warning = false,
|
|
1048
|
+
closable = true,
|
|
1049
|
+
backdrop = true,
|
|
1050
|
+
children,
|
|
1051
|
+
dismiss,
|
|
1052
|
+
secondary,
|
|
1053
|
+
confirm,
|
|
1054
|
+
className = ""
|
|
1055
|
+
} = _b, rest = __objRest(_b, [
|
|
1056
|
+
"open",
|
|
1057
|
+
"onOpenChange",
|
|
1058
|
+
"display",
|
|
1059
|
+
"artwork",
|
|
1060
|
+
"title",
|
|
1061
|
+
"subtitle",
|
|
1062
|
+
"warning",
|
|
1063
|
+
"closable",
|
|
1064
|
+
"backdrop",
|
|
1065
|
+
"children",
|
|
1066
|
+
"dismiss",
|
|
1067
|
+
"secondary",
|
|
1068
|
+
"confirm",
|
|
1069
|
+
"className"
|
|
1070
|
+
]);
|
|
1071
|
+
const { mounted, animate } = useMountTransition(open);
|
|
1146
1072
|
(0, import_react11.useEffect)(() => {
|
|
1147
|
-
if (
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
setIsOpen(true);
|
|
1159
|
-
},
|
|
1160
|
-
[startModalBtn]
|
|
1161
|
-
);
|
|
1162
|
-
const handleStopClick = (0, import_react11.useCallback)(
|
|
1163
|
-
(e) => {
|
|
1164
|
-
var _a, _b;
|
|
1165
|
-
(_b = stopModalBtn == null ? void 0 : (_a = stopModalBtn.props).onClick) == null ? void 0 : _b.call(_a, e);
|
|
1166
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
1167
|
-
setIsOpen(false);
|
|
1168
|
-
},
|
|
1169
|
-
[stopModalBtn]
|
|
1170
|
-
);
|
|
1171
|
-
const handleCloseClick = () => {
|
|
1172
|
-
setIsForceOpen == null ? void 0 : setIsForceOpen(false);
|
|
1173
|
-
setIsOpen(false);
|
|
1073
|
+
if (!open || !closable) return;
|
|
1074
|
+
const handleKeyDown = (e) => {
|
|
1075
|
+
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1076
|
+
};
|
|
1077
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1078
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1079
|
+
}, [open, closable, onOpenChange]);
|
|
1080
|
+
if (!mounted) return null;
|
|
1081
|
+
const handleClose = () => onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1082
|
+
const handleBackdropMouseDown = (e) => {
|
|
1083
|
+
if (closable && e.target === e.currentTarget) handleClose();
|
|
1174
1084
|
};
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1085
|
+
const showHeader = Boolean(title || subtitle || warning || closable);
|
|
1086
|
+
const footerCount = [dismiss, secondary, confirm].filter(Boolean).length;
|
|
1087
|
+
const showFooter = footerCount > 0;
|
|
1088
|
+
const splitDismissLeft = footerCount === 3;
|
|
1089
|
+
const mobileTransition = display === "centered" ? animate ? "scale-100 opacity-100" : "scale-95 opacity-0" : animate ? "translate-y-0" : "translate-y-full";
|
|
1090
|
+
const desktopTransition = animate ? "lg:scale-100 lg:opacity-100 lg:translate-y-0" : "lg:scale-95 lg:opacity-0 lg:translate-y-0";
|
|
1091
|
+
return (0, import_react_dom.createPortal)(
|
|
1092
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1093
|
+
"div",
|
|
1094
|
+
{
|
|
1095
|
+
className: [
|
|
1096
|
+
"fixed inset-0 z-15000 flex flex-col",
|
|
1097
|
+
backdrop ? "bg-dialog-background-backdrop" : "",
|
|
1098
|
+
"transition-opacity duration-300",
|
|
1099
|
+
animate ? "opacity-100" : "opacity-0",
|
|
1100
|
+
display === "slide-up" ? "items-center justify-end" : "",
|
|
1101
|
+
display === "full" ? "items-start justify-end" : "",
|
|
1102
|
+
display === "centered" ? "items-center justify-center px-24" : "",
|
|
1103
|
+
"lg:items-center lg:justify-center lg:px-0"
|
|
1104
|
+
].filter(Boolean).join(" "),
|
|
1105
|
+
role: "presentation",
|
|
1106
|
+
onMouseDown: handleBackdropMouseDown,
|
|
1107
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1108
|
+
"div",
|
|
1109
|
+
__spreadProps(__spreadValues({
|
|
1110
|
+
ref,
|
|
1111
|
+
role: "dialog",
|
|
1112
|
+
"aria-modal": "true",
|
|
1113
|
+
className: [
|
|
1114
|
+
"relative flex w-full flex-col overflow-hidden bg-dialog-background-primary",
|
|
1115
|
+
display === "centered" ? "rounded-12" : "rounded-t-12",
|
|
1116
|
+
"max-h-[85vh]",
|
|
1117
|
+
display === "full" ? "max-w-479 flex-1" : "max-w-479",
|
|
1118
|
+
"lg:min-w-0 lg:w-480 lg:max-w-480 lg:flex-none lg:rounded-16 lg:max-h-[85vh]",
|
|
1119
|
+
"transition-all duration-300",
|
|
1120
|
+
mobileTransition,
|
|
1121
|
+
desktopTransition,
|
|
1122
|
+
className
|
|
1123
|
+
].filter(Boolean).join(" "),
|
|
1124
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
1125
|
+
}, rest), {
|
|
1126
|
+
children: [
|
|
1127
|
+
artwork ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative shrink-0 bg-background-tertiary", children: [
|
|
1128
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "absolute right-24 top-20", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1129
|
+
IconButton,
|
|
1130
|
+
{
|
|
1131
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CloseIcon2, { className: "h-24 w-24" }),
|
|
1132
|
+
size: "m",
|
|
1133
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1134
|
+
onClick: handleClose,
|
|
1135
|
+
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!"
|
|
1136
|
+
}
|
|
1137
|
+
) }),
|
|
1138
|
+
artwork
|
|
1139
|
+
] }) : null,
|
|
1140
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("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: [
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-w-0 flex-1 items-start gap-8", children: [
|
|
1142
|
+
warning && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex shrink-0 items-center pt-2", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(WarningIcon2, { className: "h-20 w-20 text-dialog-icon-warning lg:h-24 lg:w-24" }) }),
|
|
1143
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1144
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1145
|
+
subtitle && !artwork && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1146
|
+
] })
|
|
1147
|
+
] }),
|
|
1148
|
+
closable && !artwork && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
1149
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1150
|
+
IconButton,
|
|
1202
1151
|
{
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-16 cursor-pointer",
|
|
1209
|
-
onMouseDown: (e) => {
|
|
1210
|
-
e.preventDefault();
|
|
1211
|
-
handleCloseClick();
|
|
1212
|
-
},
|
|
1213
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1214
|
-
"path",
|
|
1215
|
-
{
|
|
1216
|
-
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",
|
|
1217
|
-
fill: "#111827"
|
|
1218
|
-
}
|
|
1219
|
-
)
|
|
1152
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CloseIcon2, { className: "h-20 w-20" }),
|
|
1153
|
+
size: "s",
|
|
1154
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1155
|
+
onClick: handleClose,
|
|
1156
|
+
className: "bg-icon-button-background-enabled lg:hidden!"
|
|
1220
1157
|
}
|
|
1221
1158
|
),
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1159
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1160
|
+
IconButton,
|
|
1161
|
+
{
|
|
1162
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CloseIcon2, { className: "h-24 w-24" }),
|
|
1163
|
+
size: "m",
|
|
1164
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1165
|
+
onClick: handleClose,
|
|
1166
|
+
className: "hidden! bg-icon-button-background-enabled lg:inline-flex!"
|
|
1167
|
+
}
|
|
1168
|
+
)
|
|
1169
|
+
] })
|
|
1170
|
+
] }),
|
|
1171
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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 }),
|
|
1172
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("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: [
|
|
1173
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1174
|
+
DialogAction,
|
|
1175
|
+
{
|
|
1176
|
+
action: dismiss,
|
|
1177
|
+
variant: "tertiary",
|
|
1178
|
+
orderClass: `order-3 lg:order-1 ${splitDismissLeft ? "lg:mr-auto" : ""}`
|
|
1179
|
+
}
|
|
1180
|
+
),
|
|
1181
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1182
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" })
|
|
1183
|
+
] })
|
|
1184
|
+
]
|
|
1185
|
+
})
|
|
1186
|
+
)
|
|
1187
|
+
}
|
|
1188
|
+
),
|
|
1189
|
+
document.body
|
|
1190
|
+
);
|
|
1236
1191
|
}
|
|
1237
1192
|
);
|
|
1238
1193
|
Dialog.displayName = "Dialog";
|
|
1239
1194
|
|
|
1240
|
-
// src/components/
|
|
1195
|
+
// src/components/Drawer/Drawer.tsx
|
|
1241
1196
|
var import_react12 = require("react");
|
|
1197
|
+
var import_react_dom2 = require("react-dom");
|
|
1242
1198
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1243
|
-
|
|
1199
|
+
function CloseIcon3({ className }) {
|
|
1200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1201
|
+
}
|
|
1202
|
+
function useMountTransition2(open, duration = 300) {
|
|
1203
|
+
const [mounted, setMounted] = (0, import_react12.useState)(open);
|
|
1204
|
+
const [animate, setAnimate] = (0, import_react12.useState)(open);
|
|
1205
|
+
(0, import_react12.useEffect)(() => {
|
|
1206
|
+
if (open) {
|
|
1207
|
+
setMounted(true);
|
|
1208
|
+
let raf2 = 0;
|
|
1209
|
+
const raf1 = requestAnimationFrame(() => {
|
|
1210
|
+
raf2 = requestAnimationFrame(() => setAnimate(true));
|
|
1211
|
+
});
|
|
1212
|
+
return () => {
|
|
1213
|
+
cancelAnimationFrame(raf1);
|
|
1214
|
+
cancelAnimationFrame(raf2);
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
setAnimate(false);
|
|
1218
|
+
const timer = setTimeout(() => setMounted(false), duration);
|
|
1219
|
+
return () => clearTimeout(timer);
|
|
1220
|
+
}, [open, duration]);
|
|
1221
|
+
return { mounted, animate };
|
|
1222
|
+
}
|
|
1223
|
+
function DrawerAction({
|
|
1224
|
+
action,
|
|
1225
|
+
variant,
|
|
1226
|
+
orderClass
|
|
1227
|
+
}) {
|
|
1228
|
+
if (!action) return null;
|
|
1229
|
+
const _a = action, { label, className = "" } = _a, rest = __objRest(_a, ["label", "className"]);
|
|
1230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1231
|
+
Button,
|
|
1232
|
+
__spreadProps(__spreadValues({
|
|
1233
|
+
variant,
|
|
1234
|
+
size: "lg",
|
|
1235
|
+
className: `w-full lg:w-auto ${orderClass} ${className}`
|
|
1236
|
+
}, rest), {
|
|
1237
|
+
children: label
|
|
1238
|
+
})
|
|
1239
|
+
);
|
|
1240
|
+
}
|
|
1241
|
+
var Drawer = (0, import_react12.forwardRef)(
|
|
1242
|
+
(_a, ref) => {
|
|
1243
|
+
var _b = _a, {
|
|
1244
|
+
open,
|
|
1245
|
+
onOpenChange,
|
|
1246
|
+
title,
|
|
1247
|
+
subtitle,
|
|
1248
|
+
closable = true,
|
|
1249
|
+
backdrop = true,
|
|
1250
|
+
children,
|
|
1251
|
+
dismiss,
|
|
1252
|
+
secondary,
|
|
1253
|
+
confirm,
|
|
1254
|
+
className = ""
|
|
1255
|
+
} = _b, rest = __objRest(_b, [
|
|
1256
|
+
"open",
|
|
1257
|
+
"onOpenChange",
|
|
1258
|
+
"title",
|
|
1259
|
+
"subtitle",
|
|
1260
|
+
"closable",
|
|
1261
|
+
"backdrop",
|
|
1262
|
+
"children",
|
|
1263
|
+
"dismiss",
|
|
1264
|
+
"secondary",
|
|
1265
|
+
"confirm",
|
|
1266
|
+
"className"
|
|
1267
|
+
]);
|
|
1268
|
+
const { mounted, animate } = useMountTransition2(open);
|
|
1269
|
+
(0, import_react12.useEffect)(() => {
|
|
1270
|
+
if (!open || !closable) return;
|
|
1271
|
+
const handleKeyDown = (e) => {
|
|
1272
|
+
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1273
|
+
};
|
|
1274
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1275
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1276
|
+
}, [open, closable, onOpenChange]);
|
|
1277
|
+
if (!mounted) return null;
|
|
1278
|
+
const handleClose = () => onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1279
|
+
const handleBackdropMouseDown = (e) => {
|
|
1280
|
+
if (closable && e.target === e.currentTarget) handleClose();
|
|
1281
|
+
};
|
|
1282
|
+
const showHeader = Boolean(title || subtitle || closable);
|
|
1283
|
+
const showFooter = Boolean(dismiss || secondary || confirm);
|
|
1284
|
+
const allActions = Boolean(dismiss && secondary && confirm);
|
|
1285
|
+
return (0, import_react_dom2.createPortal)(
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1287
|
+
"div",
|
|
1288
|
+
{
|
|
1289
|
+
className: [
|
|
1290
|
+
"fixed inset-0 z-15000 flex flex-col items-end justify-center",
|
|
1291
|
+
backdrop ? "bg-dialog-background-backdrop" : "",
|
|
1292
|
+
"transition-opacity duration-300",
|
|
1293
|
+
animate ? "opacity-100" : "opacity-0"
|
|
1294
|
+
].filter(Boolean).join(" "),
|
|
1295
|
+
role: "presentation",
|
|
1296
|
+
onMouseDown: handleBackdropMouseDown,
|
|
1297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1298
|
+
"div",
|
|
1299
|
+
__spreadProps(__spreadValues({
|
|
1300
|
+
ref,
|
|
1301
|
+
role: "dialog",
|
|
1302
|
+
"aria-modal": "true",
|
|
1303
|
+
className: [
|
|
1304
|
+
"relative flex h-full w-full flex-col overflow-hidden bg-dialog-background-primary",
|
|
1305
|
+
"transition-transform duration-300",
|
|
1306
|
+
animate ? "translate-y-0" : "translate-y-full",
|
|
1307
|
+
"lg:translate-y-0",
|
|
1308
|
+
animate ? "lg:translate-x-0" : "lg:translate-x-full",
|
|
1309
|
+
"lg:w-480 lg:min-w-480 lg:max-w-640",
|
|
1310
|
+
className
|
|
1311
|
+
].filter(Boolean).join(" "),
|
|
1312
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
1313
|
+
}, rest), {
|
|
1314
|
+
children: [
|
|
1315
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("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: [
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1317
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1318
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1319
|
+
] }),
|
|
1320
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1321
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1322
|
+
IconButton,
|
|
1323
|
+
{
|
|
1324
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon3, { className: "h-20 w-20" }),
|
|
1325
|
+
size: "s",
|
|
1326
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1327
|
+
onClick: handleClose,
|
|
1328
|
+
className: "bg-icon-button-background-enabled lg:hidden!"
|
|
1329
|
+
}
|
|
1330
|
+
),
|
|
1331
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1332
|
+
IconButton,
|
|
1333
|
+
{
|
|
1334
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon3, { className: "h-24 w-24" }),
|
|
1335
|
+
size: "m",
|
|
1336
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1337
|
+
onClick: handleClose,
|
|
1338
|
+
className: "hidden! bg-icon-button-background-enabled lg:inline-flex!"
|
|
1339
|
+
}
|
|
1340
|
+
)
|
|
1341
|
+
] })
|
|
1342
|
+
] }),
|
|
1343
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-1 overflow-y-auto bg-dialog-background-primary p-16 text-body-regular text-dialog-text-primary lg:p-24", children }),
|
|
1344
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" }),
|
|
1346
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "contents gap-8 lg:order-2 lg:ml-auto lg:flex lg:items-center", children: [
|
|
1347
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1" }),
|
|
1348
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2" })
|
|
1349
|
+
] })
|
|
1350
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1351
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1352
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" }),
|
|
1353
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" })
|
|
1354
|
+
] }) })
|
|
1355
|
+
]
|
|
1356
|
+
})
|
|
1357
|
+
)
|
|
1358
|
+
}
|
|
1359
|
+
),
|
|
1360
|
+
document.body
|
|
1361
|
+
);
|
|
1362
|
+
}
|
|
1363
|
+
);
|
|
1364
|
+
Drawer.displayName = "Drawer";
|
|
1365
|
+
|
|
1366
|
+
// src/components/Dropdown/Dropdown.tsx
|
|
1367
|
+
var import_react13 = require("react");
|
|
1368
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1369
|
+
var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1244
1370
|
"svg",
|
|
1245
1371
|
{
|
|
1246
1372
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1248,7 +1374,7 @@ var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
|
1248
1374
|
height: "20",
|
|
1249
1375
|
viewBox: "0 0 20 20",
|
|
1250
1376
|
fill: "none",
|
|
1251
|
-
children: /* @__PURE__ */ (0,
|
|
1377
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1252
1378
|
"path",
|
|
1253
1379
|
{
|
|
1254
1380
|
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",
|
|
@@ -1258,7 +1384,7 @@ var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
|
1258
1384
|
}
|
|
1259
1385
|
);
|
|
1260
1386
|
function IconCheck({ className }) {
|
|
1261
|
-
return /* @__PURE__ */ (0,
|
|
1387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1262
1388
|
"svg",
|
|
1263
1389
|
{
|
|
1264
1390
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1267,7 +1393,7 @@ function IconCheck({ className }) {
|
|
|
1267
1393
|
viewBox: "0 0 20 20",
|
|
1268
1394
|
fill: "none",
|
|
1269
1395
|
className,
|
|
1270
|
-
children: /* @__PURE__ */ (0,
|
|
1396
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1271
1397
|
"path",
|
|
1272
1398
|
{
|
|
1273
1399
|
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
@@ -1278,7 +1404,7 @@ function IconCheck({ className }) {
|
|
|
1278
1404
|
);
|
|
1279
1405
|
}
|
|
1280
1406
|
function ChevronDown({ className }) {
|
|
1281
|
-
return /* @__PURE__ */ (0,
|
|
1407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1282
1408
|
"svg",
|
|
1283
1409
|
{
|
|
1284
1410
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1287,7 +1413,7 @@ function ChevronDown({ className }) {
|
|
|
1287
1413
|
viewBox: "0 0 20 20",
|
|
1288
1414
|
fill: "none",
|
|
1289
1415
|
className,
|
|
1290
|
-
children: /* @__PURE__ */ (0,
|
|
1416
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1291
1417
|
"path",
|
|
1292
1418
|
{
|
|
1293
1419
|
d: "M14.7119 8.0625L10 12.7744L5.28809 8.0625L6.0625 7.28809L10 11.2256L13.9375 7.28809L14.7119 8.0625Z",
|
|
@@ -1297,16 +1423,17 @@ function ChevronDown({ className }) {
|
|
|
1297
1423
|
}
|
|
1298
1424
|
);
|
|
1299
1425
|
}
|
|
1300
|
-
var Dropdown = (0,
|
|
1426
|
+
var Dropdown = (0, import_react13.forwardRef)(
|
|
1301
1427
|
(_a, ref) => {
|
|
1302
1428
|
var _b = _a, {
|
|
1303
1429
|
size = "md",
|
|
1430
|
+
variant = "default",
|
|
1304
1431
|
error,
|
|
1305
1432
|
label,
|
|
1306
1433
|
placeholder,
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1434
|
+
helperText,
|
|
1435
|
+
disabled = false,
|
|
1436
|
+
textCenter = false,
|
|
1310
1437
|
value,
|
|
1311
1438
|
setValue,
|
|
1312
1439
|
dropDownItems = [
|
|
@@ -1319,168 +1446,248 @@ var Dropdown = (0, import_react12.forwardRef)(
|
|
|
1319
1446
|
className = ""
|
|
1320
1447
|
} = _b, rest = __objRest(_b, [
|
|
1321
1448
|
"size",
|
|
1449
|
+
"variant",
|
|
1322
1450
|
"error",
|
|
1323
1451
|
"label",
|
|
1324
1452
|
"placeholder",
|
|
1325
|
-
"
|
|
1326
|
-
"
|
|
1327
|
-
"
|
|
1453
|
+
"helperText",
|
|
1454
|
+
"disabled",
|
|
1455
|
+
"textCenter",
|
|
1328
1456
|
"value",
|
|
1329
1457
|
"setValue",
|
|
1330
1458
|
"dropDownItems",
|
|
1331
1459
|
"className"
|
|
1332
1460
|
]);
|
|
1333
|
-
const
|
|
1334
|
-
const
|
|
1335
|
-
const
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1338
|
-
);
|
|
1339
|
-
(0,
|
|
1461
|
+
const isCombobox = variant === "combobox";
|
|
1462
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
1463
|
+
const [isOpen, setIsOpen] = (0, import_react13.useState)(false);
|
|
1464
|
+
const [isFocused, setIsFocused] = (0, import_react13.useState)(false);
|
|
1465
|
+
const [query, setQuery] = (0, import_react13.useState)(value.label || "");
|
|
1466
|
+
const [filterText, setFilterText] = (0, import_react13.useState)("");
|
|
1467
|
+
const dropdownRef = (0, import_react13.useRef)(null);
|
|
1468
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
1469
|
+
const listboxId = (0, import_react13.useId)();
|
|
1470
|
+
const [prevLabel, setPrevLabel] = (0, import_react13.useState)(value.label);
|
|
1471
|
+
if (value.label !== prevLabel) {
|
|
1472
|
+
setPrevLabel(value.label);
|
|
1473
|
+
setQuery(value.label || "");
|
|
1474
|
+
}
|
|
1475
|
+
const filteredItems = isCombobox ? dropDownItems.filter(
|
|
1476
|
+
(item) => item.label.toLowerCase().includes(filterText.toLowerCase())
|
|
1477
|
+
) : dropDownItems;
|
|
1478
|
+
(0, import_react13.useEffect)(() => {
|
|
1340
1479
|
function handleClickOutside(event) {
|
|
1341
1480
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1342
1481
|
setIsOpen(false);
|
|
1482
|
+
if (isCombobox) setQuery(value.label || "");
|
|
1343
1483
|
}
|
|
1344
1484
|
}
|
|
1345
1485
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1346
1486
|
return () => {
|
|
1347
1487
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1348
1488
|
};
|
|
1349
|
-
}, []);
|
|
1350
|
-
|
|
1351
|
-
|
|
1489
|
+
}, [isCombobox, value.label]);
|
|
1490
|
+
const triggerClassName = `w-full rounded-6 text-body-small px-16 inline-flex gap-8 items-center border
|
|
1491
|
+
${size === "lg" ? "h-48 py-16" : "h-40 py-12"}
|
|
1492
|
+
${!isCombobox ? disabled ? "text-dropdown-text-disabled cursor-not-allowed" : value ? "text-dropdown-text-primary cursor-pointer" : "text-dropdown-text-secondary cursor-pointer" : ""}
|
|
1493
|
+
${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"}
|
|
1494
|
+
${className}`;
|
|
1495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1496
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1352
1497
|
"p",
|
|
1353
1498
|
{
|
|
1354
|
-
className: `text-label-medium text-left items-left font-medium
|
|
1499
|
+
className: `text-label-medium text-left items-left font-medium ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
|
|
1355
1500
|
children: label
|
|
1356
1501
|
}
|
|
1357
|
-
) : /* @__PURE__ */ (0,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1502
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {}),
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w-full flex flex-col relative", ref: dropdownRef, children: [
|
|
1504
|
+
isCombobox ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1360
1505
|
"div",
|
|
1361
1506
|
__spreadProps(__spreadValues({
|
|
1362
1507
|
ref
|
|
1363
1508
|
}, rest), {
|
|
1364
|
-
onClick: () =>
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
${className}`,
|
|
1509
|
+
onClick: () => {
|
|
1510
|
+
var _a2;
|
|
1511
|
+
return !disabled && ((_a2 = inputRef.current) == null ? void 0 : _a2.focus());
|
|
1512
|
+
},
|
|
1513
|
+
className: triggerClassName,
|
|
1370
1514
|
children: [
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
"
|
|
1515
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1516
|
+
"input",
|
|
1373
1517
|
{
|
|
1374
|
-
|
|
1375
|
-
|
|
1518
|
+
ref: inputRef,
|
|
1519
|
+
type: "text",
|
|
1520
|
+
role: "combobox",
|
|
1521
|
+
"aria-autocomplete": "list",
|
|
1522
|
+
"aria-haspopup": "listbox",
|
|
1523
|
+
"aria-expanded": isOpen,
|
|
1524
|
+
"aria-controls": listboxId,
|
|
1525
|
+
disabled,
|
|
1526
|
+
placeholder,
|
|
1527
|
+
value: query,
|
|
1528
|
+
onChange: (e) => {
|
|
1529
|
+
setQuery(e.target.value);
|
|
1530
|
+
setFilterText(e.target.value);
|
|
1531
|
+
setIsOpen(true);
|
|
1532
|
+
},
|
|
1533
|
+
onFocus: () => {
|
|
1534
|
+
setIsFocused(true);
|
|
1535
|
+
setIsOpen(true);
|
|
1536
|
+
setFilterText("");
|
|
1537
|
+
},
|
|
1538
|
+
onBlur: () => setIsFocused(false),
|
|
1539
|
+
onKeyDown: (e) => {
|
|
1540
|
+
if (!disabled && e.key === "Escape") {
|
|
1541
|
+
setIsOpen(false);
|
|
1542
|
+
setQuery(value.label || "");
|
|
1543
|
+
}
|
|
1544
|
+
},
|
|
1545
|
+
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"}`
|
|
1376
1546
|
}
|
|
1377
1547
|
),
|
|
1378
|
-
/* @__PURE__ */ (0,
|
|
1379
|
-
|
|
1380
|
-
/* @__PURE__ */ (0,
|
|
1381
|
-
|
|
1548
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
1549
|
+
disabled ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconDanger, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {}),
|
|
1550
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1551
|
+
IconButton,
|
|
1382
1552
|
{
|
|
1383
|
-
|
|
1553
|
+
size: iconButtonSize,
|
|
1554
|
+
disabled,
|
|
1555
|
+
tabIndex: -1,
|
|
1556
|
+
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1557
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1558
|
+
ChevronDown,
|
|
1559
|
+
{
|
|
1560
|
+
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
1561
|
+
}
|
|
1562
|
+
),
|
|
1563
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1564
|
+
onClick: (e) => {
|
|
1565
|
+
var _a2;
|
|
1566
|
+
e.stopPropagation();
|
|
1567
|
+
if (disabled) return;
|
|
1568
|
+
if (isOpen) {
|
|
1569
|
+
setIsOpen(false);
|
|
1570
|
+
setQuery(value.label || "");
|
|
1571
|
+
} else {
|
|
1572
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1384
1575
|
}
|
|
1385
1576
|
)
|
|
1386
1577
|
] })
|
|
1387
1578
|
]
|
|
1388
1579
|
})
|
|
1389
|
-
),
|
|
1390
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1580
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1391
1581
|
"div",
|
|
1392
|
-
{
|
|
1393
|
-
|
|
1394
|
-
|
|
1582
|
+
__spreadProps(__spreadValues({
|
|
1583
|
+
ref
|
|
1584
|
+
}, rest), {
|
|
1585
|
+
tabIndex: disabled ? -1 : 0,
|
|
1586
|
+
role: "button",
|
|
1587
|
+
"aria-haspopup": "listbox",
|
|
1588
|
+
"aria-expanded": isOpen,
|
|
1589
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
1590
|
+
onFocus: (e) => {
|
|
1591
|
+
var _a2;
|
|
1592
|
+
setIsFocused(true);
|
|
1593
|
+
(_a2 = rest.onFocus) == null ? void 0 : _a2.call(rest, e);
|
|
1594
|
+
},
|
|
1595
|
+
onBlur: (e) => {
|
|
1596
|
+
var _a2;
|
|
1597
|
+
setIsFocused(false);
|
|
1598
|
+
(_a2 = rest.onBlur) == null ? void 0 : _a2.call(rest, e);
|
|
1599
|
+
},
|
|
1600
|
+
onKeyDown: (e) => {
|
|
1601
|
+
var _a2;
|
|
1602
|
+
if (disabled) return;
|
|
1603
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1604
|
+
e.preventDefault();
|
|
1605
|
+
setIsOpen((prev) => !prev);
|
|
1606
|
+
} else if (e.key === "Escape") {
|
|
1607
|
+
setIsOpen(false);
|
|
1608
|
+
}
|
|
1609
|
+
(_a2 = rest.onKeyDown) == null ? void 0 : _a2.call(rest, e);
|
|
1610
|
+
},
|
|
1611
|
+
className: `focus:outline-none ${triggerClassName}`,
|
|
1395
1612
|
children: [
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", children: [
|
|
1399
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute inset-y-0 rtl:inset-r-0 inset-s-0 flex items-center ps-12 pointer-events-none", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1400
|
-
"svg",
|
|
1401
|
-
{
|
|
1402
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1403
|
-
width: "20",
|
|
1404
|
-
height: "20",
|
|
1405
|
-
viewBox: "0 0 20 20",
|
|
1406
|
-
fill: "none",
|
|
1407
|
-
children: [
|
|
1408
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1409
|
-
"mask",
|
|
1410
|
-
{
|
|
1411
|
-
id: "mask0_3218_5077",
|
|
1412
|
-
style: { maskType: "alpha" },
|
|
1413
|
-
maskUnits: "userSpaceOnUse",
|
|
1414
|
-
x: "0",
|
|
1415
|
-
y: "0",
|
|
1416
|
-
width: "20",
|
|
1417
|
-
height: "20",
|
|
1418
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("rect", { width: "20", height: "20", fill: "#D9D9D9" })
|
|
1419
|
-
}
|
|
1420
|
-
),
|
|
1421
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("g", { mask: "url(#mask0_3218_5077)", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1422
|
-
"path",
|
|
1423
|
-
{
|
|
1424
|
-
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",
|
|
1425
|
-
fill: "#111827"
|
|
1426
|
-
}
|
|
1427
|
-
) })
|
|
1428
|
-
]
|
|
1429
|
-
}
|
|
1430
|
-
) }),
|
|
1431
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1432
|
-
"input",
|
|
1433
|
-
{
|
|
1434
|
-
type: "text",
|
|
1435
|
-
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",
|
|
1436
|
-
placeholder: "Search...",
|
|
1437
|
-
value: search,
|
|
1438
|
-
onChange: (e) => setSearch(e.target.value)
|
|
1439
|
-
}
|
|
1440
|
-
)
|
|
1441
|
-
] })
|
|
1442
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, {}),
|
|
1443
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1444
|
-
"ul",
|
|
1613
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1614
|
+
"p",
|
|
1445
1615
|
{
|
|
1446
|
-
className: "
|
|
1447
|
-
|
|
1448
|
-
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1449
|
-
"div",
|
|
1450
|
-
{
|
|
1451
|
-
onClick: () => {
|
|
1452
|
-
setValue(item);
|
|
1453
|
-
setSearch("");
|
|
1454
|
-
setIsOpen(false);
|
|
1455
|
-
},
|
|
1456
|
-
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",
|
|
1457
|
-
children: [
|
|
1458
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
|
|
1459
|
-
value.value === item.value && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconCheck, { className: "h-20 w-20" })
|
|
1460
|
-
]
|
|
1461
|
-
}
|
|
1462
|
-
) }, idx)) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("li", { className: "px-8 py-8 text-label-medium text-gray-900", children: "No results found" })
|
|
1616
|
+
className: `grow truncate ${textCenter ? "text-center" : "text-start"}`,
|
|
1617
|
+
children: value.label || placeholder
|
|
1463
1618
|
}
|
|
1464
|
-
)
|
|
1619
|
+
),
|
|
1620
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
1621
|
+
disabled ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {}) : error ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconDanger, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {}),
|
|
1622
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1623
|
+
IconButton,
|
|
1624
|
+
{
|
|
1625
|
+
size: iconButtonSize,
|
|
1626
|
+
disabled,
|
|
1627
|
+
tabIndex: -1,
|
|
1628
|
+
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1629
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1630
|
+
ChevronDown,
|
|
1631
|
+
{
|
|
1632
|
+
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
1633
|
+
}
|
|
1634
|
+
),
|
|
1635
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1636
|
+
onClick: (e) => {
|
|
1637
|
+
e.stopPropagation();
|
|
1638
|
+
if (!disabled) setIsOpen((prev) => !prev);
|
|
1639
|
+
}
|
|
1640
|
+
}
|
|
1641
|
+
)
|
|
1642
|
+
] })
|
|
1465
1643
|
]
|
|
1644
|
+
})
|
|
1645
|
+
),
|
|
1646
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1647
|
+
"div",
|
|
1648
|
+
{
|
|
1649
|
+
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`,
|
|
1650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1651
|
+
"ul",
|
|
1652
|
+
{
|
|
1653
|
+
id: isCombobox ? listboxId : void 0,
|
|
1654
|
+
role: isCombobox ? "listbox" : void 0,
|
|
1655
|
+
className: "h-auto max-h-200 overflow-y-auto cursor-pointer",
|
|
1656
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1657
|
+
"div",
|
|
1658
|
+
{
|
|
1659
|
+
onClick: () => {
|
|
1660
|
+
setValue(item);
|
|
1661
|
+
if (isCombobox) setQuery(item.label);
|
|
1662
|
+
setIsOpen(false);
|
|
1663
|
+
},
|
|
1664
|
+
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",
|
|
1665
|
+
children: [
|
|
1666
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
|
|
1667
|
+
value.value === item.value && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconCheck, { className: "h-20 w-20" })
|
|
1668
|
+
]
|
|
1669
|
+
}
|
|
1670
|
+
) }, idx)) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("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" })
|
|
1671
|
+
}
|
|
1672
|
+
)
|
|
1466
1673
|
}
|
|
1467
1674
|
)
|
|
1468
1675
|
] }),
|
|
1469
|
-
error ? /* @__PURE__ */ (0,
|
|
1676
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-caption-caption text-left items-left text-dropdown-text-danger", children: error }) : helperText ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1470
1677
|
"p",
|
|
1471
1678
|
{
|
|
1472
|
-
className: `text-caption-caption text-left items-left text-dropdown-text-
|
|
1473
|
-
children:
|
|
1679
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-secondary"}`,
|
|
1680
|
+
children: helperText
|
|
1474
1681
|
}
|
|
1475
|
-
) : /* @__PURE__ */ (0,
|
|
1682
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {})
|
|
1476
1683
|
] });
|
|
1477
1684
|
}
|
|
1478
1685
|
);
|
|
1479
1686
|
Dropdown.displayName = "Dropdown";
|
|
1480
1687
|
|
|
1481
1688
|
// src/components/FinancialLogo/FinancialLogo.tsx
|
|
1482
|
-
var
|
|
1483
|
-
var
|
|
1689
|
+
var import_react14 = require("react");
|
|
1690
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1484
1691
|
var inlineClasses2 = {
|
|
1485
1692
|
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
1486
1693
|
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
@@ -1510,34 +1717,34 @@ var inlineIconClasses2 = {
|
|
|
1510
1717
|
common: "text-alert-inline-common-icon"
|
|
1511
1718
|
};
|
|
1512
1719
|
function InfoIcon2({ className }) {
|
|
1513
|
-
return /* @__PURE__ */ (0,
|
|
1720
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" }) });
|
|
1514
1721
|
}
|
|
1515
1722
|
function SuccessIcon2({ className }) {
|
|
1516
|
-
return /* @__PURE__ */ (0,
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1723
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1724
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1519
1726
|
] });
|
|
1520
1727
|
}
|
|
1521
|
-
function
|
|
1522
|
-
return /* @__PURE__ */ (0,
|
|
1728
|
+
function WarningIcon3({ className }) {
|
|
1729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" }) });
|
|
1523
1730
|
}
|
|
1524
1731
|
function DangerIcon2({ className }) {
|
|
1525
|
-
return /* @__PURE__ */ (0,
|
|
1732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" }) });
|
|
1526
1733
|
}
|
|
1527
1734
|
function CommonIcon({ className }) {
|
|
1528
|
-
return /* @__PURE__ */ (0,
|
|
1735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" }) });
|
|
1529
1736
|
}
|
|
1530
|
-
function
|
|
1531
|
-
return /* @__PURE__ */ (0,
|
|
1737
|
+
function CloseIcon4({ className }) {
|
|
1738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1532
1739
|
}
|
|
1533
1740
|
var defaultIcons2 = {
|
|
1534
1741
|
info: InfoIcon2,
|
|
1535
1742
|
success: SuccessIcon2,
|
|
1536
|
-
warning:
|
|
1743
|
+
warning: WarningIcon3,
|
|
1537
1744
|
danger: DangerIcon2,
|
|
1538
1745
|
common: CommonIcon
|
|
1539
1746
|
};
|
|
1540
|
-
var FinancialLogo = (0,
|
|
1747
|
+
var FinancialLogo = (0, import_react14.forwardRef)(
|
|
1541
1748
|
(_a, ref) => {
|
|
1542
1749
|
var _b = _a, {
|
|
1543
1750
|
variant = "info",
|
|
@@ -1573,22 +1780,22 @@ var FinancialLogo = (0, import_react13.forwardRef)(
|
|
|
1573
1780
|
variantClass,
|
|
1574
1781
|
className
|
|
1575
1782
|
].filter(Boolean).join(" ");
|
|
1576
|
-
return /* @__PURE__ */ (0,
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1579
|
-
title && /* @__PURE__ */ (0,
|
|
1580
|
-
description && /* @__PURE__ */ (0,
|
|
1783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
1784
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `shrink-0 mt-2 ${iconColorClass}`, children: icon != null ? icon : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
1785
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
1786
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm font-medium leading-20", children: title }),
|
|
1787
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
|
|
1581
1788
|
children
|
|
1582
1789
|
] }),
|
|
1583
|
-
action && /* @__PURE__ */ (0,
|
|
1584
|
-
onClose && /* @__PURE__ */ (0,
|
|
1790
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
|
|
1791
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1585
1792
|
"button",
|
|
1586
1793
|
{
|
|
1587
1794
|
type: "button",
|
|
1588
1795
|
onClick: onClose,
|
|
1589
1796
|
className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
|
|
1590
1797
|
"aria-label": "Close",
|
|
1591
|
-
children: /* @__PURE__ */ (0,
|
|
1798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CloseIcon4, { className: "h-16 w-16" })
|
|
1592
1799
|
}
|
|
1593
1800
|
)
|
|
1594
1801
|
] }));
|
|
@@ -1597,9 +1804,9 @@ var FinancialLogo = (0, import_react13.forwardRef)(
|
|
|
1597
1804
|
FinancialLogo.displayName = "FinancialLogo";
|
|
1598
1805
|
|
|
1599
1806
|
// src/components/Icon/Icon.tsx
|
|
1600
|
-
var
|
|
1601
|
-
var
|
|
1602
|
-
var Icon = (0,
|
|
1807
|
+
var import_react15 = require("react");
|
|
1808
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1809
|
+
var Icon = (0, import_react15.forwardRef)(
|
|
1603
1810
|
(_a, ref) => {
|
|
1604
1811
|
var _b = _a, {
|
|
1605
1812
|
name,
|
|
@@ -1627,7 +1834,7 @@ var Icon = (0, import_react14.forwardRef)(
|
|
|
1627
1834
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
1628
1835
|
className
|
|
1629
1836
|
].filter(Boolean).join(" ");
|
|
1630
|
-
return /* @__PURE__ */ (0,
|
|
1837
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1631
1838
|
"span",
|
|
1632
1839
|
__spreadProps(__spreadValues({
|
|
1633
1840
|
ref,
|
|
@@ -1650,8 +1857,8 @@ var Icon = (0, import_react14.forwardRef)(
|
|
|
1650
1857
|
Icon.displayName = "Icon";
|
|
1651
1858
|
|
|
1652
1859
|
// src/components/Link/Link.tsx
|
|
1653
|
-
var
|
|
1654
|
-
var
|
|
1860
|
+
var import_react16 = require("react");
|
|
1861
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1655
1862
|
var linkStyleClasses = {
|
|
1656
1863
|
brand: "font-sans text-link-text-enabled",
|
|
1657
1864
|
white: "font-sans text-link-text-enabled-inverse",
|
|
@@ -1673,12 +1880,12 @@ var iconVariantClasses = {
|
|
|
1673
1880
|
lg: "w-24 h-24"
|
|
1674
1881
|
};
|
|
1675
1882
|
function SuccessIcon3({ className }) {
|
|
1676
|
-
return /* @__PURE__ */ (0,
|
|
1677
|
-
/* @__PURE__ */ (0,
|
|
1678
|
-
/* @__PURE__ */ (0,
|
|
1883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1884
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
1885
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1679
1886
|
] });
|
|
1680
1887
|
}
|
|
1681
|
-
var Link = (0,
|
|
1888
|
+
var Link = (0, import_react16.forwardRef)(
|
|
1682
1889
|
(_a, ref) => {
|
|
1683
1890
|
var _b = _a, {
|
|
1684
1891
|
variant = "sm",
|
|
@@ -1709,18 +1916,18 @@ var Link = (0, import_react15.forwardRef)(
|
|
|
1709
1916
|
variantClass,
|
|
1710
1917
|
className
|
|
1711
1918
|
].filter(Boolean).join(" ");
|
|
1712
|
-
return /* @__PURE__ */ (0,
|
|
1713
|
-
/* @__PURE__ */ (0,
|
|
1714
|
-
icon && !isInline ? /* @__PURE__ */ (0,
|
|
1919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "link", className: classes }, rest), { children: [
|
|
1920
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("a", { href, target: "_blank", rel: "noopener noreferrer", children: text }),
|
|
1921
|
+
icon && !isInline ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SuccessIcon3, { className: iconClass }) : null
|
|
1715
1922
|
] }));
|
|
1716
1923
|
}
|
|
1717
1924
|
);
|
|
1718
1925
|
Link.displayName = "Link";
|
|
1719
1926
|
|
|
1720
1927
|
// src/components/Radio/Radio.tsx
|
|
1721
|
-
var
|
|
1722
|
-
var
|
|
1723
|
-
var Radio = (0,
|
|
1928
|
+
var import_react17 = require("react");
|
|
1929
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1930
|
+
var Radio = (0, import_react17.forwardRef)(
|
|
1724
1931
|
(_a, ref) => {
|
|
1725
1932
|
var _b = _a, {
|
|
1726
1933
|
size = "sm",
|
|
@@ -1745,20 +1952,20 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1745
1952
|
"id",
|
|
1746
1953
|
"name"
|
|
1747
1954
|
]);
|
|
1748
|
-
const reactId = (0,
|
|
1955
|
+
const reactId = (0, import_react17.useId)();
|
|
1749
1956
|
const inputId = id != null ? id : reactId;
|
|
1750
|
-
return /* @__PURE__ */ (0,
|
|
1957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1751
1958
|
"div",
|
|
1752
1959
|
{
|
|
1753
1960
|
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
1754
|
-
children: /* @__PURE__ */ (0,
|
|
1961
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1755
1962
|
"label",
|
|
1756
1963
|
{
|
|
1757
1964
|
htmlFor: inputId,
|
|
1758
1965
|
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
1759
1966
|
children: [
|
|
1760
|
-
/* @__PURE__ */ (0,
|
|
1761
|
-
/* @__PURE__ */ (0,
|
|
1967
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
1968
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1762
1969
|
"input",
|
|
1763
1970
|
__spreadValues({
|
|
1764
1971
|
ref,
|
|
@@ -1771,14 +1978,14 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1771
1978
|
name
|
|
1772
1979
|
}, rest)
|
|
1773
1980
|
),
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1981
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1775
1982
|
"div",
|
|
1776
1983
|
{
|
|
1777
1984
|
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
1778
1985
|
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
1779
1986
|
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
1780
1987
|
`,
|
|
1781
|
-
children: /* @__PURE__ */ (0,
|
|
1988
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1782
1989
|
"span",
|
|
1783
1990
|
{
|
|
1784
1991
|
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
@@ -1789,12 +1996,12 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1789
1996
|
}
|
|
1790
1997
|
)
|
|
1791
1998
|
] }),
|
|
1792
|
-
/* @__PURE__ */ (0,
|
|
1999
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1793
2000
|
"div",
|
|
1794
2001
|
{
|
|
1795
2002
|
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
1796
2003
|
children: [
|
|
1797
|
-
/* @__PURE__ */ (0,
|
|
2004
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1798
2005
|
"p",
|
|
1799
2006
|
{
|
|
1800
2007
|
className: `
|
|
@@ -1804,7 +2011,7 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1804
2011
|
children: label
|
|
1805
2012
|
}
|
|
1806
2013
|
),
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
2014
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1808
2015
|
"p",
|
|
1809
2016
|
{
|
|
1810
2017
|
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
@@ -1824,18 +2031,18 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1824
2031
|
Radio.displayName = "Radio";
|
|
1825
2032
|
|
|
1826
2033
|
// src/components/SegmentControl/SegmentControl.tsx
|
|
1827
|
-
var
|
|
1828
|
-
var
|
|
1829
|
-
var SegmentControl = (0,
|
|
2034
|
+
var import_react18 = require("react");
|
|
2035
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2036
|
+
var SegmentControl = (0, import_react18.forwardRef)(
|
|
1830
2037
|
(_a, ref) => {
|
|
1831
2038
|
var _b = _a, { size = "md", items, selected, setSelected, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "className"]);
|
|
1832
|
-
return /* @__PURE__ */ (0,
|
|
2039
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1833
2040
|
"div",
|
|
1834
2041
|
__spreadProps(__spreadValues({
|
|
1835
2042
|
ref,
|
|
1836
2043
|
className: `bg-background-tertiary rounded-full flex flex-row items-center justify-center p-4 gap-4 ${className}`
|
|
1837
2044
|
}, rest), {
|
|
1838
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
2045
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1839
2046
|
"div",
|
|
1840
2047
|
{
|
|
1841
2048
|
onClick: () => setSelected == null ? void 0 : setSelected(item.value),
|
|
@@ -1852,8 +2059,8 @@ var SegmentControl = (0, import_react17.forwardRef)(
|
|
|
1852
2059
|
SegmentControl.displayName = "SegmentControl";
|
|
1853
2060
|
|
|
1854
2061
|
// src/components/Slider/Slider.tsx
|
|
1855
|
-
var
|
|
1856
|
-
var
|
|
2062
|
+
var import_react19 = require("react");
|
|
2063
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1857
2064
|
var sizeConfig = {
|
|
1858
2065
|
small: {
|
|
1859
2066
|
trackH: "h-4",
|
|
@@ -1884,7 +2091,7 @@ var sizeConfig = {
|
|
|
1884
2091
|
}
|
|
1885
2092
|
};
|
|
1886
2093
|
function ChevronGlyphs({ size, color }) {
|
|
1887
|
-
return /* @__PURE__ */ (0,
|
|
2094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1888
2095
|
"svg",
|
|
1889
2096
|
{
|
|
1890
2097
|
width: size,
|
|
@@ -1894,7 +2101,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1894
2101
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1895
2102
|
"aria-hidden": "true",
|
|
1896
2103
|
children: [
|
|
1897
|
-
/* @__PURE__ */ (0,
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1898
2105
|
"path",
|
|
1899
2106
|
{
|
|
1900
2107
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -1904,7 +2111,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1904
2111
|
strokeLinejoin: "round"
|
|
1905
2112
|
}
|
|
1906
2113
|
),
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
2114
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1908
2115
|
"path",
|
|
1909
2116
|
{
|
|
1910
2117
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -1918,7 +2125,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1918
2125
|
}
|
|
1919
2126
|
);
|
|
1920
2127
|
}
|
|
1921
|
-
var Slider = (0,
|
|
2128
|
+
var Slider = (0, import_react19.forwardRef)(
|
|
1922
2129
|
(_a, ref) => {
|
|
1923
2130
|
var _b = _a, {
|
|
1924
2131
|
size = "medium",
|
|
@@ -1953,15 +2160,15 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
1953
2160
|
"onChange",
|
|
1954
2161
|
"aria-label"
|
|
1955
2162
|
]);
|
|
1956
|
-
const reactId = (0,
|
|
2163
|
+
const reactId = (0, import_react19.useId)();
|
|
1957
2164
|
const inputId = id != null ? id : reactId;
|
|
1958
2165
|
const sz = sizeConfig[size];
|
|
1959
2166
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
1960
2167
|
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
1961
2168
|
const isControlled = controlledValue !== void 0;
|
|
1962
|
-
const [internalValue, setInternalValue] = (0,
|
|
2169
|
+
const [internalValue, setInternalValue] = (0, import_react19.useState)(defaultValue != null ? defaultValue : min);
|
|
1963
2170
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
1964
|
-
const handleChange = (0,
|
|
2171
|
+
const handleChange = (0, import_react19.useCallback)(
|
|
1965
2172
|
(e) => {
|
|
1966
2173
|
const val = Number(e.target.value);
|
|
1967
2174
|
if (!isControlled) {
|
|
@@ -1981,13 +2188,13 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
1981
2188
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
1982
2189
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
1983
2190
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
1984
|
-
return /* @__PURE__ */ (0,
|
|
2191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1985
2192
|
"div",
|
|
1986
2193
|
{
|
|
1987
2194
|
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
1988
2195
|
children: [
|
|
1989
|
-
(label || showValue && !disabled) && /* @__PURE__ */ (0,
|
|
1990
|
-
label && /* @__PURE__ */ (0,
|
|
2196
|
+
(label || showValue && !disabled) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2197
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1991
2198
|
"label",
|
|
1992
2199
|
{
|
|
1993
2200
|
htmlFor: inputId,
|
|
@@ -2000,7 +2207,7 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2000
2207
|
children: label
|
|
2001
2208
|
}
|
|
2002
2209
|
),
|
|
2003
|
-
showValue && /* @__PURE__ */ (0,
|
|
2210
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2004
2211
|
"span",
|
|
2005
2212
|
{
|
|
2006
2213
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -2008,7 +2215,7 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2008
2215
|
}
|
|
2009
2216
|
)
|
|
2010
2217
|
] }),
|
|
2011
|
-
/* @__PURE__ */ (0,
|
|
2218
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2012
2219
|
"div",
|
|
2013
2220
|
{
|
|
2014
2221
|
className: [
|
|
@@ -2017,7 +2224,7 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2017
2224
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2018
2225
|
].join(" "),
|
|
2019
2226
|
children: [
|
|
2020
|
-
/* @__PURE__ */ (0,
|
|
2227
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2021
2228
|
"div",
|
|
2022
2229
|
{
|
|
2023
2230
|
className: [
|
|
@@ -2027,14 +2234,14 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2027
2234
|
].join(" ")
|
|
2028
2235
|
}
|
|
2029
2236
|
),
|
|
2030
|
-
/* @__PURE__ */ (0,
|
|
2237
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2031
2238
|
"div",
|
|
2032
2239
|
{
|
|
2033
2240
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
2034
2241
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
2035
2242
|
}
|
|
2036
2243
|
),
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2244
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2038
2245
|
"input",
|
|
2039
2246
|
__spreadValues({
|
|
2040
2247
|
ref,
|
|
@@ -2055,7 +2262,7 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2055
2262
|
].join(" ")
|
|
2056
2263
|
}, rest)
|
|
2057
2264
|
),
|
|
2058
|
-
/* @__PURE__ */ (0,
|
|
2265
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2059
2266
|
"div",
|
|
2060
2267
|
{
|
|
2061
2268
|
className: [
|
|
@@ -2068,13 +2275,13 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2068
2275
|
!disabled && "peer-hover:shadow-medium"
|
|
2069
2276
|
].filter(Boolean).join(" "),
|
|
2070
2277
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
2071
|
-
children: /* @__PURE__ */ (0,
|
|
2278
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
2072
2279
|
}
|
|
2073
2280
|
)
|
|
2074
2281
|
]
|
|
2075
2282
|
}
|
|
2076
2283
|
),
|
|
2077
|
-
description && /* @__PURE__ */ (0,
|
|
2284
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2078
2285
|
"span",
|
|
2079
2286
|
{
|
|
2080
2287
|
id: ariaDescriptionId,
|
|
@@ -2090,9 +2297,9 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2090
2297
|
Slider.displayName = "Slider";
|
|
2091
2298
|
|
|
2092
2299
|
// src/components/Tab/Tab.tsx
|
|
2093
|
-
var
|
|
2094
|
-
var
|
|
2095
|
-
var Tab = (0,
|
|
2300
|
+
var import_react20 = require("react");
|
|
2301
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2302
|
+
var Tab = (0, import_react20.forwardRef)(
|
|
2096
2303
|
(_a, ref) => {
|
|
2097
2304
|
var _b = _a, {
|
|
2098
2305
|
size = "md",
|
|
@@ -2111,7 +2318,7 @@ var Tab = (0, import_react19.forwardRef)(
|
|
|
2111
2318
|
"setSelected",
|
|
2112
2319
|
"className"
|
|
2113
2320
|
]);
|
|
2114
|
-
return /* @__PURE__ */ (0,
|
|
2321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2115
2322
|
"div",
|
|
2116
2323
|
__spreadProps(__spreadValues({
|
|
2117
2324
|
ref,
|
|
@@ -2129,301 +2336,399 @@ var Tab = (0, import_react19.forwardRef)(
|
|
|
2129
2336
|
Tab.displayName = "Tab";
|
|
2130
2337
|
|
|
2131
2338
|
// src/components/TextArea/TextArea.tsx
|
|
2132
|
-
var
|
|
2133
|
-
var
|
|
2134
|
-
var TextArea = (0,
|
|
2339
|
+
var import_react21 = require("react");
|
|
2340
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2341
|
+
var TextArea = (0, import_react21.forwardRef)(
|
|
2135
2342
|
(_a, ref) => {
|
|
2136
2343
|
var _b = _a, {
|
|
2137
|
-
maxText = 500,
|
|
2138
|
-
height = 100,
|
|
2139
2344
|
error,
|
|
2140
2345
|
label,
|
|
2141
2346
|
placeholder,
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2347
|
+
helperText,
|
|
2348
|
+
optional = false,
|
|
2349
|
+
success = false,
|
|
2350
|
+
pending = false,
|
|
2351
|
+
clearable = true,
|
|
2352
|
+
disabled = false,
|
|
2353
|
+
showCounter = true,
|
|
2354
|
+
maxLength = 500,
|
|
2355
|
+
height = 100,
|
|
2149
2356
|
value,
|
|
2150
|
-
onChange
|
|
2357
|
+
onChange,
|
|
2358
|
+
onFocus,
|
|
2359
|
+
onBlur,
|
|
2360
|
+
className
|
|
2151
2361
|
} = _b, props = __objRest(_b, [
|
|
2152
|
-
"maxText",
|
|
2153
|
-
"height",
|
|
2154
2362
|
"error",
|
|
2155
2363
|
"label",
|
|
2156
2364
|
"placeholder",
|
|
2157
|
-
"
|
|
2158
|
-
"
|
|
2159
|
-
"
|
|
2160
|
-
"
|
|
2161
|
-
"
|
|
2162
|
-
"isClearable",
|
|
2365
|
+
"helperText",
|
|
2366
|
+
"optional",
|
|
2367
|
+
"success",
|
|
2368
|
+
"pending",
|
|
2369
|
+
"clearable",
|
|
2163
2370
|
"disabled",
|
|
2371
|
+
"showCounter",
|
|
2372
|
+
"maxLength",
|
|
2373
|
+
"height",
|
|
2164
2374
|
"value",
|
|
2165
|
-
"onChange"
|
|
2375
|
+
"onChange",
|
|
2376
|
+
"onFocus",
|
|
2377
|
+
"onBlur",
|
|
2378
|
+
"className"
|
|
2166
2379
|
]);
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2380
|
+
var _a2;
|
|
2381
|
+
const [isFocused, setIsFocused] = (0, import_react21.useState)(false);
|
|
2382
|
+
const isActive = isFocused && !!value;
|
|
2383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2384
|
+
label || showCounter ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w-full flex justify-between items-center gap-8", children: [
|
|
2385
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2171
2386
|
"p",
|
|
2172
2387
|
{
|
|
2173
|
-
className: `text-label-medium text-left items-left ${
|
|
2174
|
-
children:
|
|
2388
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-primary"}`,
|
|
2389
|
+
children: [
|
|
2390
|
+
label,
|
|
2391
|
+
optional && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-text-area-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2392
|
+
]
|
|
2175
2393
|
}
|
|
2176
|
-
) : /* @__PURE__ */ (0,
|
|
2177
|
-
|
|
2178
|
-
"
|
|
2179
|
-
(value == null ? void 0 : value.length) || 0,
|
|
2180
|
-
" / ",
|
|
2181
|
-
maxText
|
|
2182
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, {})
|
|
2183
|
-
] }),
|
|
2184
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "relative w-full", children: [
|
|
2185
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2186
|
-
"textarea",
|
|
2187
|
-
__spreadValues({
|
|
2188
|
-
ref,
|
|
2189
|
-
name: "text-input",
|
|
2190
|
-
placeholder,
|
|
2191
|
-
disabled: isDisabled || disabled || isLoading,
|
|
2192
|
-
onFocus: () => setIsFocused(true),
|
|
2193
|
-
onBlur: () => setIsFocused(false),
|
|
2194
|
-
value,
|
|
2195
|
-
onChange,
|
|
2196
|
-
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"}`
|
|
2197
|
-
}, props)
|
|
2198
|
-
),
|
|
2199
|
-
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2200
|
-
Loading,
|
|
2394
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", {}),
|
|
2395
|
+
showCounter && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2396
|
+
"p",
|
|
2201
2397
|
{
|
|
2202
|
-
|
|
2203
|
-
|
|
2398
|
+
className: `shrink-0 text-caption-caption ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-tertiary"}`,
|
|
2399
|
+
children: [
|
|
2400
|
+
(_a2 = value == null ? void 0 : value.length) != null ? _a2 : 0,
|
|
2401
|
+
"/",
|
|
2402
|
+
maxLength
|
|
2403
|
+
]
|
|
2204
2404
|
}
|
|
2205
|
-
)
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2405
|
+
)
|
|
2406
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {}),
|
|
2407
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2408
|
+
"div",
|
|
2409
|
+
{
|
|
2410
|
+
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 : ""}`,
|
|
2411
|
+
children: [
|
|
2412
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2413
|
+
"textarea",
|
|
2414
|
+
__spreadValues({
|
|
2415
|
+
ref,
|
|
2416
|
+
placeholder,
|
|
2417
|
+
disabled: disabled || pending,
|
|
2418
|
+
maxLength,
|
|
2419
|
+
style: { height },
|
|
2420
|
+
onFocus: (e) => {
|
|
2421
|
+
setIsFocused(true);
|
|
2422
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
2423
|
+
},
|
|
2424
|
+
onBlur: (e) => {
|
|
2425
|
+
setIsFocused(false);
|
|
2426
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
2427
|
+
},
|
|
2428
|
+
value,
|
|
2429
|
+
onChange,
|
|
2430
|
+
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"}`
|
|
2431
|
+
}, props)
|
|
2432
|
+
),
|
|
2433
|
+
pending ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Loading, { size: "sm", className: "shrink-0 absolute right-12 top-12" }) : clearable && isFocused && value ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2434
|
+
IconButton,
|
|
2220
2435
|
{
|
|
2221
|
-
|
|
2222
|
-
|
|
2436
|
+
size: "s",
|
|
2437
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2438
|
+
className: "absolute right-6 top-6",
|
|
2439
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2440
|
+
"svg",
|
|
2441
|
+
{
|
|
2442
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2443
|
+
width: "20",
|
|
2444
|
+
height: "20",
|
|
2445
|
+
viewBox: "0 0 20 20",
|
|
2446
|
+
fill: "none",
|
|
2447
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2448
|
+
"path",
|
|
2449
|
+
{
|
|
2450
|
+
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",
|
|
2451
|
+
fill: "currentColor"
|
|
2452
|
+
}
|
|
2453
|
+
)
|
|
2454
|
+
}
|
|
2455
|
+
),
|
|
2456
|
+
onMouseDown: (e) => {
|
|
2457
|
+
e.preventDefault();
|
|
2458
|
+
},
|
|
2459
|
+
onClick: () => {
|
|
2460
|
+
onChange == null ? void 0 : onChange({
|
|
2461
|
+
target: { value: "" }
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2223
2464
|
}
|
|
2224
|
-
)
|
|
2225
|
-
|
|
2226
|
-
) : isVertify ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2227
|
-
"svg",
|
|
2228
|
-
{
|
|
2229
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2230
|
-
width: "20",
|
|
2231
|
-
height: "20",
|
|
2232
|
-
viewBox: "0 0 20 20",
|
|
2233
|
-
fill: "none",
|
|
2234
|
-
className: "text-green-600 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2235
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2236
|
-
"path",
|
|
2465
|
+
) : success ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2466
|
+
"svg",
|
|
2237
2467
|
{
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2468
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2469
|
+
width: "20",
|
|
2470
|
+
height: "20",
|
|
2471
|
+
viewBox: "0 0 20 20",
|
|
2472
|
+
fill: "none",
|
|
2473
|
+
className: "shrink-0 text-accent-success flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2474
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2475
|
+
"path",
|
|
2476
|
+
{
|
|
2477
|
+
fillRule: "evenodd",
|
|
2478
|
+
clipRule: "evenodd",
|
|
2479
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2480
|
+
fill: "currentColor"
|
|
2481
|
+
}
|
|
2482
|
+
)
|
|
2242
2483
|
}
|
|
2243
|
-
)
|
|
2244
|
-
|
|
2245
|
-
) : error ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2246
|
-
"svg",
|
|
2247
|
-
{
|
|
2248
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2249
|
-
width: "20",
|
|
2250
|
-
height: "20",
|
|
2251
|
-
viewBox: "0 0 20 20",
|
|
2252
|
-
fill: "none",
|
|
2253
|
-
className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2254
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2255
|
-
"path",
|
|
2484
|
+
) : error ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2485
|
+
"svg",
|
|
2256
2486
|
{
|
|
2257
|
-
|
|
2258
|
-
|
|
2487
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2488
|
+
width: "20",
|
|
2489
|
+
height: "20",
|
|
2490
|
+
viewBox: "0 0 20 20",
|
|
2491
|
+
fill: "none",
|
|
2492
|
+
className: "shrink-0 text-text-area-text-danger flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2493
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2494
|
+
"path",
|
|
2495
|
+
{
|
|
2496
|
+
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",
|
|
2497
|
+
fill: "currentColor"
|
|
2498
|
+
}
|
|
2499
|
+
)
|
|
2259
2500
|
}
|
|
2260
|
-
)
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
error ? /* @__PURE__ */ (0,
|
|
2501
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {})
|
|
2502
|
+
]
|
|
2503
|
+
}
|
|
2504
|
+
),
|
|
2505
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-caption-caption text-left items-left text-text-area-text-danger", children: error }) : helperText ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2506
|
+
"p",
|
|
2507
|
+
{
|
|
2508
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-secondary"}`,
|
|
2509
|
+
children: helperText
|
|
2510
|
+
}
|
|
2511
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {})
|
|
2265
2512
|
] });
|
|
2266
2513
|
}
|
|
2267
2514
|
);
|
|
2268
2515
|
TextArea.displayName = "TextArea";
|
|
2269
2516
|
|
|
2270
2517
|
// src/components/TextField/TextField.tsx
|
|
2271
|
-
var
|
|
2272
|
-
var
|
|
2273
|
-
var TextField = (0,
|
|
2518
|
+
var import_react22 = require("react");
|
|
2519
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2520
|
+
var TextField = (0, import_react22.forwardRef)(
|
|
2274
2521
|
(_a, ref) => {
|
|
2275
2522
|
var _b = _a, {
|
|
2276
|
-
|
|
2523
|
+
size = "md",
|
|
2277
2524
|
error,
|
|
2278
2525
|
label,
|
|
2279
2526
|
placeholder,
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
disabled,
|
|
2527
|
+
helperText,
|
|
2528
|
+
prefix,
|
|
2529
|
+
suffix,
|
|
2530
|
+
optional = false,
|
|
2531
|
+
success = false,
|
|
2532
|
+
pending = false,
|
|
2533
|
+
clearable = true,
|
|
2534
|
+
disabled = false,
|
|
2288
2535
|
type,
|
|
2289
2536
|
value,
|
|
2290
|
-
onChange
|
|
2537
|
+
onChange,
|
|
2538
|
+
onFocus,
|
|
2539
|
+
onBlur,
|
|
2540
|
+
className
|
|
2291
2541
|
} = _b, props = __objRest(_b, [
|
|
2292
|
-
"
|
|
2542
|
+
"size",
|
|
2293
2543
|
"error",
|
|
2294
2544
|
"label",
|
|
2295
2545
|
"placeholder",
|
|
2296
|
-
"
|
|
2297
|
-
"
|
|
2298
|
-
"
|
|
2299
|
-
"
|
|
2300
|
-
"
|
|
2301
|
-
"
|
|
2302
|
-
"
|
|
2546
|
+
"helperText",
|
|
2547
|
+
"prefix",
|
|
2548
|
+
"suffix",
|
|
2549
|
+
"optional",
|
|
2550
|
+
"success",
|
|
2551
|
+
"pending",
|
|
2552
|
+
"clearable",
|
|
2303
2553
|
"disabled",
|
|
2304
2554
|
"type",
|
|
2305
2555
|
"value",
|
|
2306
|
-
"onChange"
|
|
2556
|
+
"onChange",
|
|
2557
|
+
"onFocus",
|
|
2558
|
+
"onBlur",
|
|
2559
|
+
"className"
|
|
2307
2560
|
]);
|
|
2308
|
-
const [isFocused, setIsFocused] = (0,
|
|
2309
|
-
|
|
2310
|
-
|
|
2561
|
+
const [isFocused, setIsFocused] = (0, import_react22.useState)(false);
|
|
2562
|
+
const isActive = isFocused && !!value;
|
|
2563
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
2564
|
+
const inputRef = (0, import_react22.useRef)(null);
|
|
2565
|
+
(0, import_react22.useImperativeHandle)(ref, () => inputRef.current);
|
|
2566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2567
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2311
2568
|
"p",
|
|
2312
2569
|
{
|
|
2313
|
-
className: `text-label-medium text-left items-left ${
|
|
2570
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
|
|
2314
2571
|
children: [
|
|
2315
2572
|
label,
|
|
2316
|
-
" ",
|
|
2317
|
-
isUnrequired && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-gray-400", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2573
|
+
optional && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-text-field-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2318
2574
|
]
|
|
2319
2575
|
}
|
|
2320
|
-
) : /* @__PURE__ */ (0,
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
disabled: isDisabled || disabled || isLoading,
|
|
2329
|
-
onFocus: () => setIsFocused(true),
|
|
2330
|
-
onBlur: () => setIsFocused(false),
|
|
2331
|
-
value,
|
|
2332
|
-
onChange,
|
|
2333
|
-
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"}`
|
|
2334
|
-
}, props)
|
|
2335
|
-
),
|
|
2336
|
-
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2337
|
-
Loading,
|
|
2338
|
-
{
|
|
2339
|
-
size: "sm",
|
|
2340
|
-
className: `absolute right-16 top-1/2 -translate-y-1/2`
|
|
2341
|
-
}
|
|
2342
|
-
) : isClearable && isFocused && value ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2343
|
-
"svg",
|
|
2344
|
-
{
|
|
2345
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2346
|
-
width: "20",
|
|
2347
|
-
height: "20",
|
|
2348
|
-
viewBox: "0 0 20 20",
|
|
2349
|
-
fill: "none",
|
|
2350
|
-
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2351
|
-
onMouseDown: (e) => {
|
|
2576
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, {}),
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2578
|
+
"div",
|
|
2579
|
+
{
|
|
2580
|
+
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 : ""}`,
|
|
2581
|
+
onMouseDown: (e) => {
|
|
2582
|
+
var _a2;
|
|
2583
|
+
if (e.target !== inputRef.current && !disabled) {
|
|
2352
2584
|
e.preventDefault();
|
|
2353
|
-
|
|
2354
|
-
}
|
|
2355
|
-
|
|
2356
|
-
|
|
2585
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
children: [
|
|
2589
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2590
|
+
"span",
|
|
2357
2591
|
{
|
|
2358
|
-
|
|
2359
|
-
|
|
2592
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2593
|
+
children: prefix
|
|
2360
2594
|
}
|
|
2361
|
-
)
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2595
|
+
),
|
|
2596
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2597
|
+
"input",
|
|
2598
|
+
__spreadValues({
|
|
2599
|
+
ref: inputRef,
|
|
2600
|
+
type: type || "text",
|
|
2601
|
+
placeholder,
|
|
2602
|
+
disabled: disabled || pending,
|
|
2603
|
+
onFocus: (e) => {
|
|
2604
|
+
setIsFocused(true);
|
|
2605
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
2606
|
+
},
|
|
2607
|
+
onBlur: (e) => {
|
|
2608
|
+
setIsFocused(false);
|
|
2609
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
2610
|
+
},
|
|
2611
|
+
value,
|
|
2612
|
+
onChange,
|
|
2613
|
+
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"}`
|
|
2614
|
+
}, props)
|
|
2615
|
+
),
|
|
2616
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2617
|
+
"span",
|
|
2374
2618
|
{
|
|
2375
|
-
"
|
|
2376
|
-
|
|
2377
|
-
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2378
|
-
fill: "#16A34A"
|
|
2619
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2620
|
+
children: suffix
|
|
2379
2621
|
}
|
|
2380
|
-
)
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
"svg",
|
|
2384
|
-
{
|
|
2385
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2386
|
-
width: "20",
|
|
2387
|
-
height: "20",
|
|
2388
|
-
viewBox: "0 0 20 20",
|
|
2389
|
-
fill: "none",
|
|
2390
|
-
className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2391
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2392
|
-
"path",
|
|
2622
|
+
),
|
|
2623
|
+
(pending || clearable || success || error) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2624
|
+
"span",
|
|
2393
2625
|
{
|
|
2394
|
-
|
|
2395
|
-
|
|
2626
|
+
className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
|
|
2627
|
+
children: pending ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2628
|
+
IconButton,
|
|
2629
|
+
{
|
|
2630
|
+
size: iconButtonSize,
|
|
2631
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2632
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2633
|
+
"svg",
|
|
2634
|
+
{
|
|
2635
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2636
|
+
width: "20",
|
|
2637
|
+
height: "20",
|
|
2638
|
+
viewBox: "0 0 20 20",
|
|
2639
|
+
fill: "none",
|
|
2640
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2641
|
+
"path",
|
|
2642
|
+
{
|
|
2643
|
+
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",
|
|
2644
|
+
fill: "currentColor"
|
|
2645
|
+
}
|
|
2646
|
+
)
|
|
2647
|
+
}
|
|
2648
|
+
),
|
|
2649
|
+
onMouseDown: (e) => {
|
|
2650
|
+
e.preventDefault();
|
|
2651
|
+
},
|
|
2652
|
+
onClick: () => {
|
|
2653
|
+
onChange == null ? void 0 : onChange({
|
|
2654
|
+
target: { value: "" }
|
|
2655
|
+
});
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
) : success ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2659
|
+
"svg",
|
|
2660
|
+
{
|
|
2661
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2662
|
+
width: "20",
|
|
2663
|
+
height: "20",
|
|
2664
|
+
viewBox: "0 0 20 20",
|
|
2665
|
+
fill: "none",
|
|
2666
|
+
className: "text-accent-success flex h-20 w-20 items-center justify-center",
|
|
2667
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2668
|
+
"path",
|
|
2669
|
+
{
|
|
2670
|
+
fillRule: "evenodd",
|
|
2671
|
+
clipRule: "evenodd",
|
|
2672
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2673
|
+
fill: "currentColor"
|
|
2674
|
+
}
|
|
2675
|
+
)
|
|
2676
|
+
}
|
|
2677
|
+
) : error ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2678
|
+
"svg",
|
|
2679
|
+
{
|
|
2680
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2681
|
+
width: "20",
|
|
2682
|
+
height: "20",
|
|
2683
|
+
viewBox: "0 0 20 20",
|
|
2684
|
+
fill: "none",
|
|
2685
|
+
className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
|
|
2686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2687
|
+
"path",
|
|
2688
|
+
{
|
|
2689
|
+
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",
|
|
2690
|
+
fill: "currentColor"
|
|
2691
|
+
}
|
|
2692
|
+
)
|
|
2693
|
+
}
|
|
2694
|
+
) : null
|
|
2396
2695
|
}
|
|
2397
2696
|
)
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
error ? /* @__PURE__ */ (0,
|
|
2697
|
+
]
|
|
2698
|
+
}
|
|
2699
|
+
),
|
|
2700
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-caption-caption text-left items-left text-text-field-text-danger", children: error }) : helperText ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2701
|
+
"p",
|
|
2702
|
+
{
|
|
2703
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
|
|
2704
|
+
children: helperText
|
|
2705
|
+
}
|
|
2706
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, {})
|
|
2402
2707
|
] });
|
|
2403
2708
|
}
|
|
2404
2709
|
);
|
|
2405
2710
|
TextField.displayName = "TextField";
|
|
2406
2711
|
|
|
2407
2712
|
// src/components/Toast/Toast.tsx
|
|
2408
|
-
var
|
|
2409
|
-
var
|
|
2713
|
+
var import_react23 = require("react");
|
|
2714
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2410
2715
|
function CheckCircleIcon({ className }) {
|
|
2411
|
-
return /* @__PURE__ */ (0,
|
|
2412
|
-
/* @__PURE__ */ (0,
|
|
2413
|
-
/* @__PURE__ */ (0,
|
|
2716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2717
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2718
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
2414
2719
|
] });
|
|
2415
2720
|
}
|
|
2416
2721
|
function ProgressIcon({ className }) {
|
|
2417
|
-
return /* @__PURE__ */ (0,
|
|
2722
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loading, { size: "sm", className });
|
|
2418
2723
|
}
|
|
2419
2724
|
function ErrorIcon({ className }) {
|
|
2420
|
-
return /* @__PURE__ */ (0,
|
|
2421
|
-
/* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2727
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
2423
2728
|
] });
|
|
2424
2729
|
}
|
|
2425
|
-
function
|
|
2426
|
-
return /* @__PURE__ */ (0,
|
|
2730
|
+
function CloseIcon5({ className }) {
|
|
2731
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("svg", { className, width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "M12 4 4 12M4 4l8 8", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2427
2732
|
}
|
|
2428
2733
|
var defaultIcons3 = {
|
|
2429
2734
|
default: CheckCircleIcon,
|
|
@@ -2440,7 +2745,7 @@ var iconColorClasses = {
|
|
|
2440
2745
|
progress: "text-toast-progress-icon",
|
|
2441
2746
|
error: "text-toast-error-icon"
|
|
2442
2747
|
};
|
|
2443
|
-
var Toast = (0,
|
|
2748
|
+
var Toast = (0, import_react23.forwardRef)(
|
|
2444
2749
|
(_a, ref) => {
|
|
2445
2750
|
var _b = _a, {
|
|
2446
2751
|
type = "default",
|
|
@@ -2468,10 +2773,10 @@ var Toast = (0, import_react22.forwardRef)(
|
|
|
2468
2773
|
typeClasses[type],
|
|
2469
2774
|
className
|
|
2470
2775
|
].filter(Boolean).join(" ");
|
|
2471
|
-
return /* @__PURE__ */ (0,
|
|
2472
|
-
icon && /* @__PURE__ */ (0,
|
|
2473
|
-
/* @__PURE__ */ (0,
|
|
2474
|
-
actionLabel && onAction && /* @__PURE__ */ (0,
|
|
2776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2777
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: `shrink-0 ${iconColorClasses[type]}`, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(DefaultIcon, { className: "h-20 w-20" }) }),
|
|
2778
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
2779
|
+
actionLabel && onAction && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2475
2780
|
"button",
|
|
2476
2781
|
{
|
|
2477
2782
|
type: "button",
|
|
@@ -2480,14 +2785,14 @@ var Toast = (0, import_react22.forwardRef)(
|
|
|
2480
2785
|
children: actionLabel
|
|
2481
2786
|
}
|
|
2482
2787
|
),
|
|
2483
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
2788
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2484
2789
|
"button",
|
|
2485
2790
|
{
|
|
2486
2791
|
type: "button",
|
|
2487
2792
|
onClick: onDismiss,
|
|
2488
2793
|
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
2489
2794
|
"aria-label": "Dismiss",
|
|
2490
|
-
children: /* @__PURE__ */ (0,
|
|
2795
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CloseIcon5, { className: "h-16 w-16" })
|
|
2491
2796
|
}
|
|
2492
2797
|
)
|
|
2493
2798
|
] }));
|
|
@@ -2496,9 +2801,9 @@ var Toast = (0, import_react22.forwardRef)(
|
|
|
2496
2801
|
Toast.displayName = "Toast";
|
|
2497
2802
|
|
|
2498
2803
|
// src/components/ToggleSwitch/ToggleSwitch.tsx
|
|
2499
|
-
var
|
|
2500
|
-
var
|
|
2501
|
-
var ToggleSwitch = (0,
|
|
2804
|
+
var import_react24 = require("react");
|
|
2805
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2806
|
+
var ToggleSwitch = (0, import_react24.forwardRef)(
|
|
2502
2807
|
(_a, ref) => {
|
|
2503
2808
|
var _b = _a, {
|
|
2504
2809
|
value,
|
|
@@ -2513,14 +2818,14 @@ var ToggleSwitch = (0, import_react23.forwardRef)(
|
|
|
2513
2818
|
"setIsSelected",
|
|
2514
2819
|
"className"
|
|
2515
2820
|
]);
|
|
2516
|
-
return /* @__PURE__ */ (0,
|
|
2821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2517
2822
|
"label",
|
|
2518
2823
|
__spreadProps(__spreadValues({
|
|
2519
2824
|
ref,
|
|
2520
2825
|
className: `inline-flex items-center ${className}`
|
|
2521
2826
|
}, rest), {
|
|
2522
2827
|
children: [
|
|
2523
|
-
/* @__PURE__ */ (0,
|
|
2828
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2524
2829
|
"input",
|
|
2525
2830
|
{
|
|
2526
2831
|
type: "checkbox",
|
|
@@ -2530,7 +2835,7 @@ var ToggleSwitch = (0, import_react23.forwardRef)(
|
|
|
2530
2835
|
onChange: () => !isDisabled && (setIsSelected == null ? void 0 : setIsSelected(!isSelected))
|
|
2531
2836
|
}
|
|
2532
2837
|
),
|
|
2533
|
-
/* @__PURE__ */ (0,
|
|
2838
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2534
2839
|
"div",
|
|
2535
2840
|
{
|
|
2536
2841
|
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 `
|
|
@@ -2544,9 +2849,9 @@ var ToggleSwitch = (0, import_react23.forwardRef)(
|
|
|
2544
2849
|
ToggleSwitch.displayName = "ToggleSwitch";
|
|
2545
2850
|
|
|
2546
2851
|
// src/components/Tooltip/Tooltip.tsx
|
|
2547
|
-
var
|
|
2548
|
-
var
|
|
2549
|
-
var Tooltip = (0,
|
|
2852
|
+
var import_react25 = require("react");
|
|
2853
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2854
|
+
var Tooltip = (0, import_react25.forwardRef)(
|
|
2550
2855
|
(_a, ref) => {
|
|
2551
2856
|
var _b = _a, {
|
|
2552
2857
|
size = "md",
|
|
@@ -2563,10 +2868,10 @@ var Tooltip = (0, import_react24.forwardRef)(
|
|
|
2563
2868
|
"position",
|
|
2564
2869
|
"className"
|
|
2565
2870
|
]);
|
|
2566
|
-
const wrapperRef = (0,
|
|
2567
|
-
const [isVisible, setIsVisible] = (0,
|
|
2568
|
-
const [isHovered, setIsHovered] = (0,
|
|
2569
|
-
(0,
|
|
2871
|
+
const wrapperRef = (0, import_react25.useRef)(null);
|
|
2872
|
+
const [isVisible, setIsVisible] = (0, import_react25.useState)(false);
|
|
2873
|
+
const [isHovered, setIsHovered] = (0, import_react25.useState)(false);
|
|
2874
|
+
(0, import_react25.useEffect)(() => {
|
|
2570
2875
|
const handleClickOutside = (event) => {
|
|
2571
2876
|
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
2572
2877
|
setIsVisible(false);
|
|
@@ -2578,14 +2883,14 @@ var Tooltip = (0, import_react24.forwardRef)(
|
|
|
2578
2883
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2579
2884
|
};
|
|
2580
2885
|
}, []);
|
|
2581
|
-
return /* @__PURE__ */ (0,
|
|
2886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2582
2887
|
"div",
|
|
2583
2888
|
__spreadProps(__spreadValues({
|
|
2584
2889
|
className: `group relative inline-block ${className}`,
|
|
2585
2890
|
ref
|
|
2586
2891
|
}, rest), {
|
|
2587
2892
|
children: [
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2893
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2589
2894
|
"div",
|
|
2590
2895
|
{
|
|
2591
2896
|
ref: wrapperRef,
|
|
@@ -2602,25 +2907,25 @@ var Tooltip = (0, import_react24.forwardRef)(
|
|
|
2602
2907
|
children
|
|
2603
2908
|
}
|
|
2604
2909
|
),
|
|
2605
|
-
/* @__PURE__ */ (0,
|
|
2910
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2606
2911
|
"div",
|
|
2607
2912
|
{
|
|
2608
2913
|
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"}`}`,
|
|
2609
2914
|
children: [
|
|
2610
|
-
/* @__PURE__ */ (0,
|
|
2915
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2611
2916
|
"span",
|
|
2612
2917
|
{
|
|
2613
2918
|
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`} `
|
|
2614
2919
|
}
|
|
2615
2920
|
),
|
|
2616
|
-
headText ? /* @__PURE__ */ (0,
|
|
2921
|
+
headText ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2617
2922
|
"p",
|
|
2618
2923
|
{
|
|
2619
2924
|
className: `text-sm text-white font-semibold text-center ${text ? "mb-5" : ""}`,
|
|
2620
2925
|
children: headText
|
|
2621
2926
|
}
|
|
2622
|
-
) : /* @__PURE__ */ (0,
|
|
2623
|
-
text ? /* @__PURE__ */ (0,
|
|
2927
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, {}),
|
|
2928
|
+
text ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-xs text-white font-normal text-center text-wrap", children: text }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, {})
|
|
2624
2929
|
]
|
|
2625
2930
|
}
|
|
2626
2931
|
)
|
|
@@ -2636,15 +2941,16 @@ Tooltip.displayName = "Tooltip";
|
|
|
2636
2941
|
AlertBanner,
|
|
2637
2942
|
Avatar,
|
|
2638
2943
|
Badge,
|
|
2639
|
-
BottomSheet,
|
|
2640
2944
|
Branding,
|
|
2641
2945
|
Button,
|
|
2642
2946
|
Checkbox,
|
|
2643
2947
|
Chip,
|
|
2644
2948
|
Dialog,
|
|
2949
|
+
Drawer,
|
|
2645
2950
|
Dropdown,
|
|
2646
2951
|
FinancialLogo,
|
|
2647
2952
|
Icon,
|
|
2953
|
+
IconButton,
|
|
2648
2954
|
Link,
|
|
2649
2955
|
Loading,
|
|
2650
2956
|
Radio,
|