@x-plat/design-system 0.8.3 → 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.
Files changed (72) hide show
  1. package/dist/components/AutoResizeTextArea/index.cjs +140 -4
  2. package/dist/components/AutoResizeTextArea/index.css +38 -0
  3. package/dist/components/AutoResizeTextArea/index.d.cts +3 -0
  4. package/dist/components/AutoResizeTextArea/index.d.ts +3 -0
  5. package/dist/components/AutoResizeTextArea/index.js +140 -4
  6. package/dist/components/ChatInput/index.cjs +150 -9
  7. package/dist/components/ChatInput/index.css +38 -0
  8. package/dist/components/ChatInput/index.d.cts +3 -0
  9. package/dist/components/ChatInput/index.d.ts +3 -0
  10. package/dist/components/ChatInput/index.js +151 -10
  11. package/dist/components/CheckBox/index.cjs +132 -5
  12. package/dist/components/CheckBox/index.css +38 -0
  13. package/dist/components/CheckBox/index.d.cts +3 -0
  14. package/dist/components/CheckBox/index.d.ts +3 -0
  15. package/dist/components/CheckBox/index.js +132 -5
  16. package/dist/components/DatePicker/index.cjs +72 -59
  17. package/dist/components/DatePicker/index.css +38 -31
  18. package/dist/components/DatePicker/index.js +38 -25
  19. package/dist/components/FieldMessage/index.cjs +183 -0
  20. package/dist/components/FieldMessage/index.css +37 -0
  21. package/dist/components/FieldMessage/index.d.cts +37 -0
  22. package/dist/components/FieldMessage/index.d.ts +37 -0
  23. package/dist/components/FieldMessage/index.js +154 -0
  24. package/dist/components/FileUpload/index.cjs +135 -8
  25. package/dist/components/FileUpload/index.css +38 -0
  26. package/dist/components/FileUpload/index.d.cts +3 -0
  27. package/dist/components/FileUpload/index.d.ts +3 -0
  28. package/dist/components/FileUpload/index.js +135 -8
  29. package/dist/components/ImageSelector/index.cjs +153 -11
  30. package/dist/components/ImageSelector/index.css +38 -0
  31. package/dist/components/ImageSelector/index.d.cts +3 -0
  32. package/dist/components/ImageSelector/index.d.ts +3 -0
  33. package/dist/components/ImageSelector/index.js +153 -11
  34. package/dist/components/Input/index.cjs +38 -25
  35. package/dist/components/Input/index.css +38 -31
  36. package/dist/components/Input/index.d.cts +3 -8
  37. package/dist/components/Input/index.d.ts +3 -8
  38. package/dist/components/Input/index.js +36 -23
  39. package/dist/components/Radio/index.cjs +152 -8
  40. package/dist/components/Radio/index.css +38 -0
  41. package/dist/components/Radio/index.d.cts +3 -0
  42. package/dist/components/Radio/index.d.ts +3 -0
  43. package/dist/components/Radio/index.js +152 -8
  44. package/dist/components/Select/index.cjs +139 -13
  45. package/dist/components/Select/index.css +38 -0
  46. package/dist/components/Select/index.d.cts +3 -0
  47. package/dist/components/Select/index.d.ts +3 -0
  48. package/dist/components/Select/index.js +139 -13
  49. package/dist/components/Switch/index.cjs +140 -4
  50. package/dist/components/Switch/index.css +38 -0
  51. package/dist/components/Switch/index.d.cts +3 -0
  52. package/dist/components/Switch/index.d.ts +3 -0
  53. package/dist/components/Switch/index.js +140 -4
  54. package/dist/components/TextArea/index.cjs +138 -2
  55. package/dist/components/TextArea/index.css +38 -0
  56. package/dist/components/TextArea/index.d.cts +3 -0
  57. package/dist/components/TextArea/index.d.ts +3 -0
  58. package/dist/components/TextArea/index.js +138 -2
  59. package/dist/components/index.cjs +439 -385
  60. package/dist/components/index.css +38 -31
  61. package/dist/components/index.d.cts +2 -0
  62. package/dist/components/index.d.ts +2 -0
  63. package/dist/components/index.js +222 -171
  64. package/dist/index.cjs +444 -390
  65. package/dist/index.css +38 -31
  66. package/dist/index.d.cts +2 -0
  67. package/dist/index.d.ts +2 -0
  68. package/dist/index.js +224 -173
  69. package/dist/validation-Dqo1zqhT.d.cts +13 -0
  70. package/dist/validation-Dqo1zqhT.d.ts +13 -0
  71. package/guidelines/components/form.md +26 -0
  72. package/package.json +1 -1
