@refinn/core-ui 0.1.9 → 0.1.11
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 +1075 -734
- package/dist/index.d.mts +72 -58
- package/dist/index.d.ts +72 -58
- package/dist/index.js +1064 -708
- package/dist/theme.css +12 -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,
|
|
@@ -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-15000 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,445 @@ 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
|
+
fullScreen = false,
|
|
1251
|
+
header,
|
|
1252
|
+
background = "primary",
|
|
1253
|
+
children,
|
|
1254
|
+
dismiss,
|
|
1255
|
+
secondary,
|
|
1256
|
+
confirm,
|
|
1257
|
+
className = ""
|
|
1258
|
+
} = _b, rest = __objRest(_b, [
|
|
1259
|
+
"open",
|
|
1260
|
+
"onOpenChange",
|
|
1261
|
+
"title",
|
|
1262
|
+
"subtitle",
|
|
1263
|
+
"closable",
|
|
1264
|
+
"backdrop",
|
|
1265
|
+
"fullScreen",
|
|
1266
|
+
"header",
|
|
1267
|
+
"background",
|
|
1268
|
+
"children",
|
|
1269
|
+
"dismiss",
|
|
1270
|
+
"secondary",
|
|
1271
|
+
"confirm",
|
|
1272
|
+
"className"
|
|
1273
|
+
]);
|
|
1274
|
+
const { mounted, animate } = useMountTransition2(open);
|
|
1275
|
+
(0, import_react12.useEffect)(() => {
|
|
1276
|
+
if (!open || !closable) return;
|
|
1277
|
+
const handleKeyDown = (e) => {
|
|
1278
|
+
if (e.key === "Escape") onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1279
|
+
};
|
|
1280
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
1281
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
1282
|
+
}, [open, closable, onOpenChange]);
|
|
1283
|
+
if (!mounted) return null;
|
|
1284
|
+
const handleClose = () => onOpenChange == null ? void 0 : onOpenChange(false);
|
|
1285
|
+
const handleBackdropMouseDown = (e) => {
|
|
1286
|
+
if (closable && e.target === e.currentTarget) handleClose();
|
|
1287
|
+
};
|
|
1288
|
+
const showHeader = header != null ? header : Boolean(title || subtitle || closable);
|
|
1289
|
+
const showFooter = Boolean(dismiss || secondary || confirm);
|
|
1290
|
+
const allActions = Boolean(dismiss && secondary && confirm);
|
|
1291
|
+
return (0, import_react_dom2.createPortal)(
|
|
1292
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1293
|
+
"div",
|
|
1294
|
+
{
|
|
1295
|
+
className: [
|
|
1296
|
+
"fixed inset-0 z-15000 flex flex-col items-end justify-center",
|
|
1297
|
+
backdrop ? "bg-dialog-background-backdrop" : "",
|
|
1298
|
+
"transition-opacity duration-300",
|
|
1299
|
+
animate ? "opacity-100" : "opacity-0"
|
|
1300
|
+
].filter(Boolean).join(" "),
|
|
1301
|
+
role: "presentation",
|
|
1302
|
+
onMouseDown: handleBackdropMouseDown,
|
|
1303
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1304
|
+
"div",
|
|
1305
|
+
__spreadProps(__spreadValues({
|
|
1306
|
+
ref,
|
|
1307
|
+
role: "dialog",
|
|
1308
|
+
"aria-modal": "true",
|
|
1309
|
+
className: [
|
|
1310
|
+
"relative flex h-full w-full flex-col overflow-hidden bg-dialog-background-primary",
|
|
1311
|
+
"transition-transform duration-300",
|
|
1312
|
+
animate ? "translate-y-0" : "translate-y-full",
|
|
1313
|
+
fullScreen ? "" : [
|
|
1314
|
+
"lg:translate-y-0",
|
|
1315
|
+
animate ? "lg:translate-x-0" : "lg:translate-x-full"
|
|
1316
|
+
].join(" "),
|
|
1317
|
+
fullScreen ? "lg:w-full" : "lg:w-480 lg:min-w-480 lg:max-w-640",
|
|
1318
|
+
className
|
|
1319
|
+
].filter(Boolean).join(" "),
|
|
1320
|
+
onMouseDown: (e) => e.stopPropagation()
|
|
1321
|
+
}, rest), {
|
|
1322
|
+
children: [
|
|
1323
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1324
|
+
"div",
|
|
1325
|
+
{
|
|
1326
|
+
className: [
|
|
1327
|
+
"flex shrink-0 items-center gap-8 border-b border-border-subtle bg-dialog-background-primary px-16 pb-12 pt-16",
|
|
1328
|
+
fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-16 lg:pt-20"
|
|
1329
|
+
].join(" "),
|
|
1330
|
+
children: [
|
|
1331
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
|
|
1332
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-heading-3 text-dialog-text-primary lg:text-heading-3-md", children: title }),
|
|
1333
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-body-small text-dialog-text-secondary", children: subtitle })
|
|
1334
|
+
] }),
|
|
1335
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1336
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1337
|
+
IconButton,
|
|
1338
|
+
{
|
|
1339
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon3, { className: "h-20 w-20" }),
|
|
1340
|
+
size: "s",
|
|
1341
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1342
|
+
onClick: handleClose,
|
|
1343
|
+
className: "bg-icon-button-background-enabled lg:hidden!"
|
|
1344
|
+
}
|
|
1345
|
+
),
|
|
1346
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1347
|
+
IconButton,
|
|
1348
|
+
{
|
|
1349
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CloseIcon3, { className: "h-24 w-24" }),
|
|
1350
|
+
size: fullScreen ? "l" : "m",
|
|
1351
|
+
"aria-label": "\u0E1B\u0E34\u0E14",
|
|
1352
|
+
onClick: handleClose,
|
|
1353
|
+
className: "hidden! bg-icon-button-background-enabled lg:inline-flex!"
|
|
1354
|
+
}
|
|
1355
|
+
)
|
|
1356
|
+
] })
|
|
1357
|
+
]
|
|
1358
|
+
}
|
|
1359
|
+
),
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1361
|
+
"div",
|
|
1362
|
+
{
|
|
1363
|
+
className: [
|
|
1364
|
+
"flex-1 overflow-y-auto p-16 text-body-regular text-dialog-text-primary",
|
|
1365
|
+
background === "secondary" ? "bg-drawer-background-secondary" : "bg-dialog-background-primary",
|
|
1366
|
+
fullScreen ? "lg:px-112 lg:py-24" : "lg:p-24"
|
|
1367
|
+
].join(" "),
|
|
1368
|
+
children
|
|
1369
|
+
}
|
|
1370
|
+
),
|
|
1371
|
+
showFooter && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1372
|
+
"div",
|
|
1373
|
+
{
|
|
1374
|
+
className: [
|
|
1375
|
+
"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",
|
|
1376
|
+
fullScreen ? "lg:gap-16 lg:px-112 lg:py-24" : "lg:px-24 lg:pb-24 lg:pt-16"
|
|
1377
|
+
].join(" "),
|
|
1378
|
+
children: allActions ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" }),
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "contents gap-8 lg:order-2 lg:ml-auto lg:flex lg:items-center", children: [
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1" }),
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2" })
|
|
1383
|
+
] })
|
|
1384
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1385
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: secondary, variant: "secondary", orderClass: "order-1 lg:order-2" }),
|
|
1386
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: confirm, variant: "primary", orderClass: "order-2 lg:order-3" }),
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(DrawerAction, { action: dismiss, variant: "tertiary", orderClass: "order-3 lg:order-1" })
|
|
1388
|
+
] })
|
|
1389
|
+
}
|
|
1390
|
+
)
|
|
1391
|
+
]
|
|
1392
|
+
})
|
|
1393
|
+
)
|
|
1394
|
+
}
|
|
1395
|
+
),
|
|
1396
|
+
document.body
|
|
1397
|
+
);
|
|
1398
|
+
}
|
|
1399
|
+
);
|
|
1400
|
+
Drawer.displayName = "Drawer";
|
|
1401
|
+
|
|
1402
|
+
// src/components/Dropdown/Dropdown.tsx
|
|
1403
|
+
var import_react13 = require("react");
|
|
1404
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1405
|
+
var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1244
1406
|
"svg",
|
|
1245
1407
|
{
|
|
1246
1408
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1248,7 +1410,7 @@ var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
|
1248
1410
|
height: "20",
|
|
1249
1411
|
viewBox: "0 0 20 20",
|
|
1250
1412
|
fill: "none",
|
|
1251
|
-
children: /* @__PURE__ */ (0,
|
|
1413
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1252
1414
|
"path",
|
|
1253
1415
|
{
|
|
1254
1416
|
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 +1420,7 @@ var IconDanger = () => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
|
1258
1420
|
}
|
|
1259
1421
|
);
|
|
1260
1422
|
function IconCheck({ className }) {
|
|
1261
|
-
return /* @__PURE__ */ (0,
|
|
1423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1262
1424
|
"svg",
|
|
1263
1425
|
{
|
|
1264
1426
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1267,7 +1429,7 @@ function IconCheck({ className }) {
|
|
|
1267
1429
|
viewBox: "0 0 20 20",
|
|
1268
1430
|
fill: "none",
|
|
1269
1431
|
className,
|
|
1270
|
-
children: /* @__PURE__ */ (0,
|
|
1432
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1271
1433
|
"path",
|
|
1272
1434
|
{
|
|
1273
1435
|
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 +1440,7 @@ function IconCheck({ className }) {
|
|
|
1278
1440
|
);
|
|
1279
1441
|
}
|
|
1280
1442
|
function ChevronDown({ className }) {
|
|
1281
|
-
return /* @__PURE__ */ (0,
|
|
1443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1282
1444
|
"svg",
|
|
1283
1445
|
{
|
|
1284
1446
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1287,7 +1449,7 @@ function ChevronDown({ className }) {
|
|
|
1287
1449
|
viewBox: "0 0 20 20",
|
|
1288
1450
|
fill: "none",
|
|
1289
1451
|
className,
|
|
1290
|
-
children: /* @__PURE__ */ (0,
|
|
1452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1291
1453
|
"path",
|
|
1292
1454
|
{
|
|
1293
1455
|
d: "M14.7119 8.0625L10 12.7744L5.28809 8.0625L6.0625 7.28809L10 11.2256L13.9375 7.28809L14.7119 8.0625Z",
|
|
@@ -1297,16 +1459,17 @@ function ChevronDown({ className }) {
|
|
|
1297
1459
|
}
|
|
1298
1460
|
);
|
|
1299
1461
|
}
|
|
1300
|
-
var Dropdown = (0,
|
|
1462
|
+
var Dropdown = (0, import_react13.forwardRef)(
|
|
1301
1463
|
(_a, ref) => {
|
|
1302
1464
|
var _b = _a, {
|
|
1303
1465
|
size = "md",
|
|
1466
|
+
variant = "default",
|
|
1304
1467
|
error,
|
|
1305
1468
|
label,
|
|
1306
1469
|
placeholder,
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1470
|
+
helperText,
|
|
1471
|
+
disabled = false,
|
|
1472
|
+
textCenter = false,
|
|
1310
1473
|
value,
|
|
1311
1474
|
setValue,
|
|
1312
1475
|
dropDownItems = [
|
|
@@ -1319,168 +1482,248 @@ var Dropdown = (0, import_react12.forwardRef)(
|
|
|
1319
1482
|
className = ""
|
|
1320
1483
|
} = _b, rest = __objRest(_b, [
|
|
1321
1484
|
"size",
|
|
1485
|
+
"variant",
|
|
1322
1486
|
"error",
|
|
1323
1487
|
"label",
|
|
1324
1488
|
"placeholder",
|
|
1325
|
-
"
|
|
1326
|
-
"
|
|
1327
|
-
"
|
|
1489
|
+
"helperText",
|
|
1490
|
+
"disabled",
|
|
1491
|
+
"textCenter",
|
|
1328
1492
|
"value",
|
|
1329
1493
|
"setValue",
|
|
1330
1494
|
"dropDownItems",
|
|
1331
1495
|
"className"
|
|
1332
1496
|
]);
|
|
1333
|
-
const
|
|
1334
|
-
const
|
|
1335
|
-
const
|
|
1336
|
-
const
|
|
1337
|
-
|
|
1338
|
-
);
|
|
1339
|
-
(0,
|
|
1497
|
+
const isCombobox = variant === "combobox";
|
|
1498
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
1499
|
+
const [isOpen, setIsOpen] = (0, import_react13.useState)(false);
|
|
1500
|
+
const [isFocused, setIsFocused] = (0, import_react13.useState)(false);
|
|
1501
|
+
const [query, setQuery] = (0, import_react13.useState)(value.label || "");
|
|
1502
|
+
const [filterText, setFilterText] = (0, import_react13.useState)("");
|
|
1503
|
+
const dropdownRef = (0, import_react13.useRef)(null);
|
|
1504
|
+
const inputRef = (0, import_react13.useRef)(null);
|
|
1505
|
+
const listboxId = (0, import_react13.useId)();
|
|
1506
|
+
const [prevLabel, setPrevLabel] = (0, import_react13.useState)(value.label);
|
|
1507
|
+
if (value.label !== prevLabel) {
|
|
1508
|
+
setPrevLabel(value.label);
|
|
1509
|
+
setQuery(value.label || "");
|
|
1510
|
+
}
|
|
1511
|
+
const filteredItems = isCombobox ? dropDownItems.filter(
|
|
1512
|
+
(item) => item.label.toLowerCase().includes(filterText.toLowerCase())
|
|
1513
|
+
) : dropDownItems;
|
|
1514
|
+
(0, import_react13.useEffect)(() => {
|
|
1340
1515
|
function handleClickOutside(event) {
|
|
1341
1516
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1342
1517
|
setIsOpen(false);
|
|
1518
|
+
if (isCombobox) setQuery(value.label || "");
|
|
1343
1519
|
}
|
|
1344
1520
|
}
|
|
1345
1521
|
document.addEventListener("mousedown", handleClickOutside);
|
|
1346
1522
|
return () => {
|
|
1347
1523
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
1348
1524
|
};
|
|
1349
|
-
}, []);
|
|
1350
|
-
|
|
1351
|
-
|
|
1525
|
+
}, [isCombobox, value.label]);
|
|
1526
|
+
const triggerClassName = `w-full rounded-6 text-body-small px-16 inline-flex gap-8 items-center border
|
|
1527
|
+
${size === "lg" ? "h-48 py-16" : "h-40 py-12"}
|
|
1528
|
+
${!isCombobox ? disabled ? "text-dropdown-text-disabled cursor-not-allowed" : value ? "text-dropdown-text-primary cursor-pointer" : "text-dropdown-text-secondary cursor-pointer" : ""}
|
|
1529
|
+
${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"}
|
|
1530
|
+
${className}`;
|
|
1531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
1532
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1352
1533
|
"p",
|
|
1353
1534
|
{
|
|
1354
|
-
className: `text-label-medium text-left items-left font-medium
|
|
1535
|
+
className: `text-label-medium text-left items-left font-medium ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-primary"}`,
|
|
1355
1536
|
children: label
|
|
1356
1537
|
}
|
|
1357
|
-
) : /* @__PURE__ */ (0,
|
|
1358
|
-
/* @__PURE__ */ (0,
|
|
1359
|
-
/* @__PURE__ */ (0,
|
|
1538
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {}),
|
|
1539
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "w-full flex flex-col relative", ref: dropdownRef, children: [
|
|
1540
|
+
isCombobox ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1360
1541
|
"div",
|
|
1361
1542
|
__spreadProps(__spreadValues({
|
|
1362
1543
|
ref
|
|
1363
1544
|
}, rest), {
|
|
1364
|
-
onClick: () =>
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
${className}`,
|
|
1545
|
+
onClick: () => {
|
|
1546
|
+
var _a2;
|
|
1547
|
+
return !disabled && ((_a2 = inputRef.current) == null ? void 0 : _a2.focus());
|
|
1548
|
+
},
|
|
1549
|
+
className: triggerClassName,
|
|
1370
1550
|
children: [
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
"
|
|
1551
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1552
|
+
"input",
|
|
1373
1553
|
{
|
|
1374
|
-
|
|
1375
|
-
|
|
1554
|
+
ref: inputRef,
|
|
1555
|
+
type: "text",
|
|
1556
|
+
role: "combobox",
|
|
1557
|
+
"aria-autocomplete": "list",
|
|
1558
|
+
"aria-haspopup": "listbox",
|
|
1559
|
+
"aria-expanded": isOpen,
|
|
1560
|
+
"aria-controls": listboxId,
|
|
1561
|
+
disabled,
|
|
1562
|
+
placeholder,
|
|
1563
|
+
value: query,
|
|
1564
|
+
onChange: (e) => {
|
|
1565
|
+
setQuery(e.target.value);
|
|
1566
|
+
setFilterText(e.target.value);
|
|
1567
|
+
setIsOpen(true);
|
|
1568
|
+
},
|
|
1569
|
+
onFocus: () => {
|
|
1570
|
+
setIsFocused(true);
|
|
1571
|
+
setIsOpen(true);
|
|
1572
|
+
setFilterText("");
|
|
1573
|
+
},
|
|
1574
|
+
onBlur: () => setIsFocused(false),
|
|
1575
|
+
onKeyDown: (e) => {
|
|
1576
|
+
if (!disabled && e.key === "Escape") {
|
|
1577
|
+
setIsOpen(false);
|
|
1578
|
+
setQuery(value.label || "");
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1581
|
+
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
1582
|
}
|
|
1377
1583
|
),
|
|
1378
|
-
/* @__PURE__ */ (0,
|
|
1379
|
-
|
|
1380
|
-
/* @__PURE__ */ (0,
|
|
1381
|
-
|
|
1584
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
1585
|
+
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, {}),
|
|
1586
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1587
|
+
IconButton,
|
|
1382
1588
|
{
|
|
1383
|
-
|
|
1589
|
+
size: iconButtonSize,
|
|
1590
|
+
disabled,
|
|
1591
|
+
tabIndex: -1,
|
|
1592
|
+
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1593
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1594
|
+
ChevronDown,
|
|
1595
|
+
{
|
|
1596
|
+
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
1597
|
+
}
|
|
1598
|
+
),
|
|
1599
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1600
|
+
onClick: (e) => {
|
|
1601
|
+
var _a2;
|
|
1602
|
+
e.stopPropagation();
|
|
1603
|
+
if (disabled) return;
|
|
1604
|
+
if (isOpen) {
|
|
1605
|
+
setIsOpen(false);
|
|
1606
|
+
setQuery(value.label || "");
|
|
1607
|
+
} else {
|
|
1608
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1384
1611
|
}
|
|
1385
1612
|
)
|
|
1386
1613
|
] })
|
|
1387
1614
|
]
|
|
1388
1615
|
})
|
|
1389
|
-
),
|
|
1390
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1616
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1391
1617
|
"div",
|
|
1392
|
-
{
|
|
1393
|
-
|
|
1394
|
-
|
|
1618
|
+
__spreadProps(__spreadValues({
|
|
1619
|
+
ref
|
|
1620
|
+
}, rest), {
|
|
1621
|
+
tabIndex: disabled ? -1 : 0,
|
|
1622
|
+
role: "button",
|
|
1623
|
+
"aria-haspopup": "listbox",
|
|
1624
|
+
"aria-expanded": isOpen,
|
|
1625
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
1626
|
+
onFocus: (e) => {
|
|
1627
|
+
var _a2;
|
|
1628
|
+
setIsFocused(true);
|
|
1629
|
+
(_a2 = rest.onFocus) == null ? void 0 : _a2.call(rest, e);
|
|
1630
|
+
},
|
|
1631
|
+
onBlur: (e) => {
|
|
1632
|
+
var _a2;
|
|
1633
|
+
setIsFocused(false);
|
|
1634
|
+
(_a2 = rest.onBlur) == null ? void 0 : _a2.call(rest, e);
|
|
1635
|
+
},
|
|
1636
|
+
onKeyDown: (e) => {
|
|
1637
|
+
var _a2;
|
|
1638
|
+
if (disabled) return;
|
|
1639
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1640
|
+
e.preventDefault();
|
|
1641
|
+
setIsOpen((prev) => !prev);
|
|
1642
|
+
} else if (e.key === "Escape") {
|
|
1643
|
+
setIsOpen(false);
|
|
1644
|
+
}
|
|
1645
|
+
(_a2 = rest.onKeyDown) == null ? void 0 : _a2.call(rest, e);
|
|
1646
|
+
},
|
|
1647
|
+
className: `focus:outline-none ${triggerClassName}`,
|
|
1395
1648
|
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",
|
|
1649
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1650
|
+
"p",
|
|
1445
1651
|
{
|
|
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" })
|
|
1652
|
+
className: `grow truncate ${textCenter ? "text-center" : "text-start"}`,
|
|
1653
|
+
children: value.label || placeholder
|
|
1463
1654
|
}
|
|
1464
|
-
)
|
|
1655
|
+
),
|
|
1656
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-4", children: [
|
|
1657
|
+
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, {}),
|
|
1658
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1659
|
+
IconButton,
|
|
1660
|
+
{
|
|
1661
|
+
size: iconButtonSize,
|
|
1662
|
+
disabled,
|
|
1663
|
+
tabIndex: -1,
|
|
1664
|
+
"aria-label": "\u0E40\u0E1B\u0E34\u0E14/\u0E1B\u0E34\u0E14\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
1665
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1666
|
+
ChevronDown,
|
|
1667
|
+
{
|
|
1668
|
+
className: `h-20 w-20 duration-300 ${isOpen ? "rotate-180" : ""}`
|
|
1669
|
+
}
|
|
1670
|
+
),
|
|
1671
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
1672
|
+
onClick: (e) => {
|
|
1673
|
+
e.stopPropagation();
|
|
1674
|
+
if (!disabled) setIsOpen((prev) => !prev);
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
)
|
|
1678
|
+
] })
|
|
1465
1679
|
]
|
|
1680
|
+
})
|
|
1681
|
+
),
|
|
1682
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1683
|
+
"div",
|
|
1684
|
+
{
|
|
1685
|
+
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`,
|
|
1686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1687
|
+
"ul",
|
|
1688
|
+
{
|
|
1689
|
+
id: isCombobox ? listboxId : void 0,
|
|
1690
|
+
role: isCombobox ? "listbox" : void 0,
|
|
1691
|
+
className: "h-auto max-h-200 overflow-y-auto cursor-pointer",
|
|
1692
|
+
children: filteredItems.length > 0 ? filteredItems.map((item, idx) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1693
|
+
"div",
|
|
1694
|
+
{
|
|
1695
|
+
onClick: () => {
|
|
1696
|
+
setValue(item);
|
|
1697
|
+
if (isCombobox) setQuery(item.label);
|
|
1698
|
+
setIsOpen(false);
|
|
1699
|
+
},
|
|
1700
|
+
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",
|
|
1701
|
+
children: [
|
|
1702
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "text-label-medium text-dropdown-text-primary", children: item.label }),
|
|
1703
|
+
value.value === item.value && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconCheck, { className: "h-20 w-20" })
|
|
1704
|
+
]
|
|
1705
|
+
}
|
|
1706
|
+
) }, 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" })
|
|
1707
|
+
}
|
|
1708
|
+
)
|
|
1466
1709
|
}
|
|
1467
1710
|
)
|
|
1468
1711
|
] }),
|
|
1469
|
-
error ? /* @__PURE__ */ (0,
|
|
1712
|
+
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
1713
|
"p",
|
|
1471
1714
|
{
|
|
1472
|
-
className: `text-caption-caption text-left items-left text-dropdown-text-
|
|
1473
|
-
children:
|
|
1715
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-dropdown-text-disabled" : "text-dropdown-text-secondary"}`,
|
|
1716
|
+
children: helperText
|
|
1474
1717
|
}
|
|
1475
|
-
) : /* @__PURE__ */ (0,
|
|
1718
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_jsx_runtime13.Fragment, {})
|
|
1476
1719
|
] });
|
|
1477
1720
|
}
|
|
1478
1721
|
);
|
|
1479
1722
|
Dropdown.displayName = "Dropdown";
|
|
1480
1723
|
|
|
1481
1724
|
// src/components/FinancialLogo/FinancialLogo.tsx
|
|
1482
|
-
var
|
|
1483
|
-
var
|
|
1725
|
+
var import_react14 = require("react");
|
|
1726
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1484
1727
|
var inlineClasses2 = {
|
|
1485
1728
|
info: "bg-alert-inline-info-bg border-alert-inline-info-border text-alert-text-primary",
|
|
1486
1729
|
success: "bg-alert-inline-success-bg border-alert-inline-success-border text-alert-text-primary",
|
|
@@ -1510,34 +1753,34 @@ var inlineIconClasses2 = {
|
|
|
1510
1753
|
common: "text-alert-inline-common-icon"
|
|
1511
1754
|
};
|
|
1512
1755
|
function InfoIcon2({ className }) {
|
|
1513
|
-
return /* @__PURE__ */ (0,
|
|
1756
|
+
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
1757
|
}
|
|
1515
1758
|
function SuccessIcon2({ className }) {
|
|
1516
|
-
return /* @__PURE__ */ (0,
|
|
1517
|
-
/* @__PURE__ */ (0,
|
|
1518
|
-
/* @__PURE__ */ (0,
|
|
1759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1760
|
+
/* @__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" }),
|
|
1761
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1519
1762
|
] });
|
|
1520
1763
|
}
|
|
1521
|
-
function
|
|
1522
|
-
return /* @__PURE__ */ (0,
|
|
1764
|
+
function WarningIcon3({ className }) {
|
|
1765
|
+
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
1766
|
}
|
|
1524
1767
|
function DangerIcon2({ className }) {
|
|
1525
|
-
return /* @__PURE__ */ (0,
|
|
1768
|
+
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
1769
|
}
|
|
1527
1770
|
function CommonIcon({ className }) {
|
|
1528
|
-
return /* @__PURE__ */ (0,
|
|
1771
|
+
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
1772
|
}
|
|
1530
|
-
function
|
|
1531
|
-
return /* @__PURE__ */ (0,
|
|
1773
|
+
function CloseIcon4({ className }) {
|
|
1774
|
+
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
1775
|
}
|
|
1533
1776
|
var defaultIcons2 = {
|
|
1534
1777
|
info: InfoIcon2,
|
|
1535
1778
|
success: SuccessIcon2,
|
|
1536
|
-
warning:
|
|
1779
|
+
warning: WarningIcon3,
|
|
1537
1780
|
danger: DangerIcon2,
|
|
1538
1781
|
common: CommonIcon
|
|
1539
1782
|
};
|
|
1540
|
-
var FinancialLogo = (0,
|
|
1783
|
+
var FinancialLogo = (0, import_react14.forwardRef)(
|
|
1541
1784
|
(_a, ref) => {
|
|
1542
1785
|
var _b = _a, {
|
|
1543
1786
|
variant = "info",
|
|
@@ -1573,22 +1816,22 @@ var FinancialLogo = (0, import_react13.forwardRef)(
|
|
|
1573
1816
|
variantClass,
|
|
1574
1817
|
className
|
|
1575
1818
|
].filter(Boolean).join(" ");
|
|
1576
|
-
return /* @__PURE__ */ (0,
|
|
1577
|
-
/* @__PURE__ */ (0,
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1579
|
-
title && /* @__PURE__ */ (0,
|
|
1580
|
-
description && /* @__PURE__ */ (0,
|
|
1819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
1820
|
+
/* @__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" }) }),
|
|
1821
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
1822
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-sm font-medium leading-20", children: title }),
|
|
1823
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: `text-sm leading-20 ${descColorClass} ${title ? "mt-4" : ""}`, children: description }),
|
|
1581
1824
|
children
|
|
1582
1825
|
] }),
|
|
1583
|
-
action && /* @__PURE__ */ (0,
|
|
1584
|
-
onClose && /* @__PURE__ */ (0,
|
|
1826
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: `${actionClass} underline text-sm font-medium`, children: action }),
|
|
1827
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1585
1828
|
"button",
|
|
1586
1829
|
{
|
|
1587
1830
|
type: "button",
|
|
1588
1831
|
onClick: onClose,
|
|
1589
1832
|
className: `shrink-0 p-2 rounded transition-colors ${closeColorClass}`,
|
|
1590
1833
|
"aria-label": "Close",
|
|
1591
|
-
children: /* @__PURE__ */ (0,
|
|
1834
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CloseIcon4, { className: "h-16 w-16" })
|
|
1592
1835
|
}
|
|
1593
1836
|
)
|
|
1594
1837
|
] }));
|
|
@@ -1597,9 +1840,9 @@ var FinancialLogo = (0, import_react13.forwardRef)(
|
|
|
1597
1840
|
FinancialLogo.displayName = "FinancialLogo";
|
|
1598
1841
|
|
|
1599
1842
|
// src/components/Icon/Icon.tsx
|
|
1600
|
-
var
|
|
1601
|
-
var
|
|
1602
|
-
var Icon = (0,
|
|
1843
|
+
var import_react15 = require("react");
|
|
1844
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1845
|
+
var Icon = (0, import_react15.forwardRef)(
|
|
1603
1846
|
(_a, ref) => {
|
|
1604
1847
|
var _b = _a, {
|
|
1605
1848
|
name,
|
|
@@ -1627,7 +1870,7 @@ var Icon = (0, import_react14.forwardRef)(
|
|
|
1627
1870
|
"material-symbols-outlined select-none shrink-0 inline-block leading-none",
|
|
1628
1871
|
className
|
|
1629
1872
|
].filter(Boolean).join(" ");
|
|
1630
|
-
return /* @__PURE__ */ (0,
|
|
1873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1631
1874
|
"span",
|
|
1632
1875
|
__spreadProps(__spreadValues({
|
|
1633
1876
|
ref,
|
|
@@ -1650,8 +1893,8 @@ var Icon = (0, import_react14.forwardRef)(
|
|
|
1650
1893
|
Icon.displayName = "Icon";
|
|
1651
1894
|
|
|
1652
1895
|
// src/components/Link/Link.tsx
|
|
1653
|
-
var
|
|
1654
|
-
var
|
|
1896
|
+
var import_react16 = require("react");
|
|
1897
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1655
1898
|
var linkStyleClasses = {
|
|
1656
1899
|
brand: "font-sans text-link-text-enabled",
|
|
1657
1900
|
white: "font-sans text-link-text-enabled-inverse",
|
|
@@ -1673,12 +1916,12 @@ var iconVariantClasses = {
|
|
|
1673
1916
|
lg: "w-24 h-24"
|
|
1674
1917
|
};
|
|
1675
1918
|
function SuccessIcon3({ className }) {
|
|
1676
|
-
return /* @__PURE__ */ (0,
|
|
1677
|
-
/* @__PURE__ */ (0,
|
|
1678
|
-
/* @__PURE__ */ (0,
|
|
1919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
1920
|
+
/* @__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" }),
|
|
1921
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
1679
1922
|
] });
|
|
1680
1923
|
}
|
|
1681
|
-
var Link = (0,
|
|
1924
|
+
var Link = (0, import_react16.forwardRef)(
|
|
1682
1925
|
(_a, ref) => {
|
|
1683
1926
|
var _b = _a, {
|
|
1684
1927
|
variant = "sm",
|
|
@@ -1709,18 +1952,18 @@ var Link = (0, import_react15.forwardRef)(
|
|
|
1709
1952
|
variantClass,
|
|
1710
1953
|
className
|
|
1711
1954
|
].filter(Boolean).join(" ");
|
|
1712
|
-
return /* @__PURE__ */ (0,
|
|
1713
|
-
/* @__PURE__ */ (0,
|
|
1714
|
-
icon && !isInline ? /* @__PURE__ */ (0,
|
|
1955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "link", className: classes }, rest), { children: [
|
|
1956
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("a", { href, target: "_blank", rel: "noopener noreferrer", children: text }),
|
|
1957
|
+
icon && !isInline ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SuccessIcon3, { className: iconClass }) : null
|
|
1715
1958
|
] }));
|
|
1716
1959
|
}
|
|
1717
1960
|
);
|
|
1718
1961
|
Link.displayName = "Link";
|
|
1719
1962
|
|
|
1720
1963
|
// src/components/Radio/Radio.tsx
|
|
1721
|
-
var
|
|
1722
|
-
var
|
|
1723
|
-
var Radio = (0,
|
|
1964
|
+
var import_react17 = require("react");
|
|
1965
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1966
|
+
var Radio = (0, import_react17.forwardRef)(
|
|
1724
1967
|
(_a, ref) => {
|
|
1725
1968
|
var _b = _a, {
|
|
1726
1969
|
size = "sm",
|
|
@@ -1745,20 +1988,20 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1745
1988
|
"id",
|
|
1746
1989
|
"name"
|
|
1747
1990
|
]);
|
|
1748
|
-
const reactId = (0,
|
|
1991
|
+
const reactId = (0, import_react17.useId)();
|
|
1749
1992
|
const inputId = id != null ? id : reactId;
|
|
1750
|
-
return /* @__PURE__ */ (0,
|
|
1993
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1751
1994
|
"div",
|
|
1752
1995
|
{
|
|
1753
1996
|
className: `${disabled ? "cursor-not-allowed" : "cursor-pointer"} ${className}`,
|
|
1754
|
-
children: /* @__PURE__ */ (0,
|
|
1997
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1755
1998
|
"label",
|
|
1756
1999
|
{
|
|
1757
2000
|
htmlFor: inputId,
|
|
1758
2001
|
className: `flex gap-4 ${disabled ? "pointer-events-none text-gray-400" : "text-gray-900 cursor-pointer"}`,
|
|
1759
2002
|
children: [
|
|
1760
|
-
/* @__PURE__ */ (0,
|
|
1761
|
-
/* @__PURE__ */ (0,
|
|
2003
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
2004
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1762
2005
|
"input",
|
|
1763
2006
|
__spreadValues({
|
|
1764
2007
|
ref,
|
|
@@ -1771,14 +2014,14 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1771
2014
|
name
|
|
1772
2015
|
}, rest)
|
|
1773
2016
|
),
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
2017
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1775
2018
|
"div",
|
|
1776
2019
|
{
|
|
1777
2020
|
className: `relative box flex items-center justify-center rounded-full border-2 group bg-white
|
|
1778
2021
|
${size === "sm" ? "h-16 w-16 my-4 ml-3 mr-3" : "m-3 h-20 w-20 text-label-large"}
|
|
1779
2022
|
${error ? "border-red-500" : "border-gray-600 peer-checked:border-blue-600 peer-disabled:border-gray-400!"}
|
|
1780
2023
|
`,
|
|
1781
|
-
children: /* @__PURE__ */ (0,
|
|
2024
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1782
2025
|
"span",
|
|
1783
2026
|
{
|
|
1784
2027
|
className: `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2
|
|
@@ -1789,12 +2032,12 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1789
2032
|
}
|
|
1790
2033
|
)
|
|
1791
2034
|
] }),
|
|
1792
|
-
/* @__PURE__ */ (0,
|
|
2035
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1793
2036
|
"div",
|
|
1794
2037
|
{
|
|
1795
2038
|
className: `flex flex-col gap-1 ${size === "sm" ? "mt-2" : "mt-4"}`,
|
|
1796
2039
|
children: [
|
|
1797
|
-
/* @__PURE__ */ (0,
|
|
2040
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1798
2041
|
"p",
|
|
1799
2042
|
{
|
|
1800
2043
|
className: `
|
|
@@ -1804,7 +2047,7 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1804
2047
|
children: label
|
|
1805
2048
|
}
|
|
1806
2049
|
),
|
|
1807
|
-
/* @__PURE__ */ (0,
|
|
2050
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1808
2051
|
"p",
|
|
1809
2052
|
{
|
|
1810
2053
|
className: `text-caption-caption ${disabled ? "text-gray-400" : error ? "text-red-600" : "text-gray-600"}`,
|
|
@@ -1824,18 +2067,18 @@ var Radio = (0, import_react16.forwardRef)(
|
|
|
1824
2067
|
Radio.displayName = "Radio";
|
|
1825
2068
|
|
|
1826
2069
|
// src/components/SegmentControl/SegmentControl.tsx
|
|
1827
|
-
var
|
|
1828
|
-
var
|
|
1829
|
-
var SegmentControl = (0,
|
|
2070
|
+
var import_react18 = require("react");
|
|
2071
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2072
|
+
var SegmentControl = (0, import_react18.forwardRef)(
|
|
1830
2073
|
(_a, ref) => {
|
|
1831
2074
|
var _b = _a, { size = "md", items, selected, setSelected, className = "" } = _b, rest = __objRest(_b, ["size", "items", "selected", "setSelected", "className"]);
|
|
1832
|
-
return /* @__PURE__ */ (0,
|
|
2075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1833
2076
|
"div",
|
|
1834
2077
|
__spreadProps(__spreadValues({
|
|
1835
2078
|
ref,
|
|
1836
2079
|
className: `bg-background-tertiary rounded-full flex flex-row items-center justify-center p-4 gap-4 ${className}`
|
|
1837
2080
|
}, rest), {
|
|
1838
|
-
children: items.map((item) => /* @__PURE__ */ (0,
|
|
2081
|
+
children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1839
2082
|
"div",
|
|
1840
2083
|
{
|
|
1841
2084
|
onClick: () => setSelected == null ? void 0 : setSelected(item.value),
|
|
@@ -1852,8 +2095,8 @@ var SegmentControl = (0, import_react17.forwardRef)(
|
|
|
1852
2095
|
SegmentControl.displayName = "SegmentControl";
|
|
1853
2096
|
|
|
1854
2097
|
// src/components/Slider/Slider.tsx
|
|
1855
|
-
var
|
|
1856
|
-
var
|
|
2098
|
+
var import_react19 = require("react");
|
|
2099
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1857
2100
|
var sizeConfig = {
|
|
1858
2101
|
small: {
|
|
1859
2102
|
trackH: "h-4",
|
|
@@ -1884,7 +2127,7 @@ var sizeConfig = {
|
|
|
1884
2127
|
}
|
|
1885
2128
|
};
|
|
1886
2129
|
function ChevronGlyphs({ size, color }) {
|
|
1887
|
-
return /* @__PURE__ */ (0,
|
|
2130
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1888
2131
|
"svg",
|
|
1889
2132
|
{
|
|
1890
2133
|
width: size,
|
|
@@ -1894,7 +2137,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1894
2137
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1895
2138
|
"aria-hidden": "true",
|
|
1896
2139
|
children: [
|
|
1897
|
-
/* @__PURE__ */ (0,
|
|
2140
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1898
2141
|
"path",
|
|
1899
2142
|
{
|
|
1900
2143
|
d: "M4.75 3.25L2.25 6L4.75 8.75",
|
|
@@ -1904,7 +2147,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1904
2147
|
strokeLinejoin: "round"
|
|
1905
2148
|
}
|
|
1906
2149
|
),
|
|
1907
|
-
/* @__PURE__ */ (0,
|
|
2150
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1908
2151
|
"path",
|
|
1909
2152
|
{
|
|
1910
2153
|
d: "M7.25 3.25L9.75 6L7.25 8.75",
|
|
@@ -1918,7 +2161,7 @@ function ChevronGlyphs({ size, color }) {
|
|
|
1918
2161
|
}
|
|
1919
2162
|
);
|
|
1920
2163
|
}
|
|
1921
|
-
var Slider = (0,
|
|
2164
|
+
var Slider = (0, import_react19.forwardRef)(
|
|
1922
2165
|
(_a, ref) => {
|
|
1923
2166
|
var _b = _a, {
|
|
1924
2167
|
size = "medium",
|
|
@@ -1953,15 +2196,15 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
1953
2196
|
"onChange",
|
|
1954
2197
|
"aria-label"
|
|
1955
2198
|
]);
|
|
1956
|
-
const reactId = (0,
|
|
2199
|
+
const reactId = (0, import_react19.useId)();
|
|
1957
2200
|
const inputId = id != null ? id : reactId;
|
|
1958
2201
|
const sz = sizeConfig[size];
|
|
1959
2202
|
const ariaLabel = ariaLabelProp != null ? ariaLabelProp : typeof label === "string" ? void 0 : "Slider";
|
|
1960
2203
|
const ariaDescriptionId = description ? `${inputId}-description` : void 0;
|
|
1961
2204
|
const isControlled = controlledValue !== void 0;
|
|
1962
|
-
const [internalValue, setInternalValue] = (0,
|
|
2205
|
+
const [internalValue, setInternalValue] = (0, import_react19.useState)(defaultValue != null ? defaultValue : min);
|
|
1963
2206
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
1964
|
-
const handleChange = (0,
|
|
2207
|
+
const handleChange = (0, import_react19.useCallback)(
|
|
1965
2208
|
(e) => {
|
|
1966
2209
|
const val = Number(e.target.value);
|
|
1967
2210
|
if (!isControlled) {
|
|
@@ -1981,13 +2224,13 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
1981
2224
|
const descriptionColor = disabled ? "text-slider-label-disabled" : "text-slider-description";
|
|
1982
2225
|
const thumbOffset = percent * sz.thumbPx / 100;
|
|
1983
2226
|
const fillOffset = sz.thumbPx / 2 - thumbOffset;
|
|
1984
|
-
return /* @__PURE__ */ (0,
|
|
2227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1985
2228
|
"div",
|
|
1986
2229
|
{
|
|
1987
2230
|
className: ["flex w-full flex-col gap-8 font-sans", className].filter(Boolean).join(" "),
|
|
1988
2231
|
children: [
|
|
1989
|
-
(label || showValue && !disabled) && /* @__PURE__ */ (0,
|
|
1990
|
-
label && /* @__PURE__ */ (0,
|
|
2232
|
+
(label || showValue && !disabled) && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center justify-between", children: [
|
|
2233
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1991
2234
|
"label",
|
|
1992
2235
|
{
|
|
1993
2236
|
htmlFor: inputId,
|
|
@@ -2000,7 +2243,7 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2000
2243
|
children: label
|
|
2001
2244
|
}
|
|
2002
2245
|
),
|
|
2003
|
-
showValue && /* @__PURE__ */ (0,
|
|
2246
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2004
2247
|
"span",
|
|
2005
2248
|
{
|
|
2006
2249
|
className: [sz.description, "tabular-nums", labelColor].join(" "),
|
|
@@ -2008,7 +2251,7 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2008
2251
|
}
|
|
2009
2252
|
)
|
|
2010
2253
|
] }),
|
|
2011
|
-
/* @__PURE__ */ (0,
|
|
2254
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2012
2255
|
"div",
|
|
2013
2256
|
{
|
|
2014
2257
|
className: [
|
|
@@ -2017,7 +2260,7 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2017
2260
|
disabled ? "cursor-not-allowed" : "cursor-pointer"
|
|
2018
2261
|
].join(" "),
|
|
2019
2262
|
children: [
|
|
2020
|
-
/* @__PURE__ */ (0,
|
|
2263
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2021
2264
|
"div",
|
|
2022
2265
|
{
|
|
2023
2266
|
className: [
|
|
@@ -2027,14 +2270,14 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2027
2270
|
].join(" ")
|
|
2028
2271
|
}
|
|
2029
2272
|
),
|
|
2030
|
-
/* @__PURE__ */ (0,
|
|
2273
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2031
2274
|
"div",
|
|
2032
2275
|
{
|
|
2033
2276
|
className: ["absolute left-0 rounded-full", sz.trackH, fillBg].join(" "),
|
|
2034
2277
|
style: { width: `calc(${percent}% + ${fillOffset}px)` }
|
|
2035
2278
|
}
|
|
2036
2279
|
),
|
|
2037
|
-
/* @__PURE__ */ (0,
|
|
2280
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2038
2281
|
"input",
|
|
2039
2282
|
__spreadValues({
|
|
2040
2283
|
ref,
|
|
@@ -2055,7 +2298,7 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2055
2298
|
].join(" ")
|
|
2056
2299
|
}, rest)
|
|
2057
2300
|
),
|
|
2058
|
-
/* @__PURE__ */ (0,
|
|
2301
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2059
2302
|
"div",
|
|
2060
2303
|
{
|
|
2061
2304
|
className: [
|
|
@@ -2068,13 +2311,13 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2068
2311
|
!disabled && "peer-hover:shadow-medium"
|
|
2069
2312
|
].filter(Boolean).join(" "),
|
|
2070
2313
|
style: { left: `calc(${percent}% - ${thumbOffset}px)` },
|
|
2071
|
-
children: /* @__PURE__ */ (0,
|
|
2314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronGlyphs, { size: sz.iconPx, color: iconColor })
|
|
2072
2315
|
}
|
|
2073
2316
|
)
|
|
2074
2317
|
]
|
|
2075
2318
|
}
|
|
2076
2319
|
),
|
|
2077
|
-
description && /* @__PURE__ */ (0,
|
|
2320
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2078
2321
|
"span",
|
|
2079
2322
|
{
|
|
2080
2323
|
id: ariaDescriptionId,
|
|
@@ -2090,9 +2333,9 @@ var Slider = (0, import_react18.forwardRef)(
|
|
|
2090
2333
|
Slider.displayName = "Slider";
|
|
2091
2334
|
|
|
2092
2335
|
// src/components/Tab/Tab.tsx
|
|
2093
|
-
var
|
|
2094
|
-
var
|
|
2095
|
-
var Tab = (0,
|
|
2336
|
+
var import_react20 = require("react");
|
|
2337
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2338
|
+
var Tab = (0, import_react20.forwardRef)(
|
|
2096
2339
|
(_a, ref) => {
|
|
2097
2340
|
var _b = _a, {
|
|
2098
2341
|
size = "md",
|
|
@@ -2111,7 +2354,7 @@ var Tab = (0, import_react19.forwardRef)(
|
|
|
2111
2354
|
"setSelected",
|
|
2112
2355
|
"className"
|
|
2113
2356
|
]);
|
|
2114
|
-
return /* @__PURE__ */ (0,
|
|
2357
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2115
2358
|
"div",
|
|
2116
2359
|
__spreadProps(__spreadValues({
|
|
2117
2360
|
ref,
|
|
@@ -2129,302 +2372,399 @@ var Tab = (0, import_react19.forwardRef)(
|
|
|
2129
2372
|
Tab.displayName = "Tab";
|
|
2130
2373
|
|
|
2131
2374
|
// src/components/TextArea/TextArea.tsx
|
|
2132
|
-
var
|
|
2133
|
-
var
|
|
2134
|
-
var TextArea = (0,
|
|
2375
|
+
var import_react21 = require("react");
|
|
2376
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2377
|
+
var TextArea = (0, import_react21.forwardRef)(
|
|
2135
2378
|
(_a, ref) => {
|
|
2136
2379
|
var _b = _a, {
|
|
2137
|
-
maxText = 500,
|
|
2138
|
-
height = 100,
|
|
2139
2380
|
error,
|
|
2140
2381
|
label,
|
|
2141
2382
|
placeholder,
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2383
|
+
helperText,
|
|
2384
|
+
optional = false,
|
|
2385
|
+
success = false,
|
|
2386
|
+
pending = false,
|
|
2387
|
+
clearable = true,
|
|
2388
|
+
disabled = false,
|
|
2389
|
+
showCounter = true,
|
|
2390
|
+
maxLength = 500,
|
|
2391
|
+
height = 100,
|
|
2149
2392
|
value,
|
|
2150
|
-
onChange
|
|
2393
|
+
onChange,
|
|
2394
|
+
onFocus,
|
|
2395
|
+
onBlur,
|
|
2396
|
+
className
|
|
2151
2397
|
} = _b, props = __objRest(_b, [
|
|
2152
|
-
"maxText",
|
|
2153
|
-
"height",
|
|
2154
2398
|
"error",
|
|
2155
2399
|
"label",
|
|
2156
2400
|
"placeholder",
|
|
2157
|
-
"
|
|
2158
|
-
"
|
|
2159
|
-
"
|
|
2160
|
-
"
|
|
2161
|
-
"
|
|
2162
|
-
"isClearable",
|
|
2401
|
+
"helperText",
|
|
2402
|
+
"optional",
|
|
2403
|
+
"success",
|
|
2404
|
+
"pending",
|
|
2405
|
+
"clearable",
|
|
2163
2406
|
"disabled",
|
|
2407
|
+
"showCounter",
|
|
2408
|
+
"maxLength",
|
|
2409
|
+
"height",
|
|
2164
2410
|
"value",
|
|
2165
|
-
"onChange"
|
|
2411
|
+
"onChange",
|
|
2412
|
+
"onFocus",
|
|
2413
|
+
"onBlur",
|
|
2414
|
+
"className"
|
|
2166
2415
|
]);
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2416
|
+
var _a2;
|
|
2417
|
+
const [isFocused, setIsFocused] = (0, import_react21.useState)(false);
|
|
2418
|
+
const isActive = isFocused && !!value;
|
|
2419
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2420
|
+
label || showCounter ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "w-full flex justify-between items-center gap-8", children: [
|
|
2421
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2171
2422
|
"p",
|
|
2172
2423
|
{
|
|
2173
|
-
className: `text-label-medium text-left items-left ${
|
|
2174
|
-
children:
|
|
2424
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-primary"}`,
|
|
2425
|
+
children: [
|
|
2426
|
+
label,
|
|
2427
|
+
optional && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-text-area-text-secondary", children: `(\u0E44\u0E21\u0E48\u0E1A\u0E31\u0E07\u0E04\u0E31\u0E1A)` })
|
|
2428
|
+
]
|
|
2175
2429
|
}
|
|
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,
|
|
2430
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", {}),
|
|
2431
|
+
showCounter && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2432
|
+
"p",
|
|
2201
2433
|
{
|
|
2202
|
-
|
|
2203
|
-
|
|
2434
|
+
className: `shrink-0 text-caption-caption ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-tertiary"}`,
|
|
2435
|
+
children: [
|
|
2436
|
+
(_a2 = value == null ? void 0 : value.length) != null ? _a2 : 0,
|
|
2437
|
+
"/",
|
|
2438
|
+
maxLength
|
|
2439
|
+
]
|
|
2204
2440
|
}
|
|
2205
|
-
)
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2441
|
+
)
|
|
2442
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {}),
|
|
2443
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2444
|
+
"div",
|
|
2445
|
+
{
|
|
2446
|
+
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 : ""}`,
|
|
2447
|
+
children: [
|
|
2448
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2449
|
+
"textarea",
|
|
2450
|
+
__spreadValues({
|
|
2451
|
+
ref,
|
|
2452
|
+
placeholder,
|
|
2453
|
+
disabled: disabled || pending,
|
|
2454
|
+
maxLength,
|
|
2455
|
+
style: { height },
|
|
2456
|
+
onFocus: (e) => {
|
|
2457
|
+
setIsFocused(true);
|
|
2458
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
2459
|
+
},
|
|
2460
|
+
onBlur: (e) => {
|
|
2461
|
+
setIsFocused(false);
|
|
2462
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
2463
|
+
},
|
|
2464
|
+
value,
|
|
2465
|
+
onChange,
|
|
2466
|
+
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"}`
|
|
2467
|
+
}, props)
|
|
2468
|
+
),
|
|
2469
|
+
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)(
|
|
2470
|
+
IconButton,
|
|
2220
2471
|
{
|
|
2221
|
-
|
|
2222
|
-
|
|
2472
|
+
size: "s",
|
|
2473
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2474
|
+
className: "absolute right-6 top-6",
|
|
2475
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2476
|
+
"svg",
|
|
2477
|
+
{
|
|
2478
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2479
|
+
width: "20",
|
|
2480
|
+
height: "20",
|
|
2481
|
+
viewBox: "0 0 20 20",
|
|
2482
|
+
fill: "none",
|
|
2483
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2484
|
+
"path",
|
|
2485
|
+
{
|
|
2486
|
+
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",
|
|
2487
|
+
fill: "currentColor"
|
|
2488
|
+
}
|
|
2489
|
+
)
|
|
2490
|
+
}
|
|
2491
|
+
),
|
|
2492
|
+
onMouseDown: (e) => {
|
|
2493
|
+
e.preventDefault();
|
|
2494
|
+
},
|
|
2495
|
+
onClick: () => {
|
|
2496
|
+
onChange == null ? void 0 : onChange({
|
|
2497
|
+
target: { value: "" }
|
|
2498
|
+
});
|
|
2499
|
+
}
|
|
2223
2500
|
}
|
|
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",
|
|
2501
|
+
) : success ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2502
|
+
"svg",
|
|
2237
2503
|
{
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2504
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2505
|
+
width: "20",
|
|
2506
|
+
height: "20",
|
|
2507
|
+
viewBox: "0 0 20 20",
|
|
2508
|
+
fill: "none",
|
|
2509
|
+
className: "shrink-0 text-accent-success flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2511
|
+
"path",
|
|
2512
|
+
{
|
|
2513
|
+
fillRule: "evenodd",
|
|
2514
|
+
clipRule: "evenodd",
|
|
2515
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2516
|
+
fill: "currentColor"
|
|
2517
|
+
}
|
|
2518
|
+
)
|
|
2242
2519
|
}
|
|
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",
|
|
2520
|
+
) : error ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2521
|
+
"svg",
|
|
2256
2522
|
{
|
|
2257
|
-
|
|
2258
|
-
|
|
2523
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2524
|
+
width: "20",
|
|
2525
|
+
height: "20",
|
|
2526
|
+
viewBox: "0 0 20 20",
|
|
2527
|
+
fill: "none",
|
|
2528
|
+
className: "shrink-0 text-text-area-text-danger flex h-20 w-20 items-center justify-center absolute right-12 top-12",
|
|
2529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2530
|
+
"path",
|
|
2531
|
+
{
|
|
2532
|
+
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",
|
|
2533
|
+
fill: "currentColor"
|
|
2534
|
+
}
|
|
2535
|
+
)
|
|
2259
2536
|
}
|
|
2260
|
-
)
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
error ? /* @__PURE__ */ (0,
|
|
2537
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {})
|
|
2538
|
+
]
|
|
2539
|
+
}
|
|
2540
|
+
),
|
|
2541
|
+
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)(
|
|
2542
|
+
"p",
|
|
2543
|
+
{
|
|
2544
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-area-text-disabled" : "text-text-area-text-secondary"}`,
|
|
2545
|
+
children: helperText
|
|
2546
|
+
}
|
|
2547
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, {})
|
|
2265
2548
|
] });
|
|
2266
2549
|
}
|
|
2267
2550
|
);
|
|
2268
2551
|
TextArea.displayName = "TextArea";
|
|
2269
2552
|
|
|
2270
2553
|
// src/components/TextField/TextField.tsx
|
|
2271
|
-
var
|
|
2272
|
-
var
|
|
2273
|
-
var TextField = (0,
|
|
2554
|
+
var import_react22 = require("react");
|
|
2555
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2556
|
+
var TextField = (0, import_react22.forwardRef)(
|
|
2274
2557
|
(_a, ref) => {
|
|
2275
2558
|
var _b = _a, {
|
|
2276
|
-
|
|
2559
|
+
size = "md",
|
|
2277
2560
|
error,
|
|
2278
2561
|
label,
|
|
2279
2562
|
placeholder,
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
disabled,
|
|
2563
|
+
helperText,
|
|
2564
|
+
prefix,
|
|
2565
|
+
suffix,
|
|
2566
|
+
optional = false,
|
|
2567
|
+
success = false,
|
|
2568
|
+
pending = false,
|
|
2569
|
+
clearable = true,
|
|
2570
|
+
disabled = false,
|
|
2288
2571
|
type,
|
|
2289
2572
|
value,
|
|
2290
|
-
onChange
|
|
2573
|
+
onChange,
|
|
2574
|
+
onFocus,
|
|
2575
|
+
onBlur,
|
|
2576
|
+
className
|
|
2291
2577
|
} = _b, props = __objRest(_b, [
|
|
2292
|
-
"
|
|
2578
|
+
"size",
|
|
2293
2579
|
"error",
|
|
2294
2580
|
"label",
|
|
2295
2581
|
"placeholder",
|
|
2296
|
-
"
|
|
2297
|
-
"
|
|
2298
|
-
"
|
|
2299
|
-
"
|
|
2300
|
-
"
|
|
2301
|
-
"
|
|
2302
|
-
"
|
|
2582
|
+
"helperText",
|
|
2583
|
+
"prefix",
|
|
2584
|
+
"suffix",
|
|
2585
|
+
"optional",
|
|
2586
|
+
"success",
|
|
2587
|
+
"pending",
|
|
2588
|
+
"clearable",
|
|
2303
2589
|
"disabled",
|
|
2304
2590
|
"type",
|
|
2305
2591
|
"value",
|
|
2306
|
-
"onChange"
|
|
2592
|
+
"onChange",
|
|
2593
|
+
"onFocus",
|
|
2594
|
+
"onBlur",
|
|
2595
|
+
"className"
|
|
2307
2596
|
]);
|
|
2308
|
-
const [isFocused, setIsFocused] = (0,
|
|
2309
|
-
|
|
2310
|
-
|
|
2597
|
+
const [isFocused, setIsFocused] = (0, import_react22.useState)(false);
|
|
2598
|
+
const isActive = isFocused && !!value;
|
|
2599
|
+
const iconButtonSize = size === "lg" ? "m" : "s";
|
|
2600
|
+
const inputRef = (0, import_react22.useRef)(null);
|
|
2601
|
+
(0, import_react22.useImperativeHandle)(ref, () => inputRef.current);
|
|
2602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "w-full flex flex-col gap-4 font-sans", children: [
|
|
2603
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2311
2604
|
"p",
|
|
2312
2605
|
{
|
|
2313
|
-
className: `text-label-medium text-left items-left ${
|
|
2606
|
+
className: `text-label-medium text-left items-left flex gap-4 ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-primary"}`,
|
|
2314
2607
|
children: [
|
|
2315
2608
|
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)` })
|
|
2609
|
+
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
2610
|
]
|
|
2319
2611
|
}
|
|
2320
|
-
) : /* @__PURE__ */ (0,
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
"
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
placeholder,
|
|
2329
|
-
disabled: isDisabled || disabled || isLoading,
|
|
2330
|
-
onFocus: () => setIsFocused(true),
|
|
2331
|
-
onBlur: () => setIsFocused(false),
|
|
2332
|
-
value,
|
|
2333
|
-
onChange,
|
|
2334
|
-
className: `w-full ${icon ? "pl-40 focus:pl-39" : "pl-16 focus:pl-15"} pr-16 focus:pr-15 ${inputSize === "md" ? "py-8 focus:py-7" : "py-12 focus:py-11"} 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"}`
|
|
2335
|
-
}, props)
|
|
2336
|
-
),
|
|
2337
|
-
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2338
|
-
Loading,
|
|
2339
|
-
{
|
|
2340
|
-
size: "sm",
|
|
2341
|
-
className: `absolute right-16 top-1/2 -translate-y-1/2`
|
|
2342
|
-
}
|
|
2343
|
-
) : isClearable && isFocused && value ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2344
|
-
"svg",
|
|
2345
|
-
{
|
|
2346
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2347
|
-
width: "20",
|
|
2348
|
-
height: "20",
|
|
2349
|
-
viewBox: "0 0 20 20",
|
|
2350
|
-
fill: "none",
|
|
2351
|
-
className: "text-gray-900 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2352
|
-
onMouseDown: (e) => {
|
|
2612
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, {}),
|
|
2613
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2614
|
+
"div",
|
|
2615
|
+
{
|
|
2616
|
+
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 : ""}`,
|
|
2617
|
+
onMouseDown: (e) => {
|
|
2618
|
+
var _a2;
|
|
2619
|
+
if (e.target !== inputRef.current && !disabled) {
|
|
2353
2620
|
e.preventDefault();
|
|
2354
|
-
|
|
2355
|
-
}
|
|
2356
|
-
|
|
2357
|
-
|
|
2621
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
2622
|
+
}
|
|
2623
|
+
},
|
|
2624
|
+
children: [
|
|
2625
|
+
prefix && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2626
|
+
"span",
|
|
2358
2627
|
{
|
|
2359
|
-
|
|
2360
|
-
|
|
2628
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2629
|
+
children: prefix
|
|
2361
2630
|
}
|
|
2362
|
-
)
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2631
|
+
),
|
|
2632
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2633
|
+
"input",
|
|
2634
|
+
__spreadValues({
|
|
2635
|
+
ref: inputRef,
|
|
2636
|
+
type: type || "text",
|
|
2637
|
+
placeholder,
|
|
2638
|
+
disabled: disabled || pending,
|
|
2639
|
+
onFocus: (e) => {
|
|
2640
|
+
setIsFocused(true);
|
|
2641
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
2642
|
+
},
|
|
2643
|
+
onBlur: (e) => {
|
|
2644
|
+
setIsFocused(false);
|
|
2645
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
2646
|
+
},
|
|
2647
|
+
value,
|
|
2648
|
+
onChange,
|
|
2649
|
+
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"}`
|
|
2650
|
+
}, props)
|
|
2651
|
+
),
|
|
2652
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2653
|
+
"span",
|
|
2375
2654
|
{
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2379
|
-
fill: "#16A34A"
|
|
2655
|
+
className: `shrink-0 ${disabled ? "text-static-icon-disabled" : "text-static-icon-primary"}`,
|
|
2656
|
+
children: suffix
|
|
2380
2657
|
}
|
|
2381
|
-
)
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
"svg",
|
|
2385
|
-
{
|
|
2386
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2387
|
-
width: "20",
|
|
2388
|
-
height: "20",
|
|
2389
|
-
viewBox: "0 0 20 20",
|
|
2390
|
-
fill: "none",
|
|
2391
|
-
className: "text-red-500 flex h-20 w-20 items-center justify-center absolute right-16 top-1/2 -translate-y-1/2",
|
|
2392
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2393
|
-
"path",
|
|
2658
|
+
),
|
|
2659
|
+
(pending || clearable || success || error) && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2660
|
+
"span",
|
|
2394
2661
|
{
|
|
2395
|
-
|
|
2396
|
-
|
|
2662
|
+
className: `shrink-0 flex items-center justify-center ${size === "lg" ? "h-40 w-40" : "h-32 w-32"}`,
|
|
2663
|
+
children: pending ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Loading, { size: "sm" }) : clearable && isFocused && value ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2664
|
+
IconButton,
|
|
2665
|
+
{
|
|
2666
|
+
size: iconButtonSize,
|
|
2667
|
+
"aria-label": "\u0E25\u0E49\u0E32\u0E07\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21",
|
|
2668
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2669
|
+
"svg",
|
|
2670
|
+
{
|
|
2671
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2672
|
+
width: "20",
|
|
2673
|
+
height: "20",
|
|
2674
|
+
viewBox: "0 0 20 20",
|
|
2675
|
+
fill: "none",
|
|
2676
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2677
|
+
"path",
|
|
2678
|
+
{
|
|
2679
|
+
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",
|
|
2680
|
+
fill: "currentColor"
|
|
2681
|
+
}
|
|
2682
|
+
)
|
|
2683
|
+
}
|
|
2684
|
+
),
|
|
2685
|
+
onMouseDown: (e) => {
|
|
2686
|
+
e.preventDefault();
|
|
2687
|
+
},
|
|
2688
|
+
onClick: () => {
|
|
2689
|
+
onChange == null ? void 0 : onChange({
|
|
2690
|
+
target: { value: "" }
|
|
2691
|
+
});
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
) : success ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2695
|
+
"svg",
|
|
2696
|
+
{
|
|
2697
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2698
|
+
width: "20",
|
|
2699
|
+
height: "20",
|
|
2700
|
+
viewBox: "0 0 20 20",
|
|
2701
|
+
fill: "none",
|
|
2702
|
+
className: "text-accent-success flex h-20 w-20 items-center justify-center",
|
|
2703
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2704
|
+
"path",
|
|
2705
|
+
{
|
|
2706
|
+
fillRule: "evenodd",
|
|
2707
|
+
clipRule: "evenodd",
|
|
2708
|
+
d: "M15.6328 6.64062L8.10449 14.1494L4.36719 10.4326L5.13281 9.64551L8.10449 12.6172L14.8672 5.875L15.6328 6.64062Z",
|
|
2709
|
+
fill: "currentColor"
|
|
2710
|
+
}
|
|
2711
|
+
)
|
|
2712
|
+
}
|
|
2713
|
+
) : error ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2714
|
+
"svg",
|
|
2715
|
+
{
|
|
2716
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2717
|
+
width: "20",
|
|
2718
|
+
height: "20",
|
|
2719
|
+
viewBox: "0 0 20 20",
|
|
2720
|
+
fill: "none",
|
|
2721
|
+
className: "text-text-field-text-danger flex h-20 w-20 items-center justify-center",
|
|
2722
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2723
|
+
"path",
|
|
2724
|
+
{
|
|
2725
|
+
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",
|
|
2726
|
+
fill: "currentColor"
|
|
2727
|
+
}
|
|
2728
|
+
)
|
|
2729
|
+
}
|
|
2730
|
+
) : null
|
|
2397
2731
|
}
|
|
2398
2732
|
)
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
error ? /* @__PURE__ */ (0,
|
|
2733
|
+
]
|
|
2734
|
+
}
|
|
2735
|
+
),
|
|
2736
|
+
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)(
|
|
2737
|
+
"p",
|
|
2738
|
+
{
|
|
2739
|
+
className: `text-caption-caption text-left items-left ${disabled ? "text-text-field-text-disabled" : "text-text-field-text-secondary"}`,
|
|
2740
|
+
children: helperText
|
|
2741
|
+
}
|
|
2742
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, {})
|
|
2403
2743
|
] });
|
|
2404
2744
|
}
|
|
2405
2745
|
);
|
|
2406
2746
|
TextField.displayName = "TextField";
|
|
2407
2747
|
|
|
2408
2748
|
// src/components/Toast/Toast.tsx
|
|
2409
|
-
var
|
|
2410
|
-
var
|
|
2749
|
+
var import_react23 = require("react");
|
|
2750
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2411
2751
|
function CheckCircleIcon({ className }) {
|
|
2412
|
-
return /* @__PURE__ */ (0,
|
|
2413
|
-
/* @__PURE__ */ (0,
|
|
2414
|
-
/* @__PURE__ */ (0,
|
|
2752
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2753
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2754
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "m7 10 2 2 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
2415
2755
|
] });
|
|
2416
2756
|
}
|
|
2417
2757
|
function ProgressIcon({ className }) {
|
|
2418
|
-
return /* @__PURE__ */ (0,
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loading, { size: "sm", className });
|
|
2419
2759
|
}
|
|
2420
2760
|
function ErrorIcon({ className }) {
|
|
2421
|
-
return /* @__PURE__ */ (0,
|
|
2422
|
-
/* @__PURE__ */ (0,
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("svg", { className, width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", "aria-hidden": "true", children: [
|
|
2762
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("circle", { cx: "10", cy: "10", r: "8", stroke: "currentColor", strokeWidth: "1.5" }),
|
|
2763
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("path", { d: "M10 6.5v4M10 13.5h.01", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
|
|
2424
2764
|
] });
|
|
2425
2765
|
}
|
|
2426
|
-
function
|
|
2427
|
-
return /* @__PURE__ */ (0,
|
|
2766
|
+
function CloseIcon5({ className }) {
|
|
2767
|
+
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" }) });
|
|
2428
2768
|
}
|
|
2429
2769
|
var defaultIcons3 = {
|
|
2430
2770
|
default: CheckCircleIcon,
|
|
@@ -2441,7 +2781,7 @@ var iconColorClasses = {
|
|
|
2441
2781
|
progress: "text-toast-progress-icon",
|
|
2442
2782
|
error: "text-toast-error-icon"
|
|
2443
2783
|
};
|
|
2444
|
-
var Toast = (0,
|
|
2784
|
+
var Toast = (0, import_react23.forwardRef)(
|
|
2445
2785
|
(_a, ref) => {
|
|
2446
2786
|
var _b = _a, {
|
|
2447
2787
|
type = "default",
|
|
@@ -2469,10 +2809,10 @@ var Toast = (0, import_react22.forwardRef)(
|
|
|
2469
2809
|
typeClasses[type],
|
|
2470
2810
|
className
|
|
2471
2811
|
].filter(Boolean).join(" ");
|
|
2472
|
-
return /* @__PURE__ */ (0,
|
|
2473
|
-
icon && /* @__PURE__ */ (0,
|
|
2474
|
-
/* @__PURE__ */ (0,
|
|
2475
|
-
actionLabel && onAction && /* @__PURE__ */ (0,
|
|
2812
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", __spreadProps(__spreadValues({ ref, role: "alert", className: classes }, rest), { children: [
|
|
2813
|
+
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" }) }),
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "flex-1 text-sm font-medium leading-20 truncate", children }),
|
|
2815
|
+
actionLabel && onAction && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2476
2816
|
"button",
|
|
2477
2817
|
{
|
|
2478
2818
|
type: "button",
|
|
@@ -2481,14 +2821,14 @@ var Toast = (0, import_react22.forwardRef)(
|
|
|
2481
2821
|
children: actionLabel
|
|
2482
2822
|
}
|
|
2483
2823
|
),
|
|
2484
|
-
onDismiss && /* @__PURE__ */ (0,
|
|
2824
|
+
onDismiss && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2485
2825
|
"button",
|
|
2486
2826
|
{
|
|
2487
2827
|
type: "button",
|
|
2488
2828
|
onClick: onDismiss,
|
|
2489
2829
|
className: "shrink-0 p-4 rounded-md text-toast-dismiss hover:text-toast-dismiss-hover transition-colors",
|
|
2490
2830
|
"aria-label": "Dismiss",
|
|
2491
|
-
children: /* @__PURE__ */ (0,
|
|
2831
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CloseIcon5, { className: "h-16 w-16" })
|
|
2492
2832
|
}
|
|
2493
2833
|
)
|
|
2494
2834
|
] }));
|
|
@@ -2497,9 +2837,9 @@ var Toast = (0, import_react22.forwardRef)(
|
|
|
2497
2837
|
Toast.displayName = "Toast";
|
|
2498
2838
|
|
|
2499
2839
|
// src/components/ToggleSwitch/ToggleSwitch.tsx
|
|
2500
|
-
var
|
|
2501
|
-
var
|
|
2502
|
-
var ToggleSwitch = (0,
|
|
2840
|
+
var import_react24 = require("react");
|
|
2841
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2842
|
+
var ToggleSwitch = (0, import_react24.forwardRef)(
|
|
2503
2843
|
(_a, ref) => {
|
|
2504
2844
|
var _b = _a, {
|
|
2505
2845
|
value,
|
|
@@ -2514,14 +2854,14 @@ var ToggleSwitch = (0, import_react23.forwardRef)(
|
|
|
2514
2854
|
"setIsSelected",
|
|
2515
2855
|
"className"
|
|
2516
2856
|
]);
|
|
2517
|
-
return /* @__PURE__ */ (0,
|
|
2857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
2518
2858
|
"label",
|
|
2519
2859
|
__spreadProps(__spreadValues({
|
|
2520
2860
|
ref,
|
|
2521
2861
|
className: `inline-flex items-center ${className}`
|
|
2522
2862
|
}, rest), {
|
|
2523
2863
|
children: [
|
|
2524
|
-
/* @__PURE__ */ (0,
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2525
2865
|
"input",
|
|
2526
2866
|
{
|
|
2527
2867
|
type: "checkbox",
|
|
@@ -2531,7 +2871,7 @@ var ToggleSwitch = (0, import_react23.forwardRef)(
|
|
|
2531
2871
|
onChange: () => !isDisabled && (setIsSelected == null ? void 0 : setIsSelected(!isSelected))
|
|
2532
2872
|
}
|
|
2533
2873
|
),
|
|
2534
|
-
/* @__PURE__ */ (0,
|
|
2874
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2535
2875
|
"div",
|
|
2536
2876
|
{
|
|
2537
2877
|
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 `
|
|
@@ -2545,9 +2885,9 @@ var ToggleSwitch = (0, import_react23.forwardRef)(
|
|
|
2545
2885
|
ToggleSwitch.displayName = "ToggleSwitch";
|
|
2546
2886
|
|
|
2547
2887
|
// src/components/Tooltip/Tooltip.tsx
|
|
2548
|
-
var
|
|
2549
|
-
var
|
|
2550
|
-
var Tooltip = (0,
|
|
2888
|
+
var import_react25 = require("react");
|
|
2889
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2890
|
+
var Tooltip = (0, import_react25.forwardRef)(
|
|
2551
2891
|
(_a, ref) => {
|
|
2552
2892
|
var _b = _a, {
|
|
2553
2893
|
size = "md",
|
|
@@ -2564,10 +2904,10 @@ var Tooltip = (0, import_react24.forwardRef)(
|
|
|
2564
2904
|
"position",
|
|
2565
2905
|
"className"
|
|
2566
2906
|
]);
|
|
2567
|
-
const wrapperRef = (0,
|
|
2568
|
-
const [isVisible, setIsVisible] = (0,
|
|
2569
|
-
const [isHovered, setIsHovered] = (0,
|
|
2570
|
-
(0,
|
|
2907
|
+
const wrapperRef = (0, import_react25.useRef)(null);
|
|
2908
|
+
const [isVisible, setIsVisible] = (0, import_react25.useState)(false);
|
|
2909
|
+
const [isHovered, setIsHovered] = (0, import_react25.useState)(false);
|
|
2910
|
+
(0, import_react25.useEffect)(() => {
|
|
2571
2911
|
const handleClickOutside = (event) => {
|
|
2572
2912
|
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
2573
2913
|
setIsVisible(false);
|
|
@@ -2579,14 +2919,14 @@ var Tooltip = (0, import_react24.forwardRef)(
|
|
|
2579
2919
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2580
2920
|
};
|
|
2581
2921
|
}, []);
|
|
2582
|
-
return /* @__PURE__ */ (0,
|
|
2922
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2583
2923
|
"div",
|
|
2584
2924
|
__spreadProps(__spreadValues({
|
|
2585
2925
|
className: `group relative inline-block ${className}`,
|
|
2586
2926
|
ref
|
|
2587
2927
|
}, rest), {
|
|
2588
2928
|
children: [
|
|
2589
|
-
/* @__PURE__ */ (0,
|
|
2929
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2590
2930
|
"div",
|
|
2591
2931
|
{
|
|
2592
2932
|
ref: wrapperRef,
|
|
@@ -2603,25 +2943,25 @@ var Tooltip = (0, import_react24.forwardRef)(
|
|
|
2603
2943
|
children
|
|
2604
2944
|
}
|
|
2605
2945
|
),
|
|
2606
|
-
/* @__PURE__ */ (0,
|
|
2946
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
2607
2947
|
"div",
|
|
2608
2948
|
{
|
|
2609
2949
|
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"}`}`,
|
|
2610
2950
|
children: [
|
|
2611
|
-
/* @__PURE__ */ (0,
|
|
2951
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2612
2952
|
"span",
|
|
2613
2953
|
{
|
|
2614
2954
|
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`} `
|
|
2615
2955
|
}
|
|
2616
2956
|
),
|
|
2617
|
-
headText ? /* @__PURE__ */ (0,
|
|
2957
|
+
headText ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
2618
2958
|
"p",
|
|
2619
2959
|
{
|
|
2620
2960
|
className: `text-sm text-white font-semibold text-center ${text ? "mb-5" : ""}`,
|
|
2621
2961
|
children: headText
|
|
2622
2962
|
}
|
|
2623
|
-
) : /* @__PURE__ */ (0,
|
|
2624
|
-
text ? /* @__PURE__ */ (0,
|
|
2963
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, {}),
|
|
2964
|
+
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, {})
|
|
2625
2965
|
]
|
|
2626
2966
|
}
|
|
2627
2967
|
)
|
|
@@ -2637,15 +2977,16 @@ Tooltip.displayName = "Tooltip";
|
|
|
2637
2977
|
AlertBanner,
|
|
2638
2978
|
Avatar,
|
|
2639
2979
|
Badge,
|
|
2640
|
-
BottomSheet,
|
|
2641
2980
|
Branding,
|
|
2642
2981
|
Button,
|
|
2643
2982
|
Checkbox,
|
|
2644
2983
|
Chip,
|
|
2645
2984
|
Dialog,
|
|
2985
|
+
Drawer,
|
|
2646
2986
|
Dropdown,
|
|
2647
2987
|
FinancialLogo,
|
|
2648
2988
|
Icon,
|
|
2989
|
+
IconButton,
|
|
2649
2990
|
Link,
|
|
2650
2991
|
Loading,
|
|
2651
2992
|
Radio,
|