@x-plat/design-system 0.12.0 → 0.14.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/{breakpoints-DsXkJgdl.d.cts → breakpoints-CKkNxA-y.d.cts} +1 -1
- package/dist/{breakpoints-DsXkJgdl.d.ts → breakpoints-CKkNxA-y.d.ts} +1 -1
- package/dist/components/AutoResizeTextArea/index.cjs +2 -2
- package/dist/components/AutoResizeTextArea/index.js +2 -2
- package/dist/components/Badge/index.d.cts +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/ChatInput/index.cjs +2 -2
- package/dist/components/ChatInput/index.js +2 -2
- package/dist/components/CheckBox/index.cjs +2 -2
- package/dist/components/CheckBox/index.js +2 -2
- package/dist/components/DatePicker/index.cjs +109 -75
- package/dist/components/DatePicker/index.d.cts +19 -0
- package/dist/components/DatePicker/index.d.ts +19 -0
- package/dist/components/DatePicker/index.js +109 -75
- package/dist/components/Editor/index.css +3 -0
- package/dist/components/FieldMessage/index.cjs +2 -2
- package/dist/components/FieldMessage/index.d.cts +8 -0
- package/dist/components/FieldMessage/index.d.ts +8 -0
- package/dist/components/FieldMessage/index.js +2 -2
- package/dist/components/FileUpload/index.cjs +10 -6
- package/dist/components/FileUpload/index.d.cts +15 -2
- package/dist/components/FileUpload/index.d.ts +15 -2
- package/dist/components/FileUpload/index.js +10 -6
- package/dist/components/ImageSelector/index.cjs +7 -6
- package/dist/components/ImageSelector/index.d.cts +15 -2
- package/dist/components/ImageSelector/index.d.ts +15 -2
- package/dist/components/ImageSelector/index.js +7 -6
- package/dist/components/Input/index.cjs +2 -2
- package/dist/components/Input/index.d.cts +4 -0
- package/dist/components/Input/index.d.ts +4 -0
- package/dist/components/Input/index.js +2 -2
- package/dist/components/Radio/index.cjs +2 -2
- package/dist/components/Radio/index.js +2 -2
- package/dist/components/Select/index.cjs +2 -2
- package/dist/components/Select/index.d.cts +1 -2
- package/dist/components/Select/index.d.ts +1 -2
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Switch/index.cjs +2 -2
- package/dist/components/Switch/index.js +2 -2
- package/dist/components/TextArea/index.cjs +2 -2
- package/dist/components/TextArea/index.js +2 -2
- package/dist/components/TimePicker/index.cjs +2 -2
- package/dist/components/TimePicker/index.js +2 -2
- package/dist/components/ToggleChip/index.cjs +69 -0
- package/dist/components/ToggleChip/index.css +102 -0
- package/dist/components/ToggleChip/index.d.cts +37 -0
- package/dist/components/ToggleChip/index.d.ts +37 -0
- package/dist/components/ToggleChip/index.js +42 -0
- package/dist/components/index.cjs +184 -119
- package/dist/components/index.css +40 -0
- package/dist/components/index.d.cts +2 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +174 -110
- package/dist/index.cjs +203 -138
- package/dist/index.css +40 -0
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +191 -127
- package/dist/layout/Grid/Item/index.d.cts +1 -1
- package/dist/layout/Grid/Item/index.d.ts +1 -1
- package/dist/layout/Grid/index.d.cts +1 -1
- package/dist/layout/Grid/index.d.ts +1 -1
- package/dist/layout/index.d.cts +1 -1
- package/dist/layout/index.d.ts +1 -1
- package/dist/tokens/index.d.cts +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/guidelines/Guidelines.md +13 -1
- package/guidelines/MIGRATION.md +297 -0
- package/guidelines/components/chip-tag.md +75 -2
- package/guidelines/components/datepicker.md +26 -0
- package/guidelines/components/file-media.md +21 -4
- package/package.json +1 -1
|
@@ -178,11 +178,11 @@ var FieldMessage = (props) => {
|
|
|
178
178
|
FieldMessage.displayName = "FieldMessage";
|
|
179
179
|
var FieldMessage_default = FieldMessage;
|
|
180
180
|
var Field = (props) => {
|
|
181
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
181
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
182
182
|
const hasMessages = !!validations && validations.length > 0;
|
|
183
183
|
if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
|
|
184
184
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
185
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
185
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
186
186
|
label,
|
|
187
187
|
required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
188
188
|
] }),
|
|
@@ -23,6 +23,10 @@ interface PasswordInputProps extends Omit<InputAttributes, "size"> {
|
|
|
23
23
|
validations?: Validation[];
|
|
24
24
|
/** 높이와 글자 크기 */
|
|
25
25
|
size?: InputSize;
|
|
26
|
+
/** 컨트롤 위에 붙는 라벨. 클릭하면 입력칸에 포커스가 간다 */
|
|
27
|
+
label?: React.ReactNode;
|
|
28
|
+
/** 라벨 뒤에 필수 표시(*)를 붙인다 */
|
|
29
|
+
required?: boolean;
|
|
26
30
|
reg?: RegExp;
|
|
27
31
|
}
|
|
28
32
|
declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -23,6 +23,10 @@ interface PasswordInputProps extends Omit<InputAttributes, "size"> {
|
|
|
23
23
|
validations?: Validation[];
|
|
24
24
|
/** 높이와 글자 크기 */
|
|
25
25
|
size?: InputSize;
|
|
26
|
+
/** 컨트롤 위에 붙는 라벨. 클릭하면 입력칸에 포커스가 간다 */
|
|
27
|
+
label?: React.ReactNode;
|
|
28
|
+
/** 라벨 뒤에 필수 표시(*)를 붙인다 */
|
|
29
|
+
required?: boolean;
|
|
26
30
|
reg?: RegExp;
|
|
27
31
|
}
|
|
28
32
|
declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -141,11 +141,11 @@ var FieldMessage = (props) => {
|
|
|
141
141
|
FieldMessage.displayName = "FieldMessage";
|
|
142
142
|
var FieldMessage_default = FieldMessage;
|
|
143
143
|
var Field = (props) => {
|
|
144
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
144
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
145
145
|
const hasMessages = !!validations && validations.length > 0;
|
|
146
146
|
if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
|
|
147
147
|
return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
|
|
148
|
-
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
148
|
+
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
149
149
|
label,
|
|
150
150
|
required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
151
151
|
] }),
|
|
@@ -177,11 +177,11 @@ var FieldMessage = (props) => {
|
|
|
177
177
|
};
|
|
178
178
|
FieldMessage.displayName = "FieldMessage";
|
|
179
179
|
var Field = (props) => {
|
|
180
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
180
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
181
181
|
const hasMessages = !!validations && validations.length > 0;
|
|
182
182
|
if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
|
|
183
183
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
184
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
184
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
185
185
|
label,
|
|
186
186
|
required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
187
187
|
] }),
|
|
@@ -140,11 +140,11 @@ var FieldMessage = (props) => {
|
|
|
140
140
|
};
|
|
141
141
|
FieldMessage.displayName = "FieldMessage";
|
|
142
142
|
var Field = (props) => {
|
|
143
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
143
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
144
144
|
const hasMessages = !!validations && validations.length > 0;
|
|
145
145
|
if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
|
|
146
146
|
return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
|
|
147
|
-
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
147
|
+
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
148
148
|
label,
|
|
149
149
|
required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
150
150
|
] }),
|
|
@@ -1200,11 +1200,11 @@ var FieldMessage = (props) => {
|
|
|
1200
1200
|
};
|
|
1201
1201
|
FieldMessage.displayName = "FieldMessage";
|
|
1202
1202
|
var Field = (props) => {
|
|
1203
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
1203
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
1204
1204
|
const hasMessages = !!validations && validations.length > 0;
|
|
1205
1205
|
if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_jsx_runtime295.Fragment, { children });
|
|
1206
1206
|
return /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
1207
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
1207
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime295.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
1208
1208
|
label,
|
|
1209
1209
|
required && /* @__PURE__ */ (0, import_jsx_runtime295.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
1210
1210
|
] }),
|
|
@@ -34,10 +34,8 @@ interface SelectProps {
|
|
|
34
34
|
children: SelectItemElement | SelectItemElement[];
|
|
35
35
|
/** 비활성화 상태 */
|
|
36
36
|
disabled?: boolean;
|
|
37
|
-
/** 에러 상태 */
|
|
38
37
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
39
38
|
validations?: Validation[];
|
|
40
|
-
/** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
|
|
41
39
|
/** 컨트롤 위에 붙는 라벨. 클릭하면 컨트롤에 포커스가 간다 */
|
|
42
40
|
label?: React.ReactNode;
|
|
43
41
|
/** 라벨 뒤에 필수 표시(*)를 붙인다 */
|
|
@@ -49,6 +47,7 @@ interface SelectProps {
|
|
|
49
47
|
searchable?: boolean;
|
|
50
48
|
/** 검색칸 안내 문구 */
|
|
51
49
|
searchPlaceholder?: string;
|
|
50
|
+
/** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
|
|
52
51
|
error?: boolean;
|
|
53
52
|
/** 사이즈 */
|
|
54
53
|
size?: SelectSize;
|
|
@@ -34,10 +34,8 @@ interface SelectProps {
|
|
|
34
34
|
children: SelectItemElement | SelectItemElement[];
|
|
35
35
|
/** 비활성화 상태 */
|
|
36
36
|
disabled?: boolean;
|
|
37
|
-
/** 에러 상태 */
|
|
38
37
|
/** 컨트롤 아래에 표시할 검증 메시지. DS 폼 컴포넌트 공통 */
|
|
39
38
|
validations?: Validation[];
|
|
40
|
-
/** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
|
|
41
39
|
/** 컨트롤 위에 붙는 라벨. 클릭하면 컨트롤에 포커스가 간다 */
|
|
42
40
|
label?: React.ReactNode;
|
|
43
41
|
/** 라벨 뒤에 필수 표시(*)를 붙인다 */
|
|
@@ -49,6 +47,7 @@ interface SelectProps {
|
|
|
49
47
|
searchable?: boolean;
|
|
50
48
|
/** 검색칸 안내 문구 */
|
|
51
49
|
searchPlaceholder?: string;
|
|
50
|
+
/** 메시지 없이 테두리만 붉게 한다. validations 와 함께 쓰면 둘 중 하나만 참이어도 적용된다 */
|
|
52
51
|
error?: boolean;
|
|
53
52
|
/** 사이즈 */
|
|
54
53
|
size?: SelectSize;
|
|
@@ -1163,11 +1163,11 @@ var FieldMessage = (props) => {
|
|
|
1163
1163
|
};
|
|
1164
1164
|
FieldMessage.displayName = "FieldMessage";
|
|
1165
1165
|
var Field = (props) => {
|
|
1166
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
1166
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
1167
1167
|
const hasMessages = !!validations && validations.length > 0;
|
|
1168
1168
|
if (!label && !hasMessages) return /* @__PURE__ */ jsx295(Fragment, { children });
|
|
1169
1169
|
return /* @__PURE__ */ jsxs189("div", { className: "lib-xplat-field", children: [
|
|
1170
|
-
label && /* @__PURE__ */ jsxs189("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
1170
|
+
label && /* @__PURE__ */ jsxs189("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
1171
1171
|
label,
|
|
1172
1172
|
required && /* @__PURE__ */ jsx295("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
1173
1173
|
] }),
|
|
@@ -179,11 +179,11 @@ var FieldMessage = (props) => {
|
|
|
179
179
|
};
|
|
180
180
|
FieldMessage.displayName = "FieldMessage";
|
|
181
181
|
var Field = (props) => {
|
|
182
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
182
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
183
183
|
const hasMessages = !!validations && validations.length > 0;
|
|
184
184
|
if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
|
|
185
185
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
186
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
186
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
187
187
|
label,
|
|
188
188
|
required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
189
189
|
] }),
|
|
@@ -143,11 +143,11 @@ var FieldMessage = (props) => {
|
|
|
143
143
|
};
|
|
144
144
|
FieldMessage.displayName = "FieldMessage";
|
|
145
145
|
var Field = (props) => {
|
|
146
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
146
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
147
147
|
const hasMessages = !!validations && validations.length > 0;
|
|
148
148
|
if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
|
|
149
149
|
return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
|
|
150
|
-
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
150
|
+
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
151
151
|
label,
|
|
152
152
|
required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
153
153
|
] }),
|
|
@@ -176,11 +176,11 @@ var FieldMessage = (props) => {
|
|
|
176
176
|
};
|
|
177
177
|
FieldMessage.displayName = "FieldMessage";
|
|
178
178
|
var Field = (props) => {
|
|
179
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
179
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
180
180
|
const hasMessages = !!validations && validations.length > 0;
|
|
181
181
|
if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
|
|
182
182
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
183
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
183
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
184
184
|
label,
|
|
185
185
|
required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
186
186
|
] }),
|
|
@@ -140,11 +140,11 @@ var FieldMessage = (props) => {
|
|
|
140
140
|
};
|
|
141
141
|
FieldMessage.displayName = "FieldMessage";
|
|
142
142
|
var Field = (props) => {
|
|
143
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
143
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
144
144
|
const hasMessages = !!validations && validations.length > 0;
|
|
145
145
|
if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
|
|
146
146
|
return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
|
|
147
|
-
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
147
|
+
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
148
148
|
label,
|
|
149
149
|
required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
150
150
|
] }),
|
|
@@ -308,11 +308,11 @@ var FieldMessage = (props) => {
|
|
|
308
308
|
};
|
|
309
309
|
FieldMessage.displayName = "FieldMessage";
|
|
310
310
|
var Field = (props) => {
|
|
311
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
311
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
312
312
|
const hasMessages = !!validations && validations.length > 0;
|
|
313
313
|
if (!label && !hasMessages) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children });
|
|
314
314
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "lib-xplat-field", children: [
|
|
315
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
315
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
316
316
|
label,
|
|
317
317
|
required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
318
318
|
] }),
|
|
@@ -272,11 +272,11 @@ var FieldMessage = (props) => {
|
|
|
272
272
|
};
|
|
273
273
|
FieldMessage.displayName = "FieldMessage";
|
|
274
274
|
var Field = (props) => {
|
|
275
|
-
const { label, required = false, htmlFor, validations, children } = props;
|
|
275
|
+
const { label, required = false, htmlFor, labelId, validations, children } = props;
|
|
276
276
|
const hasMessages = !!validations && validations.length > 0;
|
|
277
277
|
if (!label && !hasMessages) return /* @__PURE__ */ jsx4(Fragment, { children });
|
|
278
278
|
return /* @__PURE__ */ jsxs3("div", { className: "lib-xplat-field", children: [
|
|
279
|
-
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", htmlFor, children: [
|
|
279
|
+
label && /* @__PURE__ */ jsxs3("label", { className: "lib-xplat-field-label", id: labelId, htmlFor, children: [
|
|
280
280
|
label,
|
|
281
281
|
required && /* @__PURE__ */ jsx4("span", { className: "required", "aria-hidden": "true", children: "*" })
|
|
282
282
|
] }),
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/ToggleChip/index.ts
|
|
21
|
+
var ToggleChip_exports = {};
|
|
22
|
+
__export(ToggleChip_exports, {
|
|
23
|
+
ToggleChip: () => ToggleChip_default
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ToggleChip_exports);
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/clsx/dist/clsx.mjs
|
|
28
|
+
function r(e) {
|
|
29
|
+
var t, f, n = "";
|
|
30
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
31
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
32
|
+
var o = e.length;
|
|
33
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
34
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
35
|
+
return n;
|
|
36
|
+
}
|
|
37
|
+
function clsx() {
|
|
38
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
39
|
+
return n;
|
|
40
|
+
}
|
|
41
|
+
var clsx_default = clsx;
|
|
42
|
+
|
|
43
|
+
// src/components/ToggleChip/ToggleChip.tsx
|
|
44
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
var ToggleChip = (props) => {
|
|
46
|
+
const { children, selected = false, onClick, disabled = false, size = "md" } = props;
|
|
47
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
type: "button",
|
|
51
|
+
className: clsx_default(
|
|
52
|
+
"lib-xplat-chip",
|
|
53
|
+
"lib-xplat-toggle-chip",
|
|
54
|
+
size,
|
|
55
|
+
selected ? "selected" : "unselected"
|
|
56
|
+
),
|
|
57
|
+
"aria-pressed": selected,
|
|
58
|
+
disabled,
|
|
59
|
+
onClick,
|
|
60
|
+
children
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
ToggleChip.displayName = "ToggleChip";
|
|
65
|
+
var ToggleChip_default = ToggleChip;
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
ToggleChip
|
|
69
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
/* src/components/Chip/chip.scss */
|
|
4
|
+
.lib-xplat-chip {
|
|
5
|
+
border-radius: var(--spacing-radius-full);
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
user-select: none;
|
|
10
|
+
transition: background-color 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
11
|
+
}
|
|
12
|
+
.lib-xplat-chip.sm {
|
|
13
|
+
padding: 1px var(--spacing-space-2);
|
|
14
|
+
font-family: var(--semantic-typo-caption-2-r-font);
|
|
15
|
+
font-size: var(--semantic-typo-caption-2-r-size);
|
|
16
|
+
line-height: var(--semantic-typo-caption-2-r-lh);
|
|
17
|
+
font-weight: var(--semantic-typo-caption-2-r-weight);
|
|
18
|
+
letter-spacing: var(--semantic-typo-caption-2-r-ls);
|
|
19
|
+
}
|
|
20
|
+
.lib-xplat-chip.md {
|
|
21
|
+
padding: 2px var(--spacing-space-3);
|
|
22
|
+
font-family: var(--semantic-typo-caption-1-r-font);
|
|
23
|
+
font-size: var(--semantic-typo-caption-1-r-size);
|
|
24
|
+
line-height: var(--semantic-typo-caption-1-r-lh);
|
|
25
|
+
font-weight: var(--semantic-typo-caption-1-r-weight);
|
|
26
|
+
letter-spacing: var(--semantic-typo-caption-1-r-ls);
|
|
27
|
+
}
|
|
28
|
+
.lib-xplat-chip.lg {
|
|
29
|
+
padding: var(--spacing-space-1) var(--spacing-space-4);
|
|
30
|
+
font-family: var(--semantic-typo-label-2-m-font);
|
|
31
|
+
font-size: var(--semantic-typo-label-2-m-size);
|
|
32
|
+
line-height: var(--semantic-typo-label-2-m-lh);
|
|
33
|
+
font-weight: var(--semantic-typo-label-2-m-weight);
|
|
34
|
+
letter-spacing: var(--semantic-typo-label-2-m-ls);
|
|
35
|
+
}
|
|
36
|
+
.lib-xplat-chip.primary {
|
|
37
|
+
color: var(--semantic-text-inverse);
|
|
38
|
+
background-color: var(--semantic-surface-brand-default);
|
|
39
|
+
}
|
|
40
|
+
.lib-xplat-chip.secondary {
|
|
41
|
+
color: var(--semantic-surface-brand-default);
|
|
42
|
+
background-color: var(--semantic-surface-neutral-primary);
|
|
43
|
+
border: 1px solid var(--semantic-border-primary);
|
|
44
|
+
}
|
|
45
|
+
.lib-xplat-chip.neutral {
|
|
46
|
+
color: var(--semantic-text-secondary);
|
|
47
|
+
background-color: var(--semantic-surface-neutral-secondary);
|
|
48
|
+
border: 1px solid var(--semantic-border-primary);
|
|
49
|
+
}
|
|
50
|
+
.lib-xplat-chip.success {
|
|
51
|
+
color: var(--semantic-text-success);
|
|
52
|
+
background-color: var(--semantic-surface-success-subtle);
|
|
53
|
+
}
|
|
54
|
+
.lib-xplat-chip.error {
|
|
55
|
+
color: var(--semantic-text-error);
|
|
56
|
+
background-color: var(--semantic-surface-error-subtle);
|
|
57
|
+
}
|
|
58
|
+
.lib-xplat-chip.warning {
|
|
59
|
+
color: var(--semantic-text-warning);
|
|
60
|
+
background-color: var(--semantic-surface-warning-subtle);
|
|
61
|
+
}
|
|
62
|
+
.lib-xplat-chip.info {
|
|
63
|
+
color: var(--semantic-text-info);
|
|
64
|
+
background-color: var(--semantic-surface-info-subtle);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* src/components/ToggleChip/togglechip.scss */
|
|
68
|
+
.lib-xplat-toggle-chip {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
font-family: inherit;
|
|
71
|
+
transition:
|
|
72
|
+
background-color 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
|
|
73
|
+
border-color 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94),
|
|
74
|
+
color 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
75
|
+
}
|
|
76
|
+
.lib-xplat-toggle-chip.unselected {
|
|
77
|
+
color: var(--semantic-text-secondary);
|
|
78
|
+
background-color: var(--semantic-surface-neutral-primary);
|
|
79
|
+
border: 1px solid var(--semantic-border-primary);
|
|
80
|
+
}
|
|
81
|
+
.lib-xplat-toggle-chip.unselected:hover:not(:disabled) {
|
|
82
|
+
color: var(--semantic-text-primary);
|
|
83
|
+
background-color: var(--semantic-surface-neutral-secondary);
|
|
84
|
+
}
|
|
85
|
+
.lib-xplat-toggle-chip {
|
|
86
|
+
}
|
|
87
|
+
.lib-xplat-toggle-chip.selected {
|
|
88
|
+
color: var(--semantic-text-brand-primary);
|
|
89
|
+
background-color: var(--semantic-surface-brand-subtle);
|
|
90
|
+
border: 1px solid var(--semantic-border-brand-primary);
|
|
91
|
+
}
|
|
92
|
+
.lib-xplat-toggle-chip.selected:hover:not(:disabled) {
|
|
93
|
+
background-color: var(--semantic-surface-brand-secondary);
|
|
94
|
+
}
|
|
95
|
+
.lib-xplat-toggle-chip:focus-visible {
|
|
96
|
+
outline: 2px solid var(--semantic-interaction-focus-ring);
|
|
97
|
+
outline-offset: 2px;
|
|
98
|
+
}
|
|
99
|
+
.lib-xplat-toggle-chip:disabled {
|
|
100
|
+
cursor: not-allowed;
|
|
101
|
+
opacity: 0.4;
|
|
102
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
type ToggleChipSize = "sm" | "md" | "lg";
|
|
5
|
+
interface ToggleChipProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** 켜진 상태인가. 색과 `aria-pressed` 가 함께 바뀐다 */
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
/** 누를 때. 켜고 끄는 판단은 쓰는 쪽이 한다 */
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
/** 흐리게 하고 못 누르게 한다 */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** 칩 크기. `Chip` 과 같은 눈금이다 */
|
|
14
|
+
size?: ToggleChipSize;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 눌러서 고르는 칩.
|
|
18
|
+
*
|
|
19
|
+
* `Chip` 은 표시 전용이고 `Tag` 의 클릭은 **삭제**다. 이것만이 **켜짐/꺼짐**을
|
|
20
|
+
* 다룬다. 여러 개 고르기와 한 개 고르기 양쪽에 쓴다 — 몇 개까지 켤 수 있는지,
|
|
21
|
+
* 마지막 하나를 뗄 수 있는지 같은 규칙은 쓰는 쪽 사정이라 여기서 정하지 않는다.
|
|
22
|
+
*
|
|
23
|
+
* 모양은 `.lib-xplat-chip` 을 그대로 쓴다. 알약 반지름·크기 눈금·글자 크기가
|
|
24
|
+
* `Chip` 과 **한 곳에서** 정의되므로 둘이 따로 놀 수 없다. 같은 화면에 나란히
|
|
25
|
+
* 놓이는 일이 많아서 이게 중요하다.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <ToggleChip selected={picked.has("ko")} onClick={() => toggle("ko")}>
|
|
29
|
+
* 한국어
|
|
30
|
+
* </ToggleChip>
|
|
31
|
+
*/
|
|
32
|
+
declare const ToggleChip: {
|
|
33
|
+
(props: ToggleChipProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { ToggleChip };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
type ToggleChipSize = "sm" | "md" | "lg";
|
|
5
|
+
interface ToggleChipProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/** 켜진 상태인가. 색과 `aria-pressed` 가 함께 바뀐다 */
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
/** 누를 때. 켜고 끄는 판단은 쓰는 쪽이 한다 */
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
/** 흐리게 하고 못 누르게 한다 */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** 칩 크기. `Chip` 과 같은 눈금이다 */
|
|
14
|
+
size?: ToggleChipSize;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 눌러서 고르는 칩.
|
|
18
|
+
*
|
|
19
|
+
* `Chip` 은 표시 전용이고 `Tag` 의 클릭은 **삭제**다. 이것만이 **켜짐/꺼짐**을
|
|
20
|
+
* 다룬다. 여러 개 고르기와 한 개 고르기 양쪽에 쓴다 — 몇 개까지 켤 수 있는지,
|
|
21
|
+
* 마지막 하나를 뗄 수 있는지 같은 규칙은 쓰는 쪽 사정이라 여기서 정하지 않는다.
|
|
22
|
+
*
|
|
23
|
+
* 모양은 `.lib-xplat-chip` 을 그대로 쓴다. 알약 반지름·크기 눈금·글자 크기가
|
|
24
|
+
* `Chip` 과 **한 곳에서** 정의되므로 둘이 따로 놀 수 없다. 같은 화면에 나란히
|
|
25
|
+
* 놓이는 일이 많아서 이게 중요하다.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* <ToggleChip selected={picked.has("ko")} onClick={() => toggle("ko")}>
|
|
29
|
+
* 한국어
|
|
30
|
+
* </ToggleChip>
|
|
31
|
+
*/
|
|
32
|
+
declare const ToggleChip: {
|
|
33
|
+
(props: ToggleChipProps): react_jsx_runtime.JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { ToggleChip };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// ../../node_modules/clsx/dist/clsx.mjs
|
|
2
|
+
function r(e) {
|
|
3
|
+
var t, f, n = "";
|
|
4
|
+
if ("string" == typeof e || "number" == typeof e) n += e;
|
|
5
|
+
else if ("object" == typeof e) if (Array.isArray(e)) {
|
|
6
|
+
var o = e.length;
|
|
7
|
+
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
8
|
+
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
function clsx() {
|
|
12
|
+
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
13
|
+
return n;
|
|
14
|
+
}
|
|
15
|
+
var clsx_default = clsx;
|
|
16
|
+
|
|
17
|
+
// src/components/ToggleChip/ToggleChip.tsx
|
|
18
|
+
import { jsx } from "react/jsx-runtime";
|
|
19
|
+
var ToggleChip = (props) => {
|
|
20
|
+
const { children, selected = false, onClick, disabled = false, size = "md" } = props;
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
type: "button",
|
|
25
|
+
className: clsx_default(
|
|
26
|
+
"lib-xplat-chip",
|
|
27
|
+
"lib-xplat-toggle-chip",
|
|
28
|
+
size,
|
|
29
|
+
selected ? "selected" : "unselected"
|
|
30
|
+
),
|
|
31
|
+
"aria-pressed": selected,
|
|
32
|
+
disabled,
|
|
33
|
+
onClick,
|
|
34
|
+
children
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
ToggleChip.displayName = "ToggleChip";
|
|
39
|
+
var ToggleChip_default = ToggleChip;
|
|
40
|
+
export {
|
|
41
|
+
ToggleChip_default as ToggleChip
|
|
42
|
+
};
|