@@ -892,12 +892,83 @@ var import_jsx_runtime253 = require("react/jsx-runtime");
892
892
 
893
893
  // src/tokens/svg/status/ErrorIcon.tsx
894
894
  var import_jsx_runtime254 = require("react/jsx-runtime");
895
+ var ErrorIcon = () => /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
896
+ "svg",
897
+ {
898
+ xmlns: "http://www.w3.org/2000/svg",
899
+ width: "1em",
900
+ height: "1em",
901
+ viewBox: "0 0 16 16",
902
+ fill: "none",
903
+ children: [
904
+ /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)("g", { clipPath: "url(#clip0_1196_9603)", children: [
905
+ /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
906
+ "path",
907
+ {
908
+ 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",
909
+ fill: "currentColor"
910
+ }
911
+ ),
912
+ /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
913
+ "path",
914
+ {
915
+ fillRule: "evenodd",
916
+ clipRule: "evenodd",
917
+ 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",
918
+ fill: "currentColor"
919
+ }
920
+ )
921
+ ] }),
922
+ /* @__PURE__ */ (0, import_jsx_runtime254.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ (0, import_jsx_runtime254.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
923
+ ]
924
+ }
925
+ );
926
+ var ErrorIcon_default = ErrorIcon;
895
927
 
896
928
  // src/tokens/svg/status/HelpCircleIcon.tsx
897
929
  var import_jsx_runtime255 = require("react/jsx-runtime");
898
930
 
899
931
  // src/tokens/svg/status/InfoIcon.tsx
900
932
  var import_jsx_runtime256 = require("react/jsx-runtime");
933
+ var InfoIcon = () => /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(
934
+ "svg",
935
+ {
936
+ xmlns: "http://www.w3.org/2000/svg",
937
+ width: "1em",
938
+ height: "1em",
939
+ viewBox: "0 0 16 16",
940
+ fill: "none",
941
+ children: [
942
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)("g", { clipPath: "url(#clip0_1188_11261)", children: [
943
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
944
+ "path",
945
+ {
946
+ 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",
947
+ fill: "currentColor"
948
+ }
949
+ ),
950
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
951
+ "path",
952
+ {
953
+ 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",
954
+ fill: "currentColor"
955
+ }
956
+ ),
957
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
958
+ "path",
959
+ {
960
+ fillRule: "evenodd",
961
+ clipRule: "evenodd",
962
+ 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",
963
+ fill: "currentColor"
964
+ }
965
+ )
966
+ ] }),
967
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)("rect", { width: "16", height: "16", fill: "white" }) }) })
968
+ ]
969
+ }
970
+ );
971
+ var InfoIcon_default = InfoIcon;
901
972
 
902
973
  // src/tokens/svg/status/LoaderIcon.tsx
903
974
  var import_jsx_runtime257 = require("react/jsx-runtime");
@@ -922,6 +993,24 @@ var import_jsx_runtime263 = require("react/jsx-runtime");
922
993
 
923
994
  // src/tokens/svg/status/SuccessIcon.tsx
924
995
  var import_jsx_runtime264 = require("react/jsx-runtime");
996
+ var SuccessIcon = () => /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
997
+ "svg",
998
+ {
999
+ xmlns: "http://www.w3.org/2000/svg",
1000
+ width: "1em",
1001
+ height: "1em",
1002
+ viewBox: "0 0 16 16",
1003
+ fill: "none",
1004
+ children: /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
1005
+ "path",
1006
+ {
1007
+ 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",
1008
+ fill: "currentColor"
1009
+ }
1010
+ )
1011
+ }
1012
+ );
1013
+ var SuccessIcon_default = SuccessIcon;
925
1014
 
926
1015
  // src/tokens/svg/status/XCircleIcon.tsx
927
1016
  var import_jsx_runtime265 = require("react/jsx-runtime");
@@ -1013,10 +1102,61 @@ var import_jsx_runtime293 = require("react/jsx-runtime");
1013
1102
  // src/tokens/svg/weather/WindIcon.tsx
1014
1103
  var import_jsx_runtime294 = require("react/jsx-runtime");
1015
1104
 
