@pylerai/design-system 2.1.0 → 2.2.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 +27 -2
- package/dist/components/ui/badge.js +6 -6
- package/dist/components/ui/button.js +9 -9
- package/dist/components/ui/chip.js +4 -4
- package/dist/components/ui/dropdown.js +47 -47
- package/dist/components/ui/input.js +14 -14
- package/dist/components/ui/loading-bar.js +26 -26
- package/dist/components/ui/pagination.js +11 -11
- package/dist/components/ui/search-field.js +10 -10
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tips.js +11 -11
- package/dist/components/ui/toast.js +17 -17
- package/dist/index.d.ts +2 -0
- package/dist/index.js +66 -63
- package/dist/style.css +1 -1
- package/dist/tokens/shadow-radius.d.ts +26 -0
- package/dist/tokens/shadow-radius.js +20 -0
- package/package.json +5 -3
- package/pyler-shadow-radius.cjs +25 -0
- package/tailwind-preset.cjs +2 -10
package/README.md
CHANGED
|
@@ -86,13 +86,21 @@ module.exports = {
|
|
|
86
86
|
};
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
이미 `extend
|
|
89
|
+
이미 자체 `theme.extend`가 있어 프리셋 대신 조각만 합치려면 (`darkMode` 등 프리셋의 다른 설정은 들어오지 않습니다):
|
|
90
90
|
|
|
91
91
|
```javascript
|
|
92
92
|
const { dsColors } = require("@pylerai/design-system/pyler-tailwind-colors");
|
|
93
|
+
const { pylerTypographyThemeExtend } = require("@pylerai/design-system/pyler-typography");
|
|
94
|
+
const { pylerShadowRadiusThemeExtend } = require("@pylerai/design-system/pyler-shadow-radius");
|
|
93
95
|
|
|
94
96
|
module.exports = {
|
|
95
|
-
theme: {
|
|
97
|
+
theme: {
|
|
98
|
+
extend: {
|
|
99
|
+
colors: { ds: dsColors },
|
|
100
|
+
...pylerTypographyThemeExtend, // fontFamily.sans, fontSize.text-*
|
|
101
|
+
...pylerShadowRadiusThemeExtend, // boxShadow.ds-*, borderRadius.ds-*
|
|
102
|
+
},
|
|
103
|
+
},
|
|
96
104
|
};
|
|
97
105
|
```
|
|
98
106
|
|
|
@@ -229,6 +237,23 @@ import { PYLER_TYPOGRAPHY_STYLE } from "@pylerai/design-system";
|
|
|
229
237
|
// shadow: ds-default, ds-modal
|
|
230
238
|
```
|
|
231
239
|
|
|
240
|
+
Tailwind 클래스를 쓸 수 없는 자리(Chakra `radii`/`shadows` foundation, `sx`, inline style)에는 `DS_RADIUS`·`DS_SHADOW`를 넘깁니다. 값은 `var(--ds-*)` 문자열이라 `style.css`가 로드돼 있어야 합니다.
|
|
241
|
+
|
|
242
|
+
```tsx
|
|
243
|
+
import { DS_RADIUS, DS_SHADOW } from "@pylerai/design-system";
|
|
244
|
+
|
|
245
|
+
// Chakra: theme foundation 에 등록하면 borderRadius="ds-md" 처럼 토큰 이름으로 쓸 수 있습니다
|
|
246
|
+
extendTheme({
|
|
247
|
+
radii: { "ds-xs": DS_RADIUS.xs, "ds-ss": DS_RADIUS.ss, "ds-md": DS_RADIUS.md, "ds-lg": DS_RADIUS.lg },
|
|
248
|
+
shadows: { "ds-default": DS_SHADOW.default, "ds-modal": DS_SHADOW.modal },
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
<Box borderRadius="ds-md" boxShadow="ds-default" />
|
|
252
|
+
<div style={{ borderRadius: DS_RADIUS.md }} />
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
앱에서 `rounded-[8px]`·`shadow-[0px_5px_16px_…]` 같은 리터럴을 새로 쓰지 않습니다. 값이 같아도 토큰이 바뀌면 리터럴만 남아 드리프트합니다.
|
|
256
|
+
|
|
232
257
|
Dim은 `var(--ds-dim-default)`로 제공됩니다. Storybook **Foundation → Radius / Shadow / Dim** 참고.
|
|
233
258
|
|
|
234
259
|
## ♿ 접근성
|
|
@@ -23,21 +23,21 @@ const b = {
|
|
|
23
23
|
md: { padding: "px-2 pt-[5px] pb-[3px]", text: "text-body-3-m" },
|
|
24
24
|
sm: { padding: "px-1 pt-[3px] pb-[1px]", text: "text-label-1-r" }
|
|
25
25
|
}, g = l.forwardRef(
|
|
26
|
-
({ color: r = "normal", size: e = "md", className: t, children: o, ...
|
|
27
|
-
const { border:
|
|
26
|
+
({ color: r = "normal", size: e = "md", className: t, children: o, ...s }, d) => {
|
|
27
|
+
const { border: a, text: n } = b[r], { padding: p, text: m } = c[e];
|
|
28
28
|
return /* @__PURE__ */ x(
|
|
29
29
|
"span",
|
|
30
30
|
{
|
|
31
|
-
ref:
|
|
31
|
+
ref: d,
|
|
32
32
|
className: i(
|
|
33
|
-
"inline-flex items-center justify-center border rounded-
|
|
34
|
-
|
|
33
|
+
"inline-flex items-center justify-center border rounded-ds-ss bg-ds-background-default whitespace-nowrap",
|
|
34
|
+
a,
|
|
35
35
|
p,
|
|
36
36
|
n,
|
|
37
37
|
m,
|
|
38
38
|
t
|
|
39
39
|
),
|
|
40
|
-
...
|
|
40
|
+
...s,
|
|
41
41
|
children: o
|
|
42
42
|
}
|
|
43
43
|
);
|
|
@@ -9,10 +9,10 @@ const v = R(
|
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
filled: "rounded-
|
|
13
|
-
outlined: "rounded-
|
|
14
|
-
text: "rounded-
|
|
15
|
-
icon: "rounded-
|
|
12
|
+
filled: "rounded-ds-md",
|
|
13
|
+
outlined: "rounded-ds-md border border-ds-line-normal bg-ds-background-default text-ds-text-strong hover:bg-ds-surface-normal active:bg-ds-surface-strong disabled:bg-ds-surface-normal disabled:text-ds-text-disabled",
|
|
14
|
+
text: "rounded-ds-md bg-transparent text-ds-text-strong disabled:text-ds-text-disabled",
|
|
15
|
+
icon: "rounded-ds-md",
|
|
16
16
|
indicator: "rounded-full inline-block"
|
|
17
17
|
},
|
|
18
18
|
color: {
|
|
@@ -116,12 +116,12 @@ const v = R(
|
|
|
116
116
|
asChild: c = !1,
|
|
117
117
|
shape: u = "square",
|
|
118
118
|
iconStyle: x = "filled",
|
|
119
|
-
leftIcon:
|
|
120
|
-
rightIcon:
|
|
119
|
+
leftIcon: d,
|
|
120
|
+
rightIcon: t,
|
|
121
121
|
children: b,
|
|
122
122
|
...h
|
|
123
123
|
}, y) => {
|
|
124
|
-
const f = c ? B : "button", N = e === "icon" && x === "outlined" ? "bg-ds-background-default border border-ds-line-normal text-ds-text-strong hover:bg-ds-surface-normal active:bg-ds-surface-strong disabled:text-ds-text-disabled" : void 0, l = !!
|
|
124
|
+
const f = c ? B : "button", N = e === "icon" && x === "outlined" ? "bg-ds-background-default border border-ds-line-normal text-ds-text-strong hover:bg-ds-surface-normal active:bg-ds-surface-strong disabled:text-ds-text-disabled" : void 0, l = !!d, p = !!t, z = e !== "icon" && e !== "indicator" && (l || p) ? (() => {
|
|
125
125
|
const n = r ?? "md", o = {
|
|
126
126
|
sm: { leftOnly: "pl-1 pr-2", rightOnly: "pl-2 pr-1", both: "px-1" },
|
|
127
127
|
md: { leftOnly: "pl-2 pr-3", rightOnly: "pl-3 pr-2", both: "px-2" },
|
|
@@ -143,9 +143,9 @@ const v = R(
|
|
|
143
143
|
ref: y,
|
|
144
144
|
...h,
|
|
145
145
|
children: c ? b : /* @__PURE__ */ O(k, { children: [
|
|
146
|
-
|
|
146
|
+
d && /* @__PURE__ */ a("span", { className: "shrink-0", children: d }),
|
|
147
147
|
b,
|
|
148
|
-
|
|
148
|
+
t && /* @__PURE__ */ a("span", { className: "shrink-0", children: t })
|
|
149
149
|
] })
|
|
150
150
|
}
|
|
151
151
|
);
|
|
@@ -4,20 +4,20 @@ import { XIcon as b } from "../../lib/icons.js";
|
|
|
4
4
|
import { cn as n } from "../../lib/utils.js";
|
|
5
5
|
import * as f from "react";
|
|
6
6
|
const h = f.forwardRef(
|
|
7
|
-
({ size: l = "md", selected: i = !1, disabled: e = !1, onRemove: a, onClick: r, children:
|
|
7
|
+
({ size: l = "md", selected: i = !1, disabled: e = !1, onRemove: a, onClick: r, children: d, className: p }, c) => {
|
|
8
8
|
const s = l === "md", t = !!a, u = r ? "button" : "span";
|
|
9
9
|
return /* @__PURE__ */ x(
|
|
10
10
|
"div",
|
|
11
11
|
{
|
|
12
12
|
ref: c,
|
|
13
13
|
className: n(
|
|
14
|
-
"inline-flex items-center border rounded-
|
|
14
|
+
"inline-flex items-center border rounded-ds-ss bg-ds-background-default select-none transition-colors",
|
|
15
15
|
// 좌우 여백은 컨테이너가 아니라 본문(클릭 대상)이 갖는다.
|
|
16
16
|
// 컨테이너에 두면 여백 영역이 클릭되지 않는 죽은 공간이 된다.
|
|
17
17
|
s ? t ? "h-8 pr-1" : "h-8" : t ? "h-[26px] pr-0.5" : "h-[26px]",
|
|
18
18
|
s ? "text-body-3-r" : "text-body-4-r",
|
|
19
19
|
e ? "border-ds-line-normal text-ds-text-disabled cursor-not-allowed" : i ? "border-ds-primary-blue-normal text-ds-text-strong cursor-pointer" : "border-ds-line-normal text-ds-text-strong cursor-pointer hover:border-ds-line-strong",
|
|
20
|
-
|
|
20
|
+
p
|
|
21
21
|
),
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ o(
|
|
@@ -36,7 +36,7 @@ const h = f.forwardRef(
|
|
|
36
36
|
r && !e && "cursor-pointer",
|
|
37
37
|
r && "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ds-primary-blue-normal rounded-[3px]"
|
|
38
38
|
),
|
|
39
|
-
children:
|
|
39
|
+
children: d
|
|
40
40
|
}
|
|
41
41
|
),
|
|
42
42
|
t && /* @__PURE__ */ o(
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import { DropdownArrowIcon as _, SelectCheckIcon as C, CheckboxCheckedIcon as V, CheckboxUncheckedIcon as ee, RadioCheckedIcon as te, RadioUncheckedIcon as re } from "../../lib/icons.js";
|
|
4
4
|
import { cn as m } from "../../lib/utils.js";
|
|
5
|
-
import * as
|
|
5
|
+
import * as l from "react";
|
|
6
6
|
import { Button as q } from "./button.js";
|
|
7
7
|
const k = {
|
|
8
8
|
lg: {
|
|
@@ -20,19 +20,19 @@ const k = {
|
|
|
20
20
|
option: "h-8 pl-3 pr-2",
|
|
21
21
|
text: "text-body-3-r"
|
|
22
22
|
}
|
|
23
|
-
}, se =
|
|
23
|
+
}, se = l.forwardRef(
|
|
24
24
|
({
|
|
25
|
-
type:
|
|
26
|
-
options:
|
|
25
|
+
type: i = "default",
|
|
26
|
+
options: o,
|
|
27
27
|
value: A,
|
|
28
28
|
onValueChange: w,
|
|
29
29
|
values: n,
|
|
30
30
|
onValuesChange: N,
|
|
31
31
|
placeholder: L = "선택해주세요",
|
|
32
|
-
label:
|
|
32
|
+
label: h,
|
|
33
33
|
showLabel: v = !0,
|
|
34
34
|
require: M,
|
|
35
|
-
size:
|
|
35
|
+
size: g = "lg",
|
|
36
36
|
disabled: x,
|
|
37
37
|
readOnly: y,
|
|
38
38
|
error: b,
|
|
@@ -47,58 +47,58 @@ const k = {
|
|
|
47
47
|
className: G,
|
|
48
48
|
"aria-label": J
|
|
49
49
|
}, P) => {
|
|
50
|
-
const [s,
|
|
51
|
-
|
|
50
|
+
const [s, d] = l.useState(!1), [c, D] = l.useState(-1), E = l.useRef(null), U = l.useRef(null), K = l.useRef(null), f = l.useId(), j = (e) => `${f}-option-${e}`;
|
|
51
|
+
l.useEffect(() => {
|
|
52
52
|
const e = (t) => {
|
|
53
|
-
E.current && !E.current.contains(t.target) &&
|
|
53
|
+
E.current && !E.current.contains(t.target) && d(!1);
|
|
54
54
|
};
|
|
55
55
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
56
|
-
}, []),
|
|
56
|
+
}, []), l.useEffect(() => {
|
|
57
57
|
s || D(-1);
|
|
58
|
-
}, [s]),
|
|
58
|
+
}, [s]), l.useEffect(() => {
|
|
59
59
|
var e, t;
|
|
60
60
|
!s || c < 0 || (t = (e = U.current) == null ? void 0 : e.querySelector(`#${CSS.escape(j(c))}`)) == null || t.scrollIntoView({ block: "nearest" });
|
|
61
61
|
}, [s, c]);
|
|
62
|
-
const Q = (e) =>
|
|
63
|
-
x || y ||
|
|
62
|
+
const Q = (e) => i === "checkbox" ? (n == null ? void 0 : n.includes(e)) ?? !1 : e === A, $ = o.find((e) => e.value === A), W = () => i === "checkbox" ? !n || n.length === 0 ? L : o.filter((t) => n.includes(t.value)).map((t) => t.label).join(", ") : $ ? $.label : L, X = () => {
|
|
63
|
+
x || y || d((e) => !e);
|
|
64
64
|
}, T = (e) => {
|
|
65
|
-
if (
|
|
66
|
-
const t = n ?? [],
|
|
67
|
-
N == null || N(
|
|
65
|
+
if (i === "checkbox") {
|
|
66
|
+
const t = n ?? [], a = t.includes(e) ? t.filter((p) => p !== e) : [...t, e];
|
|
67
|
+
N == null || N(a);
|
|
68
68
|
} else
|
|
69
|
-
w == null || w(e),
|
|
70
|
-
}, Y =
|
|
71
|
-
var
|
|
69
|
+
w == null || w(e), d(!1);
|
|
70
|
+
}, Y = i === "checkbox" ? ((n == null ? void 0 : n.length) ?? 0) > 0 : !!$, Z = (e) => {
|
|
71
|
+
var a;
|
|
72
72
|
if (x || y) return;
|
|
73
73
|
const t = (p) => {
|
|
74
|
-
e.preventDefault(), s ||
|
|
74
|
+
e.preventDefault(), s || d(!0), D(p);
|
|
75
75
|
};
|
|
76
76
|
switch (e.key) {
|
|
77
77
|
case "ArrowDown":
|
|
78
|
-
return t(s ? Math.min(c + 1,
|
|
78
|
+
return t(s ? Math.min(c + 1, o.length - 1) : 0);
|
|
79
79
|
case "ArrowUp":
|
|
80
|
-
return t(s ? Math.max(c - 1, 0) :
|
|
80
|
+
return t(s ? Math.max(c - 1, 0) : o.length - 1);
|
|
81
81
|
case "Home":
|
|
82
82
|
return s ? t(0) : void 0;
|
|
83
83
|
case "End":
|
|
84
|
-
return s ? t(
|
|
84
|
+
return s ? t(o.length - 1) : void 0;
|
|
85
85
|
case "Enter":
|
|
86
86
|
case " ":
|
|
87
|
-
e.preventDefault(), s ? c >= 0 && T(
|
|
87
|
+
e.preventDefault(), s ? c >= 0 && T(o[c].value) : d(!0);
|
|
88
88
|
return;
|
|
89
89
|
case "Escape":
|
|
90
|
-
s && (e.preventDefault(),
|
|
90
|
+
s && (e.preventDefault(), d(!1), (a = K.current) == null || a.focus());
|
|
91
91
|
return;
|
|
92
92
|
case "Tab":
|
|
93
|
-
|
|
93
|
+
d(!1);
|
|
94
94
|
return;
|
|
95
95
|
default:
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
99
|
return /* @__PURE__ */ u("div", { ref: P, className: m("flex flex-col gap-2", F), children: [
|
|
100
|
-
v &&
|
|
101
|
-
/* @__PURE__ */ r("span", { id: `${f}-label`, className: "text-body-2-r text-ds-text-strong", children:
|
|
100
|
+
v && h && /* @__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: h }),
|
|
102
102
|
M && /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "text-body-2-r text-ds-primary-red-normal", children: "*" })
|
|
103
103
|
] }),
|
|
104
104
|
/* @__PURE__ */ u("div", { ref: E, className: "relative", children: [
|
|
@@ -112,8 +112,8 @@ const k = {
|
|
|
112
112
|
"aria-haspopup": "listbox",
|
|
113
113
|
"aria-controls": s ? f : void 0,
|
|
114
114
|
"aria-activedescendant": s && c >= 0 ? j(c) : void 0,
|
|
115
|
-
"aria-labelledby": v &&
|
|
116
|
-
"aria-label": v &&
|
|
115
|
+
"aria-labelledby": v && h ? `${f}-label` : void 0,
|
|
116
|
+
"aria-label": v && h ? void 0 : J,
|
|
117
117
|
"aria-invalid": b ? !0 : void 0,
|
|
118
118
|
"aria-describedby": b || I ? `${f}-description` : void 0,
|
|
119
119
|
"aria-required": M || void 0,
|
|
@@ -121,9 +121,9 @@ const k = {
|
|
|
121
121
|
onClick: X,
|
|
122
122
|
onKeyDown: Z,
|
|
123
123
|
className: m(
|
|
124
|
-
"flex items-center w-full rounded-
|
|
124
|
+
"flex items-center w-full rounded-ds-md border transition-colors",
|
|
125
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[
|
|
126
|
+
k[g].trigger,
|
|
127
127
|
G
|
|
128
128
|
),
|
|
129
129
|
children: [
|
|
@@ -133,7 +133,7 @@ const k = {
|
|
|
133
133
|
{
|
|
134
134
|
className: m(
|
|
135
135
|
"flex-1 min-w-0 text-left truncate font-sans",
|
|
136
|
-
k[
|
|
136
|
+
k[g].text,
|
|
137
137
|
Y ? "text-ds-text-strong" : x ? "text-ds-text-disabled" : "text-ds-text-normal"
|
|
138
138
|
),
|
|
139
139
|
children: W()
|
|
@@ -159,11 +159,11 @@ const k = {
|
|
|
159
159
|
ref: U,
|
|
160
160
|
id: f,
|
|
161
161
|
role: "listbox",
|
|
162
|
-
"aria-multiselectable":
|
|
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-
|
|
162
|
+
"aria-multiselectable": i === "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-ds-md p-1 shadow-ds-default",
|
|
164
164
|
children: [
|
|
165
|
-
|
|
166
|
-
const
|
|
165
|
+
o.map((e, t) => {
|
|
166
|
+
const a = Q(e.value), p = t === c;
|
|
167
167
|
return (
|
|
168
168
|
// 키보드 조작은 aria-activedescendant 패턴에 따라 combobox 트리거의
|
|
169
169
|
// onKeyDown이 전담한다(옵션은 포커스를 받지 않는 것이 WAI-ARIA 권고).
|
|
@@ -174,13 +174,13 @@ const k = {
|
|
|
174
174
|
{
|
|
175
175
|
id: j(t),
|
|
176
176
|
role: "option",
|
|
177
|
-
"aria-selected":
|
|
177
|
+
"aria-selected": a,
|
|
178
178
|
onClick: () => T(e.value),
|
|
179
179
|
onMouseEnter: () => D(t),
|
|
180
180
|
className: m(
|
|
181
|
-
"flex items-center rounded-
|
|
182
|
-
k[
|
|
183
|
-
|
|
181
|
+
"flex items-center rounded-ds-md cursor-pointer gap-1.5 transition-colors",
|
|
182
|
+
k[g].option,
|
|
183
|
+
a ? "bg-ds-surface-normal" : "bg-ds-background-default hover:bg-ds-surface-normal",
|
|
184
184
|
// 키보드 이동 위치 표시 (마우스 hover와 구분되도록 링으로)
|
|
185
185
|
p && "ring-1 ring-inset ring-ds-primary-blue-normal"
|
|
186
186
|
),
|
|
@@ -190,15 +190,15 @@ const k = {
|
|
|
190
190
|
{
|
|
191
191
|
className: m(
|
|
192
192
|
"flex-1 min-w-0 truncate font-sans",
|
|
193
|
-
k[
|
|
193
|
+
k[g].text,
|
|
194
194
|
"text-ds-text-strong"
|
|
195
195
|
),
|
|
196
196
|
children: e.label
|
|
197
197
|
}
|
|
198
198
|
),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
i === "default" && a && /* @__PURE__ */ r("span", { className: "shrink-0 flex items-center justify-center text-ds-text-strong", children: /* @__PURE__ */ r(C, {}) }),
|
|
200
|
+
i === "checkbox" && /* @__PURE__ */ r("span", { className: "shrink-0 flex items-center justify-center", children: a ? /* @__PURE__ */ r(V, {}) : /* @__PURE__ */ r(ee, {}) }),
|
|
201
|
+
i === "radio" && /* @__PURE__ */ r("span", { className: "shrink-0 flex items-center justify-center", children: a ? /* @__PURE__ */ r(te, {}) : /* @__PURE__ */ r(re, {}) })
|
|
202
202
|
]
|
|
203
203
|
},
|
|
204
204
|
e.value
|
|
@@ -213,7 +213,7 @@ const k = {
|
|
|
213
213
|
size: "lg",
|
|
214
214
|
className: "flex-1",
|
|
215
215
|
onClick: () => {
|
|
216
|
-
R == null || R(),
|
|
216
|
+
R == null || R(), d(!1);
|
|
217
217
|
},
|
|
218
218
|
children: B
|
|
219
219
|
}
|
|
@@ -226,7 +226,7 @@ const k = {
|
|
|
226
226
|
size: "lg",
|
|
227
227
|
className: "flex-1",
|
|
228
228
|
onClick: () => {
|
|
229
|
-
S == null || S(),
|
|
229
|
+
S == null || S(), d(!1);
|
|
230
230
|
},
|
|
231
231
|
children: H
|
|
232
232
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import { EyeOnIcon as E, EyeOffIcon as P } from "../../lib/icons.js";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as d } from "../../lib/utils.js";
|
|
5
5
|
import * as o from "react";
|
|
6
6
|
const I = {
|
|
7
7
|
lg: {
|
|
@@ -18,7 +18,7 @@ const I = {
|
|
|
18
18
|
}
|
|
19
19
|
}, V = o.forwardRef(
|
|
20
20
|
({
|
|
21
|
-
label:
|
|
21
|
+
label: r,
|
|
22
22
|
showLabel: c = !0,
|
|
23
23
|
require: l,
|
|
24
24
|
message: n,
|
|
@@ -44,17 +44,17 @@ const I = {
|
|
|
44
44
|
children: m ? /* @__PURE__ */ e(E, {}) : /* @__PURE__ */ e(P, {})
|
|
45
45
|
}
|
|
46
46
|
) : null);
|
|
47
|
-
return /* @__PURE__ */ i("div", { className:
|
|
48
|
-
c &&
|
|
49
|
-
/* @__PURE__ */ e("label", { htmlFor: y, className: "text-body-2-r text-ds-text-strong", children:
|
|
47
|
+
return /* @__PURE__ */ i("div", { className: d("flex flex-col gap-2", F), children: [
|
|
48
|
+
c && r && /* @__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: r }),
|
|
50
50
|
l && /* @__PURE__ */ e("span", { "aria-hidden": "true", className: "text-body-2-r text-ds-primary-red-normal", children: "*" })
|
|
51
51
|
] }),
|
|
52
52
|
n && /* @__PURE__ */ e("p", { id: N, className: "text-body-4-r text-ds-text-strong", children: n }),
|
|
53
53
|
/* @__PURE__ */ i(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
57
|
-
"flex items-center overflow-hidden bg-ds-background-default border rounded-
|
|
56
|
+
className: d(
|
|
57
|
+
"flex items-center overflow-hidden bg-ds-background-default border rounded-ds-md transition-colors",
|
|
58
58
|
t ? "border-ds-primary-red-normal" : "border-ds-line-normal hover:border-ds-line-strong focus-within:border-ds-primary-blue-normal",
|
|
59
59
|
(b || f) && "bg-ds-surface-normal",
|
|
60
60
|
I[a].container
|
|
@@ -69,7 +69,7 @@ const I = {
|
|
|
69
69
|
"aria-invalid": t ? !0 : void 0,
|
|
70
70
|
"aria-describedby": B,
|
|
71
71
|
"aria-required": l || void 0,
|
|
72
|
-
className:
|
|
72
|
+
className: d(
|
|
73
73
|
"flex-1 min-w-0 bg-transparent outline-none font-sans",
|
|
74
74
|
"text-ds-text-strong placeholder:text-ds-text-normal",
|
|
75
75
|
"disabled:text-ds-text-disabled",
|
|
@@ -89,7 +89,7 @@ const I = {
|
|
|
89
89
|
"p",
|
|
90
90
|
{
|
|
91
91
|
id: v,
|
|
92
|
-
className:
|
|
92
|
+
className: d(
|
|
93
93
|
"text-body-4-r",
|
|
94
94
|
t ? "text-ds-primary-red-normal" : "text-ds-text-normal"
|
|
95
95
|
),
|
|
@@ -101,16 +101,16 @@ const I = {
|
|
|
101
101
|
);
|
|
102
102
|
V.displayName = "InputField";
|
|
103
103
|
const $ = o.forwardRef(
|
|
104
|
-
({ label:
|
|
104
|
+
({ label: r, showLabel: c = !0, wrapperClassName: l, className: n, ...s }, t) => {
|
|
105
105
|
const x = o.useId(), a = s.id ?? x;
|
|
106
|
-
return /* @__PURE__ */ i("div", { className:
|
|
107
|
-
c &&
|
|
108
|
-
/* @__PURE__ */ e("div", { className: "overflow-hidden border border-ds-line-normal bg-ds-background-default rounded-
|
|
106
|
+
return /* @__PURE__ */ i("div", { className: d("flex flex-col gap-2", l), children: [
|
|
107
|
+
c && r && /* @__PURE__ */ e("label", { htmlFor: a, className: "text-body-2-r text-ds-text-strong", children: r }),
|
|
108
|
+
/* @__PURE__ */ e("div", { className: "overflow-hidden border border-ds-line-normal bg-ds-background-default rounded-ds-md p-3 hover:border-ds-line-strong focus-within:border-ds-primary-blue-normal transition-colors", children: /* @__PURE__ */ e(
|
|
109
109
|
"textarea",
|
|
110
110
|
{
|
|
111
111
|
ref: t,
|
|
112
112
|
id: a,
|
|
113
|
-
className:
|
|
113
|
+
className: d(
|
|
114
114
|
"w-full min-h-[114px] resize-none bg-transparent outline-none font-sans",
|
|
115
115
|
"text-body-3-r text-ds-text-strong placeholder:text-ds-text-normal",
|
|
116
116
|
"disabled:text-ds-text-disabled",
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { cn as
|
|
2
|
+
import { jsxs as s, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { cn as n } from "../../lib/utils.js";
|
|
4
4
|
import * as o from "react";
|
|
5
5
|
const l = {
|
|
6
|
-
xl: "size-[50px] rounded-
|
|
7
|
-
lg: "size-[42px] rounded-
|
|
8
|
-
md: "size-[38px] rounded-
|
|
9
|
-
sm: "size-[34px] rounded-
|
|
6
|
+
xl: "size-[50px] rounded-ds-md",
|
|
7
|
+
lg: "size-[42px] rounded-ds-md",
|
|
8
|
+
md: "size-[38px] rounded-ds-md",
|
|
9
|
+
sm: "size-[34px] rounded-ds-ss"
|
|
10
10
|
}, p = {
|
|
11
|
-
xl: "h-[50px] rounded-
|
|
12
|
-
lg: "h-[42px] rounded-
|
|
13
|
-
md: "h-[38px] rounded-
|
|
11
|
+
xl: "h-[50px] rounded-ds-md pl-[12px] pr-[18px]",
|
|
12
|
+
lg: "h-[42px] rounded-ds-md pl-[10px] pr-[14px]",
|
|
13
|
+
md: "h-[38px] rounded-ds-md pl-[8px] pr-[12px]"
|
|
14
14
|
};
|
|
15
|
-
function i({ size: e, className:
|
|
16
|
-
const
|
|
17
|
-
return e === "sm" ? /* @__PURE__ */
|
|
15
|
+
function i({ size: e, className: t }) {
|
|
16
|
+
const d = n("animate-spin shrink-0", t);
|
|
17
|
+
return e === "sm" ? /* @__PURE__ */ s("svg", { className: d, width: "12", height: "12", viewBox: "0 0 10 10.0649", fill: "none", "aria-hidden": "true", children: [
|
|
18
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
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__ */
|
|
20
|
+
] }) : e === "xl" ? /* @__PURE__ */ s("svg", { className: d, width: "28", height: "28", viewBox: "0 0 23.333 23.7432", fill: "none", "aria-hidden": "true", children: [
|
|
21
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
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__ */
|
|
23
|
+
] }) : /* @__PURE__ */ s("svg", { className: d, width: "20", height: "20", viewBox: "0 0 16.667 16.7749", fill: "none", "aria-hidden": "true", children: [
|
|
24
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
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
26
|
] });
|
|
27
27
|
}
|
|
28
|
-
const
|
|
29
|
-
({ size: e = "xl", label:
|
|
28
|
+
const c = o.forwardRef(
|
|
29
|
+
({ size: e = "xl", label: t, className: d }, a) => !!t && e !== "sm" ? /* @__PURE__ */ s(
|
|
30
30
|
"div",
|
|
31
31
|
{
|
|
32
|
-
ref:
|
|
33
|
-
className:
|
|
32
|
+
ref: a,
|
|
33
|
+
className: n(
|
|
34
34
|
"inline-flex items-center gap-[11px] border border-ds-line-normal bg-ds-background-default",
|
|
35
35
|
p[e],
|
|
36
|
-
|
|
36
|
+
d
|
|
37
37
|
),
|
|
38
38
|
children: [
|
|
39
39
|
/* @__PURE__ */ r(i, { size: e }),
|
|
40
|
-
/* @__PURE__ */ r("span", { className:
|
|
40
|
+
/* @__PURE__ */ r("span", { className: n(
|
|
41
41
|
"shrink-0 text-ds-text-strong whitespace-nowrap",
|
|
42
42
|
e === "xl" && "text-body-2-r",
|
|
43
43
|
e === "lg" && "text-body-3-r",
|
|
44
44
|
e === "md" && "text-body-4-r"
|
|
45
|
-
), children:
|
|
45
|
+
), children: t })
|
|
46
46
|
]
|
|
47
47
|
}
|
|
48
48
|
) : /* @__PURE__ */ r(
|
|
49
49
|
"div",
|
|
50
50
|
{
|
|
51
|
-
ref:
|
|
52
|
-
className:
|
|
51
|
+
ref: a,
|
|
52
|
+
className: n(
|
|
53
53
|
"inline-flex items-center justify-center border border-ds-line-normal bg-ds-background-default",
|
|
54
54
|
l[e],
|
|
55
|
-
|
|
55
|
+
d
|
|
56
56
|
),
|
|
57
57
|
children: /* @__PURE__ */ r(i, { size: e })
|
|
58
58
|
}
|
|
59
59
|
)
|
|
60
60
|
);
|
|
61
|
-
|
|
61
|
+
c.displayName = "LoadingBar";
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
c as LoadingBar
|
|
64
64
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
|
3
3
|
import { DoubleArrowLeftIcon as v, ArrowLeftIcon as N, ArrowRightIcon as p, DoubleArrowRightIcon as w } from "../../lib/icons.js";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as a } from "../../lib/utils.js";
|
|
5
5
|
import * as j from "react";
|
|
6
6
|
const A = j.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
page: e,
|
|
9
|
-
totalPages:
|
|
9
|
+
totalPages: d,
|
|
10
10
|
onPageChange: r,
|
|
11
11
|
showTopButton: u = !1,
|
|
12
12
|
onTopClick: m,
|
|
13
13
|
bordered: f = !0,
|
|
14
14
|
className: x
|
|
15
15
|
}, h) => {
|
|
16
|
-
const o = e <= 1, i = e >=
|
|
17
|
-
{ length: Math.min(5,
|
|
18
|
-
(n, k) =>
|
|
16
|
+
const o = e <= 1, i = e >= d, c = Math.floor((e - 1) / 5) * 5 + 1, y = Array.from(
|
|
17
|
+
{ length: Math.min(5, d - c + 1) },
|
|
18
|
+
(n, k) => c + k
|
|
19
19
|
), s = "inline-flex items-center justify-center text-ds-text-normal transition-colors focus-visible:outline-none", l = "inline-flex items-center justify-center text-ds-text-disabled cursor-not-allowed";
|
|
20
|
-
return /* @__PURE__ */ b("div", { ref: h, className:
|
|
20
|
+
return /* @__PURE__ */ b("div", { ref: h, className: a("flex items-center gap-3", x), children: [
|
|
21
21
|
/* @__PURE__ */ t(
|
|
22
22
|
"div",
|
|
23
23
|
{
|
|
24
|
-
className:
|
|
25
|
-
"flex h-9 items-center overflow-hidden px-4 rounded-
|
|
24
|
+
className: a(
|
|
25
|
+
"flex h-9 items-center overflow-hidden px-4 rounded-ds-md bg-ds-background-default",
|
|
26
26
|
f && "border border-ds-line-normal"
|
|
27
27
|
),
|
|
28
28
|
children: /* @__PURE__ */ b("div", { className: "flex items-center gap-2", children: [
|
|
@@ -55,7 +55,7 @@ const A = j.forwardRef(
|
|
|
55
55
|
"aria-label": `${n} 페이지`,
|
|
56
56
|
"aria-current": n === e ? "page" : void 0,
|
|
57
57
|
onClick: () => r(n),
|
|
58
|
-
className:
|
|
58
|
+
className: a(
|
|
59
59
|
"size-6 rounded-full inline-flex items-center justify-center shrink-0 text-body-3-m transition-colors focus-visible:outline-none",
|
|
60
60
|
n === e ? "text-ds-text-strong" : "text-ds-text-disabled"
|
|
61
61
|
),
|
|
@@ -80,7 +80,7 @@ const A = j.forwardRef(
|
|
|
80
80
|
type: "button",
|
|
81
81
|
"aria-label": "마지막 페이지",
|
|
82
82
|
disabled: i,
|
|
83
|
-
onClick: () => !i && r(
|
|
83
|
+
onClick: () => !i && r(d),
|
|
84
84
|
className: i ? l : s,
|
|
85
85
|
children: /* @__PURE__ */ t(w, {})
|
|
86
86
|
}
|
|
@@ -93,7 +93,7 @@ const A = j.forwardRef(
|
|
|
93
93
|
{
|
|
94
94
|
type: "button",
|
|
95
95
|
onClick: m,
|
|
96
|
-
className: "h-9 px-3.5 rounded-
|
|
96
|
+
className: "h-9 px-3.5 rounded-ds-md border border-ds-line-normal bg-ds-background-default text-body-2-m text-ds-text-strong shrink-0 transition-colors focus-visible:outline-none",
|
|
97
97
|
children: "TOP으로"
|
|
98
98
|
}
|
|
99
99
|
)
|