@pylerai/design-system 1.2.3 → 2.0.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/README.md +169 -316
- package/dist/components/ui/badge.d.ts +2 -1
- package/dist/components/ui/badge.js +49 -0
- package/dist/components/ui/body.js +52 -0
- package/dist/components/ui/button.d.ts +2 -1
- package/dist/components/ui/button.js +172 -0
- package/dist/components/ui/calendar.js +275 -0
- package/dist/components/ui/checkbox.d.ts +7 -0
- package/dist/components/ui/checkbox.js +45 -0
- package/dist/components/ui/chip.d.ts +4 -3
- package/dist/components/ui/chip.js +66 -0
- package/dist/components/ui/dropdown.d.ts +8 -2
- package/dist/components/ui/dropdown.js +256 -0
- package/dist/components/ui/headline.js +50 -0
- package/dist/components/ui/input.d.ts +3 -2
- package/dist/components/ui/input.js +129 -0
- package/dist/components/ui/label.js +43 -0
- package/dist/components/ui/loading-bar.d.ts +2 -1
- package/dist/components/ui/loading-bar.js +64 -0
- package/dist/components/ui/modal.d.ts +3 -2
- package/dist/components/ui/modal.js +170 -0
- package/dist/components/ui/pagination.d.ts +2 -0
- package/dist/components/ui/pagination.js +106 -0
- package/dist/components/ui/radio.d.ts +7 -0
- package/dist/components/ui/radio.js +42 -0
- package/dist/components/ui/search-field.d.ts +3 -2
- package/dist/components/ui/search-field.js +98 -0
- package/dist/components/ui/table.js +206 -0
- package/dist/components/ui/tabs.js +149 -0
- package/dist/components/ui/tag.d.ts +2 -1
- package/dist/components/ui/tag.js +31 -0
- package/dist/components/ui/tips.d.ts +2 -1
- package/dist/components/ui/tips.js +25 -0
- package/dist/components/ui/toast.js +70 -0
- package/dist/components/ui/toggle.d.ts +1 -2
- package/dist/components/ui/toggle.js +41 -0
- package/dist/components/ui/use-modal.js +94 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +75 -5769
- package/dist/lib/icons.js +225 -0
- package/dist/lib/size.d.ts +8 -0
- package/dist/lib/use-dialog-a11y.d.ts +2 -0
- package/dist/lib/use-dialog-a11y.js +50 -0
- package/dist/lib/utils.js +16 -0
- package/dist/style.css +1 -1
- package/dist/tokens/pyler-light.js +134 -0
- package/dist/tokens/typography.js +84 -0
- package/package.json +14 -1
- package/pyler-tailwind-colors.cjs +4 -0
- package/dist/index.css.d.ts +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DsSize } from '../../lib/size';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
export type DropdownOption = {
|
|
3
4
|
label: string;
|
|
@@ -24,8 +25,8 @@ export interface DropdownProps {
|
|
|
24
25
|
showLabel?: boolean;
|
|
25
26
|
/** 필수 입력 표시(*) */
|
|
26
27
|
require?: boolean;
|
|
27
|
-
/** 크기. 기본값: "
|
|
28
|
-
size?: "
|
|
28
|
+
/** 크기. 기본값: "lg" */
|
|
29
|
+
size?: Extract<DsSize, "lg" | "md" | "sm">;
|
|
29
30
|
disabled?: boolean;
|
|
30
31
|
readOnly?: boolean;
|
|
31
32
|
/** 에러 메시지. 표시 시 필드에 빨간 테두리 적용 */
|
|
@@ -47,6 +48,11 @@ export interface DropdownProps {
|
|
|
47
48
|
/** 외부 컨테이너 className */
|
|
48
49
|
wrapperClassName?: string;
|
|
49
50
|
className?: string;
|
|
51
|
+
/**
|
|
52
|
+
* 라벨을 표시하지 않을 때(`showLabel={false}` 또는 `label` 미지정) 접근 가능한
|
|
53
|
+
* 이름을 지정한다. 라벨이 있으면 그쪽이 우선한다.
|
|
54
|
+
*/
|
|
55
|
+
"aria-label"?: string;
|
|
50
56
|
}
|
|
51
57
|
declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLDivElement>>;
|
|
52
58
|
export { Dropdown };
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownArrowIcon as _, SelectCheckIcon as C, CheckboxCheckedIcon as V, CheckboxUncheckedIcon as ee, RadioCheckedIcon as te, RadioUncheckedIcon as re } from "../../lib/icons.js";
|
|
4
|
+
import { cn as m } from "../../lib/utils.js";
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import { Button as q } from "./button.js";
|
|
7
|
+
const k = {
|
|
8
|
+
lg: {
|
|
9
|
+
trigger: "h-11 pl-3 pr-2 gap-1.5",
|
|
10
|
+
option: "h-11 pl-3 pr-2",
|
|
11
|
+
text: "text-body-2-r"
|
|
12
|
+
},
|
|
13
|
+
md: {
|
|
14
|
+
trigger: "h-9 pl-3 pr-2 gap-1.5",
|
|
15
|
+
option: "h-9 pl-3 pr-2",
|
|
16
|
+
text: "text-body-3-r"
|
|
17
|
+
},
|
|
18
|
+
sm: {
|
|
19
|
+
trigger: "h-8 pl-3 pr-2 gap-1.5",
|
|
20
|
+
option: "h-8 pl-3 pr-2",
|
|
21
|
+
text: "text-body-3-r"
|
|
22
|
+
}
|
|
23
|
+
}, se = a.forwardRef(
|
|
24
|
+
({
|
|
25
|
+
type: o = "default",
|
|
26
|
+
options: d,
|
|
27
|
+
value: A,
|
|
28
|
+
onValueChange: w,
|
|
29
|
+
values: n,
|
|
30
|
+
onValuesChange: N,
|
|
31
|
+
placeholder: L = "선택해주세요",
|
|
32
|
+
label: g,
|
|
33
|
+
showLabel: v = !0,
|
|
34
|
+
require: M,
|
|
35
|
+
size: h = "lg",
|
|
36
|
+
disabled: x,
|
|
37
|
+
readOnly: y,
|
|
38
|
+
error: b,
|
|
39
|
+
hint: I,
|
|
40
|
+
leftIcon: O,
|
|
41
|
+
showButtons: z,
|
|
42
|
+
cancelLabel: B = "취소",
|
|
43
|
+
confirmLabel: H = "확인",
|
|
44
|
+
onCancel: R,
|
|
45
|
+
onConfirm: S,
|
|
46
|
+
wrapperClassName: F,
|
|
47
|
+
className: G,
|
|
48
|
+
"aria-label": J
|
|
49
|
+
}, P) => {
|
|
50
|
+
const [s, i] = a.useState(!1), [c, D] = a.useState(-1), E = a.useRef(null), U = a.useRef(null), K = a.useRef(null), f = a.useId(), j = (e) => `${f}-option-${e}`;
|
|
51
|
+
a.useEffect(() => {
|
|
52
|
+
const e = (t) => {
|
|
53
|
+
E.current && !E.current.contains(t.target) && i(!1);
|
|
54
|
+
};
|
|
55
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
56
|
+
}, []), a.useEffect(() => {
|
|
57
|
+
s || D(-1);
|
|
58
|
+
}, [s]), a.useEffect(() => {
|
|
59
|
+
var e, t;
|
|
60
|
+
!s || c < 0 || (t = (e = U.current) == null ? void 0 : e.querySelector(`#${CSS.escape(j(c))}`)) == null || t.scrollIntoView({ block: "nearest" });
|
|
61
|
+
}, [s, c]);
|
|
62
|
+
const Q = (e) => o === "checkbox" ? (n == null ? void 0 : n.includes(e)) ?? !1 : e === A, $ = d.find((e) => e.value === A), W = () => o === "checkbox" ? !n || n.length === 0 ? L : d.filter((t) => n.includes(t.value)).map((t) => t.label).join(", ") : $ ? $.label : L, X = () => {
|
|
63
|
+
x || y || i((e) => !e);
|
|
64
|
+
}, T = (e) => {
|
|
65
|
+
if (o === "checkbox") {
|
|
66
|
+
const t = n ?? [], l = t.includes(e) ? t.filter((p) => p !== e) : [...t, e];
|
|
67
|
+
N == null || N(l);
|
|
68
|
+
} else
|
|
69
|
+
w == null || w(e), i(!1);
|
|
70
|
+
}, Y = o === "checkbox" ? ((n == null ? void 0 : n.length) ?? 0) > 0 : !!$, Z = (e) => {
|
|
71
|
+
var l;
|
|
72
|
+
if (x || y) return;
|
|
73
|
+
const t = (p) => {
|
|
74
|
+
e.preventDefault(), s || i(!0), D(p);
|
|
75
|
+
};
|
|
76
|
+
switch (e.key) {
|
|
77
|
+
case "ArrowDown":
|
|
78
|
+
return t(s ? Math.min(c + 1, d.length - 1) : 0);
|
|
79
|
+
case "ArrowUp":
|
|
80
|
+
return t(s ? Math.max(c - 1, 0) : d.length - 1);
|
|
81
|
+
case "Home":
|
|
82
|
+
return s ? t(0) : void 0;
|
|
83
|
+
case "End":
|
|
84
|
+
return s ? t(d.length - 1) : void 0;
|
|
85
|
+
case "Enter":
|
|
86
|
+
case " ":
|
|
87
|
+
e.preventDefault(), s ? c >= 0 && T(d[c].value) : i(!0);
|
|
88
|
+
return;
|
|
89
|
+
case "Escape":
|
|
90
|
+
s && (e.preventDefault(), i(!1), (l = K.current) == null || l.focus());
|
|
91
|
+
return;
|
|
92
|
+
case "Tab":
|
|
93
|
+
i(!1);
|
|
94
|
+
return;
|
|
95
|
+
default:
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ u("div", { ref: P, className: m("flex flex-col gap-2", F), children: [
|
|
100
|
+
v && g && /* @__PURE__ */ u("div", { className: "flex items-start gap-0.5 whitespace-nowrap", children: [
|
|
101
|
+
/* @__PURE__ */ r("span", { id: `${f}-label`, className: "text-body-2-r text-ds-text-strong", children: g }),
|
|
102
|
+
M && /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "text-body-2-r text-ds-primary-red-normal", children: "*" })
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ u("div", { ref: E, className: "relative", children: [
|
|
105
|
+
/* @__PURE__ */ u(
|
|
106
|
+
"button",
|
|
107
|
+
{
|
|
108
|
+
ref: K,
|
|
109
|
+
type: "button",
|
|
110
|
+
role: "combobox",
|
|
111
|
+
"aria-expanded": s,
|
|
112
|
+
"aria-haspopup": "listbox",
|
|
113
|
+
"aria-controls": s ? f : void 0,
|
|
114
|
+
"aria-activedescendant": s && c >= 0 ? j(c) : void 0,
|
|
115
|
+
"aria-labelledby": v && g ? `${f}-label` : void 0,
|
|
116
|
+
"aria-label": v && g ? void 0 : J,
|
|
117
|
+
"aria-invalid": b ? !0 : void 0,
|
|
118
|
+
"aria-describedby": b || I ? `${f}-description` : void 0,
|
|
119
|
+
"aria-required": M || void 0,
|
|
120
|
+
disabled: x,
|
|
121
|
+
onClick: X,
|
|
122
|
+
onKeyDown: Z,
|
|
123
|
+
className: m(
|
|
124
|
+
"flex items-center w-full rounded-lg border transition-colors",
|
|
125
|
+
x ? "bg-ds-surface-strong border-ds-line-normal cursor-not-allowed" : y ? "bg-ds-surface-normal border-ds-line-normal cursor-default" : b ? "bg-ds-background-default border-ds-primary-red-normal hover:bg-ds-surface-normal" : s ? "bg-ds-background-default border-ds-primary-blue-normal" : "bg-ds-background-default border-ds-line-normal hover:bg-ds-surface-normal hover:border-ds-line-strong",
|
|
126
|
+
k[h].trigger,
|
|
127
|
+
G
|
|
128
|
+
),
|
|
129
|
+
children: [
|
|
130
|
+
O && /* @__PURE__ */ r("span", { className: "shrink-0 flex items-center justify-center text-ds-icon-normal", children: O }),
|
|
131
|
+
/* @__PURE__ */ r(
|
|
132
|
+
"span",
|
|
133
|
+
{
|
|
134
|
+
className: m(
|
|
135
|
+
"flex-1 min-w-0 text-left truncate font-sans",
|
|
136
|
+
k[h].text,
|
|
137
|
+
Y ? "text-ds-text-strong" : x ? "text-ds-text-disabled" : "text-ds-text-normal"
|
|
138
|
+
),
|
|
139
|
+
children: W()
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ r(
|
|
143
|
+
"span",
|
|
144
|
+
{
|
|
145
|
+
className: m(
|
|
146
|
+
"shrink-0 flex items-center justify-center transition-transform",
|
|
147
|
+
s && "rotate-180",
|
|
148
|
+
x ? "text-ds-text-disabled" : "text-ds-text-normal"
|
|
149
|
+
),
|
|
150
|
+
children: /* @__PURE__ */ r(_, {})
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
s && /* @__PURE__ */ u(
|
|
157
|
+
"ul",
|
|
158
|
+
{
|
|
159
|
+
ref: U,
|
|
160
|
+
id: f,
|
|
161
|
+
role: "listbox",
|
|
162
|
+
"aria-multiselectable": o === "checkbox" ? !0 : void 0,
|
|
163
|
+
className: "absolute top-full left-0 z-50 mt-1 min-w-full w-max max-w-sm bg-ds-background-default border border-ds-line-normal rounded-lg p-1 shadow-ds-default",
|
|
164
|
+
children: [
|
|
165
|
+
d.map((e, t) => {
|
|
166
|
+
const l = Q(e.value), p = t === c;
|
|
167
|
+
return (
|
|
168
|
+
// 키보드 조작은 aria-activedescendant 패턴에 따라 combobox 트리거의
|
|
169
|
+
// onKeyDown이 전담한다(옵션은 포커스를 받지 않는 것이 WAI-ARIA 권고).
|
|
170
|
+
// 이 규칙은 그 패턴을 인식하지 못하므로 해당 줄만 해제한다.
|
|
171
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
172
|
+
/* @__PURE__ */ u(
|
|
173
|
+
"li",
|
|
174
|
+
{
|
|
175
|
+
id: j(t),
|
|
176
|
+
role: "option",
|
|
177
|
+
"aria-selected": l,
|
|
178
|
+
onClick: () => T(e.value),
|
|
179
|
+
onMouseEnter: () => D(t),
|
|
180
|
+
className: m(
|
|
181
|
+
"flex items-center rounded-lg cursor-pointer gap-1.5 transition-colors",
|
|
182
|
+
k[h].option,
|
|
183
|
+
l ? "bg-ds-surface-normal" : "bg-ds-background-default hover:bg-ds-surface-normal",
|
|
184
|
+
// 키보드 이동 위치 표시 (마우스 hover와 구분되도록 링으로)
|
|
185
|
+
p && "ring-1 ring-inset ring-ds-primary-blue-normal"
|
|
186
|
+
),
|
|
187
|
+
children: [
|
|
188
|
+
/* @__PURE__ */ r(
|
|
189
|
+
"span",
|
|
190
|
+
{
|
|
191
|
+
className: m(
|
|
192
|
+
"flex-1 min-w-0 truncate font-sans",
|
|
193
|
+
k[h].text,
|
|
194
|
+
"text-ds-text-strong"
|
|
195
|
+
),
|
|
196
|
+
children: e.label
|
|
197
|
+
}
|
|
198
|
+
),
|
|
199
|
+
o === "default" && l && /* @__PURE__ */ r("span", { className: "shrink-0 flex items-center justify-center text-ds-text-strong", children: /* @__PURE__ */ r(C, {}) }),
|
|
200
|
+
o === "checkbox" && /* @__PURE__ */ r("span", { className: "shrink-0 flex items-center justify-center", children: l ? /* @__PURE__ */ r(V, {}) : /* @__PURE__ */ r(ee, {}) }),
|
|
201
|
+
o === "radio" && /* @__PURE__ */ r("span", { className: "shrink-0 flex items-center justify-center", children: l ? /* @__PURE__ */ r(te, {}) : /* @__PURE__ */ r(re, {}) })
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
e.value
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
}),
|
|
208
|
+
z && /* @__PURE__ */ u("li", { className: "flex gap-2 pt-1", children: [
|
|
209
|
+
/* @__PURE__ */ r(
|
|
210
|
+
q,
|
|
211
|
+
{
|
|
212
|
+
variant: "outlined",
|
|
213
|
+
size: "lg",
|
|
214
|
+
className: "flex-1",
|
|
215
|
+
onClick: () => {
|
|
216
|
+
R == null || R(), i(!1);
|
|
217
|
+
},
|
|
218
|
+
children: B
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
/* @__PURE__ */ r(
|
|
222
|
+
q,
|
|
223
|
+
{
|
|
224
|
+
variant: "filled",
|
|
225
|
+
color: "blue",
|
|
226
|
+
size: "lg",
|
|
227
|
+
className: "flex-1",
|
|
228
|
+
onClick: () => {
|
|
229
|
+
S == null || S(), i(!1);
|
|
230
|
+
},
|
|
231
|
+
children: H
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
] })
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
)
|
|
238
|
+
] }),
|
|
239
|
+
(b || I) && /* @__PURE__ */ r(
|
|
240
|
+
"p",
|
|
241
|
+
{
|
|
242
|
+
id: `${f}-description`,
|
|
243
|
+
className: m(
|
|
244
|
+
"text-body-4-r",
|
|
245
|
+
b ? "text-ds-primary-red-normal" : "text-ds-text-normal"
|
|
246
|
+
),
|
|
247
|
+
children: b ?? I
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
] });
|
|
251
|
+
}
|
|
252
|
+
);
|
|
253
|
+
se.displayName = "Dropdown";
|
|
254
|
+
export {
|
|
255
|
+
se as Dropdown
|
|
256
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { cn as m } from "../../lib/utils.js";
|
|
4
|
+
import { Slot as l } from "@radix-ui/react-slot";
|
|
5
|
+
import { cva as p } from "class-variance-authority";
|
|
6
|
+
import * as c from "react";
|
|
7
|
+
const f = p(
|
|
8
|
+
"text-foreground",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
"title-1-sb": "text-title-1-sb",
|
|
13
|
+
"title-1-m": "text-title-1-m",
|
|
14
|
+
"title-2-sb": "text-title-2-sb"
|
|
15
|
+
},
|
|
16
|
+
as: {
|
|
17
|
+
h1: "",
|
|
18
|
+
h2: "",
|
|
19
|
+
h3: "",
|
|
20
|
+
h4: "",
|
|
21
|
+
h5: "",
|
|
22
|
+
h6: "",
|
|
23
|
+
div: "",
|
|
24
|
+
span: "",
|
|
25
|
+
p: ""
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
variant: "title-1-sb",
|
|
30
|
+
as: "h1"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
), h = c.forwardRef(
|
|
34
|
+
({ className: e, variant: a, as: i, asChild: o, ...r }, s) => {
|
|
35
|
+
const t = i || "h1";
|
|
36
|
+
return /* @__PURE__ */ n(
|
|
37
|
+
o ? l : t,
|
|
38
|
+
{
|
|
39
|
+
className: m(f({ variant: a, as: t, className: e })),
|
|
40
|
+
ref: s,
|
|
41
|
+
...r
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
h.displayName = "Headline";
|
|
47
|
+
export {
|
|
48
|
+
h as Headline,
|
|
49
|
+
f as headlineVariants
|
|
50
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DsSize } from '../../lib/size';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
export interface InputFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
3
4
|
/** 라벨 텍스트 */
|
|
@@ -14,8 +15,8 @@ export interface InputFieldProps extends Omit<React.InputHTMLAttributes<HTMLInpu
|
|
|
14
15
|
error?: string;
|
|
15
16
|
/** 우측 아이콘. type="password"이면 기본 비밀번호 토글 아이콘 */
|
|
16
17
|
rightIcon?: React.ReactNode;
|
|
17
|
-
/** 크기. 기본값: "
|
|
18
|
-
size?: "
|
|
18
|
+
/** 크기. 기본값: "lg" */
|
|
19
|
+
size?: Extract<DsSize, "lg" | "md" | "sm">;
|
|
19
20
|
/** 외부 컨테이너 className */
|
|
20
21
|
wrapperClassName?: string;
|
|
21
22
|
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { EyeOnIcon as E, EyeOffIcon as P } from "../../lib/icons.js";
|
|
4
|
+
import { cn as r } from "../../lib/utils.js";
|
|
5
|
+
import * as o from "react";
|
|
6
|
+
const I = {
|
|
7
|
+
lg: {
|
|
8
|
+
container: "h-11 px-3 gap-1.5",
|
|
9
|
+
text: "text-body-2-r"
|
|
10
|
+
},
|
|
11
|
+
md: {
|
|
12
|
+
container: "h-9 px-3 py-2 gap-1.5",
|
|
13
|
+
text: "text-body-3-r"
|
|
14
|
+
},
|
|
15
|
+
sm: {
|
|
16
|
+
container: "h-8 px-3 py-1.5 gap-1.5",
|
|
17
|
+
text: "text-body-3-r"
|
|
18
|
+
}
|
|
19
|
+
}, V = o.forwardRef(
|
|
20
|
+
({
|
|
21
|
+
label: d,
|
|
22
|
+
showLabel: c = !0,
|
|
23
|
+
require: l,
|
|
24
|
+
message: n,
|
|
25
|
+
hint: s,
|
|
26
|
+
error: t,
|
|
27
|
+
rightIcon: x,
|
|
28
|
+
size: a = "lg",
|
|
29
|
+
wrapperClassName: F,
|
|
30
|
+
className: j,
|
|
31
|
+
disabled: b,
|
|
32
|
+
readOnly: f,
|
|
33
|
+
type: u,
|
|
34
|
+
...h
|
|
35
|
+
}, k) => {
|
|
36
|
+
const [m, R] = o.useState(!1), g = u === "password", T = g ? m ? "text" : "password" : u, p = o.useId(), y = h.id ?? p, N = `${p}-message`, v = `${p}-description`, B = [n ? N : null, t || s ? v : null].filter(Boolean).join(" ") || void 0, w = x ?? (g ? /* @__PURE__ */ e(
|
|
37
|
+
"button",
|
|
38
|
+
{
|
|
39
|
+
type: "button",
|
|
40
|
+
onClick: () => R((C) => !C),
|
|
41
|
+
className: "flex items-center justify-center text-ds-text-normal",
|
|
42
|
+
tabIndex: -1,
|
|
43
|
+
"aria-label": m ? "비밀번호 숨기기" : "비밀번호 보기",
|
|
44
|
+
children: m ? /* @__PURE__ */ e(E, {}) : /* @__PURE__ */ e(P, {})
|
|
45
|
+
}
|
|
46
|
+
) : null);
|
|
47
|
+
return /* @__PURE__ */ i("div", { className: r("flex flex-col gap-2", F), children: [
|
|
48
|
+
c && d && /* @__PURE__ */ i("div", { className: "flex items-start gap-0.5 whitespace-nowrap", children: [
|
|
49
|
+
/* @__PURE__ */ e("label", { htmlFor: y, className: "text-body-2-r text-ds-text-strong", children: d }),
|
|
50
|
+
l && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "text-body-2-r text-ds-primary-red-normal", children: "*" })
|
|
51
|
+
] }),
|
|
52
|
+
n && /* @__PURE__ */ e("p", { id: N, className: "text-body-4-r text-ds-text-strong", children: n }),
|
|
53
|
+
/* @__PURE__ */ i(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: r(
|
|
57
|
+
"flex items-center overflow-hidden bg-ds-background-default border rounded-lg transition-colors",
|
|
58
|
+
t ? "border-ds-primary-red-normal" : "border-ds-line-normal hover:border-ds-line-strong focus-within:border-ds-primary-blue-normal",
|
|
59
|
+
(b || f) && "bg-ds-surface-normal",
|
|
60
|
+
I[a].container
|
|
61
|
+
),
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
"input",
|
|
65
|
+
{
|
|
66
|
+
ref: k,
|
|
67
|
+
id: y,
|
|
68
|
+
type: T,
|
|
69
|
+
"aria-invalid": t ? !0 : void 0,
|
|
70
|
+
"aria-describedby": B,
|
|
71
|
+
"aria-required": l || void 0,
|
|
72
|
+
className: r(
|
|
73
|
+
"flex-1 min-w-0 bg-transparent outline-none font-sans",
|
|
74
|
+
"text-ds-text-strong placeholder:text-ds-text-normal",
|
|
75
|
+
"disabled:text-ds-text-disabled",
|
|
76
|
+
I[a].text,
|
|
77
|
+
j
|
|
78
|
+
),
|
|
79
|
+
disabled: b,
|
|
80
|
+
readOnly: f,
|
|
81
|
+
...h
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
w && /* @__PURE__ */ e("span", { className: "shrink-0 text-ds-text-normal flex items-center", children: w })
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
(t || s) && /* @__PURE__ */ e(
|
|
89
|
+
"p",
|
|
90
|
+
{
|
|
91
|
+
id: v,
|
|
92
|
+
className: r(
|
|
93
|
+
"text-body-4-r",
|
|
94
|
+
t ? "text-ds-primary-red-normal" : "text-ds-text-normal"
|
|
95
|
+
),
|
|
96
|
+
children: t ?? s
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
] });
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
V.displayName = "InputField";
|
|
103
|
+
const $ = o.forwardRef(
|
|
104
|
+
({ label: d, showLabel: c = !0, wrapperClassName: l, className: n, ...s }, t) => {
|
|
105
|
+
const x = o.useId(), a = s.id ?? x;
|
|
106
|
+
return /* @__PURE__ */ i("div", { className: r("flex flex-col gap-2", l), children: [
|
|
107
|
+
c && d && /* @__PURE__ */ e("label", { htmlFor: a, className: "text-body-2-r text-ds-text-strong", children: d }),
|
|
108
|
+
/* @__PURE__ */ e("div", { className: "overflow-hidden border border-ds-line-normal bg-ds-background-default rounded-lg p-3 hover:border-ds-line-strong focus-within:border-ds-primary-blue-normal transition-colors", children: /* @__PURE__ */ e(
|
|
109
|
+
"textarea",
|
|
110
|
+
{
|
|
111
|
+
ref: t,
|
|
112
|
+
id: a,
|
|
113
|
+
className: r(
|
|
114
|
+
"w-full min-h-[114px] resize-none bg-transparent outline-none font-sans",
|
|
115
|
+
"text-body-3-r text-ds-text-strong placeholder:text-ds-text-normal",
|
|
116
|
+
"disabled:text-ds-text-disabled",
|
|
117
|
+
n
|
|
118
|
+
),
|
|
119
|
+
...s
|
|
120
|
+
}
|
|
121
|
+
) })
|
|
122
|
+
] });
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
$.displayName = "TextField";
|
|
126
|
+
export {
|
|
127
|
+
V as InputField,
|
|
128
|
+
$ as TextField
|
|
129
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
+
import { cn as i } from "../../lib/utils.js";
|
|
4
|
+
import { Slot as m } from "@radix-ui/react-slot";
|
|
5
|
+
import { cva as p } from "class-variance-authority";
|
|
6
|
+
import * as b from "react";
|
|
7
|
+
const c = p(
|
|
8
|
+
"text-foreground leading-tight",
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
"label-1-r": "text-label-1-r"
|
|
13
|
+
},
|
|
14
|
+
as: {
|
|
15
|
+
label: "",
|
|
16
|
+
span: "",
|
|
17
|
+
div: "",
|
|
18
|
+
p: ""
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
variant: "label-1-r",
|
|
23
|
+
as: "label"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
), f = b.forwardRef(
|
|
27
|
+
({ className: t, variant: r, as: e, asChild: o, ...l }, n) => {
|
|
28
|
+
const a = e || "label";
|
|
29
|
+
return /* @__PURE__ */ s(
|
|
30
|
+
o ? m : a,
|
|
31
|
+
{
|
|
32
|
+
className: i(c({ variant: r, as: a, className: t })),
|
|
33
|
+
ref: n,
|
|
34
|
+
...l
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
f.displayName = "Label";
|
|
40
|
+
export {
|
|
41
|
+
f as Label,
|
|
42
|
+
c as labelVariants
|
|
43
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { cn as a } from "../../lib/utils.js";
|
|
4
|
+
import * as o from "react";
|
|
5
|
+
const l = {
|
|
6
|
+
xl: "size-[50px] rounded-[8px]",
|
|
7
|
+
lg: "size-[42px] rounded-[8px]",
|
|
8
|
+
md: "size-[38px] rounded-[8px]",
|
|
9
|
+
sm: "size-[34px] rounded-[4px]"
|
|
10
|
+
}, p = {
|
|
11
|
+
xl: "h-[50px] rounded-[8px] pl-[12px] pr-[18px]",
|
|
12
|
+
lg: "h-[42px] rounded-[8px] pl-[10px] pr-[14px]",
|
|
13
|
+
md: "h-[38px] rounded-[8px] pl-[8px] pr-[12px]"
|
|
14
|
+
};
|
|
15
|
+
function i({ size: e, className: n }) {
|
|
16
|
+
const t = a("animate-spin shrink-0", n);
|
|
17
|
+
return e === "sm" ? /* @__PURE__ */ d("svg", { className: t, width: "12", height: "12", viewBox: "0 0 10 10.0649", fill: "none", "aria-hidden": "true", children: [
|
|
18
|
+
/* @__PURE__ */ r("path", { opacity: "0.1", d: "M5 0C7.76132 0 9.99983 2.2403 10 5.00391C10 7.76766 7.76142 10.0088 5 10.0088C2.23858 10.0088 0 7.76766 0 5.00391C0.000166843 2.2403 2.23868 0 5 0ZM5 1.50098C3.06713 1.50098 1.5002 3.06946 1.5 5.00391C1.5 6.93853 3.06701 8.50683 5 8.50684C6.933 8.50684 8.5 6.93853 8.5 5.00391C8.4998 3.06945 6.93287 1.50098 5 1.50098Z", className: "fill-ds-text-strong" }),
|
|
19
|
+
/* @__PURE__ */ r("path", { d: "M8.00001 8.00681C6.75001 9.25786 5.00001 9.75829 3.00001 8.75744", className: "stroke-ds-primary-blue-normal", strokeWidth: "1.55", strokeLinecap: "round" })
|
|
20
|
+
] }) : e === "xl" ? /* @__PURE__ */ d("svg", { className: t, width: "28", height: "28", viewBox: "0 0 23.333 23.7432", fill: "none", "aria-hidden": "true", children: [
|
|
21
|
+
/* @__PURE__ */ r("path", { opacity: "0.1", d: "M11.667 0C18.1102 0.000176413 23.333 5.22811 23.333 11.6768C23.3329 18.1253 18.1101 23.3524 11.667 23.3525C5.22376 23.3525 0.000138013 18.1254 0 11.6768C0 5.228 5.22367 0 11.667 0ZM11.667 3.50293C7.15667 3.50293 3.5 7.16263 3.5 11.6768C3.50005 16.1908 7.1567 19.8506 11.667 19.8506C16.1771 19.8504 19.833 16.1907 19.833 11.6768C19.833 7.16275 16.1772 3.50312 11.667 3.50293Z", className: "fill-ds-text-strong" }),
|
|
22
|
+
/* @__PURE__ */ r("path", { d: "M18.6666 18.6826C15.75 21.6017 11.6666 22.7694 6.99998 20.4341", className: "stroke-ds-primary-blue-normal", strokeWidth: "4.13333", strokeLinecap: "round" })
|
|
23
|
+
] }) : /* @__PURE__ */ d("svg", { className: t, width: "20", height: "20", viewBox: "0 0 16.667 16.7749", fill: "none", "aria-hidden": "true", children: [
|
|
24
|
+
/* @__PURE__ */ r("path", { opacity: "0.1", d: "M8.33301 0C12.9354 0 16.667 3.73457 16.667 8.34082C16.6667 12.9469 12.9352 16.6807 8.33301 16.6807C3.73094 16.6805 0.000249233 12.9468 0 8.34082C0 3.73468 3.73078 0.0001759 8.33301 0ZM8.33301 2.50195C5.11149 2.50212 2.5 5.11655 2.5 8.34082C2.50019 11.5649 5.1116 14.1785 8.33301 14.1787C11.5546 14.1787 14.1668 11.565 14.167 8.34082C14.167 5.11644 11.5547 2.50195 8.33301 2.50195Z", className: "fill-ds-text-strong" }),
|
|
25
|
+
/* @__PURE__ */ r("path", { d: "M13.3333 13.3447C11.25 15.4298 8.33331 16.2638 4.99998 14.5957", className: "stroke-ds-primary-blue-normal", strokeWidth: "2.58333", strokeLinecap: "round" })
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
const x = o.forwardRef(
|
|
29
|
+
({ size: e = "xl", label: n, className: t }, s) => !!n && e !== "sm" ? /* @__PURE__ */ d(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
ref: s,
|
|
33
|
+
className: a(
|
|
34
|
+
"inline-flex items-center gap-[11px] border border-ds-line-normal bg-ds-background-default",
|
|
35
|
+
p[e],
|
|
36
|
+
t
|
|
37
|
+
),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ r(i, { size: e }),
|
|
40
|
+
/* @__PURE__ */ r("span", { className: a(
|
|
41
|
+
"shrink-0 text-ds-text-strong whitespace-nowrap",
|
|
42
|
+
e === "xl" && "text-body-2-r",
|
|
43
|
+
e === "lg" && "text-body-3-r",
|
|
44
|
+
e === "md" && "text-body-4-r"
|
|
45
|
+
), children: n })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
) : /* @__PURE__ */ r(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref: s,
|
|
52
|
+
className: a(
|
|
53
|
+
"inline-flex items-center justify-center border border-ds-line-normal bg-ds-background-default",
|
|
54
|
+
l[e],
|
|
55
|
+
t
|
|
56
|
+
),
|
|
57
|
+
children: /* @__PURE__ */ r(i, { size: e })
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
x.displayName = "LoadingBar";
|
|
62
|
+
export {
|
|
63
|
+
x as LoadingBar
|
|
64
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DsSize } from '../../lib/size';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
export interface InformationModalProps {
|
|
3
4
|
open: boolean;
|
|
@@ -24,12 +25,12 @@ export interface ActionModalProps {
|
|
|
24
25
|
className?: string;
|
|
25
26
|
}
|
|
26
27
|
declare function ActionModal({ open, title, description, cancelLabel, confirmLabel, onCancel, onConfirm, onClose, className, }: ActionModalProps): React.ReactPortal | null;
|
|
27
|
-
export type ContentModalSize = "
|
|
28
|
+
export type ContentModalSize = Extract<DsSize, "lg" | "md" | "sm">;
|
|
28
29
|
export interface ContentModalProps {
|
|
29
30
|
open: boolean;
|
|
30
31
|
title: React.ReactNode;
|
|
31
32
|
description?: React.ReactNode;
|
|
32
|
-
/** 모달 크기. 기본값: "
|
|
33
|
+
/** 모달 크기. 기본값: "sm" */
|
|
33
34
|
size?: ContentModalSize;
|
|
34
35
|
/** 취소 버튼 텍스트. 기본값: "닫기" */
|
|
35
36
|
cancelLabel?: string;
|