1016
- // src/components/ImageSelector/ImageSelector.tsx
1105
+ // ../../node_modules/clsx/dist/clsx.mjs
1106
+ function r(e) {
1107
+ var t, f, n = "";
1108
+ if ("string" == typeof e || "number" == typeof e) n += e;
1109
+ else if ("object" == typeof e) if (Array.isArray(e)) {
1110
+ var o = e.length;
1111
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
1112
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
1113
+ return n;
1114
+ }
1115
+ function clsx() {
1116
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
1117
+ return n;
1118
+ }
1119
+ var clsx_default = clsx;
1120
+
1121
+ // src/components/FieldMessage/FieldMessage.tsx
1017
1122
  var import_jsx_runtime295 = require("react/jsx-runtime");
1123
+ var ICON = {
1124
+ default: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(InfoIcon_default, {}),
1125
+ success: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(SuccessIcon_default, {}),
1126
+ warning: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(InfoIcon_default, {}),
1127
+ error: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ErrorIcon_default, {})
1128
+ };
1129
+ var FieldMessage = (props) => {
1130
+ const { validations } = props;
1131
+ if (!validations || validations.length === 0) return null;
1132
+ return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)(
1133
+ "div",
1134
+ {
1135
+ className: clsx_default("lib-xplat-field-message", v.status),
1136
+ children: [
1137
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "icon", children: ICON[v.status] }),
1138
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { children: v.message })
1139
+ ]
1140
+ },
1141
+ `${v.message}_${idx}`
1142
+ )) });
1143
+ };
1144
+ FieldMessage.displayName = "FieldMessage";
1145
+ var Field = (props) => {
1146
+ const { validations, children } = props;
1147
+ if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_jsx_runtime295.Fragment, { children });
1148
+ return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: "lib-xplat-field", children: [
1149
+ children,
1150
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(FieldMessage, { validations })
1151
+ ] });
1152
+ };
1153
+ Field.displayName = "Field";
1154
+ var hasError = (validations) => !!validations?.some((v) => v.status === "error");
1155
+
1156
+ // src/components/ImageSelector/ImageSelector.tsx
1157
+ var import_jsx_runtime296 = require("react/jsx-runtime");
1018
1158
  var ImageSelector = (props) => {
1019
- const { value, label, onChange } = props;
1159
+ const { value, label, onChange, validations } = props;
1020
1160
  const [previewUrl, setPreviewUrl] = import_react.default.useState();
1021
1161
  import_react.default.useEffect(() => {
1022
1162
  if (!value) {
@@ -1040,26 +1180,28 @@ var ImageSelector = (props) => {
1040
1180
  const handleOpenFileDialog = () => {
1041
1181
  inputRef.current?.click();
1042
1182
  };
1043
- return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
1044
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
1183
+ const control = /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
1184
+ /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
1045
1185
  "input",
1046
1186
  {
1047
1187
  type: "file",
1048
1188
  accept: "image/*",
1049
1189
  id: "image-input",
1050
1190
  onChange: handleFileChange,
1051
- ref: inputRef
1191
+ ref: inputRef,
1192
+ "aria-invalid": hasError(validations) || void 0
1052
1193
  }
1053
1194
  ),
1054
- value && /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: "action-bar", children: [
1055
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(UploadIcon_default, {}) }),
1056
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(DeleteIcon_default, {}) })
1195
+ value && /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)("div", { className: "action-bar", children: [
1196
+ /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(UploadIcon_default, {}) }),
1197
+ /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(DeleteIcon_default, {}) })
1057
1198
  ] }),
1058
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
1059
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ImageIcon_default, {}) }),
1060
- /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
1199
+ /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("div", { className: "content", children: previewUrl ? /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
1200
+ /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("div", { className: "icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(ImageIcon_default, {}) }),
1201
+ /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
1061
1202
  ] }) })
1062
1203
  ] });
1204
+ return /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(Field, { validations, children: control });
1063
1205
  };
1064
1206
  ImageSelector.displayName = "ImageSelector";
1065
1207
  var ImageSelector_default = ImageSelector;
