@x-plat/design-system 0.8.2 → 0.9.0
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/components/AutoResizeTextArea/index.cjs +140 -4
- package/dist/components/AutoResizeTextArea/index.css +38 -3
- package/dist/components/AutoResizeTextArea/index.d.cts +3 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +3 -0
- package/dist/components/AutoResizeTextArea/index.js +140 -4
- package/dist/components/ChatInput/index.cjs +150 -9
- package/dist/components/ChatInput/index.css +38 -3
- package/dist/components/ChatInput/index.d.cts +3 -0
- package/dist/components/ChatInput/index.d.ts +3 -0
- package/dist/components/ChatInput/index.js +151 -10
- package/dist/components/CheckBox/index.cjs +132 -5
- package/dist/components/CheckBox/index.css +38 -0
- package/dist/components/CheckBox/index.d.cts +3 -0
- package/dist/components/CheckBox/index.d.ts +3 -0
- package/dist/components/CheckBox/index.js +132 -5
- package/dist/components/DatePicker/index.cjs +72 -59
- package/dist/components/DatePicker/index.css +38 -34
- package/dist/components/DatePicker/index.js +38 -25
- package/dist/components/FieldMessage/index.cjs +183 -0
- package/dist/components/FieldMessage/index.css +37 -0
- package/dist/components/FieldMessage/index.d.cts +37 -0
- package/dist/components/FieldMessage/index.d.ts +37 -0
- package/dist/components/FieldMessage/index.js +154 -0
- package/dist/components/FileUpload/index.cjs +135 -8
- package/dist/components/FileUpload/index.css +38 -0
- package/dist/components/FileUpload/index.d.cts +3 -0
- package/dist/components/FileUpload/index.d.ts +3 -0
- package/dist/components/FileUpload/index.js +135 -8
- package/dist/components/ImageSelector/index.cjs +153 -11
- package/dist/components/ImageSelector/index.css +38 -0
- package/dist/components/ImageSelector/index.d.cts +3 -0
- package/dist/components/ImageSelector/index.d.ts +3 -0
- package/dist/components/ImageSelector/index.js +153 -11
- package/dist/components/Input/index.cjs +38 -25
- package/dist/components/Input/index.css +38 -34
- package/dist/components/Input/index.d.cts +3 -8
- package/dist/components/Input/index.d.ts +3 -8
- package/dist/components/Input/index.js +36 -23
- package/dist/components/Radio/index.cjs +152 -8
- package/dist/components/Radio/index.css +38 -0
- package/dist/components/Radio/index.d.cts +3 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/Radio/index.js +152 -8
- package/dist/components/Select/index.cjs +139 -13
- package/dist/components/Select/index.css +38 -0
- package/dist/components/Select/index.d.cts +3 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.js +139 -13
- package/dist/components/Switch/index.cjs +140 -4
- package/dist/components/Switch/index.css +38 -0
- package/dist/components/Switch/index.d.cts +3 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.js +140 -4
- package/dist/components/TextArea/index.cjs +138 -2
- package/dist/components/TextArea/index.css +38 -3
- package/dist/components/TextArea/index.d.cts +3 -0
- package/dist/components/TextArea/index.d.ts +3 -0
- package/dist/components/TextArea/index.js +138 -2
- package/dist/components/index.cjs +439 -385
- package/dist/components/index.css +38 -40
- package/dist/components/index.d.cts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +222 -171
- package/dist/index.cjs +444 -390
- package/dist/index.css +38 -40
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +224 -173
- package/dist/validation-Dqo1zqhT.d.cts +13 -0
- package/dist/validation-Dqo1zqhT.d.ts +13 -0
- package/guidelines/components/form.md +26 -0
- package/package.json +1 -1
|
@@ -780,12 +780,83 @@ var CheckIcon_default = CheckIcon;
|
|
|
780
780
|
|
|
781
781
|
// src/tokens/svg/status/ErrorIcon.tsx
|
|
782
782
|
import { jsx as jsx254, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
783
|
+
var ErrorIcon = () => /* @__PURE__ */ jsxs160(
|
|
784
|
+
"svg",
|
|
785
|
+
{
|
|
786
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
787
|
+
width: "1em",
|
|
788
|
+
height: "1em",
|
|
789
|
+
viewBox: "0 0 16 16",
|
|
790
|
+
fill: "none",
|
|
791
|
+
children: [
|
|
792
|
+
/* @__PURE__ */ jsxs160("g", { clipPath: "url(#clip0_1196_9603)", children: [
|
|
793
|
+
/* @__PURE__ */ jsx254(
|
|
794
|
+
"path",
|
|
795
|
+
{
|
|
796
|
+
d: "M9.57588 5.57559C9.81019 5.34127 10.19 5.34127 10.4243 5.57559C10.6586 5.8099 10.6586 6.18971 10.4243 6.42402L8.84854 7.9998L10.4243 9.57559C10.6586 9.8099 10.6586 10.1897 10.4243 10.424C10.19 10.6583 9.81019 10.6583 9.57588 10.424L8.0001 8.84824L6.42432 10.424C6.19 10.6583 5.81019 10.6583 5.57588 10.424C5.34156 10.1897 5.34156 9.8099 5.57588 9.57559L7.15166 7.9998L5.57588 6.42402C5.34156 6.18971 5.34156 5.8099 5.57588 5.57559C5.81019 5.34127 6.19 5.34127 6.42432 5.57559L8.0001 7.15137L9.57588 5.57559Z",
|
|
797
|
+
fill: "currentColor"
|
|
798
|
+
}
|
|
799
|
+
),
|
|
800
|
+
/* @__PURE__ */ jsx254(
|
|
801
|
+
"path",
|
|
802
|
+
{
|
|
803
|
+
fillRule: "evenodd",
|
|
804
|
+
clipRule: "evenodd",
|
|
805
|
+
d: "M8.0001 0.733398C12.0131 0.73361 15.2671 3.98679 15.2673 7.9998C15.2672 12.0129 12.0131 15.2668 8.0001 15.267C3.98701 15.2669 0.733016 12.0129 0.73291 7.9998C0.733051 3.98674 3.98704 0.733539 8.0001 0.733398ZM8.0001 1.9334C4.64978 1.93354 1.93383 4.64948 1.93369 7.9998C1.9338 11.3502 4.64975 14.0669 8.0001 14.067C11.3504 14.0668 14.0672 11.3501 14.0673 7.9998C14.0671 4.64953 11.3504 1.93361 8.0001 1.9334Z",
|
|
806
|
+
fill: "currentColor"
|
|
807
|
+
}
|
|
808
|
+
)
|
|
809
|
+
] }),
|
|
810
|
+
/* @__PURE__ */ jsx254("defs", { children: /* @__PURE__ */ jsx254("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ jsx254("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
811
|
+
]
|
|
812
|
+
}
|
|
813
|
+
);
|
|
814
|
+
var ErrorIcon_default = ErrorIcon;
|
|
783
815
|
|
|
784
816
|
// src/tokens/svg/status/HelpCircleIcon.tsx
|
|
785
817
|
import { jsx as jsx255, jsxs as jsxs161 } from "react/jsx-runtime";
|
|
786
818
|
|
|
787
819
|
// src/tokens/svg/status/InfoIcon.tsx
|
|
788
820
|
import { jsx as jsx256, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
821
|
+
var InfoIcon = () => /* @__PURE__ */ jsxs162(
|
|
822
|
+
"svg",
|
|
823
|
+
{
|
|
824
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
825
|
+
width: "1em",
|
|
826
|
+
height: "1em",
|
|
827
|
+
viewBox: "0 0 16 16",
|
|
828
|
+
fill: "none",
|
|
829
|
+
children: [
|
|
830
|
+
/* @__PURE__ */ jsxs162("g", { clipPath: "url(#clip0_1188_11261)", children: [
|
|
831
|
+
/* @__PURE__ */ jsx256(
|
|
832
|
+
"path",
|
|
833
|
+
{
|
|
834
|
+
d: "M8.00156 7.39999C8.33293 7.39999 8.60156 7.66862 8.60156 7.99999V10.6664C8.60156 10.9978 8.33293 11.2664 8.00156 11.2664C7.67019 11.2664 7.40156 10.9978 7.40156 10.6664V7.99999C7.40156 7.66862 7.67019 7.39999 8.00156 7.39999Z",
|
|
835
|
+
fill: "currentColor"
|
|
836
|
+
}
|
|
837
|
+
),
|
|
838
|
+
/* @__PURE__ */ jsx256(
|
|
839
|
+
"path",
|
|
840
|
+
{
|
|
841
|
+
d: "M8.00859 4.73358C8.3398 4.73378 8.60859 5.00233 8.60859 5.33358C8.60849 5.66474 8.33973 5.93338 8.00859 5.93358H8.00156C7.67026 5.93358 7.40167 5.66486 7.40156 5.33358C7.40156 5.00221 7.67019 4.73358 8.00156 4.73358H8.00859Z",
|
|
842
|
+
fill: "currentColor"
|
|
843
|
+
}
|
|
844
|
+
),
|
|
845
|
+
/* @__PURE__ */ jsx256(
|
|
846
|
+
"path",
|
|
847
|
+
{
|
|
848
|
+
fillRule: "evenodd",
|
|
849
|
+
clipRule: "evenodd",
|
|
850
|
+
d: "M8.00156 0.733582C12.0146 0.733793 15.2686 3.98697 15.2688 7.99999C15.2686 12.013 12.0146 15.267 8.00156 15.2672C3.98848 15.267 0.734481 12.0131 0.734375 7.99999C0.734516 3.98693 3.9885 0.733722 8.00156 0.733582ZM8.00156 1.93358C4.65124 1.93372 1.9353 4.64967 1.93516 7.99999C1.93526 11.3503 4.65122 14.067 8.00156 14.0672C11.3518 14.067 14.0686 11.3503 14.0688 7.99999C14.0686 4.64971 11.3518 1.93379 8.00156 1.93358Z",
|
|
851
|
+
fill: "currentColor"
|
|
852
|
+
}
|
|
853
|
+
)
|
|
854
|
+
] }),
|
|
855
|
+
/* @__PURE__ */ jsx256("defs", { children: /* @__PURE__ */ jsx256("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ jsx256("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
856
|
+
]
|
|
857
|
+
}
|
|
858
|
+
);
|
|
859
|
+
var InfoIcon_default = InfoIcon;
|
|
789
860
|
|
|
790
861
|
// src/tokens/svg/status/LoaderIcon.tsx
|
|
791
862
|
import { jsx as jsx257, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
@@ -810,6 +881,24 @@ import { jsx as jsx263, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
|
810
881
|
|
|
811
882
|
// src/tokens/svg/status/SuccessIcon.tsx
|
|
812
883
|
import { jsx as jsx264 } from "react/jsx-runtime";
|
|
884
|
+
var SuccessIcon = () => /* @__PURE__ */ jsx264(
|
|
885
|
+
"svg",
|
|
886
|
+
{
|
|
887
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
888
|
+
width: "1em",
|
|
889
|
+
height: "1em",
|
|
890
|
+
viewBox: "0 0 16 16",
|
|
891
|
+
fill: "none",
|
|
892
|
+
children: /* @__PURE__ */ jsx264(
|
|
893
|
+
"path",
|
|
894
|
+
{
|
|
895
|
+
d: "M12.9084 3.57597C13.1426 3.34172 13.5225 3.34185 13.7568 3.57597C13.9911 3.81028 13.9911 4.19009 13.7568 4.4244L6.424 11.758C6.31157 11.8703 6.15869 11.9337 5.99978 11.9338C5.8409 11.9337 5.68798 11.8703 5.57556 11.758L2.24197 8.4244C2.00782 8.19018 2.00795 7.81028 2.24197 7.57597C2.47626 7.34167 2.85609 7.34172 3.09041 7.57597L5.999 10.4846L12.9084 3.57597Z",
|
|
896
|
+
fill: "currentColor"
|
|
897
|
+
}
|
|
898
|
+
)
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
var SuccessIcon_default = SuccessIcon;
|
|
813
902
|
|
|
814
903
|
// src/tokens/svg/status/XCircleIcon.tsx
|
|
815
904
|
import { jsx as jsx265, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
@@ -920,8 +1009,43 @@ function clsx() {
|
|
|
920
1009
|
}
|
|
921
1010
|
var clsx_default = clsx;
|
|
922
1011
|
|
|
1012
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
1013
|
+
import { Fragment, jsx as jsx295, jsxs as jsxs189 } from "react/jsx-runtime";
|
|
1014
|
+
var ICON = {
|
|
1015
|
+
default: /* @__PURE__ */ jsx295(InfoIcon_default, {}),
|
|
1016
|
+
success: /* @__PURE__ */ jsx295(SuccessIcon_default, {}),
|
|
1017
|
+
warning: /* @__PURE__ */ jsx295(InfoIcon_default, {}),
|
|
1018
|
+
error: /* @__PURE__ */ jsx295(ErrorIcon_default, {})
|
|
1019
|
+
};
|
|
1020
|
+
var FieldMessage = (props) => {
|
|
1021
|
+
const { validations } = props;
|
|
1022
|
+
if (!validations || validations.length === 0) return null;
|
|
1023
|
+
return /* @__PURE__ */ jsx295("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ jsxs189(
|
|
1024
|
+
"div",
|
|
1025
|
+
{
|
|
1026
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
1027
|
+
children: [
|
|
1028
|
+
/* @__PURE__ */ jsx295("div", { className: "icon", children: ICON[v.status] }),
|
|
1029
|
+
/* @__PURE__ */ jsx295("span", { children: v.message })
|
|
1030
|
+
]
|
|
1031
|
+
},
|
|
1032
|
+
`${v.message}_${idx}`
|
|
1033
|
+
)) });
|
|
1034
|
+
};
|
|
1035
|
+
FieldMessage.displayName = "FieldMessage";
|
|
1036
|
+
var Field = (props) => {
|
|
1037
|
+
const { validations, children } = props;
|
|
1038
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ jsx295(Fragment, { children });
|
|
1039
|
+
return /* @__PURE__ */ jsxs189("div", { className: "lib-xplat-field", children: [
|
|
1040
|
+
children,
|
|
1041
|
+
/* @__PURE__ */ jsx295(FieldMessage, { validations })
|
|
1042
|
+
] });
|
|
1043
|
+
};
|
|
1044
|
+
Field.displayName = "Field";
|
|
1045
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
1046
|
+
|
|
923
1047
|
// src/components/CheckBox/CheckBox.tsx
|
|
924
|
-
import { jsx as
|
|
1048
|
+
import { jsx as jsx296, jsxs as jsxs190 } from "react/jsx-runtime";
|
|
925
1049
|
var CheckBox = (props) => {
|
|
926
1050
|
const {
|
|
927
1051
|
checked,
|
|
@@ -931,6 +1055,7 @@ var CheckBox = (props) => {
|
|
|
931
1055
|
disabled,
|
|
932
1056
|
size = "md",
|
|
933
1057
|
type = "brand",
|
|
1058
|
+
validations,
|
|
934
1059
|
...rest
|
|
935
1060
|
} = props;
|
|
936
1061
|
const handleChange = (e) => {
|
|
@@ -940,20 +1065,22 @@ var CheckBox = (props) => {
|
|
|
940
1065
|
const checkedClasses = `checked`;
|
|
941
1066
|
const disabledClasses = "disabled";
|
|
942
1067
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
943
|
-
|
|
944
|
-
/* @__PURE__ */
|
|
1068
|
+
const control = /* @__PURE__ */ jsxs190("label", { className: clsx_default("lib-xplat-checkbox", size, type, className), children: [
|
|
1069
|
+
/* @__PURE__ */ jsx296(
|
|
945
1070
|
"input",
|
|
946
1071
|
{
|
|
947
1072
|
type: "checkbox",
|
|
948
1073
|
checked,
|
|
949
1074
|
onChange: handleChange,
|
|
950
1075
|
disabled,
|
|
1076
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
951
1077
|
...rest
|
|
952
1078
|
}
|
|
953
1079
|
),
|
|
954
|
-
/* @__PURE__ */
|
|
955
|
-
label && /* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ jsx296("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ jsx296("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ jsx296(CheckIcon_default, {}) }) }),
|
|
1081
|
+
label && /* @__PURE__ */ jsx296("span", { className: "label", children: label })
|
|
956
1082
|
] });
|
|
1083
|
+
return /* @__PURE__ */ jsx296(Field, { validations, children: control });
|
|
957
1084
|
};
|
|
958
1085
|
CheckBox.displayName = "CheckBox";
|
|
959
1086
|
var CheckBox_default = CheckBox;
|
|
@@ -38,7 +38,7 @@ __export(DatePicker_exports, {
|
|
|
38
38
|
module.exports = __toCommonJS(DatePicker_exports);
|
|
39
39
|
|
|
40
40
|
// src/components/DatePicker/InputDatePicker/index.tsx
|
|
41
|
-
var
|
|
41
|
+
var import_react6 = __toESM(require("react"), 1);
|
|
42
42
|
|
|
43
43
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
44
44
|
function r(e) {
|
|
@@ -180,22 +180,41 @@ var SuccessIcon = () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
|
180
180
|
);
|
|
181
181
|
var SuccessIcon_default = SuccessIcon;
|
|
182
182
|
|
|
183
|
-
// src/components/
|
|
183
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
184
184
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
var ICON = {
|
|
186
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InfoIcon_default, {}),
|
|
187
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SuccessIcon_default, {}),
|
|
188
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(InfoIcon_default, {}),
|
|
189
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorIcon_default, {})
|
|
190
|
+
};
|
|
191
|
+
var FieldMessage = (props) => {
|
|
192
|
+
const { validations } = props;
|
|
193
|
+
if (!validations || validations.length === 0) return null;
|
|
194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
195
|
+
"div",
|
|
196
|
+
{
|
|
197
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "icon", children: ICON[v.status] }),
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: v.message })
|
|
201
|
+
]
|
|
202
|
+
},
|
|
203
|
+
`${v.message}_${idx}`
|
|
204
|
+
)) });
|
|
205
|
+
};
|
|
206
|
+
FieldMessage.displayName = "FieldMessage";
|
|
207
|
+
var FieldMessage_default = FieldMessage;
|
|
208
|
+
var Field = (props) => {
|
|
209
|
+
const { validations, children } = props;
|
|
210
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children });
|
|
211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
212
|
+
children,
|
|
213
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FieldMessage, { validations })
|
|
195
214
|
] });
|
|
196
215
|
};
|
|
197
|
-
|
|
198
|
-
var
|
|
216
|
+
Field.displayName = "Field";
|
|
217
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
199
218
|
|
|
200
219
|
// src/components/Input/reg.ts
|
|
201
220
|
var numberAndCommaReg = /^[0-9,]+$/;
|
|
@@ -233,7 +252,6 @@ var handleTelBackspace = (prevValue, currValue) => {
|
|
|
233
252
|
|
|
234
253
|
// src/components/Input/Input.tsx
|
|
235
254
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
236
|
-
var import_react2 = require("react");
|
|
237
255
|
var formatValue = (type, value) => {
|
|
238
256
|
if (value === null || value === void 0) return "";
|
|
239
257
|
const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
|
|
@@ -322,27 +340,22 @@ var Input = import_react.default.forwardRef((props, ref) => {
|
|
|
322
340
|
disabled,
|
|
323
341
|
type: type === "number" ? "text" : type,
|
|
324
342
|
value: localValue,
|
|
325
|
-
onChange: handleChange
|
|
343
|
+
onChange: handleChange,
|
|
344
|
+
"aria-invalid": hasError(validations) || void 0
|
|
326
345
|
}
|
|
327
346
|
),
|
|
328
347
|
suffix && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "suffix", children: suffix })
|
|
329
348
|
]
|
|
330
349
|
}
|
|
331
350
|
),
|
|
332
|
-
|
|
333
|
-
InputValidations_default,
|
|
334
|
-
{
|
|
335
|
-
...validation,
|
|
336
|
-
key: `${validation.message}_${idx}`
|
|
337
|
-
}
|
|
338
|
-
)) })
|
|
351
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(FieldMessage_default, { validations })
|
|
339
352
|
] });
|
|
340
353
|
});
|
|
341
354
|
Input.displayName = "Input";
|
|
342
355
|
var Input_default = Input;
|
|
343
356
|
|
|
344
357
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
345
|
-
var
|
|
358
|
+
var import_react2 = __toESM(require("react"), 1);
|
|
346
359
|
|
|
347
360
|
// src/tokens/svg/form/CloseEyeIcon.tsx
|
|
348
361
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
@@ -412,10 +425,10 @@ var OpenEyeIcon_default = OpenEyeIcon;
|
|
|
412
425
|
|
|
413
426
|
// src/components/Input/PasswordInput/PasswordInput.tsx
|
|
414
427
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
415
|
-
var PasswordInput =
|
|
428
|
+
var PasswordInput = import_react2.default.forwardRef(
|
|
416
429
|
(props, ref) => {
|
|
417
430
|
const { reg: _reg, ...inputProps } = props;
|
|
418
|
-
const [isView, setIsView] =
|
|
431
|
+
const [isView, setIsView] = import_react2.default.useState(false);
|
|
419
432
|
const handleChangeView = () => {
|
|
420
433
|
setIsView((prev) => !prev);
|
|
421
434
|
};
|
|
@@ -433,16 +446,16 @@ var PasswordInput = import_react3.default.forwardRef(
|
|
|
433
446
|
PasswordInput.displayName = "PasswordInput";
|
|
434
447
|
|
|
435
448
|
// src/components/Modal/Modal.tsx
|
|
436
|
-
var
|
|
449
|
+
var import_react3 = __toESM(require("react"), 1);
|
|
437
450
|
var import_react_dom = require("react-dom");
|
|
438
451
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
439
452
|
var ANIMATION_DURATION_MS = 200;
|
|
440
453
|
var Modal = (props) => {
|
|
441
454
|
const { isOpen, onClose, children } = props;
|
|
442
|
-
const [mounted, setMounted] =
|
|
443
|
-
const [visible, setVisible] =
|
|
444
|
-
const [settled, setSettled] =
|
|
445
|
-
|
|
455
|
+
const [mounted, setMounted] = import_react3.default.useState(false);
|
|
456
|
+
const [visible, setVisible] = import_react3.default.useState(false);
|
|
457
|
+
const [settled, setSettled] = import_react3.default.useState(false);
|
|
458
|
+
import_react3.default.useEffect(() => {
|
|
446
459
|
if (isOpen) {
|
|
447
460
|
setMounted(true);
|
|
448
461
|
const show = setTimeout(() => setVisible(true), 1);
|
|
@@ -1396,15 +1409,15 @@ var import_jsx_runtime298 = require("react/jsx-runtime");
|
|
|
1396
1409
|
var import_jsx_runtime299 = require("react/jsx-runtime");
|
|
1397
1410
|
|
|
1398
1411
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
1399
|
-
var
|
|
1412
|
+
var import_react5 = __toESM(require("react"), 1);
|
|
1400
1413
|
|
|
1401
1414
|
// src/components/Calendar/useCalendar.ts
|
|
1402
|
-
var
|
|
1415
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
1403
1416
|
var useCalendar = (initialYear, initialMonth) => {
|
|
1404
1417
|
const today = /* @__PURE__ */ new Date();
|
|
1405
|
-
const [year, setYear] =
|
|
1406
|
-
const [month, setMonth] =
|
|
1407
|
-
const days =
|
|
1418
|
+
const [year, setYear] = import_react4.default.useState(initialYear ?? today.getFullYear());
|
|
1419
|
+
const [month, setMonth] = import_react4.default.useState(initialMonth ?? today.getMonth());
|
|
1420
|
+
const days = import_react4.default.useMemo(() => {
|
|
1408
1421
|
const firstDay = new Date(year, month, 1);
|
|
1409
1422
|
const lastDay = new Date(year, month + 1, 0);
|
|
1410
1423
|
const startDayOfWeek = firstDay.getDay();
|
|
@@ -1447,7 +1460,7 @@ var useCalendar = (initialYear, initialMonth) => {
|
|
|
1447
1460
|
}
|
|
1448
1461
|
return result;
|
|
1449
1462
|
}, [year, month]);
|
|
1450
|
-
const goToPrevMonth =
|
|
1463
|
+
const goToPrevMonth = import_react4.default.useCallback(() => {
|
|
1451
1464
|
setMonth((prev) => {
|
|
1452
1465
|
if (prev === 0) {
|
|
1453
1466
|
setYear((y) => y - 1);
|
|
@@ -1456,7 +1469,7 @@ var useCalendar = (initialYear, initialMonth) => {
|
|
|
1456
1469
|
return prev - 1;
|
|
1457
1470
|
});
|
|
1458
1471
|
}, []);
|
|
1459
|
-
const goToNextMonth =
|
|
1472
|
+
const goToNextMonth = import_react4.default.useCallback(() => {
|
|
1460
1473
|
setMonth((prev) => {
|
|
1461
1474
|
if (prev === 11) {
|
|
1462
1475
|
setYear((y) => y + 1);
|
|
@@ -1465,7 +1478,7 @@ var useCalendar = (initialYear, initialMonth) => {
|
|
|
1465
1478
|
return prev + 1;
|
|
1466
1479
|
});
|
|
1467
1480
|
}, []);
|
|
1468
|
-
const goToToday =
|
|
1481
|
+
const goToToday = import_react4.default.useCallback(() => {
|
|
1469
1482
|
setYear(today.getFullYear());
|
|
1470
1483
|
setMonth(today.getMonth());
|
|
1471
1484
|
}, []);
|
|
@@ -1500,7 +1513,7 @@ var MONTH_LABELS = {
|
|
|
1500
1513
|
|
|
1501
1514
|
// src/components/DatePicker/SingleDatePicker/index.tsx
|
|
1502
1515
|
var import_jsx_runtime300 = require("react/jsx-runtime");
|
|
1503
|
-
var DayCell =
|
|
1516
|
+
var DayCell = import_react5.default.memo(
|
|
1504
1517
|
({
|
|
1505
1518
|
day,
|
|
1506
1519
|
disabled,
|
|
@@ -1552,26 +1565,26 @@ var SingleDatePicker = (props) => {
|
|
|
1552
1565
|
initialYear,
|
|
1553
1566
|
initialMonth
|
|
1554
1567
|
);
|
|
1555
|
-
const [pickerMode, setPickerMode] =
|
|
1556
|
-
const [yearRangeStart, setYearRangeStart] =
|
|
1568
|
+
const [pickerMode, setPickerMode] = import_react5.default.useState("days");
|
|
1569
|
+
const [yearRangeStart, setYearRangeStart] = import_react5.default.useState(
|
|
1557
1570
|
Math.floor((initialYear ?? (/* @__PURE__ */ new Date()).getFullYear()) / 12) * 12
|
|
1558
1571
|
);
|
|
1559
|
-
const minTime =
|
|
1572
|
+
const minTime = import_react5.default.useMemo(
|
|
1560
1573
|
() => minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()).getTime() : -Infinity,
|
|
1561
1574
|
[minDate]
|
|
1562
1575
|
);
|
|
1563
|
-
const maxTime =
|
|
1576
|
+
const maxTime = import_react5.default.useMemo(
|
|
1564
1577
|
() => maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate()).getTime() : Infinity,
|
|
1565
1578
|
[maxDate]
|
|
1566
1579
|
);
|
|
1567
|
-
const highlightSet =
|
|
1580
|
+
const highlightSet = import_react5.default.useMemo(() => {
|
|
1568
1581
|
const set = /* @__PURE__ */ new Set();
|
|
1569
1582
|
for (const h of highlightDates) {
|
|
1570
1583
|
set.add(`${h.getFullYear()}-${h.getMonth()}-${h.getDate()}`);
|
|
1571
1584
|
}
|
|
1572
1585
|
return set;
|
|
1573
1586
|
}, [highlightDates]);
|
|
1574
|
-
const handleSelect =
|
|
1587
|
+
const handleSelect = import_react5.default.useCallback(
|
|
1575
1588
|
(date) => {
|
|
1576
1589
|
onChange?.(date);
|
|
1577
1590
|
},
|
|
@@ -1700,8 +1713,8 @@ var formatDate = (date) => {
|
|
|
1700
1713
|
};
|
|
1701
1714
|
var InputDatePicker = (props) => {
|
|
1702
1715
|
const { value, onChange, minDate, maxDate, disabled, locale = "ko", placeholder } = props;
|
|
1703
|
-
const [isOpen, setIsOpen] =
|
|
1704
|
-
const [tempDate, setTempDate] =
|
|
1716
|
+
const [isOpen, setIsOpen] = import_react6.default.useState(false);
|
|
1717
|
+
const [tempDate, setTempDate] = import_react6.default.useState(value ?? /* @__PURE__ */ new Date());
|
|
1705
1718
|
const handleOpen = () => {
|
|
1706
1719
|
if (disabled) return;
|
|
1707
1720
|
setTempDate(value ?? /* @__PURE__ */ new Date());
|
|
@@ -1750,18 +1763,18 @@ InputDatePicker.displayName = "InputDatePicker";
|
|
|
1750
1763
|
var InputDatePicker_default = InputDatePicker;
|
|
1751
1764
|
|
|
1752
1765
|
// src/components/DatePicker/PopupPicker/index.tsx
|
|
1753
|
-
var
|
|
1766
|
+
var import_react10 = __toESM(require("react"), 1);
|
|
1754
1767
|
|
|
1755
1768
|
// src/components/DatePicker/RangePicker/index.tsx
|
|
1756
|
-
var
|
|
1769
|
+
var import_react9 = __toESM(require("react"), 1);
|
|
1757
1770
|
|
|
1758
1771
|
// src/components/Tab/Tab.tsx
|
|
1759
|
-
var
|
|
1772
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
1760
1773
|
|
|
1761
1774
|
// src/components/Tab/TabItem.tsx
|
|
1762
|
-
var
|
|
1775
|
+
var import_react7 = __toESM(require("react"), 1);
|
|
1763
1776
|
var import_jsx_runtime302 = require("react/jsx-runtime");
|
|
1764
|
-
var TabItem =
|
|
1777
|
+
var TabItem = import_react7.default.forwardRef((props, ref) => {
|
|
1765
1778
|
const { isActive, title, onClick } = props;
|
|
1766
1779
|
return /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(
|
|
1767
1780
|
"div",
|
|
@@ -1780,15 +1793,15 @@ var TabItem_default = TabItem;
|
|
|
1780
1793
|
var import_jsx_runtime303 = require("react/jsx-runtime");
|
|
1781
1794
|
var Tab = (props) => {
|
|
1782
1795
|
const { activeIndex, onChange, tabs, type, size = "md" } = props;
|
|
1783
|
-
const [underlineStyle, setUnderlineStyle] =
|
|
1796
|
+
const [underlineStyle, setUnderlineStyle] = import_react8.default.useState({
|
|
1784
1797
|
left: 0,
|
|
1785
1798
|
width: 0
|
|
1786
1799
|
});
|
|
1787
|
-
const itemRefs =
|
|
1800
|
+
const itemRefs = import_react8.default.useRef([]);
|
|
1788
1801
|
const handleChangeActiveTab = (tabItem, tabIdx) => {
|
|
1789
1802
|
onChange(tabItem, tabIdx);
|
|
1790
1803
|
};
|
|
1791
|
-
|
|
1804
|
+
import_react8.default.useEffect(() => {
|
|
1792
1805
|
const el = itemRefs.current[activeIndex];
|
|
1793
1806
|
if (el) {
|
|
1794
1807
|
setUnderlineStyle({ left: el.offsetLeft, width: el.offsetWidth });
|
|
@@ -1833,7 +1846,7 @@ var RangePicker = (props) => {
|
|
|
1833
1846
|
maxDate,
|
|
1834
1847
|
locale = "ko"
|
|
1835
1848
|
} = props;
|
|
1836
|
-
const [activeTab, setActiveTab] =
|
|
1849
|
+
const [activeTab, setActiveTab] = import_react9.default.useState("start");
|
|
1837
1850
|
const handleStartChange = (date) => {
|
|
1838
1851
|
if (!date) return;
|
|
1839
1852
|
const newStart = date > endDate ? endDate : date;
|
|
@@ -1918,7 +1931,7 @@ var RangePicker_default = RangePicker;
|
|
|
1918
1931
|
var import_jsx_runtime305 = require("react/jsx-runtime");
|
|
1919
1932
|
var PopupPicker = (props) => {
|
|
1920
1933
|
const { component, type, locale } = props;
|
|
1921
|
-
const [isOpen, setIsOpen] =
|
|
1934
|
+
const [isOpen, setIsOpen] = import_react10.default.useState(false);
|
|
1922
1935
|
const handleClick = () => setIsOpen(true);
|
|
1923
1936
|
const handleClose = () => setIsOpen(false);
|
|
1924
1937
|
const handleSingleChange = (date) => {
|
|
@@ -1927,7 +1940,7 @@ var PopupPicker = (props) => {
|
|
|
1927
1940
|
handleClose();
|
|
1928
1941
|
};
|
|
1929
1942
|
return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "lib-xplat-popup-datepicker", children: [
|
|
1930
|
-
|
|
1943
|
+
import_react10.default.cloneElement(component, { onClick: handleClick }),
|
|
1931
1944
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsx)(Modal_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: clsx_default("lib-xplat-popup-datepicker-card", type === "range" && "range-mode"), children: [
|
|
1932
1945
|
/* @__PURE__ */ (0, import_jsx_runtime305.jsxs)("div", { className: "popup-datepicker-content", children: [
|
|
1933
1946
|
type === "single" && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(
|
|
@@ -105,6 +105,44 @@
|
|
|
105
105
|
outline-offset: 2px;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
+
/* src/components/FieldMessage/fieldMessage.scss */
|
|
109
|
+
.lib-xplat-field {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
gap: var(--spacing-space-2);
|
|
113
|
+
}
|
|
114
|
+
.lib-xplat-field-message-wrap {
|
|
115
|
+
display: flex;
|
|
116
|
+
gap: var(--spacing-space-2);
|
|
117
|
+
margin-left: var(--spacing-space-1);
|
|
118
|
+
}
|
|
119
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message {
|
|
120
|
+
display: flex;
|
|
121
|
+
gap: var(--spacing-space-1);
|
|
122
|
+
font-family: var(--semantic-typo-caption-2-r-font);
|
|
123
|
+
font-size: var(--semantic-typo-caption-2-r-size);
|
|
124
|
+
line-height: var(--semantic-typo-caption-2-r-lh);
|
|
125
|
+
font-weight: var(--semantic-typo-caption-2-r-weight);
|
|
126
|
+
letter-spacing: var(--semantic-typo-caption-2-r-ls);
|
|
127
|
+
align-items: center;
|
|
128
|
+
user-select: none;
|
|
129
|
+
}
|
|
130
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.default {
|
|
131
|
+
color: var(--semantic-icon-secondary);
|
|
132
|
+
}
|
|
133
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.success {
|
|
134
|
+
color: var(--semantic-text-success);
|
|
135
|
+
}
|
|
136
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.warning {
|
|
137
|
+
color: var(--semantic-text-warning);
|
|
138
|
+
}
|
|
139
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.error {
|
|
140
|
+
color: var(--semantic-text-error);
|
|
141
|
+
}
|
|
142
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message > .icon {
|
|
143
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
144
|
+
}
|
|
145
|
+
|
|
108
146
|
/* src/components/Input/input.scss */
|
|
109
147
|
.lib-xplat-input-wrap {
|
|
110
148
|
display: flex;
|
|
@@ -131,9 +169,6 @@
|
|
|
131
169
|
outline: 2px solid transparent;
|
|
132
170
|
outline-offset: 2px;
|
|
133
171
|
}
|
|
134
|
-
.lib-xplat-input-wrap .lib-xplat-input:has(> input:not(:placeholder-shown)):not(:focus-within) {
|
|
135
|
-
border-color: var(--semantic-border-tertiary);
|
|
136
|
-
}
|
|
137
172
|
.lib-xplat-input-wrap .lib-xplat-input.sm {
|
|
138
173
|
height: var(--spacing-control-height-sm);
|
|
139
174
|
font-family: var(--semantic-typo-caption-1-r-font);
|
|
@@ -190,37 +225,6 @@
|
|
|
190
225
|
.lib-xplat-input-wrap .lib-xplat-input > .suffix > .wrapper.pointer {
|
|
191
226
|
cursor: pointer;
|
|
192
227
|
}
|
|
193
|
-
.lib-xplat-input-wrap .lib-xplat-input-validation-wrap {
|
|
194
|
-
display: flex;
|
|
195
|
-
gap: var(--spacing-space-2);
|
|
196
|
-
margin-left: var(--spacing-space-1);
|
|
197
|
-
}
|
|
198
|
-
.lib-xplat-input-wrap .lib-xplat-input-validation-wrap > .lib-xplat-input-validation {
|
|
199
|
-
display: flex;
|
|
200
|
-
gap: var(--spacing-space-1);
|
|
201
|
-
font-family: var(--semantic-typo-caption-2-r-font);
|
|
202
|
-
font-size: var(--semantic-typo-caption-2-r-size);
|
|
203
|
-
line-height: var(--semantic-typo-caption-2-r-lh);
|
|
204
|
-
font-weight: var(--semantic-typo-caption-2-r-weight);
|
|
205
|
-
letter-spacing: var(--semantic-typo-caption-2-r-ls);
|
|
206
|
-
align-items: center;
|
|
207
|
-
user-select: none;
|
|
208
|
-
}
|
|
209
|
-
.lib-xplat-input-wrap .lib-xplat-input-validation-wrap > .lib-xplat-input-validation.default {
|
|
210
|
-
color: var(--semantic-icon-secondary);
|
|
211
|
-
}
|
|
212
|
-
.lib-xplat-input-wrap .lib-xplat-input-validation-wrap > .lib-xplat-input-validation.success {
|
|
213
|
-
color: var(--semantic-text-success);
|
|
214
|
-
}
|
|
215
|
-
.lib-xplat-input-wrap .lib-xplat-input-validation-wrap > .lib-xplat-input-validation.warning {
|
|
216
|
-
color: var(--semantic-text-warning);
|
|
217
|
-
}
|
|
218
|
-
.lib-xplat-input-wrap .lib-xplat-input-validation-wrap > .lib-xplat-input-validation.error {
|
|
219
|
-
color: var(--semantic-text-error);
|
|
220
|
-
}
|
|
221
|
-
.lib-xplat-input-wrap .lib-xplat-input-validation-wrap > .lib-xplat-input-validation > .icon {
|
|
222
|
-
font-size: var(--semantic-typo-label-2-m-size);
|
|
223
|
-
}
|
|
224
228
|
|
|
225
229
|
/* src/components/Modal/modal.scss */
|
|
226
230
|
.lib-xplat-modal {
|