@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.
Files changed (72) hide show
  1. package/dist/components/AutoResizeTextArea/index.cjs +140 -4
  2. package/dist/components/AutoResizeTextArea/index.css +38 -3
  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 -3
  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 -34
  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 -34
  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 -3
  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 -40
  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 -40
  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
@@ -14,6 +14,139 @@ function clsx() {
14
14
  }
15
15
  var clsx_default = clsx;
16
16
 
17
+ // src/tokens/svg/status/ErrorIcon.tsx
18
+ import { jsx, jsxs } from "react/jsx-runtime";
19
+ var ErrorIcon = () => /* @__PURE__ */ jsxs(
20
+ "svg",
21
+ {
22
+ xmlns: "http://www.w3.org/2000/svg",
23
+ width: "1em",
24
+ height: "1em",
25
+ viewBox: "0 0 16 16",
26
+ fill: "none",
27
+ children: [
28
+ /* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_1196_9603)", children: [
29
+ /* @__PURE__ */ jsx(
30
+ "path",
31
+ {
32
+ 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",
33
+ fill: "currentColor"
34
+ }
35
+ ),
36
+ /* @__PURE__ */ jsx(
37
+ "path",
38
+ {
39
+ fillRule: "evenodd",
40
+ clipRule: "evenodd",
41
+ 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",
42
+ fill: "currentColor"
43
+ }
44
+ )
45
+ ] }),
46
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
47
+ ]
48
+ }
49
+ );
50
+ var ErrorIcon_default = ErrorIcon;
51
+
52
+ // src/tokens/svg/status/InfoIcon.tsx
53
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
54
+ var InfoIcon = () => /* @__PURE__ */ jsxs2(
55
+ "svg",
56
+ {
57
+ xmlns: "http://www.w3.org/2000/svg",
58
+ width: "1em",
59
+ height: "1em",
60
+ viewBox: "0 0 16 16",
61
+ fill: "none",
62
+ children: [
63
+ /* @__PURE__ */ jsxs2("g", { clipPath: "url(#clip0_1188_11261)", children: [
64
+ /* @__PURE__ */ jsx2(
65
+ "path",
66
+ {
67
+ 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",
68
+ fill: "currentColor"
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsx2(
72
+ "path",
73
+ {
74
+ 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",
75
+ fill: "currentColor"
76
+ }
77
+ ),
78
+ /* @__PURE__ */ jsx2(
79
+ "path",
80
+ {
81
+ fillRule: "evenodd",
82
+ clipRule: "evenodd",
83
+ 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",
84
+ fill: "currentColor"
85
+ }
86
+ )
87
+ ] }),
88
+ /* @__PURE__ */ jsx2("defs", { children: /* @__PURE__ */ jsx2("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ jsx2("rect", { width: "16", height: "16", fill: "white" }) }) })
89
+ ]
90
+ }
91
+ );
92
+ var InfoIcon_default = InfoIcon;
93
+
94
+ // src/tokens/svg/status/SuccessIcon.tsx
95
+ import { jsx as jsx3 } from "react/jsx-runtime";
96
+ var SuccessIcon = () => /* @__PURE__ */ jsx3(
97
+ "svg",
98
+ {
99
+ xmlns: "http://www.w3.org/2000/svg",
100
+ width: "1em",
101
+ height: "1em",
102
+ viewBox: "0 0 16 16",
103
+ fill: "none",
104
+ children: /* @__PURE__ */ jsx3(
105
+ "path",
106
+ {
107
+ 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",
108
+ fill: "currentColor"
109
+ }
110
+ )
111
+ }
112
+ );
113
+ var SuccessIcon_default = SuccessIcon;
114
+
115
+ // src/components/FieldMessage/FieldMessage.tsx
116
+ import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
117
+ var ICON = {
118
+ default: /* @__PURE__ */ jsx4(InfoIcon_default, {}),
119
+ success: /* @__PURE__ */ jsx4(SuccessIcon_default, {}),
120
+ warning: /* @__PURE__ */ jsx4(InfoIcon_default, {}),
121
+ error: /* @__PURE__ */ jsx4(ErrorIcon_default, {})
122
+ };
123
+ var FieldMessage = (props) => {
124
+ const { validations } = props;
125
+ if (!validations || validations.length === 0) return null;
126
+ return /* @__PURE__ */ jsx4("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ jsxs3(
127
+ "div",
128
+ {
129
+ className: clsx_default("lib-xplat-field-message", v.status),
130
+ children: [
131
+ /* @__PURE__ */ jsx4("div", { className: "icon", children: ICON[v.status] }),
132
+ /* @__PURE__ */ jsx4("span", { children: v.message })
133
+ ]
134
+ },
135
+ `${v.message}_${idx}`
136
+ )) });
137
+ };
138
+ FieldMessage.displayName = "FieldMessage";
139
+ var Field = (props) => {
140
+ const { validations, children } = props;
141
+ if (!validations || validations.length === 0) return /* @__PURE__ */ jsx4(Fragment, { children });
142
+ return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
143
+ children,
144
+ /* @__PURE__ */ jsx4(FieldMessage, { validations })
145
+ ] });
146
+ };
147
+ Field.displayName = "Field";
148
+ var hasError = (validations) => !!validations?.some((v) => v.status === "error");
149
+
17
150
  // src/components/Radio/RadioGroupContext.tsx