@@ -1,3 +1,41 @@
1
+ /* src/components/FieldMessage/fieldMessage.scss */
2
+ .lib-xplat-field {
3
+ display: flex;
4
+ flex-direction: column;
5
+ gap: var(--spacing-space-2);
6
+ }
7
+ .lib-xplat-field-message-wrap {
8
+ display: flex;
9
+ gap: var(--spacing-space-2);
10
+ margin-left: var(--spacing-space-1);
11
+ }
12
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message {
13
+ display: flex;
14
+ gap: var(--spacing-space-1);
15
+ font-family: var(--semantic-typo-caption-2-r-font);
16
+ font-size: var(--semantic-typo-caption-2-r-size);
17
+ line-height: var(--semantic-typo-caption-2-r-lh);
18
+ font-weight: var(--semantic-typo-caption-2-r-weight);
19
+ letter-spacing: var(--semantic-typo-caption-2-r-ls);
20
+ align-items: center;
21
+ user-select: none;
22
+ }
23
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message.default {
24
+ color: var(--semantic-icon-secondary);
25
+ }
26
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message.success {
27
+ color: var(--semantic-text-success);
28
+ }
29
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message.warning {
30
+ color: var(--semantic-text-warning);
31
+ }
32
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message.error {
33
+ color: var(--semantic-text-error);
34
+ }
35
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message > .icon {
36
+ font-size: var(--semantic-typo-label-2-m-size);
37
+ }
38
+
1
39
  /* src/components/ImageSelector/imageselector.scss */
