@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.
- package/dist/components/AutoResizeTextArea/index.cjs +140 -4
- package/dist/components/AutoResizeTextArea/index.css +38 -0
- package/dist/components/AutoResizeTextArea/index.d.cts +3 -0
- package/dist/components/AutoResizeTextArea/index.d.ts +3 -0
- package/dist/components/AutoResizeTextArea/index.js +140 -4
- package/dist/components/ChatInput/index.cjs +150 -9
- package/dist/components/ChatInput/index.css +38 -0
- package/dist/components/ChatInput/index.d.cts +3 -0
- package/dist/components/ChatInput/index.d.ts +3 -0
- package/dist/components/ChatInput/index.js +151 -10
- package/dist/components/CheckBox/index.cjs +132 -5
- package/dist/components/CheckBox/index.css +38 -0
- package/dist/components/CheckBox/index.d.cts +3 -0
- package/dist/components/CheckBox/index.d.ts +3 -0
- package/dist/components/CheckBox/index.js +132 -5
- package/dist/components/DatePicker/index.cjs +72 -59
- package/dist/components/DatePicker/index.css +38 -31
- package/dist/components/DatePicker/index.js +38 -25
- package/dist/components/FieldMessage/index.cjs +183 -0
- package/dist/components/FieldMessage/index.css +37 -0
- package/dist/components/FieldMessage/index.d.cts +37 -0
- package/dist/components/FieldMessage/index.d.ts +37 -0
- package/dist/components/FieldMessage/index.js +154 -0
- package/dist/components/FileUpload/index.cjs +135 -8
- package/dist/components/FileUpload/index.css +38 -0
- package/dist/components/FileUpload/index.d.cts +3 -0
- package/dist/components/FileUpload/index.d.ts +3 -0
- package/dist/components/FileUpload/index.js +135 -8
- package/dist/components/ImageSelector/index.cjs +153 -11
- package/dist/components/ImageSelector/index.css +38 -0
- package/dist/components/ImageSelector/index.d.cts +3 -0
- package/dist/components/ImageSelector/index.d.ts +3 -0
- package/dist/components/ImageSelector/index.js +153 -11
- package/dist/components/Input/index.cjs +38 -25
- package/dist/components/Input/index.css +38 -31
- package/dist/components/Input/index.d.cts +3 -8
- package/dist/components/Input/index.d.ts +3 -8
- package/dist/components/Input/index.js +36 -23
- package/dist/components/Radio/index.cjs +152 -8
- package/dist/components/Radio/index.css +38 -0
- package/dist/components/Radio/index.d.cts +3 -0
- package/dist/components/Radio/index.d.ts +3 -0
- package/dist/components/Radio/index.js +152 -8
- package/dist/components/Select/index.cjs +139 -13
- package/dist/components/Select/index.css +38 -0
- package/dist/components/Select/index.d.cts +3 -0
- package/dist/components/Select/index.d.ts +3 -0
- package/dist/components/Select/index.js +139 -13
- package/dist/components/Switch/index.cjs +140 -4
- package/dist/components/Switch/index.css +38 -0
- package/dist/components/Switch/index.d.cts +3 -0
- package/dist/components/Switch/index.d.ts +3 -0
- package/dist/components/Switch/index.js +140 -4
- package/dist/components/TextArea/index.cjs +138 -2
- package/dist/components/TextArea/index.css +38 -0
- package/dist/components/TextArea/index.d.cts +3 -0
- package/dist/components/TextArea/index.d.ts +3 -0
- package/dist/components/TextArea/index.js +138 -2
- package/dist/components/index.cjs +439 -385
- package/dist/components/index.css +38 -31
- package/dist/components/index.d.cts +2 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +222 -171
- package/dist/index.cjs +444 -390
- package/dist/index.css +38 -31
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +224 -173
- package/dist/validation-Dqo1zqhT.d.cts +13 -0
- package/dist/validation-Dqo1zqhT.d.ts +13 -0
- package/guidelines/components/form.md +26 -0
- package/package.json +1 -1
|
@@ -76,6 +76,44 @@
|
|
|
76
76
|
outline-offset: 2px;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
/* src/components/FieldMessage/fieldMessage.scss */
|
|
80
|
+
.lib-xplat-field {
|
|
81
|
+
display: flex;
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
gap: var(--spacing-space-2);
|
|
84
|
+
}
|
|
85
|
+
.lib-xplat-field-message-wrap {
|
|
86
|
+
display: flex;
|
|
87
|
+
gap: var(--spacing-space-2);
|
|
88
|
+
margin-left: var(--spacing-space-1);
|
|
89
|
+
}
|
|
90
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message {
|
|
91
|
+
display: flex;
|
|
92
|
+
gap: var(--spacing-space-1);
|
|
93
|
+
font-family: var(--semantic-typo-caption-2-r-font);
|
|
94
|
+
font-size: var(--semantic-typo-caption-2-r-size);
|
|
95
|
+
line-height: var(--semantic-typo-caption-2-r-lh);
|
|
96
|
+
font-weight: var(--semantic-typo-caption-2-r-weight);
|
|
97
|
+
letter-spacing: var(--semantic-typo-caption-2-r-ls);
|
|
98
|
+
align-items: center;
|
|
99
|
+
user-select: none;
|
|
100
|
+
}
|
|
101
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.default {
|
|
102
|
+
color: var(--semantic-icon-secondary);
|
|
103
|
+
}
|
|
104
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.success {
|
|
105
|
+
color: var(--semantic-text-success);
|
|
106
|
+
}
|
|
107
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.warning {
|
|
108
|
+
color: var(--semantic-text-warning);
|
|
109
|
+
}
|
|
110
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message.error {
|
|
111
|
+
color: var(--semantic-text-error);
|
|
112
|
+
}
|
|
113
|
+
.lib-xplat-field-message-wrap > .lib-xplat-field-message > .icon {
|
|
114
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
115
|
+
}
|
|
116
|
+
|
|
79
117
|
/* src/components/AutoResizeTextArea/autoResizeTextArea.scss */
|
|
80
118
|
.lib-xplat-auto-resize-textarea-wrapper {
|
|
81
119
|
display: flex;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
2
3
|
|
|
3
4
|
type ButtonType = "primary" | "secondary" | "ghost";
|
|
4
5
|
interface ChatInputProps {
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
value?: string;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
10
|
+
validations?: Validation[];
|
|
8
11
|
buttonType?: ButtonType;
|
|
9
12
|
onSubmit?: (value: string) => void;
|
|
10
13
|
onChange?: (value: string) => void;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
2
3
|
|
|
3
4
|
type ButtonType = "primary" | "secondary" | "ghost";
|
|
4
5
|
interface ChatInputProps {
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
value?: string;
|
|
7
8
|
disabled?: boolean;
|
|
9
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
10
|
+
validations?: Validation[];
|
|
8
11
|
buttonType?: ButtonType;
|
|
9
12
|
onSubmit?: (value: string) => void;
|
|
10
13
|
onChange?: (value: string) => void;
|
|
@@ -75,11 +75,146 @@ import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
|
75
75
|
|
|
76
76
|
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
77
77
|
import React from "react";
|
|
78
|
-
|
|
78
|
+
|
|
79
|
+
// src/tokens/svg/status/ErrorIcon.tsx
|
|
80
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
81
|
+
var ErrorIcon = () => /* @__PURE__ */ jsxs4(
|
|
82
|
+
"svg",
|
|
83
|
+
{
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
85
|
+
width: "1em",
|
|
86
|
+
height: "1em",
|
|
87
|
+
viewBox: "0 0 16 16",
|
|
88
|
+
fill: "none",
|
|
89
|
+
children: [
|
|
90
|
+
/* @__PURE__ */ jsxs4("g", { clipPath: "url(#clip0_1196_9603)", children: [
|
|
91
|
+
/* @__PURE__ */ jsx9(
|
|
92
|
+
"path",
|
|
93
|
+
{
|
|
94
|
+
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",
|
|
95
|
+
fill: "currentColor"
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ jsx9(
|
|
99
|
+
"path",
|
|
100
|
+
{
|
|
101
|
+
fillRule: "evenodd",
|
|
102
|
+
clipRule: "evenodd",
|
|
103
|
+
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",
|
|
104
|
+
fill: "currentColor"
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ jsx9("defs", { children: /* @__PURE__ */ jsx9("clipPath", { id: "clip0_1196_9603", children: /* @__PURE__ */ jsx9("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
var ErrorIcon_default = ErrorIcon;
|
|
113
|
+
|
|
114
|
+
// src/tokens/svg/status/InfoIcon.tsx
|
|
115
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
116
|
+
var InfoIcon = () => /* @__PURE__ */ jsxs5(
|
|
117
|
+
"svg",
|
|
118
|
+
{
|
|
119
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
120
|
+
width: "1em",
|
|
121
|
+
height: "1em",
|
|
122
|
+
viewBox: "0 0 16 16",
|
|
123
|
+
fill: "none",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsxs5("g", { clipPath: "url(#clip0_1188_11261)", children: [
|
|
126
|
+
/* @__PURE__ */ jsx10(
|
|
127
|
+
"path",
|
|
128
|
+
{
|
|
129
|
+
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",
|
|
130
|
+
fill: "currentColor"
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ jsx10(
|
|
134
|
+
"path",
|
|
135
|
+
{
|
|
136
|
+
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",
|
|
137
|
+
fill: "currentColor"
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ jsx10(
|
|
141
|
+
"path",
|
|
142
|
+
{
|
|
143
|
+
fillRule: "evenodd",
|
|
144
|
+
clipRule: "evenodd",
|
|
145
|
+
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",
|
|
146
|
+
fill: "currentColor"
|
|
147
|
+
}
|
|
148
|
+
)
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ jsx10("defs", { children: /* @__PURE__ */ jsx10("clipPath", { id: "clip0_1188_11261", children: /* @__PURE__ */ jsx10("rect", { width: "16", height: "16", fill: "white" }) }) })
|
|
151
|
+
]
|
|
152
|
+
}
|
|
153
|
+
);
|
|
154
|
+
var InfoIcon_default = InfoIcon;
|
|
155
|
+
|
|
156
|
+
// src/tokens/svg/status/SuccessIcon.tsx
|
|
157
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
158
|
+
var SuccessIcon = () => /* @__PURE__ */ jsx11(
|
|
159
|
+
"svg",
|
|
160
|
+
{
|
|
161
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
162
|
+
width: "1em",
|
|
163
|
+
height: "1em",
|
|
164
|
+
viewBox: "0 0 16 16",
|
|
165
|
+
fill: "none",
|
|
166
|
+
children: /* @__PURE__ */ jsx11(
|
|
167
|
+
"path",
|
|
168
|
+
{
|
|
169
|
+
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",
|
|
170
|
+
fill: "currentColor"
|
|
171
|
+
}
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
var SuccessIcon_default = SuccessIcon;
|
|
176
|
+
|
|
177
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
178
|
+
import { Fragment, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
179
|
+
var ICON = {
|
|
180
|
+
default: /* @__PURE__ */ jsx12(InfoIcon_default, {}),
|
|
181
|
+
success: /* @__PURE__ */ jsx12(SuccessIcon_default, {}),
|
|
182
|
+
warning: /* @__PURE__ */ jsx12(InfoIcon_default, {}),
|
|
183
|
+
error: /* @__PURE__ */ jsx12(ErrorIcon_default, {})
|
|
184
|
+
};
|
|
185
|
+
var FieldMessage = (props) => {
|
|
186
|
+
const { validations } = props;
|
|
187
|
+
if (!validations || validations.length === 0) return null;
|
|
188
|
+
return /* @__PURE__ */ jsx12("div", { className: "lib-xplat-field-message-wrap", children: validations.map((v, idx) => /* @__PURE__ */ jsxs6(
|
|
189
|
+
"div",
|
|
190
|
+
{
|
|
191
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ jsx12("div", { className: "icon", children: ICON[v.status] }),
|
|
194
|
+
/* @__PURE__ */ jsx12("span", { children: v.message })
|
|
195
|
+
]
|
|
196
|
+
},
|
|
197
|
+
`${v.message}_${idx}`
|
|
198
|
+
)) });
|
|
199
|
+
};
|
|
200
|
+
FieldMessage.displayName = "FieldMessage";
|
|
201
|
+
var Field = (props) => {
|
|
202
|
+
const { validations, children } = props;
|
|
203
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ jsx12(Fragment, { children });
|
|
204
|
+
return /* @__PURE__ */ jsxs6("div", { className: "lib-xplat-field", children: [
|
|
205
|
+
children,
|
|
206
|
+
/* @__PURE__ */ jsx12(FieldMessage, { validations })
|
|
207
|
+
] });
|
|
208
|
+
};
|
|
209
|
+
Field.displayName = "Field";
|
|
210
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
211
|
+
|
|
212
|
+
// src/components/AutoResizeTextArea/AutoResizeTextArea.tsx
|
|
213
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
79
214
|
var MAX_HEIGHT = 400;
|
|
80
215
|
var AutoResizeTextArea = React.forwardRef(
|
|
81
216
|
(props, ref) => {
|
|
82
|
-
const { value, className, onChange, disabled, bare = false, ...textareaProps } = props;
|
|
217
|
+
const { value, className, onChange, disabled, bare = false, validations, ...textareaProps } = props;
|
|
83
218
|
const localRef = React.useRef(null);
|
|
84
219
|
const setRefs = (el) => {
|
|
85
220
|
localRef.current = el;
|
|
@@ -107,9 +242,10 @@ var AutoResizeTextArea = React.forwardRef(
|
|
|
107
242
|
updateHeight();
|
|
108
243
|
}, [value]);
|
|
109
244
|
if (bare) {
|
|
110
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ jsx13(
|
|
111
246
|
"textarea",
|
|
112
247
|
{
|
|
248
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
113
249
|
...textareaProps,
|
|
114
250
|
ref: setRefs,
|
|
115
251
|
className,
|
|
@@ -119,9 +255,10 @@ var AutoResizeTextArea = React.forwardRef(
|
|
|
119
255
|
}
|
|
120
256
|
);
|
|
121
257
|
}
|
|
122
|
-
|
|
258
|
+
const control = /* @__PURE__ */ jsx13("div", { className: clsx_default("lib-xplat-auto-resize-textarea-wrapper", className), children: /* @__PURE__ */ jsx13("div", { className: clsx_default("lib-xplat-auto-resize-textarea", disabled && "disabled"), children: /* @__PURE__ */ jsx13(
|
|
123
259
|
"textarea",
|
|
124
260
|
{
|
|
261
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
125
262
|
...textareaProps,
|
|
126
263
|
ref: setRefs,
|
|
127
264
|
disabled,
|
|
@@ -129,13 +266,14 @@ var AutoResizeTextArea = React.forwardRef(
|
|
|
129
266
|
onChange: handleChange
|
|
130
267
|
}
|
|
131
268
|
) }) });
|
|
269
|
+
return /* @__PURE__ */ jsx13(Field, { validations, children: control });
|
|
132
270
|
}
|
|
133
271
|
);
|
|
134
272
|
AutoResizeTextArea.displayName = "AutoResizeTextArea";
|
|
135
273
|
var AutoResizeTextArea_default = AutoResizeTextArea;
|
|
136
274
|
|
|
137
275
|
// src/components/ChatInput/ChatInput.tsx
|
|
138
|
-
import { jsx as
|
|
276
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
139
277
|
var ChatInput = React2.forwardRef(
|
|
140
278
|
(props, ref) => {
|
|
141
279
|
const {
|
|
@@ -144,7 +282,8 @@ var ChatInput = React2.forwardRef(
|
|
|
144
282
|
disabled = false,
|
|
145
283
|
buttonType = "primary",
|
|
146
284
|
onSubmit,
|
|
147
|
-
onChange
|
|
285
|
+
onChange,
|
|
286
|
+
validations
|
|
148
287
|
} = props;
|
|
149
288
|
const isControlled = valueProp !== void 0;
|
|
150
289
|
const [internalValue, setInternalValue] = React2.useState("");
|
|
@@ -166,8 +305,8 @@ var ChatInput = React2.forwardRef(
|
|
|
166
305
|
handleSubmit();
|
|
167
306
|
}
|
|
168
307
|
};
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */
|
|
308
|
+
const control = /* @__PURE__ */ jsxs7("div", { className: clsx_default("lib-xplat-chat-input", disabled && "disabled"), children: [
|
|
309
|
+
/* @__PURE__ */ jsx14(
|
|
171
310
|
AutoResizeTextArea_default,
|
|
172
311
|
{
|
|
173
312
|
ref,
|
|
@@ -178,13 +317,14 @@ var ChatInput = React2.forwardRef(
|
|
|
178
317
|
disabled,
|
|
179
318
|
rows: 1,
|
|
180
319
|
onChange: handleChange,
|
|
320
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
181
321
|
onKeyDown: handleKeyDown
|
|
182
322
|
}
|
|
183
323
|
),
|
|
184
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ jsx14(
|
|
185
325
|
IconButton_default,
|
|
186
326
|
{
|
|
187
|
-
icon: /* @__PURE__ */
|
|
327
|
+
icon: /* @__PURE__ */ jsx14(MessageSquareIcon_default, {}),
|
|
188
328
|
type: buttonType,
|
|
189
329
|
size: "sm",
|
|
190
330
|
disabled: !hasText || disabled,
|
|
@@ -193,6 +333,7 @@ var ChatInput = React2.forwardRef(
|
|
|
193
333
|
}
|
|
194
334
|
)
|
|
195
335
|
] });
|
|
336
|
+
return /* @__PURE__ */ jsx14(Field, { validations, children: control });
|
|
196
337
|
}
|
|
197
338
|
);
|
|
198
339
|
ChatInput.displayName = "ChatInput";
|
|
@@ -806,12 +806,83 @@ var CheckIcon_default = CheckIcon;
|
|
|
806
806
|
|
|
807
807
|
// src/tokens/svg/status/ErrorIcon.tsx
|
|
808
808
|
var import_jsx_runtime254 = require("react/jsx-runtime");
|
|
809
|
+
var ErrorIcon = () => /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)(
|
|
810
|
+
"svg",
|
|
811
|
+
{
|
|
812
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
813
|
+
width: "1em",
|
|
814
|
+
height: "1em",
|
|
815
|
+
viewBox: "0 0 16 16",
|
|
816
|
+
fill: "none",
|
|
817
|
+
children: [
|
|
818
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsxs)("g", { clipPath: "url(#clip0_1196_9603)", children: [
|
|
819
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
820
|
+
"path",
|
|
821
|
+
{
|
|
822
|
+
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",
|
|
823
|
+
fill: "currentColor"
|
|
824
|
+
}
|
|
825
|
+
),
|
|
826
|
+
/* @__PURE__ */ (0, import_jsx_runtime254.jsx)(
|
|
827
|
+
"path",
|
|
828
|
+
{
|
|
829
|
+
fillRule: "evenodd",
|
|
830
|
+
clipRule: "evenodd",
|
|
831
|
+
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",
|
|
832
|
+
fill: "currentColor"
|
|
833
|
+
}
|
|
834
|
+
)
|
|
835
|
+
] }),
|
|
836
|
+
/* @__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" }) }) })
|
|
837
|
+
]
|
|
838
|
+
}
|
|
839
|
+
);
|
|
840
|
+
var ErrorIcon_default = ErrorIcon;
|
|
809
841
|
|
|
810
842
|
// src/tokens/svg/status/HelpCircleIcon.tsx
|
|
811
843
|
var import_jsx_runtime255 = require("react/jsx-runtime");
|
|
812
844
|
|
|
813
845
|
// src/tokens/svg/status/InfoIcon.tsx
|
|
814
846
|
var import_jsx_runtime256 = require("react/jsx-runtime");
|
|
847
|
+
var InfoIcon = () => /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(
|
|
848
|
+
"svg",
|
|
849
|
+
{
|
|
850
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
851
|
+
width: "1em",
|
|
852
|
+
height: "1em",
|
|
853
|
+
viewBox: "0 0 16 16",
|
|
854
|
+
fill: "none",
|
|
855
|
+
children: [
|
|
856
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsxs)("g", { clipPath: "url(#clip0_1188_11261)", children: [
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
858
|
+
"path",
|
|
859
|
+
{
|
|
860
|
+
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",
|
|
861
|
+
fill: "currentColor"
|
|
862
|
+
}
|
|
863
|
+
),
|
|
864
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
865
|
+
"path",
|
|
866
|
+
{
|
|
867
|
+
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",
|
|
868
|
+
fill: "currentColor"
|
|
869
|
+
}
|
|
870
|
+
),
|
|
871
|
+
/* @__PURE__ */ (0, import_jsx_runtime256.jsx)(
|
|
872
|
+
"path",
|
|
873
|
+
{
|
|
874
|
+
fillRule: "evenodd",
|
|
875
|
+
clipRule: "evenodd",
|
|
876
|
+
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",
|
|
877
|
+
fill: "currentColor"
|
|
878
|
+
}
|
|
879
|
+
)
|
|
880
|
+
] }),
|
|
881
|
+
/* @__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" }) }) })
|
|
882
|
+
]
|
|
883
|
+
}
|
|
884
|
+
);
|
|
885
|
+
var InfoIcon_default = InfoIcon;
|
|
815
886
|
|
|
816
887
|
// src/tokens/svg/status/LoaderIcon.tsx
|
|
817
888
|
var import_jsx_runtime257 = require("react/jsx-runtime");
|
|
@@ -836,6 +907,24 @@ var import_jsx_runtime263 = require("react/jsx-runtime");
|
|
|
836
907
|
|
|
837
908
|
// src/tokens/svg/status/SuccessIcon.tsx
|
|
838
909
|
var import_jsx_runtime264 = require("react/jsx-runtime");
|
|
910
|
+
var SuccessIcon = () => /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
|
|
911
|
+
"svg",
|
|
912
|
+
{
|
|
913
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
914
|
+
width: "1em",
|
|
915
|
+
height: "1em",
|
|
916
|
+
viewBox: "0 0 16 16",
|
|
917
|
+
fill: "none",
|
|
918
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(
|
|
919
|
+
"path",
|
|
920
|
+
{
|
|
921
|
+
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",
|
|
922
|
+
fill: "currentColor"
|
|
923
|
+
}
|
|
924
|
+
)
|
|
925
|
+
}
|
|
926
|
+
);
|
|
927
|
+
var SuccessIcon_default = SuccessIcon;
|
|
839
928
|
|
|
840
929
|
// src/tokens/svg/status/XCircleIcon.tsx
|
|
841
930
|
var import_jsx_runtime265 = require("react/jsx-runtime");
|
|
@@ -946,8 +1035,43 @@ function clsx() {
|
|
|
946
1035
|
}
|
|
947
1036
|
var clsx_default = clsx;
|
|
948
1037
|
|
|
949
|
-
// src/components/
|
|
1038
|
+
// src/components/FieldMessage/FieldMessage.tsx
|
|
950
1039
|
var import_jsx_runtime295 = require("react/jsx-runtime");
|
|
1040
|
+
var ICON = {
|
|
1041
|
+
default: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(InfoIcon_default, {}),
|
|
1042
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(SuccessIcon_default, {}),
|
|
1043
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(InfoIcon_default, {}),
|
|
1044
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(ErrorIcon_default, {})
|
|
1045
|
+
};
|
|
1046
|
+
var FieldMessage = (props) => {
|
|
1047
|
+
const { validations } = props;
|
|
1048
|
+
if (!validations || validations.length === 0) return null;
|
|
1049
|
+
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)(
|
|
1050
|
+
"div",
|
|
1051
|
+
{
|
|
1052
|
+
className: clsx_default("lib-xplat-field-message", v.status),
|
|
1053
|
+
children: [
|
|
1054
|
+
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)("div", { className: "icon", children: ICON[v.status] }),
|
|
1055
|
+
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { children: v.message })
|
|
1056
|
+
]
|
|
1057
|
+
},
|
|
1058
|
+
`${v.message}_${idx}`
|
|
1059
|
+
)) });
|
|
1060
|
+
};
|
|
1061
|
+
FieldMessage.displayName = "FieldMessage";
|
|
1062
|
+
var Field = (props) => {
|
|
1063
|
+
const { validations, children } = props;
|
|
1064
|
+
if (!validations || validations.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_jsx_runtime295.Fragment, { children });
|
|
1065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
1066
|
+
children,
|
|
1067
|
+
/* @__PURE__ */ (0, import_jsx_runtime295.jsx)(FieldMessage, { validations })
|
|
1068
|
+
] });
|
|
1069
|
+
};
|
|
1070
|
+
Field.displayName = "Field";
|
|
1071
|
+
var hasError = (validations) => !!validations?.some((v) => v.status === "error");
|
|
1072
|
+
|
|
1073
|
+
// src/components/CheckBox/CheckBox.tsx
|
|
1074
|
+
var import_jsx_runtime296 = require("react/jsx-runtime");
|
|
951
1075
|
var CheckBox = (props) => {
|
|
952
1076
|
const {
|
|
953
1077
|
checked,
|
|
@@ -957,6 +1081,7 @@ var CheckBox = (props) => {
|
|
|
957
1081
|
disabled,
|
|
958
1082
|
size = "md",
|
|
959
1083
|
type = "brand",
|
|
1084
|
+
validations,
|
|
960
1085
|
...rest
|
|
961
1086
|
} = props;
|
|
962
1087
|
const handleChange = (e) => {
|
|
@@ -966,20 +1091,22 @@ var CheckBox = (props) => {
|
|
|
966
1091
|
const checkedClasses = `checked`;
|
|
967
1092
|
const disabledClasses = "disabled";
|
|
968
1093
|
const boxClasses = disabled ? disabledClasses : checked ? checkedClasses : uncheckedClasses;
|
|
969
|
-
|
|
970
|
-
/* @__PURE__ */ (0,
|
|
1094
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime296.jsxs)("label", { className: clsx_default("lib-xplat-checkbox", size, type, className), children: [
|
|
1095
|
+
/* @__PURE__ */ (0, import_jsx_runtime296.jsx)(
|
|
971
1096
|
"input",
|
|
972
1097
|
{
|
|
973
1098
|
type: "checkbox",
|
|
974
1099
|
checked,
|
|
975
1100
|
onChange: handleChange,
|
|
976
1101
|
disabled,
|
|
1102
|
+
"aria-invalid": hasError(validations) || void 0,
|
|
977
1103
|
...rest
|
|
978
1104
|
}
|
|
979
1105
|
),
|
|
980
|
-
/* @__PURE__ */ (0,
|
|
981
|
-
label && /* @__PURE__ */ (0,
|
|
1106
|
+
/* @__PURE__ */ (0, import_jsx_runtime296.jsx)("span", { className: clsx_default("checkbox", boxClasses), children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("span", { className: clsx_default("check-icon", { visible: checked }), children: /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(CheckIcon_default, {}) }) }),
|
|
1107
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime296.jsx)("span", { className: "label", children: label })
|
|
982
1108
|
] });
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime296.jsx)(Field, { validations, children: control });
|
|
983
1110
|
};
|
|
984
1111
|
CheckBox.displayName = "CheckBox";
|
|
985
1112
|
var CheckBox_default = CheckBox;
|
|
@@ -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/CheckBox/checkbox.scss */
|
|
2
40
|
.lib-xplat-checkbox {
|
|
3
41
|
display: flex;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { I as InputAttributes } from '../../attributes-DJIWir_0.cjs';
|
|
3
|
+
import { V as Validation } from '../../validation-Dqo1zqhT.cjs';
|
|
3
4
|
import 'react';
|
|
4
5
|
|
|
5
6
|
type CheckBoxSize = "sm" | "md" | "lg";
|
|
@@ -7,6 +8,8 @@ type CheckBoxType = "brand" | "success" | "error" | "warning" | "info";
|
|
|
7
8
|
interface CheckBoxProps extends Omit<InputAttributes, "size"> {
|
|
8
9
|
label?: string;
|
|
9
10
|
checked?: boolean;
|
|
11
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
12
|
+
validations?: Validation[];
|
|
10
13
|
size?: CheckBoxSize;
|
|
11
14
|
type?: CheckBoxType;
|
|
12
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { I as InputAttributes } from '../../attributes-DJIWir_0.js';
|
|
3
|
+
import { V as Validation } from '../../validation-Dqo1zqhT.js';
|
|
3
4
|
import 'react';
|
|
4
5
|
|
|
5
6
|
type CheckBoxSize = "sm" | "md" | "lg";
|
|
@@ -7,6 +8,8 @@ type CheckBoxType = "brand" | "success" | "error" | "warning" | "info";
|
|
|
7
8
|
interface CheckBoxProps extends Omit<InputAttributes, "size"> {
|
|
8
9
|
label?: string;
|
|
9
10
|
checked?: boolean;
|
|
11
|
+
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
12
|
+
validations?: Validation[];
|
|
10
13
|
size?: CheckBoxSize;
|
|
11
14
|
type?: CheckBoxType;
|
|
12
15
|
}
|