@x-plat/design-system 0.8.3 → 0.10.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 -0
- package/dist/components/AutoResizeTextArea/index.d.cts +4 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +4 -0
- package/dist/components/AutoResizeTextArea/index.js +140 -4
- package/dist/components/Badge/index.cjs +5 -1
- package/dist/components/Badge/index.css +1 -0
- package/dist/components/Badge/index.d.cts +1 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/index.js +5 -1
- package/dist/components/Box/index.d.cts +3 -0
- package/dist/components/Box/index.d.ts +3 -0
- package/dist/components/Chart/index.cjs +7 -6
- package/dist/components/Chart/index.d.cts +12 -1
- package/dist/components/Chart/index.d.ts +12 -1
- package/dist/components/Chart/index.js +7 -6
- package/dist/components/ChatInput/index.cjs +150 -9
- package/dist/components/ChatInput/index.css +38 -0
- package/dist/components/ChatInput/index.d.cts +9 -0
- package/dist/components/ChatInput/index.d.ts +9 -0
- package/dist/components/ChatInput/index.js +151 -10
- package/dist/components/CheckBox/index.cjs +137 -6
- package/dist/components/CheckBox/index.css +40 -0
- package/dist/components/CheckBox/index.d.cts +13 -2
- package/dist/components/CheckBox/index.d.ts +13 -2
- package/dist/components/CheckBox/index.js +137 -6
- package/dist/components/Chip/index.d.cts +2 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/DatePicker/index.cjs +76 -62
- package/dist/components/DatePicker/index.css +38 -31
- package/dist/components/DatePicker/index.js +42 -28
- package/dist/components/Drawer/index.d.cts +1 -0
- package/dist/components/Drawer/index.d.ts +1 -0
- 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 +9 -0
- package/dist/components/FileUpload/index.d.ts +9 -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 +6 -0
- package/dist/components/ImageSelector/index.d.ts +6 -0
- package/dist/components/ImageSelector/index.js +153 -11
- package/dist/components/Input/index.cjs +38 -25
- package/dist/components/Input/index.css +38 -31
- package/dist/components/Input/index.d.cts +7 -8
- package/dist/components/Input/index.d.ts +7 -8
- package/dist/components/Input/index.js +36 -23
- package/dist/components/NotificationBadge/index.cjs +5 -1
- package/dist/components/NotificationBadge/index.css +1 -0
- package/dist/components/NotificationBadge/index.d.cts +6 -2
- package/dist/components/NotificationBadge/index.d.ts +6 -2
- package/dist/components/NotificationBadge/index.js +5 -1
- package/dist/components/Pagination/index.cjs +6 -2
- package/dist/components/Pagination/index.css +1 -0
- package/dist/components/Pagination/index.d.cts +13 -2
- package/dist/components/Pagination/index.d.ts +13 -2
- package/dist/components/Pagination/index.js +6 -2
- package/dist/components/Progress/index.cjs +6 -2
- package/dist/components/Progress/index.css +1 -0
- package/dist/components/Progress/index.d.cts +11 -2
- package/dist/components/Progress/index.d.ts +11 -2
- package/dist/components/Progress/index.js +6 -2
- package/dist/components/Radio/index.cjs +158 -10
- package/dist/components/Radio/index.css +40 -0
- package/dist/components/Radio/index.d.cts +14 -2
- package/dist/components/Radio/index.d.ts +14 -2
- package/dist/components/Radio/index.js +158 -10
- package/dist/components/Select/index.cjs +139 -13
- package/dist/components/Select/index.css +38 -0
- package/dist/components/Select/index.d.cts +8 -1
- package/dist/components/Select/index.d.ts +8 -1
- package/dist/components/Select/index.js +139 -13
- package/dist/components/Skeleton/index.d.cts +3 -0
- package/dist/components/Skeleton/index.d.ts +3 -0
- package/dist/components/Spinner/index.cjs +6 -2
- package/dist/components/Spinner/index.css +1 -0
- package/dist/components/Spinner/index.d.cts +8 -2
- package/dist/components/Spinner/index.d.ts +8 -2
- package/dist/components/Spinner/index.js +6 -2
- package/dist/components/Steps/index.cjs +6 -2
- package/dist/components/Steps/index.css +11 -0
- package/dist/components/Steps/index.d.cts +9 -2
- package/dist/components/Steps/index.d.ts +9 -2
- package/dist/components/Steps/index.js +6 -2
- package/dist/components/Switch/index.cjs +146 -6
- package/dist/components/Switch/index.css +40 -0
- package/dist/components/Switch/index.d.cts +13 -2
- package/dist/components/Switch/index.d.ts +13 -2
- package/dist/components/Switch/index.js +146 -6
- package/dist/components/Tab/index.cjs +4 -3
- package/dist/components/Tab/index.d.cts +12 -1
- package/dist/components/Tab/index.d.ts +12 -1
- package/dist/components/Tab/index.js +4 -3
- package/dist/components/Tag/index.cjs +5 -3
- package/dist/components/Tag/index.d.cts +12 -2
- package/dist/components/Tag/index.d.ts +12 -2
- package/dist/components/Tag/index.js +5 -3
- package/dist/components/TextArea/index.cjs +138 -2
- package/dist/components/TextArea/index.css +38 -0
- package/dist/components/TextArea/index.d.cts +6 -0
- package/dist/components/TextArea/index.d.ts +6 -0
- package/dist/components/TextArea/index.js +138 -2
- package/dist/components/Tooltip/index.cjs +4 -2
- package/dist/components/Tooltip/index.d.cts +11 -1
- package/dist/components/Tooltip/index.d.ts +11 -1
- package/dist/components/Tooltip/index.js +4 -2
- package/dist/components/index.cjs +479 -408
- package/dist/components/index.css +59 -31
- package/dist/components/index.d.cts +3 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +262 -194
- package/dist/index.cjs +484 -413
- package/dist/index.css +59 -31
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +264 -196
- package/dist/status-g_KP3qT6.d.cts +8 -0
- package/dist/status-g_KP3qT6.d.ts +8 -0
- package/dist/validation-Dqo1zqhT.d.cts +13 -0
- package/dist/validation-Dqo1zqhT.d.ts +13 -0
- package/guidelines/AGENT_PROMPT.md +15 -0
- package/guidelines/components/card.md +3 -3
- package/guidelines/components/feedback.md +1 -1
- package/guidelines/components/form.md +26 -0
- package/guidelines/components/navigation.md +16 -15
- package/guidelines/components/overlay.md +43 -4
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/tokens/interface/status.ts
|
|
2
|
+
var normalizeStatus = (value) => value === "brand" ? "primary" : value;
|
|
3
|
+
|
|
1
4
|
// ../../node_modules/clsx/dist/clsx.mjs
|
|
2
5
|
function r(e) {
|
|
3
6
|
var t, f, n = "";
|
|
@@ -14,6 +17,139 @@ function clsx() {
|
|
|
14
17
|
}
|
|
15
18
|
var clsx_default = clsx;
|
|
16
19
|
|
|
20
|
+
// src/tokens/svg/status/ErrorIcon.tsx
|
|
21
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
var ErrorIcon = () => /* @__PURE__ */ jsxs(
|
|
23
|
+
"svg",
|
|
24
|
+
{
|
|
25
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
26
|
+
width: "1em",
|
|
27
|
+
height: "1em",
|
|
28
|
+
viewBox: "0 0 16 16",
|
|
29
|
+
fill: "none",
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ jsxs("g", { clipPath: "url(#clip0_1196_9603)", children: [
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"path",
|
|
34
|
+
{
|
|
35
|
+
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",
|
|
36
|
+
fill: "currentColor"
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ jsx(
|
|
40
|
+
"path",
|
|
41
|
+
{
|
|
42
|
+
fillRule: "evenodd",
|
|
43
|
+
clipRule: "evenodd",
|
|
44
|
+
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",
|
|
45
|
+
fill: "currentColor"
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
] }),
|
|
49
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ jsx("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
var ErrorIcon_default = ErrorIcon;
|
|
54
|
+
|
|
55
|
+
// src/tokens/svg/status/InfoIcon.tsx
|
|
56
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
57
|
+
var InfoIcon = () => /* @__PURE__ */ jsxs2(
|
|
58
|
+
"svg",
|
|
59
|
+
{
|
|
60
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
61
|
+
width: "1em",
|
|
62
|
+
height: "1em",
|
|
63
|
+
viewBox: "0 0 16 16",
|
|
64
|
+
fill: "none",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsxs2("g", { clipPath: "url(#clip0_1188_11261)", children: [
|
|
67
|
+
/* @__PURE__ */ jsx2(
|
|
68
|
+
"path",
|
|
69
|
+
{
|
|
70
|
+
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",
|
|
71
|
+
fill: "currentColor"
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ jsx2(
|
|
75
|
+
"path",
|
|
76
|
+
{
|
|
77
|
+
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",
|
|
78
|
+
fill: "currentColor"
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsx2(
|
|
82
|
+
"path",
|
|
83
|
+
{
|
|
84
|
+
fillRule: "evenodd",
|
|
85
|
+
clipRule: "evenodd",
|
|
86
|
+
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",
|
|
87
|
+
fill: "currentColor"
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ jsx2("defs", { children: /* @__PURE__ */ jsx2("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ jsx2("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
var InfoIcon_default = InfoIcon;
|
|
96
|
+
|
|
97
|
+
// src/tokens/svg/status/SuccessIcon.tsx
|
|
98
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
99
|
+
var SuccessIcon = () => /* @__PURE__ */ jsx3(
|
|
100
|
+
"svg",
|
|
101
|
+
{
|
|
102
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
103
|
+
width: "1em",
|
|
104
|
+
height: "1em",
|
|
105
|
+
viewBox: "0 0 16 16",
|
|
106
|
+
fill: "none",
|
|
107
|
+
children: /* @__PURE__ */ jsx3(
|
|
108
|
+
"path",
|
|
109
|
+
{
|
|
110
|
+
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",
|
|
111
|
+
fill: "currentColor"
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
var SuccessIcon_default = SuccessIcon;
|
|
117
|
+
|
|
118
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
119
|
+
import { Fragment, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
120
|
+
var ICON = {
|
|
121
|
+
default: /* @__PURE__ */ jsx4(InfoIcon_default, {}),
|
|
122
|
+
success: /* @__PURE__ */ jsx4(SuccessIcon_default, {}),
|
|
123
|
+
warning: /* @__PURE__ */ jsx4(InfoIcon_default, {}),
|
|
124
|
+
error: /* @__PURE__ */ jsx4(ErrorIcon_default, {})
|
|
125
|
+
};
|
|
126
|
+
var FieldMessage = (props) => {
|
|
127
|
+
const { validations } = props;
|
|
128
|
+
if (!validations || validations.length === 0) return null;
|
|
129
|
+
return /* @__PURE__ */ jsx4("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ jsxs3(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ jsx4("div", { className: "icon", children: ICON[v.status] }),
|
|
135
|
+
/* @__PURE__ */ jsx4("span", { children: v.message })
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
`${v.message}_${idx}`
|
|
139
|
+
)) });
|
|
140
|
+
};
|
|
141
|
+
FieldMessage.displayName = "FieldMessage";
|
|
142
|
+
var Field = (props) => {
|
|
143
|
+
const { validations, children } = props;
|
|
144
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ jsx4(Fragment, { children });
|
|
145
|
+
return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
|
|
146
|
+
children,
|
|
147
|
+
/* @__PURE__ */ jsx4(FieldMessage, { validations })
|
|
148
|
+
] });
|
|
149
|
+
};
|
|
150
|
+
Field.displayName = "Field";
|
|
151
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
152
|
+
|
|
17
153
|
// src/components/Radio/RadioGroupContext.tsx
|
|
18
154
|
import React from "react";
|
|
19
155
|
var RadioGroupContext = React.createContext(
|
|
@@ -25,16 +161,18 @@ var useRadioGroupContext = () => {
|
|
|
25
161
|
var RadioGroupContext_default = RadioGroupContext;
|
|
26
162
|
|
|
27
163
|
// src/components/Radio/Radio.tsx
|
|
28
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
164
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
29
165
|
var Radio = (props) => {
|
|
30
166
|
const {
|
|
31
167
|
label,
|
|
32
168
|
className,
|
|
33
169
|
value,
|
|
34
170
|
size: sizeProp,
|
|
35
|
-
type = "
|
|
171
|
+
type = "primary",
|
|
172
|
+
validations,
|
|
36
173
|
...rest
|
|
37
174
|
} = props;
|
|
175
|
+
const statusType = normalizeStatus(type);
|
|
38
176
|
const context = useRadioGroupContext();
|
|
39
177
|
const size = sizeProp ?? context?.size ?? "md";
|
|
40
178
|
const isGroup = !!context;
|
|
@@ -44,41 +182,51 @@ var Radio = (props) => {
|
|
|
44
182
|
value,
|
|
45
183
|
onChange: rest.onChange
|
|
46
184
|
};
|
|
47
|
-
|
|
185
|
+
const control = /* @__PURE__ */ jsxs4(
|
|
48
186
|
"label",
|
|
49
187
|
{
|
|
50
188
|
className: clsx_default(
|
|
51
189
|
"lib-xplat-radio",
|
|
52
190
|
size,
|
|
53
|
-
|
|
191
|
+
statusType,
|
|
54
192
|
localChecked ? "checked" : void 0,
|
|
55
193
|
className
|
|
56
194
|
),
|
|
57
195
|
children: [
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
196
|
+
/* @__PURE__ */ jsx5(
|
|
197
|
+
"input",
|
|
198
|
+
{
|
|
199
|
+
...rest,
|
|
200
|
+
...inputProps,
|
|
201
|
+
checked: localChecked,
|
|
202
|
+
type: "radio",
|
|
203
|
+
"aria-invalid": hasError(validations) || void 0
|
|
204
|
+
}
|
|
205
|
+
),
|
|
206
|
+
/* @__PURE__ */ jsx5(
|
|
60
207
|
"div",
|
|
61
208
|
{
|
|
62
209
|
className: clsx_default(
|
|
63
210
|
"circle",
|
|
64
211
|
localChecked ? "checked" : void 0
|
|
65
212
|
),
|
|
66
|
-
children: localChecked && /* @__PURE__ */
|
|
213
|
+
children: localChecked && /* @__PURE__ */ jsx5("div", { className: "inner-circle" })
|
|
67
214
|
}
|
|
68
215
|
),
|
|
69
|
-
label && /* @__PURE__ */
|
|
216
|
+
label && /* @__PURE__ */ jsx5("span", { children: label })
|
|
70
217
|
]
|
|
71
218
|
}
|
|
72
219
|
);
|
|
220
|
+
return /* @__PURE__ */ jsx5(Field, { validations, children: control });
|
|
73
221
|
};
|
|
74
222
|
Radio.displayName = "Radio";
|
|
75
223
|
var Radio_default = Radio;
|
|
76
224
|
|
|
77
225
|
// src/components/Radio/RadioGroup.tsx
|
|
78
|
-
import { Fragment, jsx as
|
|
226
|
+
import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
|
|
79
227
|
var RadioGroup = (props) => {
|
|
80
228
|
const { children, ...rest } = props;
|
|
81
|
-
return /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ jsx6(Fragment2, { children: /* @__PURE__ */ jsx6(RadioGroupContext_default.Provider, { value: rest, children }) });
|
|
82
230
|
};
|
|
83
231
|
RadioGroup.displayName = "RadioGroup";
|
|
84
232
|
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
|
|
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,
|
|
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
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
1348
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(ChevronDownIcon_default, {})
|
|
1224
1349
|
}
|
|
1225
1350
|
)
|
|
1226
1351
|
]
|
|
1227
1352
|
}
|
|
1228
1353
|
),
|
|
1229
|
-
mounted && /* @__PURE__ */ (0,
|
|
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,
|
|
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;
|
|
@@ -7,6 +8,7 @@ interface SelectItemProps {
|
|
|
7
8
|
value?: string | number;
|
|
8
9
|
/** 클릭 시 추가로 실행할 핸들러 (선택 처리 후 호출) */
|
|
9
10
|
onClick?: () => void;
|
|
11
|
+
/** 열리지 않게 막는다 */
|
|
10
12
|
disabled?: boolean;
|
|
11
13
|
}
|
|
12
14
|
declare const SelectItem: {
|
|
@@ -17,7 +19,9 @@ declare const SelectItem: {
|
|
|
17
19
|
/** Select.Item 으로만 만든 엘리먼트 (다른 컴포넌트/노드 넣으면 타입 오류) */
|
|
18
20
|
type SelectItemElement = React.ReactElement<SelectItemProps, typeof SelectItem>;
|
|
19
21
|
/** 값 변경 시 호출 (value: 아이템 value, label: 표시 텍스트) */
|
|
20
|
-
type SelectChangeHandler = (
|
|
22
|
+
type SelectChangeHandler = (
|
|
23
|
+
/** 선택된 값. 주면 controlled 가 된다 */
|
|
24
|
+
value: string | number | undefined, label: React.ReactNode) => void;
|
|
21
25
|
type SelectSize = "sm" | "md" | "lg";
|
|
22
26
|
interface SelectProps {
|
|
23
27
|
/** 선택 전 표시할 문구 */
|
|
@@ -31,6 +35,9 @@ interface SelectProps {
|
|
|
31
35
|
/** 비활성화 상태 */
|
|
32
36
|
disabled?: boolean;
|
|
33
37
|
/** 에러 상태 */
|
|
38
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
39
|
+
validations?: Validation[];
|
|
40
|
+
/** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
|
|
34
41
|
error?: boolean;
|
|
35
42
|
/** 사이즈 */
|
|
36
43
|
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;
|
|
@@ -7,6 +8,7 @@ interface SelectItemProps {
|
|
|
7
8
|
value?: string | number;
|
|
8
9
|
/** 클릭 시 추가로 실행할 핸들러 (선택 처리 후 호출) */
|
|
9
10
|
onClick?: () => void;
|
|
11
|
+
/** 열리지 않게 막는다 */
|
|
10
12
|
disabled?: boolean;
|
|
11
13
|
}
|
|
12
14
|
declare const SelectItem: {
|
|
@@ -17,7 +19,9 @@ declare const SelectItem: {
|
|
|
17
19
|
/** Select.Item 으로만 만든 엘리먼트 (다른 컴포넌트/노드 넣으면 타입 오류) */
|
|
18
20
|
type SelectItemElement = React.ReactElement<SelectItemProps, typeof SelectItem>;
|
|
19
21
|
/** 값 변경 시 호출 (value: 아이템 value, label: 표시 텍스트) */
|
|
20
|
-
type SelectChangeHandler = (
|
|
22
|
+
type SelectChangeHandler = (
|
|
23
|
+
/** 선택된 값. 주면 controlled 가 된다 */
|
|
24
|
+
value: string | number | undefined, label: React.ReactNode) => void;
|
|
21
25
|
type SelectSize = "sm" | "md" | "lg";
|
|
22
26
|
interface SelectProps {
|
|
23
27
|
/** 선택 전 표시할 문구 */
|
|
@@ -31,6 +35,9 @@ interface SelectProps {
|
|
|
31
35
|
/** 비활성화 상태 */
|
|
32
36
|
disabled?: boolean;
|
|
33
37
|
/** 에러 상태 */
|
|
38
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
39
|
+
validations?: Validation[];
|
|
40
|
+
/** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
|
|
34
41
|
error?: boolean;
|
|
35
42
|
/** 사이즈 */
|
|
36
43
|
size?: SelectSize;
|