2
40
  .lib-xplat-imageselector {
3
41
  display: flex;
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
+ import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
2
3
 
3
4
  interface ImageSelectorProps {
4
5
  value?: File;
6
+ /** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
7
+ validations?: Validation[];
5
8
  label?: string;
6
9
  onChange?: (value: File | undefined) => void;
7
10
  }
@@ -1,7 +1,10 @@
1
1
  import React from 'react';
2
+ import { V as Validation } from '../../validation-Dqo1zqhT.js';
2
3
 
3
4
  interface ImageSelectorProps {
4
5
  value?: File;
6
+ /** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
7
+ validations?: Validation[];
5
8
  label?: string;
6
9
  onChange?: (value: File | undefined) => void;
7
10
  }
@@ -856,12 +856,83 @@ import { jsx as jsx253 } from "react/jsx-runtime";
856
856
 
857
857
  // src/tokens/svg/status/ErrorIcon.tsx
858
858
  import { jsx as jsx254, jsxs as jsxs160 } from "react/jsx-runtime";
859
+ var ErrorIcon = () => /* @__PURE__ */ jsxs160(
860
+ "svg",
861
+ {
862
+ xmlns: "http://www.w3.org/2000/svg",
863
+ width: "1em",
864
+ height: "1em",
865
+ viewBox: "0 0 16 16",
866
+ fill: "none",
867
+ children: [
868
+ /* @__PURE__ */ jsxs160("g", { clipPath: "url(#clip0_1196_9603)", children: [
869
+ /* @__PURE__ */ jsx254(
870
+ "path",
871
+ {
872
+ 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",
873
+ fill: "currentColor"
874
+ }
875
+ ),
876
+ /* @__PURE__ */ jsx254(
877
+ "path",
878
+ {
879
+ fillRule: "evenodd",
880
+ clipRule: "evenodd",
881
+ 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",
882
+ fill: "currentColor"
883
+ }
884
+ )
885
+ ] }),
886
+ /* @__PURE__ */ jsx254("defs", { children: /* @__PURE__ */ jsx254("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ jsx254("rect", { width: "16", height: "16", fill: "white" }) }) })
887
+ ]
888
+ }
889
+ );
890
+ var ErrorIcon_default = ErrorIcon;
859
891
 
860
892
  // src/tokens/svg/status/HelpCircleIcon.tsx
861
893
  import { jsx as jsx255, jsxs as jsxs161 } from "react/jsx-runtime";
862
894
 
863
895
  // src/tokens/svg/status/InfoIcon.tsx
864
896
  import { jsx as jsx256, jsxs as jsxs162 } from "react/jsx-runtime";
897
+ var InfoIcon = () => /* @__PURE__ */ jsxs162(
898
+ "svg",
899
+ {
900
+ xmlns: "http://www.w3.org/2000/svg",
901
+ width: "1em",
902
+ height: "1em",
903
+ viewBox: "0 0 16 16",
904
+ fill: "none",
905
+ children: [
906
+ /* @__PURE__ */ jsxs162("g", { clipPath: "url(#clip0_1188_11261)", children: [
907
+ /* @__PURE__ */ jsx256(
908
+ "path",
909
+ {
910
+ 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",
911
+ fill: "currentColor"
912
+ }
913
+ ),
914
+ /* @__PURE__ */ jsx256(
915
+ "path",
916
+ {
917
+ 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",
918
+ fill: "currentColor"
919
+ }
920
+ ),
921
+ /* @__PURE__ */ jsx256(
922
+ "path",
923
+ {
924
+ fillRule: "evenodd",
925
+ clipRule: "evenodd",
926
+ 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",
927
+ fill: "currentColor"
928
+ }
929
+ )
930
+ ] }),
931
+ /* @__PURE__ */ jsx256("defs", { children: /* @__PURE__ */ jsx256("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ jsx256("rect", { width: "16", height: "16", fill: "white" }) }) })
932
+ ]
933
+ }
934
+ );
935
+ var InfoIcon_default = InfoIcon;
865
936
 
866
937
  // src/tokens/svg/status/LoaderIcon.tsx
867
938
  import { jsx as jsx257, jsxs as jsxs163 } from "react/jsx-runtime";
@@ -886,6 +957,24 @@ import { jsx as jsx263, jsxs as jsxs167 } from "react/jsx-runtime";
886
957
 
887
958
  // src/tokens/svg/status/SuccessIcon.tsx
888
959
  import { jsx as jsx264 } from "react/jsx-runtime";
960
+ var SuccessIcon = () => /* @__PURE__ */ jsx264(
961
+ "svg",
962
+ {
963
+ xmlns: "http://www.w3.org/2000/svg",
964
+ width: "1em",
965
+ height: "1em",
966
+ viewBox: "0 0 16 16",
967
+ fill: "none",
968
+ children: /* @__PURE__ */ jsx264(
969
+ "path",
970
+ {
971
+ 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",
972
+ fill: "currentColor"
973
+ }
974
+ )
975
+ }
976
+ );
977
+ var SuccessIcon_default = SuccessIcon;
889
978
 
890
979
  // src/tokens/svg/status/XCircleIcon.tsx
891
980
  import { jsx as jsx265, jsxs as jsxs168 } from "react/jsx-runtime";
@@ -977,10 +1066,61 @@ import { jsx as jsx293, jsxs as jsxs187 } from "react/jsx-runtime";
977
1066
  // src/tokens/svg/weather/WindIcon.tsx
978
1067
  import { jsx as jsx294, jsxs as jsxs188 } from "react/jsx-runtime";
979
1068
 
1069
+ // ../../node_modules/clsx/dist/clsx.mjs
1070
+ function r(e) {
1071
+ var t, f, n = "";
1072
+ if ("string" == typeof e || "number" == typeof e) n += e;
1073
+ else if ("object" == typeof e) if (Array.isArray(e)) {
1074
+ var o = e.length;
1075
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
1076
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
1077
+ return n;
1078
+ }
1079
+ function clsx() {
1080
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
1081
+ return n;
1082
+ }
1083
+ var clsx_default = clsx;
1084
+
1085
+ // src/components/FieldMessage/FieldMessage.tsx
1086
+ import { Fragment, jsx as jsx295, jsxs as jsxs189 } from "react/jsx-runtime";
1087
+ var ICON = {
1088
+ default: /* @__PURE__ */ jsx295(InfoIcon_default, {}),
1089
+ success: /* @__PURE__ */ jsx295(SuccessIcon_default, {}),
1090
+ warning: /* @__PURE__ */ jsx295(InfoIcon_default, {}),
1091
+ error: /* @__PURE__ */ jsx295(ErrorIcon_default, {})
1092
+ };
1093
+ var FieldMessage = (props) => {
1094
+ const { validations } = props;
1095
+ if (!validations || validations.length === 0) return null;
1096
+ return /* @__PURE__ */ jsx295("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ jsxs189(
1097
+ "div",
1098
+ {
1099
+ className: clsx_default("lib-xplat-field-message", v.status),
1100
+ children: [
1101
+ /* @__PURE__ */ jsx295("div", { className: "icon", children: ICON[v.status] }),
1102
+ /* @__PURE__ */ jsx295("span", { children: v.message })
1103
+ ]
1104
+ },
1105
+ `${v.message}_${idx}`
1106
+ )) });
1107
+ };
1108
+ FieldMessage.displayName = "FieldMessage";
1109
+ var Field = (props) => {
1110
+ const { validations, children } = props;
1111
+ if (!validations || validations.length === 0) return /* @__PURE__ */ jsx295(Fragment, { children });
1112
+ return /* @__PURE__ */ jsxs189("div", { className: "lib-xplat-field", children: [
1113
+ children,
1114
+ /* @__PURE__ */ jsx295(FieldMessage, { validations })
1115
+ ] });
1116
+ };
1117
+ Field.displayName = "Field";
1118
+ var hasError = (validations) => !!validations?.some((v) => v.status === "error");
1119
+
980
1120
  // src/components/ImageSelector/ImageSelector.tsx
981
- import { jsx as jsx295, jsxs as jsxs189 } from "react/jsx-runtime";
1121
+ import { jsx as jsx296, jsxs as jsxs190 } from "react/jsx-runtime";
982
1122
  var ImageSelector = (props) => {
983
- const { value, label, onChange } = props;
1123
+ const { value, label, onChange, validations } = props;
984
1124
  const [previewUrl, setPreviewUrl] = React.useState();
985
1125
  React.useEffect(() => {
986
1126
  if (!value) {
@@ -1004,26 +1144,28 @@ var ImageSelector = (props) => {
1004
1144
  const handleOpenFileDialog = () => {
1005
1145
  inputRef.current?.click();
1006
1146
  };
1007
- return /* @__PURE__ */ jsxs189("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
1008
- /* @__PURE__ */ jsx295(
1147
+ const control = /* @__PURE__ */ jsxs190("div", { className: `lib-xplat-imageselector${value ? "" : " none-value"}`, children: [
1148
+ /* @__PURE__ */ jsx296(
1009
1149
  "input",
1010
1150
  {
1011
1151
  type: "file",
1012
1152
  accept: "image/*",
1013
1153
  id: "image-input",
1014
1154
  onChange: handleFileChange,
1015
- ref: inputRef
1155
+ ref: inputRef,
1156
+ "aria-invalid": hasError(validations) || void 0
1016
1157
  }
1017
1158
  ),
1018
- value && /* @__PURE__ */ jsxs189("div", { className: "action-bar", children: [
1019
- /* @__PURE__ */ jsx295("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx295(UploadIcon_default, {}) }),
1020
- /* @__PURE__ */ jsx295("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx295(DeleteIcon_default, {}) })
1159
+ value && /* @__PURE__ */ jsxs190("div", { className: "action-bar", children: [
1160
+ /* @__PURE__ */ jsx296("div", { className: "icon-wrapper", onClick: handleOpenFileDialog, children: /* @__PURE__ */ jsx296(UploadIcon_default, {}) }),
1161
+ /* @__PURE__ */ jsx296("div", { className: "icon-wrapper", onClick: handleDeleteFile, children: /* @__PURE__ */ jsx296(DeleteIcon_default, {}) })
1021
1162
  ] }),
1022
- /* @__PURE__ */ jsx295("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx295("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs189("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
1023
- /* @__PURE__ */ jsx295("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx295(ImageIcon_default, {}) }),
1024
- /* @__PURE__ */ jsx295("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
1163
+ /* @__PURE__ */ jsx296("div", { className: "content", children: previewUrl ? /* @__PURE__ */ jsx296("img", { src: previewUrl, alt: "preview" }) : /* @__PURE__ */ jsxs190("div", { className: "skeleton", onClick: handleOpenFileDialog, children: [
1164
+ /* @__PURE__ */ jsx296("div", { className: "icon-wrapper", children: /* @__PURE__ */ jsx296(ImageIcon_default, {}) }),
1165
+ /* @__PURE__ */ jsx296("div", { className: "label", children: label || "\uC774\uBBF8\uC9C0 \uCD94\uAC00\uD558\uAE30" })
1025
1166
  ] }) })
1026
1167
  ] });
1168
+ return /* @__PURE__ */ jsx296(Field, { validations, children: control });
1027
1169
  };
1028
1170
  ImageSelector.displayName = "ImageSelector";
1029
1171
  var ImageSelector_default = ImageSelector;
@@ -152,22 +152,41 @@ var SuccessIcon = () => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
152
152
  );
153
153
  var SuccessIcon_default = SuccessIcon;
154
154
 
155
- // src/components/Input/InputValidations.tsx
155
+ // src/components/FieldMessage/FieldMessage.tsx
156
156
  var import_jsx_runtime4 = require("react/jsx-runtime");
157
- var InputValidations = (props) => {
158
- const { message, status = "default" } = props;
159
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: clsx_default("lib-xplat-input-validation", status), children: [
160
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "icon", children: [
161
- status === "default" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InfoIcon_default, {}),
162
- status === "success" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SuccessIcon_default, {}),
163
- status === "warning" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InfoIcon_default, {}),
164
- status === "error" && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ErrorIcon_default, {})
165
- ] }),
166
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "message", children: message })
157
+ var ICON = {
158
+ default: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InfoIcon_default, {}),
159
+ success: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SuccessIcon_default, {}),
160
+ warning: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(InfoIcon_default, {}),
161
+ error: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ErrorIcon_default, {})
162
+ };
163
+ var FieldMessage = (props) => {
164
+ const { validations } = props;
165
+ if (!validations || validations.length === 0) return null;
166
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
167
+ "div",
168
+ {
169
+ className: clsx_default("lib-xplat-field-message", v.status),
170
+ children: [
171
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "icon", children: ICON[v.status] }),
172
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: v.message })
173
+ ]
174
+ },
175
+ `${v.message}_${idx}`
176
+ )) });
177
+ };
178
+ FieldMessage.displayName = "FieldMessage";
179
+ var FieldMessage_default = FieldMessage;
180
+ var Field = (props) => {
181
+ const { validations, children } = props;
182
+ if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
183
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
184
+ children,
185
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FieldMessage, { validations })
167
186
  ] });
