@pylerai/design-system 2.2.1 → 2.3.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/ui/calendar.js +155 -156
- package/dist/components/ui/checkbox.js +18 -18
- package/dist/components/ui/dropdown.js +118 -120
- package/dist/components/ui/modal.d.ts +9 -3
- package/dist/components/ui/modal.js +88 -85
- package/dist/components/ui/radio.js +16 -16
- package/dist/components/ui/table.js +86 -86
- package/dist/components/ui/tabs.js +77 -77
- package/dist/components/ui/toast.js +3 -3
- package/dist/components/ui/toggle.js +16 -16
- package/dist/components/ui/use-modal.js +41 -49
- package/dist/lib/use-dialog-a11y.js +25 -26
- package/dist/style.css +1 -1
- package/dist/tokens/pyler-light.js +20 -20
- package/package.json +14 -14
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as e, jsxs as
|
|
2
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { XIcon as z } from "../../lib/icons.js";
|
|
4
|
-
import { useDialogA11y as
|
|
5
|
-
import { cn as
|
|
6
|
-
import * as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import { Button as
|
|
9
|
-
function
|
|
4
|
+
import { useDialogA11y as g } from "../../lib/use-dialog-a11y.js";
|
|
5
|
+
import { cn as v } from "../../lib/utils.js";
|
|
6
|
+
import * as h from "react";
|
|
7
|
+
import { createPortal as y } from "react-dom";
|
|
8
|
+
import { Button as p } from "./button.js";
|
|
9
|
+
function w({ onClick: l }) {
|
|
10
10
|
return /* @__PURE__ */ e(
|
|
11
11
|
"button",
|
|
12
12
|
{
|
|
@@ -18,45 +18,46 @@ function y({ onClick: l }) {
|
|
|
18
18
|
}
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return /* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */ e("div", { className: "absolute inset-0 bg-ds-dim-default" }),
|
|
24
|
-
/* @__PURE__ */ e("div", { className: "relative z-10 flex items-center justify-center w-full h-full", children:
|
|
21
|
+
function N({ dim: l = !0, children: s }) {
|
|
22
|
+
return /* @__PURE__ */ n("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-5", children: [
|
|
23
|
+
l && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-ds-dim-default" }),
|
|
24
|
+
/* @__PURE__ */ e("div", { className: "relative z-10 flex items-center justify-center w-full h-full", children: s })
|
|
25
25
|
] });
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const k = "bg-ds-background-default border border-ds-line-normal rounded-ds-lg p-5 flex flex-col gap-6 shadow-ds-modal focus:outline-none", $ = "flex-1 min-w-0 text-body-2-sb text-ds-text-strong";
|
|
28
28
|
function S({
|
|
29
29
|
open: l,
|
|
30
|
-
title:
|
|
31
|
-
description:
|
|
32
|
-
confirmLabel:
|
|
33
|
-
onConfirm:
|
|
34
|
-
onClose:
|
|
30
|
+
title: s,
|
|
31
|
+
description: t,
|
|
32
|
+
confirmLabel: c = "확인",
|
|
33
|
+
onConfirm: f,
|
|
34
|
+
onClose: r,
|
|
35
|
+
dim: o,
|
|
35
36
|
className: d
|
|
36
37
|
}) {
|
|
37
|
-
const
|
|
38
|
+
const i = h.useId(), m = g(l, r);
|
|
38
39
|
if (!l) return null;
|
|
39
|
-
const
|
|
40
|
-
|
|
40
|
+
const a = () => {
|
|
41
|
+
f?.(), r();
|
|
41
42
|
};
|
|
42
|
-
return
|
|
43
|
-
/* @__PURE__ */ e(
|
|
43
|
+
return y(
|
|
44
|
+
/* @__PURE__ */ e(N, { dim: o, children: /* @__PURE__ */ n(
|
|
44
45
|
"div",
|
|
45
46
|
{
|
|
46
|
-
ref:
|
|
47
|
+
ref: m,
|
|
47
48
|
role: "dialog",
|
|
48
49
|
"aria-modal": "true",
|
|
49
|
-
"aria-labelledby": `${
|
|
50
|
-
"aria-describedby":
|
|
50
|
+
"aria-labelledby": `${i}-title`,
|
|
51
|
+
"aria-describedby": t ? `${i}-description` : void 0,
|
|
51
52
|
tabIndex: -1,
|
|
52
|
-
className:
|
|
53
|
+
className: v(k, "w-[360px]", d),
|
|
53
54
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ e("p", { id: `${
|
|
56
|
-
/* @__PURE__ */ e(
|
|
55
|
+
/* @__PURE__ */ n("div", { className: "flex items-start justify-between w-full gap-2", children: [
|
|
56
|
+
/* @__PURE__ */ e("p", { id: `${i}-title`, className: $, children: s }),
|
|
57
|
+
/* @__PURE__ */ e(w, { onClick: r })
|
|
57
58
|
] }),
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
t && /* @__PURE__ */ e("p", { id: `${i}-description`, className: "text-body-3-r text-ds-text-strong w-full", children: t }),
|
|
60
|
+
c && /* @__PURE__ */ e("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ e(p, { variant: "filled", color: "blue", size: "lg", onClick: a, children: c }) })
|
|
60
61
|
]
|
|
61
62
|
}
|
|
62
63
|
) }),
|
|
@@ -65,42 +66,43 @@ function S({
|
|
|
65
66
|
}
|
|
66
67
|
function X({
|
|
67
68
|
open: l,
|
|
68
|
-
title:
|
|
69
|
-
description:
|
|
70
|
-
cancelLabel:
|
|
71
|
-
confirmLabel:
|
|
72
|
-
onCancel:
|
|
73
|
-
onConfirm:
|
|
74
|
-
onClose:
|
|
75
|
-
|
|
69
|
+
title: s,
|
|
70
|
+
description: t,
|
|
71
|
+
cancelLabel: c = "닫기",
|
|
72
|
+
confirmLabel: f = "확인",
|
|
73
|
+
onCancel: r,
|
|
74
|
+
onConfirm: o,
|
|
75
|
+
onClose: d,
|
|
76
|
+
dim: i,
|
|
77
|
+
className: m
|
|
76
78
|
}) {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
}, [
|
|
79
|
+
const a = h.useId(), x = h.useCallback(() => {
|
|
80
|
+
r?.(), d();
|
|
81
|
+
}, [r, d]), u = g(l, x);
|
|
80
82
|
if (!l) return null;
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
+
const b = () => {
|
|
84
|
+
o?.(), d();
|
|
83
85
|
};
|
|
84
|
-
return
|
|
85
|
-
/* @__PURE__ */ e(
|
|
86
|
+
return y(
|
|
87
|
+
/* @__PURE__ */ e(N, { dim: i, children: /* @__PURE__ */ n(
|
|
86
88
|
"div",
|
|
87
89
|
{
|
|
88
90
|
ref: u,
|
|
89
91
|
role: "dialog",
|
|
90
92
|
"aria-modal": "true",
|
|
91
|
-
"aria-labelledby": `${
|
|
92
|
-
"aria-describedby":
|
|
93
|
+
"aria-labelledby": `${a}-title`,
|
|
94
|
+
"aria-describedby": t ? `${a}-description` : void 0,
|
|
93
95
|
tabIndex: -1,
|
|
94
|
-
className:
|
|
96
|
+
className: v(k, "w-[360px]", m),
|
|
95
97
|
children: [
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */ e("p", { id: `${
|
|
98
|
-
/* @__PURE__ */ e(
|
|
98
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between w-full gap-2", children: [
|
|
99
|
+
/* @__PURE__ */ e("p", { id: `${a}-title`, className: $, children: s }),
|
|
100
|
+
/* @__PURE__ */ e(w, { onClick: x })
|
|
99
101
|
] }),
|
|
100
|
-
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
/* @__PURE__ */ e(
|
|
103
|
-
/* @__PURE__ */ e(
|
|
102
|
+
t && /* @__PURE__ */ e("p", { id: `${a}-description`, className: "text-body-3-r text-ds-text-strong w-full", children: t }),
|
|
103
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2 w-full", children: [
|
|
104
|
+
/* @__PURE__ */ e(p, { variant: "outlined", color: "blue", size: "lg", onClick: x, children: c }),
|
|
105
|
+
/* @__PURE__ */ e(p, { variant: "filled", color: "blue", size: "lg", onClick: b, children: f })
|
|
104
106
|
] })
|
|
105
107
|
]
|
|
106
108
|
}
|
|
@@ -115,47 +117,48 @@ const I = {
|
|
|
115
117
|
};
|
|
116
118
|
function q({
|
|
117
119
|
open: l,
|
|
118
|
-
title:
|
|
119
|
-
description:
|
|
120
|
-
size:
|
|
121
|
-
cancelLabel:
|
|
122
|
-
confirmLabel:
|
|
123
|
-
onCancel:
|
|
124
|
-
onConfirm:
|
|
125
|
-
onClose:
|
|
126
|
-
children:
|
|
127
|
-
|
|
120
|
+
title: s,
|
|
121
|
+
description: t,
|
|
122
|
+
size: c = "sm",
|
|
123
|
+
cancelLabel: f = "닫기",
|
|
124
|
+
confirmLabel: r = "확인",
|
|
125
|
+
onCancel: o,
|
|
126
|
+
onConfirm: d,
|
|
127
|
+
onClose: i,
|
|
128
|
+
children: m,
|
|
129
|
+
dim: a,
|
|
130
|
+
className: x
|
|
128
131
|
}) {
|
|
129
|
-
const u =
|
|
130
|
-
|
|
131
|
-
}, [
|
|
132
|
+
const u = h.useId(), b = h.useCallback(() => {
|
|
133
|
+
o?.(), i();
|
|
134
|
+
}, [o, i]), j = g(l, b);
|
|
132
135
|
if (!l) return null;
|
|
133
|
-
const
|
|
134
|
-
|
|
136
|
+
const C = () => {
|
|
137
|
+
d?.(), i();
|
|
135
138
|
};
|
|
136
|
-
return
|
|
137
|
-
/* @__PURE__ */ e(
|
|
139
|
+
return y(
|
|
140
|
+
/* @__PURE__ */ e(N, { dim: a, children: /* @__PURE__ */ n(
|
|
138
141
|
"div",
|
|
139
142
|
{
|
|
140
|
-
ref:
|
|
143
|
+
ref: j,
|
|
141
144
|
role: "dialog",
|
|
142
145
|
"aria-modal": "true",
|
|
143
146
|
"aria-labelledby": `${u}-title`,
|
|
144
|
-
"aria-describedby":
|
|
147
|
+
"aria-describedby": t ? `${u}-description` : void 0,
|
|
145
148
|
tabIndex: -1,
|
|
146
|
-
className:
|
|
149
|
+
className: v(k, I[c], x),
|
|
147
150
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */ e("p", { id: `${u}-title`, className:
|
|
151
|
-
/* @__PURE__ */ e(
|
|
151
|
+
/* @__PURE__ */ n("div", { className: "flex flex-col gap-3 w-full shrink-0", children: [
|
|
152
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-between w-full gap-2", children: [
|
|
153
|
+
/* @__PURE__ */ e("p", { id: `${u}-title`, className: $, children: s }),
|
|
154
|
+
/* @__PURE__ */ e(w, { onClick: b })
|
|
152
155
|
] }),
|
|
153
|
-
|
|
156
|
+
t && /* @__PURE__ */ e("p", { id: `${u}-description`, className: "text-body-3-r text-ds-text-strong w-full", children: t })
|
|
154
157
|
] }),
|
|
155
|
-
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0 bg-ds-surface-normal rounded-ds-md w-full overflow-y-auto", children:
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
/* @__PURE__ */ e(
|
|
158
|
-
/* @__PURE__ */ e(
|
|
158
|
+
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0 bg-ds-surface-normal rounded-ds-md w-full overflow-y-auto", children: m }),
|
|
159
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2 w-full shrink-0", children: [
|
|
160
|
+
/* @__PURE__ */ e(p, { variant: "outlined", color: "blue", size: "lg", onClick: b, children: f }),
|
|
161
|
+
/* @__PURE__ */ e(p, { variant: "filled", color: "blue", size: "lg", onClick: C, children: r })
|
|
159
162
|
] })
|
|
160
163
|
]
|
|
161
164
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { RadioCheckedDisabledIcon as p, RadioUncheckedDisabledIcon as f, RadioCheckedIcon as R, RadioUncheckedIcon as
|
|
4
|
-
import { cn as
|
|
5
|
-
import * as
|
|
6
|
-
const
|
|
7
|
-
({ className: a, checked: o, disabled:
|
|
8
|
-
const l =
|
|
3
|
+
import { RadioCheckedDisabledIcon as p, RadioUncheckedDisabledIcon as f, RadioCheckedIcon as R, RadioUncheckedIcon as h } from "../../lib/icons.js";
|
|
4
|
+
import { cn as k } from "../../lib/utils.js";
|
|
5
|
+
import * as x from "react";
|
|
6
|
+
const g = x.forwardRef(
|
|
7
|
+
({ className: a, checked: o, disabled: n, onChange: c, value: r, children: i, ...s }, t) => {
|
|
8
|
+
const l = n ? o ? /* @__PURE__ */ e(p, {}) : /* @__PURE__ */ e(f, {}) : o ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ e(h, {});
|
|
9
9
|
return /* @__PURE__ */ d(
|
|
10
10
|
"label",
|
|
11
11
|
{
|
|
12
|
-
className:
|
|
12
|
+
className: k(
|
|
13
13
|
"relative inline-flex items-center gap-1",
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
i ? "" : "shrink-0",
|
|
15
|
+
n ? "cursor-not-allowed" : "cursor-pointer",
|
|
16
16
|
a
|
|
17
17
|
),
|
|
18
18
|
children: [
|
|
@@ -22,21 +22,21 @@ const I = u.forwardRef(
|
|
|
22
22
|
type: "radio",
|
|
23
23
|
ref: t,
|
|
24
24
|
checked: o,
|
|
25
|
-
disabled:
|
|
26
|
-
value:
|
|
27
|
-
onChange: (m) => m.target.checked && (
|
|
25
|
+
disabled: n,
|
|
26
|
+
value: r,
|
|
27
|
+
onChange: (m) => m.target.checked && c?.(String(r ?? "")),
|
|
28
28
|
className: "sr-only",
|
|
29
|
-
...
|
|
29
|
+
...s
|
|
30
30
|
}
|
|
31
31
|
),
|
|
32
32
|
/* @__PURE__ */ e("span", { className: "shrink-0 inline-flex", children: l }),
|
|
33
|
-
|
|
33
|
+
i
|
|
34
34
|
]
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
|
-
|
|
39
|
+
g.displayName = "Radio";
|
|
40
40
|
export {
|
|
41
|
-
|
|
41
|
+
g as Radio
|
|
42
42
|
};
|
|
@@ -1,94 +1,94 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as x, jsx as
|
|
3
|
-
import { InfoIcon as
|
|
2
|
+
import { jsxs as x, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { InfoIcon as B, SortArrowIcon as _ } from "../../lib/icons.js";
|
|
4
4
|
import { cn as g } from "../../lib/utils.js";
|
|
5
|
-
import * as
|
|
6
|
-
import { Checkbox as
|
|
7
|
-
const
|
|
5
|
+
import * as f from "react";
|
|
6
|
+
import { Checkbox as C } from "./checkbox.js";
|
|
7
|
+
const S = {
|
|
8
8
|
borderRight: "3px solid var(--ds-line-normal)"
|
|
9
|
-
},
|
|
10
|
-
({ className:
|
|
9
|
+
}, j = f.forwardRef(
|
|
10
|
+
({ className: l, ...r }, n) => /* @__PURE__ */ a(
|
|
11
11
|
"div",
|
|
12
12
|
{
|
|
13
|
-
ref:
|
|
13
|
+
ref: n,
|
|
14
14
|
role: "table",
|
|
15
|
-
className: g("w-full overflow-x-auto",
|
|
15
|
+
className: g("w-full overflow-x-auto", l),
|
|
16
16
|
...r
|
|
17
17
|
}
|
|
18
18
|
)
|
|
19
19
|
);
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
(
|
|
20
|
+
j.displayName = "TableRoot";
|
|
21
|
+
const L = f.forwardRef(
|
|
22
|
+
(l, r) => /* @__PURE__ */ a("div", { ref: r, role: "rowgroup", ...l })
|
|
23
23
|
);
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
(
|
|
24
|
+
L.displayName = "TableHead";
|
|
25
|
+
const R = f.forwardRef(
|
|
26
|
+
(l, r) => /* @__PURE__ */ a("div", { ref: r, role: "rowgroup", ...l })
|
|
27
27
|
);
|
|
28
|
-
|
|
29
|
-
const N =
|
|
30
|
-
({ className:
|
|
28
|
+
R.displayName = "TableBody";
|
|
29
|
+
const N = f.forwardRef(
|
|
30
|
+
({ className: l, hoverable: r = !0, selected: n, ...i }, s) => /* @__PURE__ */ a(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
|
-
ref:
|
|
33
|
+
ref: s,
|
|
34
34
|
role: "row",
|
|
35
|
-
"aria-selected":
|
|
35
|
+
"aria-selected": n,
|
|
36
36
|
className: g(
|
|
37
37
|
"flex items-stretch w-full",
|
|
38
38
|
r && "hover:bg-ds-surface-strong",
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
n && "bg-ds-surface-normal",
|
|
40
|
+
l
|
|
41
41
|
),
|
|
42
|
-
...
|
|
42
|
+
...i
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
);
|
|
46
46
|
N.displayName = "TableRow";
|
|
47
|
-
const k =
|
|
47
|
+
const k = f.forwardRef(
|
|
48
48
|
({
|
|
49
|
-
className:
|
|
49
|
+
className: l,
|
|
50
50
|
children: r,
|
|
51
|
-
sortable:
|
|
52
|
-
sortDirection:
|
|
53
|
-
onSort:
|
|
51
|
+
sortable: n,
|
|
52
|
+
sortDirection: i,
|
|
53
|
+
onSort: s,
|
|
54
54
|
info: d,
|
|
55
|
-
fixedLine:
|
|
56
|
-
align:
|
|
55
|
+
fixedLine: m,
|
|
56
|
+
align: h = "left",
|
|
57
57
|
width: p,
|
|
58
58
|
style: b,
|
|
59
59
|
...y
|
|
60
|
-
},
|
|
61
|
-
const v =
|
|
60
|
+
}, c) => {
|
|
61
|
+
const v = n && i != null;
|
|
62
62
|
return /* @__PURE__ */ x(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
|
-
ref:
|
|
65
|
+
ref: c,
|
|
66
66
|
role: "columnheader",
|
|
67
|
-
tabIndex:
|
|
68
|
-
"aria-sort":
|
|
67
|
+
tabIndex: n ? 0 : void 0,
|
|
68
|
+
"aria-sort": n ? i === "asc" ? "ascending" : i === "desc" ? "descending" : "none" : void 0,
|
|
69
69
|
className: g(
|
|
70
70
|
"flex h-10 items-center gap-1 border-t border-ds-line-normal bg-ds-surface-normal px-3 py-2.5",
|
|
71
71
|
p ? "shrink-0" : "flex-1 min-w-0",
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
h === "right" && "justify-end",
|
|
73
|
+
n && "cursor-pointer select-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ds-primary-blue-normal",
|
|
74
|
+
l
|
|
75
75
|
),
|
|
76
|
-
style: { width: p, ...
|
|
77
|
-
onClick:
|
|
78
|
-
onKeyDown:
|
|
79
|
-
(u.key === "Enter" || u.key === " ") && (u.preventDefault(),
|
|
76
|
+
style: { width: p, ...m ? S : {}, ...b },
|
|
77
|
+
onClick: n ? s : void 0,
|
|
78
|
+
onKeyDown: n ? (u) => {
|
|
79
|
+
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), s?.());
|
|
80
80
|
} : void 0,
|
|
81
81
|
...y,
|
|
82
82
|
children: [
|
|
83
|
-
/* @__PURE__ */
|
|
84
|
-
d && /* @__PURE__ */
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
/* @__PURE__ */ a("span", { className: "text-body-3-r text-ds-text-strong whitespace-nowrap", children: r }),
|
|
84
|
+
d && /* @__PURE__ */ a(B, { className: "shrink-0 text-ds-text-disabled" }),
|
|
85
|
+
n && /* @__PURE__ */ a(
|
|
86
|
+
_,
|
|
87
87
|
{
|
|
88
88
|
className: g(
|
|
89
89
|
"shrink-0 transition-transform duration-150",
|
|
90
90
|
v ? "text-ds-text-strong" : "text-ds-text-disabled",
|
|
91
|
-
|
|
91
|
+
i === "asc" && "rotate-180"
|
|
92
92
|
)
|
|
93
93
|
}
|
|
94
94
|
)
|
|
@@ -98,59 +98,59 @@ const k = h.forwardRef(
|
|
|
98
98
|
}
|
|
99
99
|
);
|
|
100
100
|
k.displayName = "TableHeaderCell";
|
|
101
|
-
const T =
|
|
102
|
-
({ className:
|
|
101
|
+
const T = f.forwardRef(
|
|
102
|
+
({ className: l, align: r = "left", fixedLine: n, width: i, style: s, children: d, ...m }, h) => /* @__PURE__ */ a(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
|
-
ref:
|
|
105
|
+
ref: h,
|
|
106
106
|
role: "cell",
|
|
107
107
|
className: g(
|
|
108
108
|
"flex items-center border-b border-ds-line-normal px-3 py-2",
|
|
109
|
-
|
|
109
|
+
i ? "shrink-0" : "flex-1 min-w-0",
|
|
110
110
|
r === "right" && "justify-end",
|
|
111
|
-
|
|
111
|
+
l
|
|
112
112
|
),
|
|
113
|
-
style: { width:
|
|
114
|
-
...
|
|
113
|
+
style: { width: i, ...n ? S : {}, ...s },
|
|
114
|
+
...m,
|
|
115
115
|
children: d
|
|
116
116
|
}
|
|
117
117
|
)
|
|
118
118
|
);
|
|
119
119
|
T.displayName = "TableCell";
|
|
120
|
-
function
|
|
121
|
-
columns:
|
|
120
|
+
function Y({
|
|
121
|
+
columns: l,
|
|
122
122
|
data: r,
|
|
123
|
-
sortKey:
|
|
124
|
-
sortDirection:
|
|
125
|
-
onSort:
|
|
123
|
+
sortKey: n,
|
|
124
|
+
sortDirection: i,
|
|
125
|
+
onSort: s,
|
|
126
126
|
selectedRows: d,
|
|
127
|
-
onRowSelect:
|
|
128
|
-
onSelectAll:
|
|
127
|
+
onRowSelect: m,
|
|
128
|
+
onSelectAll: h,
|
|
129
129
|
getRowKey: p,
|
|
130
130
|
onRowClick: b,
|
|
131
131
|
className: y
|
|
132
132
|
}) {
|
|
133
|
-
const
|
|
134
|
-
if (!
|
|
135
|
-
|
|
133
|
+
const c = d !== void 0, v = c && r.length > 0 && d.length === r.length, u = c && d.length > 0 && d.length < r.length, E = (e) => {
|
|
134
|
+
if (!s) return;
|
|
135
|
+
s(e, n === e && i === "asc" ? "desc" : "asc");
|
|
136
136
|
};
|
|
137
|
-
return /* @__PURE__ */ x(
|
|
138
|
-
/* @__PURE__ */
|
|
139
|
-
|
|
140
|
-
|
|
137
|
+
return /* @__PURE__ */ x(j, { className: y, children: [
|
|
138
|
+
/* @__PURE__ */ a(L, { children: /* @__PURE__ */ x(N, { hoverable: !1, children: [
|
|
139
|
+
c && /* @__PURE__ */ a(k, { width: 40, className: "justify-center px-1.5", children: /* @__PURE__ */ a(
|
|
140
|
+
C,
|
|
141
141
|
{
|
|
142
142
|
"aria-label": "전체 선택",
|
|
143
143
|
checked: v,
|
|
144
144
|
indeterminate: u,
|
|
145
|
-
onChange: (e) =>
|
|
145
|
+
onChange: (e) => h?.(e)
|
|
146
146
|
}
|
|
147
147
|
) }),
|
|
148
|
-
|
|
148
|
+
l.map((e) => /* @__PURE__ */ a(
|
|
149
149
|
k,
|
|
150
150
|
{
|
|
151
151
|
sortable: e.sortable,
|
|
152
|
-
sortDirection: e.sortable &&
|
|
153
|
-
onSort: () =>
|
|
152
|
+
sortDirection: e.sortable && n === e.key ? i ?? null : null,
|
|
153
|
+
onSort: () => E(e.key),
|
|
154
154
|
info: e.info,
|
|
155
155
|
fixedLine: e.fixedLine,
|
|
156
156
|
align: e.align,
|
|
@@ -160,47 +160,47 @@ function q({
|
|
|
160
160
|
e.key
|
|
161
161
|
))
|
|
162
162
|
] }) }),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
const
|
|
163
|
+
/* @__PURE__ */ a(R, { children: r.map((e, o) => {
|
|
164
|
+
const H = p ? p(e, o) : o, w = c && d.includes(o);
|
|
165
165
|
return /* @__PURE__ */ x(
|
|
166
166
|
N,
|
|
167
167
|
{
|
|
168
|
-
selected:
|
|
168
|
+
selected: w,
|
|
169
169
|
onClick: b ? () => b(e, o) : void 0,
|
|
170
170
|
className: b ? "cursor-pointer" : void 0,
|
|
171
171
|
children: [
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
c && /* @__PURE__ */ a(T, { width: 40, className: "justify-center px-1.5", children: /* @__PURE__ */ a(
|
|
173
|
+
C,
|
|
174
174
|
{
|
|
175
175
|
"aria-label": `${o + 1}번째 행 선택`,
|
|
176
|
-
checked:
|
|
177
|
-
onChange: (t) =>
|
|
176
|
+
checked: w,
|
|
177
|
+
onChange: (t) => m?.(o, t),
|
|
178
178
|
onClick: (t) => t.stopPropagation()
|
|
179
179
|
}
|
|
180
180
|
) }),
|
|
181
|
-
|
|
181
|
+
l.map((t) => /* @__PURE__ */ a(
|
|
182
182
|
T,
|
|
183
183
|
{
|
|
184
184
|
align: t.align,
|
|
185
185
|
fixedLine: t.fixedLine,
|
|
186
186
|
width: t.width,
|
|
187
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ a("span", { className: "text-body-3-r text-ds-text-strong w-full", children: t.cell ? t.cell(e, o) : String(e[t.key] ?? "") })
|
|
188
188
|
},
|
|
189
189
|
t.key
|
|
190
190
|
))
|
|
191
191
|
]
|
|
192
192
|
},
|
|
193
|
-
|
|
193
|
+
H
|
|
194
194
|
);
|
|
195
195
|
}) })
|
|
196
196
|
] });
|
|
197
197
|
}
|
|
198
198
|
export {
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
Y as Table,
|
|
200
|
+
R as TableBody,
|
|
201
201
|
T as TableCell,
|
|
202
|
-
|
|
202
|
+
L as TableHead,
|
|
203
203
|
k as TableHeaderCell,
|
|
204
|
-
|
|
204
|
+
j as TableRoot,
|
|
205
205
|
N as TableRow
|
|
206
206
|
};
|