18
151
  import React from "react";
19
152
  var RadioGroupContext = React.createContext(
@@ -25,7 +158,7 @@ var useRadioGroupContext = () => {
25
158
  var RadioGroupContext_default = RadioGroupContext;
26
159
 
27
160
  // src/components/Radio/Radio.tsx
28
- import { jsx, jsxs } from "react/jsx-runtime";
161
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
29
162
  var Radio = (props) => {
30
163
  const {
31
164
  label,
@@ -33,6 +166,7 @@ var Radio = (props) => {
33
166
  value,
34
167
  size: sizeProp,
35
168
  type = "brand",
169
+ validations,
36
170
  ...rest
37
171
  } = props;
38
172
  const context = useRadioGroupContext();
@@ -44,7 +178,7 @@ var Radio = (props) => {
44
178
  value,
45
179
  onChange: rest.onChange
46
180
  };
47
- return /* @__PURE__ */ jsxs(
181
+ const control = /* @__PURE__ */ jsxs4(
48
182
  "label",
49
183
  {
50
184
  className: clsx_default(
@@ -55,30 +189,40 @@ var Radio = (props) => {
55
189
  className
56
190
  ),
57
191
  children: [
58
- /* @__PURE__ */ jsx("input", { ...rest, ...inputProps, checked: localChecked, type: "radio" }),
59
- /* @__PURE__ */ jsx(
192
+ /* @__PURE__ */ jsx5(
193
+ "input",
194
+ {
195
+ ...rest,
196
+ ...inputProps,
197
+ checked: localChecked,
198
+ type: "radio",
199
+ "aria-invalid": hasError(validations) || void 0
200
+ }
201
+ ),
202
+ /* @__PURE__ */ jsx5(
60
203
  "div",
61
204
  {
62
205
  className: clsx_default(
63
206
  "circle",
64
207
  localChecked ? "checked" : void 0
65
208
  ),
66
- children: localChecked && /* @__PURE__ */ jsx("div", { className: "inner-circle" })
209
+ children: localChecked && /* @__PURE__ */ jsx5("div", { className: "inner-circle" })
67
210
  }
68
211
  ),
69
- label && /* @__PURE__ */ jsx("span", { children: label })
212
+ label && /* @__PURE__ */ jsx5("span", { children: label })
70
213
  ]
71
214
  }
72
215
  );
216
+ return /* @__PURE__ */ jsx5(Field, { validations, children: control });
73
217
  };
74
218
  Radio.displayName = "Radio";
75
219
  var Radio_default = Radio;
76
220
 
77
221
  // src/components/Radio/RadioGroup.tsx
78
- import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
222
+ import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
79
223
  var RadioGroup = (props) => {
80
224
  const { children, ...rest } = props;
81
- return /* @__PURE__ */ jsx2(Fragment, { children: /* @__PURE__ */ jsx2(RadioGroupContext_default.Provider, { value: rest, children }) });
225
+ return /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */ jsx6(RadioGroupContext_default.Provider, { value: rest, children }) });
82
226
  };
83
227
  RadioGroup.displayName = "RadioGroup";
84
228
  var RadioGroup_default = RadioGroup;
@@ -912,12 +912,83 @@ var import_jsx_runtime253 = require("react/jsx-runtime");
912
912
 
913
913
  // src/tokens/svg/status/ErrorIcon.tsx
914
914
  var import_jsx_runtime254 = require("react/jsx-runtime");
915
+ var ErrorIcon = () => /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
916
+ "svg",
917
+ {
918
+ xmlns: "http://www.w3.org/2000/svg",
919
+ width: "1em",
920
+ height: "1em",
921
+ viewBox: "0 0 16 16",
922
+ fill: "none",
923
+ children: [
924
+ /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)("g", { clipPath: "url(#clip0_1196_9603)", children: [
925
+ /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
926
+ "path",
927
+ {
928
+ 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",
929
+ fill: "currentColor"
930
+ }
931
+ ),
932
+ /* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
933
+ "path",
934
+ {
935
+ fillRule: "evenodd",
936
+ clipRule: "evenodd",
937
+ 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",
938
+ fill: "currentColor"
939
+ }
940
+ )
941
+ ] }),
942
+ /* @__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" }) }) })
943
+ ]
944
+ }
945
+ );
946
+ var ErrorIcon_default = ErrorIcon;
915
947
 
916
948
  // src/tokens/svg/status/HelpCircleIcon.tsx
917
949
  var import_jsx_runtime255 = require("react/jsx-runtime");
918
950
 
919
951
  // src/tokens/svg/status/InfoIcon.tsx
920
952
  var import_jsx_runtime256 = require("react/jsx-runtime");
953
+ var InfoIcon = () => /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(
954
+ "svg",
955
+ {
956
+ xmlns: "http://www.w3.org/2000/svg",
957
+ width: "1em",
958
+ height: "1em",
959
+ viewBox: "0 0 16 16",
960
+ fill: "none",
961
+ children: [
962
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)("g", { clipPath: "url(#clip0_1188_11261)", children: [
963
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
964
+ "path",
965
+ {
966
+ 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",
967
+ fill: "currentColor"
968
+ }
969
+ ),
970
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
971
+ "path",
972
+ {
973
+ 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",
974
+ fill: "currentColor"
975
+ }
976
+ ),
977
+ /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
978
+ "path",
979
+ {
980
+ fillRule: "evenodd",
981
+ clipRule: "evenodd",
982
+ 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",
983
+ fill: "currentColor"
984
+ }
985
+ )
986
+ ] }),
987
+ /* @__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" }) }) })
988
+ ]
989
+ }
990
+ );
991
+ var InfoIcon_default = InfoIcon;
921
992
 
922
993
  // src/tokens/svg/status/LoaderIcon.tsx
923
994
  var import_jsx_runtime257 = require("react/jsx-runtime");
@@ -942,6 +1013,24 @@ var import_jsx_runtime263 = require("react/jsx-runtime");
942
1013
 
943
1014
  // src/tokens/svg/status/SuccessIcon.tsx
944
1015
  var import_jsx_runtime264 = require("react/jsx-runtime");
1016
+ var SuccessIcon = () => /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
1017
+ "svg",
1018
+ {
1019
+ xmlns: "http://www.w3.org/2000/svg",
1020
+ width: "1em",
1021
+ height: "1em",
1022
+ viewBox: "0 0 16 16",
1023
+ fill: "none",
1024
+ children: /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
1025
+ "path",
1026
+ {
1027
+ 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",
1028
+ fill: "currentColor"
1029
+ }
1030
+ )
1031
+ }
1032
+ );
1033
+ var SuccessIcon_default = SuccessIcon;
945
1034
 
946
1035
  // src/tokens/svg/status/XCircleIcon.tsx
947
1036
  var import_jsx_runtime265 = require("react/jsx-runtime");
@@ -1049,6 +1138,41 @@ function clsx() {
1049
1138
  }
1050
1139
  var clsx_default = clsx;
1051
1140
 
1141
+ // src/components/FieldMessage/FieldMessage.tsx
1142
+ var import_jsx_runtime295 = require("react/jsx-runtime");
1143
+ var ICON = {
1144
+ default: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(InfoIcon_default, {}),
1145
+ success: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(SuccessIcon_default, {}),
1146
+ warning: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(InfoIcon_default, {}),
1147
+ error: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ErrorIcon_default, {})
1148
+ };
1149
+ var FieldMessage = (props) => {
1150
+ const { validations } = props;
1151
+ if (!validations || validations.length === 0) return null;
1152
+ 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)(
1153
+ "div",
1154
+ {
1155
+ className: clsx_default("lib-xplat-field-message", v.status),
1156
+ children: [
1157
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "icon", children: ICON[v.status] }),
1158
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { children: v.message })
1159
+ ]
1160
+ },
1161
+ `${v.message}_${idx}`
1162
+ )) });
1163
+ };
1164
+ FieldMessage.displayName = "FieldMessage";
1165
+ var Field = (props) => {
1166
+ const { validations, children } = props;
1167
+ if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_jsx_runtime295.Fragment, { children });
1168
+ return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: "lib-xplat-field", children: [
1169
+ children,
1170
+ /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(FieldMessage, { validations })
1171
+ ] });
1172
+ };
1173
+ Field.displayName = "Field";
1174
+ var hasError = (validations) => !!validations?.some((v) => v.status === "error");
1175
+
1052
1176
  // src/components/Select/context.ts
1053
1177
  var import_react3 = __toESM(require("react"), 1);
1054
1178
  var SelectContext = import_react3.default.createContext(null);
@@ -1056,7 +1180,7 @@ var context_default = SelectContext;
1056
1180
 
1057
1181
  // src/components/Select/SelectItem.tsx
1058
1182
  var import_react4 = __toESM(require("react"), 1);
1059
- var import_jsx_runtime295 = require("react/jsx-runtime");
1183
+ var import_jsx_runtime296 = require("react/jsx-runtime");
1060
1184
  var SelectItem = (props) => {
1061
1185
  const { children, value, onClick, disabled = false } = props;
1062
1186
  const ctx = import_react4.default.useContext(context_default);
@@ -1069,7 +1193,7 @@ var SelectItem = (props) => {
1069
1193
  onClick?.();
1070
1194
  };
1071
1195
  const isSelected = value !== void 0 ? ctx?.selectedValue === value : ctx?.selectedLabel === children;
1072
- return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(
1196
+ return /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
1073
1197
  "div",
1074
1198
  {
1075
1199
  className: clsx_default("select-item", disabled && "disabled", isSelected && "is-selected"),
@@ -1090,7 +1214,7 @@ SelectItem.displayName = "Select.Item";
1090
1214
  var SelectItem_default = SelectItem;
1091
1215
 
1092
1216
  // src/components/Select/Select.tsx
1093
- var import_jsx_runtime296 = require("react/jsx-runtime");
1217
+ var import_jsx_runtime297 = require("react/jsx-runtime");
1094
1218
  var ANIMATION_DURATION_MS = 200;
1095
1219
  var SelectRoot = (props) => {
1096
1220
  const {
@@ -1100,6 +1224,7 @@ var SelectRoot = (props) => {
1100
1224
  children,
1101
1225
  disabled = false,
1102
1226
  error = false,
1227
+ validations,
1103
1228
  size = "md"
1104
1229
  } = props;
1105
1230
  const itemChildren = import_react5.default.Children.toArray(children).filter(
@@ -1170,32 +1295,32 @@ var SelectRoot = (props) => {
1170
1295
  if (disabled) return;
1171
1296
  toggle();
1172
1297
  };
1173
- return /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(
1298
+ const control = /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(context_default.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)(
1174
1299
  "div",
1175
1300
  {
1176
1301
  className: clsx_default(
1177
1302
  "lib-xplat-select",
1178
1303
  size,
1179
1304
  disabled && "disabled",
1180
- error && "error",
1305
+ (error || hasError(validations)) && "error",
1181
1306
  mounted && "is-open"
1182
1307
  ),
1183
1308
  children: [
1184
- /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)(
1309
+ /* @__PURE__ */ (0, import_jsx_runtime297.jsxs)(
1185
1310
  "div",
1186
1311
  {
1187
1312
  ref: triggerRef,
1188
1313
  className: clsx_default(
1189
1314
  "select-trigger",
1190
1315
  disabled && "disabled",
1191
- error && "error"
1316
+ (error || hasError(validations)) && "error"
1192
1317
  ),
1193
1318
  onClick: handleTriggerClick,
1194
1319
  role: "combobox",
1195
1320
  "aria-expanded": isOpen,
1196
1321
  "aria-haspopup": "listbox",
1197
1322
  "aria-disabled": disabled,
1198
- "aria-invalid": error,
1323
+ "aria-invalid": error || hasError(validations) || void 0,
1199
1324
  tabIndex: disabled ? -1 : 0,
1200
1325
  onKeyDown: (e) => {
1201
1326
  if (disabled) return;
@@ -1205,7 +1330,7 @@ var SelectRoot = (props) => {
1205
1330
  }
1206
1331
  },
1207
1332
  children: [
1208
- /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
1333
+ /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(
1209
1334
  "span",
1210
1335
  {
1211
1336
  className: clsx_default(
@@ -1215,30 +1340,31 @@ var SelectRoot = (props) => {
1215
1340
  children: selectedLabel ?? placeholder
1216
1341
  }
1217
1342
  ),
1218
- /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
1343
+ /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(
1219
1344
  "span",
1220
1345
  {
1221
1346
  className: clsx_default("select-trigger-icon", isOpen && "open"),
1222
1347
  "aria-hidden": true,
1223
- children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(ChevronDownIcon_default, {})
1348
+ children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(ChevronDownIcon_default, {})
1224
1349
  }
1225
1350
  )
1226
1351
  ]
1227
1352
  }
1228
1353
  ),
1229
- mounted && /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
1354
+ mounted && /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(
1230
1355
  "div",
1231
1356
  {
1232
1357
  className: clsx_default("lib-xplat-select-content", size, position.direction, stateClass),
1233
1358
  ref: contentRef,
1234
1359
  style: { ...position.position, width: triggerRef.current?.offsetWidth },
1235
1360
  role: "listbox",
1236
- children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
1361
+ children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(context_default.Provider, { value: ctxValue, children: itemChildren })
1237
1362
  }
1238
1363
  ) })
1239
1364
  ]
1240
1365
  }
1241
1366
  ) });
1367
+ return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(Field, { validations, children: control });
1242
1368
  };
1243
1369
  SelectRoot.displayName = "Select";
1244
1370
  var Select = Object.assign(SelectRoot, {
@@ -1,5 +1,43 @@
1
1
  @charset "UTF-8";
2
2
 
3
+ /* src/components/FieldMessage/fieldMessage.scss */
4
+ .lib-xplat-field {
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: var(--spacing-space-2);
8
+ }
9
+ .lib-xplat-field-message-wrap {
10
+ display: flex;
11
+ gap: var(--spacing-space-2);
12
+ margin-left: var(--spacing-space-1);
13
+ }
14
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message {
15
+ display: flex;
16
+ gap: var(--spacing-space-1);
17
+ font-family: var(--semantic-typo-caption-2-r-font);
18
+ font-size: var(--semantic-typo-caption-2-r-size);
19
+ line-height: var(--semantic-typo-caption-2-r-lh);
20
+ font-weight: var(--semantic-typo-caption-2-r-weight);
21
+ letter-spacing: var(--semantic-typo-caption-2-r-ls);
22
+ align-items: center;
23
+ user-select: none;
24
+ }
25
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message.default {
26
+ color: var(--semantic-icon-secondary);
27
+ }
28
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message.success {
29
+ color: var(--semantic-text-success);
30
+ }
31
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message.warning {
32
+ color: var(--semantic-text-warning);
33
+ }
34
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message.error {
35
+ color: var(--semantic-text-error);
36
+ }
37
+ .lib-xplat-field-message-wrap > .lib-xplat-field-message > .icon {
38
+ font-size: var(--semantic-typo-label-2-m-size);
39
+ }
40
+
3
41
  /* src/components/Select/select.scss */
4
42
  .lib-xplat-select {
5
43
  width: 100%;
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
+ import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
3
4
 
4
5
  interface SelectItemProps {
5
6
  children: React.ReactNode;
@@ -31,6 +32,8 @@ interface SelectProps {
31
32
  /** 비활성화 상태 */
32
33
  disabled?: boolean;
33
34
  /** 에러 상태 */
35
+ /** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
36
+ validations?: Validation[];
34
37
  error?: boolean;
35
38
  /** 사이즈 */
36
39
  size?: SelectSize;
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React from 'react';
3
+ import { V as Validation } from '../../validation-Dqo1zqhT.js';
3
4
 
4
5
  interface SelectItemProps {
5
6
  children: React.ReactNode;
@@ -31,6 +32,8 @@ interface SelectProps {
31
32
  /** 비활성화 상태 */
32
33
  disabled?: boolean;
33
34
  /** 에러 상태 */
35
+ /** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
36
+ validations?: Validation[];
34
37
  error?: boolean;
35
38
  /** 사이즈 */
36
39
  size?: SelectSize;