168
187
  };
169
- InputValidations.displayName = "InputValidations";
170
- var InputValidations_default = InputValidations;
188
+ Field.displayName = "Field";
189
+ var hasError = (validations) => !!validations?.some((v) => v.status === "error");
171
190
 
172
191
  // src/components/Input/reg.ts
173
192
  var numberAndCommaReg = /^[0-9,]+$/;
@@ -205,7 +224,6 @@ var handleTelBackspace = (prevValue, currValue) => {
205
224
 
206
225
  // src/components/Input/Input.tsx
207
226
  var import_jsx_runtime5 = require("react/jsx-runtime");
208
- var import_react2 = require("react");
209
227
  var formatValue = (type, value) => {
210
228
  if (value === null || value === void 0) return "";
211
229
  const strValue = Array.isArray(value) ? String(value[0] ?? "") : String(value);
@@ -294,27 +312,22 @@ var Input = import_react.default.forwardRef((props, ref) => {
294
312
  disabled,
295
313
  type: type === "number" ? "text" : type,
296
314
  value: localValue,
297
- onChange: handleChange
315
+ onChange: handleChange,
316
+ "aria-invalid": hasError(validations) || void 0
298
317
  }
299
318
  ),
300
319
  suffix && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "suffix", children: suffix })
301
320
  ]
302
321
  }
303
322
  ),
304
- validations && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "lib-xplat-input-validation-wrap", children: validations?.map((validation, idx) => /* @__PURE__ */ (0, import_react2.createElement)(
305
- InputValidations_default,
306
- {
307
- ...validation,
308
- key: `${validation.message}_${idx}`
309
- }
310
- )) })
323
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(FieldMessage_default, { validations })
311
324
  ] });
312
325
  });
313
326
  Input.displayName = "Input";
314
327
  var Input_default = Input;
315
328
 
316
329
  // src/components/Input/PasswordInput/PasswordInput.tsx
317
- var import_react3 = __toESM(require("react"), 1);
330
+ var import_react2 = __toESM(require("react"), 1);
318
331
 
319
332
  // src/tokens/svg/form/CloseEyeIcon.tsx
320
333
  var import_jsx_runtime6 = require("react/jsx-runtime");
@@ -384,10 +397,10 @@ var OpenEyeIcon_default = OpenEyeIcon;
384
397
 
385
398
  // src/components/Input/PasswordInput/PasswordInput.tsx
386
399
  var import_jsx_runtime8 = require("react/jsx-runtime");
387
- var PasswordInput = import_react3.default.forwardRef(
400
+ var PasswordInput = import_react2.default.forwardRef(
388
401
  (props, ref) => {
389
402
  const { reg: _reg, ...inputProps } = props;
390
- const [isView, setIsView] = import_react3.default.useState(false);
403
+ const [isView, setIsView] = import_react2.default.useState(false);
391
404
  const handleChangeView = () => {
392
405
  setIsView((prev) => !prev);
393
406
  };