@bigtablet/design-system 1.9.1 → 1.10.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/index.css +34 -34
- package/dist/index.d.ts +2 -1
- package/dist/index.js +41 -10
- package/dist/next.css +55 -49
- package/dist/next.d.ts +1 -4
- package/dist/next.js +94 -90
- package/dist/styles/scss/_motion.scss +12 -4
- package/package.json +1 -1
- package/src/styles/scss/_motion.scss +12 -4
package/dist/index.css
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
align-items: center;
|
|
77
77
|
justify-content: center;
|
|
78
78
|
z-index: 10000;
|
|
79
|
-
animation: fade_in 0.2s ease-out;
|
|
79
|
+
animation: fade_in 0.2s ease-in-out;
|
|
80
80
|
}
|
|
81
81
|
.alert_modal {
|
|
82
82
|
background: #ffffff;
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
min-width: 320px;
|
|
85
85
|
max-width: 480px;
|
|
86
86
|
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
87
|
-
animation: slide_up 0.3s ease-out;
|
|
87
|
+
animation: slide_up 0.3s ease-in-out;
|
|
88
88
|
overflow: hidden;
|
|
89
89
|
}
|
|
90
90
|
.alert_modal_title {
|
|
@@ -126,10 +126,10 @@
|
|
|
126
126
|
border: 1px solid transparent;
|
|
127
127
|
line-height: 1.5;
|
|
128
128
|
transition:
|
|
129
|
-
background 0.2s ease-out,
|
|
130
|
-
border-color 0.2s ease-out,
|
|
131
|
-
box-shadow 0.2s ease-out,
|
|
132
|
-
transform 0.2s ease-out;
|
|
129
|
+
background 0.2s ease-in-out,
|
|
130
|
+
border-color 0.2s ease-in-out,
|
|
131
|
+
box-shadow 0.2s ease-in-out,
|
|
132
|
+
transform 0.2s ease-in-out;
|
|
133
133
|
}
|
|
134
134
|
.alert_modal_button:focus-visible {
|
|
135
135
|
outline: none;
|
|
@@ -216,7 +216,6 @@
|
|
|
216
216
|
|
|
217
217
|
/* src/ui/general/button/style.scss */
|
|
218
218
|
.button {
|
|
219
|
-
width: 100%;
|
|
220
219
|
display: inline-flex;
|
|
221
220
|
align-items: center;
|
|
222
221
|
justify-content: center;
|
|
@@ -226,10 +225,10 @@
|
|
|
226
225
|
cursor: pointer;
|
|
227
226
|
font-weight: 500;
|
|
228
227
|
transition:
|
|
229
|
-
background 0.2s ease-out,
|
|
230
|
-
color 0.2s ease-out,
|
|
231
|
-
box-shadow 0.2s ease-out,
|
|
232
|
-
transform 0.2s ease-out;
|
|
228
|
+
background 0.2s ease-in-out,
|
|
229
|
+
color 0.2s ease-in-out,
|
|
230
|
+
box-shadow 0.2s ease-in-out,
|
|
231
|
+
transform 0.2s ease-in-out;
|
|
233
232
|
}
|
|
234
233
|
.button:disabled {
|
|
235
234
|
cursor: not-allowed;
|
|
@@ -318,9 +317,9 @@
|
|
|
318
317
|
border-radius: 6px;
|
|
319
318
|
background: #ffffff;
|
|
320
319
|
transition:
|
|
321
|
-
background 0.2s ease-out,
|
|
322
|
-
border-color 0.2s ease-out,
|
|
323
|
-
box-shadow 0.2s ease-out;
|
|
320
|
+
background 0.2s ease-in-out,
|
|
321
|
+
border-color 0.2s ease-in-out,
|
|
322
|
+
box-shadow 0.2s ease-in-out;
|
|
324
323
|
display: inline-block;
|
|
325
324
|
position: relative;
|
|
326
325
|
}
|
|
@@ -408,9 +407,9 @@
|
|
|
408
407
|
line-height: 1.5;
|
|
409
408
|
color: #1a1a1a;
|
|
410
409
|
transition:
|
|
411
|
-
background 0.2s ease-out,
|
|
412
|
-
border-color 0.2s ease-out,
|
|
413
|
-
box-shadow 0.2s ease-out;
|
|
410
|
+
background 0.2s ease-in-out,
|
|
411
|
+
border-color 0.2s ease-in-out,
|
|
412
|
+
box-shadow 0.2s ease-in-out;
|
|
414
413
|
}
|
|
415
414
|
.file_input:hover .file_input_label {
|
|
416
415
|
border-color: rgba(0, 0, 0, 0.08);
|
|
@@ -457,9 +456,9 @@
|
|
|
457
456
|
border-radius: 9999px;
|
|
458
457
|
background: #ffffff;
|
|
459
458
|
transition:
|
|
460
|
-
background 0.2s ease-out,
|
|
461
|
-
border-color 0.2s ease-out,
|
|
462
|
-
box-shadow 0.2s ease-out;
|
|
459
|
+
background 0.2s ease-in-out,
|
|
460
|
+
border-color 0.2s ease-in-out,
|
|
461
|
+
box-shadow 0.2s ease-in-out;
|
|
463
462
|
position: relative;
|
|
464
463
|
display: inline-block;
|
|
465
464
|
}
|
|
@@ -538,9 +537,9 @@
|
|
|
538
537
|
background: #ffffff;
|
|
539
538
|
border-radius: 8px;
|
|
540
539
|
transition:
|
|
541
|
-
border-color 0.2s ease-out,
|
|
542
|
-
box-shadow 0.2s ease-out,
|
|
543
|
-
background 0.2s ease-out;
|
|
540
|
+
border-color 0.2s ease-in-out,
|
|
541
|
+
box-shadow 0.2s ease-in-out,
|
|
542
|
+
background 0.2s ease-in-out;
|
|
544
543
|
font-size: 0.9375rem;
|
|
545
544
|
line-height: 1.5;
|
|
546
545
|
}
|
|
@@ -623,11 +622,12 @@
|
|
|
623
622
|
.select_list {
|
|
624
623
|
position: absolute;
|
|
625
624
|
z-index: 10000;
|
|
626
|
-
top:
|
|
625
|
+
top: 100%;
|
|
627
626
|
left: 0;
|
|
628
627
|
width: 100%;
|
|
629
628
|
min-width: 100%;
|
|
630
629
|
box-sizing: border-box;
|
|
630
|
+
margin-top: 0.25rem;
|
|
631
631
|
background: #ffffff;
|
|
632
632
|
border: 1px solid #e5e5e5;
|
|
633
633
|
border-radius: 8px;
|
|
@@ -680,7 +680,7 @@
|
|
|
680
680
|
padding: 2px;
|
|
681
681
|
border-radius: 9999px;
|
|
682
682
|
background: #e5e5e5;
|
|
683
|
-
transition: background 0.2s ease-out;
|
|
683
|
+
transition: background 0.2s ease-in-out;
|
|
684
684
|
cursor: pointer;
|
|
685
685
|
}
|
|
686
686
|
.switch_thumb {
|
|
@@ -688,7 +688,7 @@
|
|
|
688
688
|
height: 18px;
|
|
689
689
|
background: #ffffff;
|
|
690
690
|
border-radius: 9999px;
|
|
691
|
-
transition: transform 0.2s ease-out;
|
|
691
|
+
transition: transform 0.2s ease-in-out;
|
|
692
692
|
transform: translateX(0);
|
|
693
693
|
}
|
|
694
694
|
.switch_on {
|
|
@@ -782,9 +782,9 @@
|
|
|
782
782
|
width: 100%;
|
|
783
783
|
border-radius: 8px;
|
|
784
784
|
transition:
|
|
785
|
-
border-color 0.2s ease-out,
|
|
786
|
-
box-shadow 0.2s ease-out,
|
|
787
|
-
background 0.2s ease-out;
|
|
785
|
+
border-color 0.2s ease-in-out,
|
|
786
|
+
box-shadow 0.2s ease-in-out,
|
|
787
|
+
background 0.2s ease-in-out;
|
|
788
788
|
font-size: 0.9375rem;
|
|
789
789
|
line-height: 1.5;
|
|
790
790
|
color: #1a1a1a;
|
|
@@ -899,9 +899,9 @@
|
|
|
899
899
|
border-radius: 6px;
|
|
900
900
|
cursor: pointer;
|
|
901
901
|
transition:
|
|
902
|
-
border-color 0.1s ease-out,
|
|
903
|
-
box-shadow 0.1s ease-out,
|
|
904
|
-
background-color 0.1s ease-out;
|
|
902
|
+
border-color 0.1s ease-in-out,
|
|
903
|
+
box-shadow 0.1s ease-in-out,
|
|
904
|
+
background-color 0.1s ease-in-out;
|
|
905
905
|
appearance: none;
|
|
906
906
|
background-image:
|
|
907
907
|
linear-gradient(
|
|
@@ -975,7 +975,7 @@
|
|
|
975
975
|
font-size: 0.875rem;
|
|
976
976
|
line-height: 1.5;
|
|
977
977
|
color: #1a1a1a;
|
|
978
|
-
transition: background 0.2s ease-out, border-color 0.2s ease-out;
|
|
978
|
+
transition: background 0.2s ease-in-out, border-color 0.2s ease-in-out;
|
|
979
979
|
}
|
|
980
980
|
.pagination_item:hover:not(:disabled) {
|
|
981
981
|
background: #fafafa;
|
|
@@ -1002,7 +1002,7 @@
|
|
|
1002
1002
|
font-size: 0.875rem;
|
|
1003
1003
|
line-height: 1.5;
|
|
1004
1004
|
color: #666666;
|
|
1005
|
-
transition: background 0.2s ease-out, color 0.2s ease-out;
|
|
1005
|
+
transition: background 0.2s ease-in-out, color 0.2s ease-in-out;
|
|
1006
1006
|
}
|
|
1007
1007
|
.pagination_pageButton:hover {
|
|
1008
1008
|
background: #fafafa;
|
package/dist/index.d.ts
CHANGED
|
@@ -53,8 +53,9 @@ declare const useToast: (containerId?: string) => {
|
|
|
53
53
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
54
54
|
variant?: "primary" | "secondary" | "ghost" | "danger";
|
|
55
55
|
size?: "sm" | "md" | "lg";
|
|
56
|
+
width?: string;
|
|
56
57
|
}
|
|
57
|
-
declare const Button: ({ variant, size, className, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
58
|
+
declare const Button: ({ variant, size, width, className, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
|
|
58
59
|
|
|
59
60
|
interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
60
61
|
label?: React.ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -168,6 +168,7 @@ var useToast = (containerId = "default") => {
|
|
|
168
168
|
var Button = ({
|
|
169
169
|
variant = "primary",
|
|
170
170
|
size = "md",
|
|
171
|
+
width = "100%",
|
|
171
172
|
className,
|
|
172
173
|
...props
|
|
173
174
|
}) => {
|
|
@@ -177,7 +178,7 @@ var Button = ({
|
|
|
177
178
|
`button_size_${size}`,
|
|
178
179
|
className ?? ""
|
|
179
180
|
].filter(Boolean).join(" ");
|
|
180
|
-
return /* @__PURE__ */ jsx("button", { className: buttonClassName, ...props });
|
|
181
|
+
return /* @__PURE__ */ jsx("button", { className: buttonClassName, style: { width }, ...props });
|
|
181
182
|
};
|
|
182
183
|
var Checkbox = ({
|
|
183
184
|
label,
|
|
@@ -279,7 +280,9 @@ var Select = ({
|
|
|
279
280
|
React3.useEffect(() => {
|
|
280
281
|
const onDocClick = (e) => {
|
|
281
282
|
if (!wrapperRef.current) return;
|
|
282
|
-
if (!wrapperRef.current.contains(e.target))
|
|
283
|
+
if (!wrapperRef.current.contains(e.target)) {
|
|
284
|
+
setIsOpen(false);
|
|
285
|
+
}
|
|
283
286
|
};
|
|
284
287
|
document.addEventListener("mousedown", onDocClick);
|
|
285
288
|
return () => document.removeEventListener("mousedown", onDocClick);
|
|
@@ -327,7 +330,9 @@ var Select = ({
|
|
|
327
330
|
case "Home":
|
|
328
331
|
e.preventDefault();
|
|
329
332
|
setIsOpen(true);
|
|
330
|
-
setActiveIndex(
|
|
333
|
+
setActiveIndex(
|
|
334
|
+
options.findIndex((o) => !o.disabled)
|
|
335
|
+
);
|
|
331
336
|
break;
|
|
332
337
|
case "End":
|
|
333
338
|
e.preventDefault();
|
|
@@ -347,8 +352,15 @@ var Select = ({
|
|
|
347
352
|
};
|
|
348
353
|
React3.useEffect(() => {
|
|
349
354
|
if (!isOpen) return;
|
|
350
|
-
const idx = options.findIndex(
|
|
351
|
-
|
|
355
|
+
const idx = options.findIndex(
|
|
356
|
+
(o) => o.value === currentValue && !o.disabled
|
|
357
|
+
);
|
|
358
|
+
setActiveIndex(
|
|
359
|
+
idx >= 0 ? idx : Math.max(
|
|
360
|
+
0,
|
|
361
|
+
options.findIndex((o) => !o.disabled)
|
|
362
|
+
)
|
|
363
|
+
);
|
|
352
364
|
}, [isOpen, options, currentValue]);
|
|
353
365
|
const rootClassName = ["select", className ?? ""].filter(Boolean).join(" ");
|
|
354
366
|
const controlClassName = [
|
|
@@ -365,7 +377,14 @@ var Select = ({
|
|
|
365
377
|
className: rootClassName,
|
|
366
378
|
style: fullWidth ? { width: "100%" } : void 0,
|
|
367
379
|
children: [
|
|
368
|
-
label
|
|
380
|
+
label && /* @__PURE__ */ jsx(
|
|
381
|
+
"label",
|
|
382
|
+
{
|
|
383
|
+
htmlFor: selectId,
|
|
384
|
+
className: "select_label",
|
|
385
|
+
children: label
|
|
386
|
+
}
|
|
387
|
+
),
|
|
369
388
|
/* @__PURE__ */ jsxs(
|
|
370
389
|
"button",
|
|
371
390
|
{
|
|
@@ -379,12 +398,18 @@ var Select = ({
|
|
|
379
398
|
onKeyDown,
|
|
380
399
|
disabled,
|
|
381
400
|
children: [
|
|
382
|
-
/* @__PURE__ */ jsx(
|
|
401
|
+
/* @__PURE__ */ jsx(
|
|
402
|
+
"span",
|
|
403
|
+
{
|
|
404
|
+
className: currentOption ? "select_value" : "select_placeholder",
|
|
405
|
+
children: currentOption ? currentOption.label : placeholder
|
|
406
|
+
}
|
|
407
|
+
),
|
|
383
408
|
/* @__PURE__ */ jsx("span", { className: "select_icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 }) })
|
|
384
409
|
]
|
|
385
410
|
}
|
|
386
411
|
),
|
|
387
|
-
isOpen
|
|
412
|
+
isOpen && /* @__PURE__ */ jsx(
|
|
388
413
|
"ul",
|
|
389
414
|
{
|
|
390
415
|
id: `${selectId}_listbox`,
|
|
@@ -413,14 +438,20 @@ var Select = ({
|
|
|
413
438
|
},
|
|
414
439
|
children: [
|
|
415
440
|
/* @__PURE__ */ jsx("span", { children: opt.label }),
|
|
416
|
-
selected
|
|
441
|
+
selected && /* @__PURE__ */ jsx(
|
|
442
|
+
Check,
|
|
443
|
+
{
|
|
444
|
+
size: 16,
|
|
445
|
+
"aria-hidden": "true"
|
|
446
|
+
}
|
|
447
|
+
)
|
|
417
448
|
]
|
|
418
449
|
},
|
|
419
450
|
opt.value
|
|
420
451
|
);
|
|
421
452
|
})
|
|
422
453
|
}
|
|
423
|
-
)
|
|
454
|
+
)
|
|
424
455
|
]
|
|
425
456
|
}
|
|
426
457
|
);
|
package/dist/next.css
CHANGED
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
.sidebar {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
-
box-sizing: border-box;
|
|
6
5
|
height: 100%;
|
|
6
|
+
width: 240px;
|
|
7
7
|
background: #ffffff;
|
|
8
8
|
border-right: 1px solid #e5e5e5;
|
|
9
9
|
padding: 0.5rem;
|
|
10
10
|
gap: 0.5rem;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
transition: width 0.3s ease-in-out;
|
|
13
|
+
}
|
|
14
|
+
.sidebar.is_closed {
|
|
15
|
+
width: 56px;
|
|
11
16
|
}
|
|
12
17
|
.sidebar_brand {
|
|
13
18
|
padding: 0.5rem;
|
|
@@ -19,95 +24,87 @@
|
|
|
19
24
|
align-items: center;
|
|
20
25
|
justify-content: space-between;
|
|
21
26
|
align-items: center;
|
|
22
|
-
width: 100%;
|
|
23
|
-
}
|
|
24
|
-
.sidebar_brand_img {
|
|
25
|
-
object-fit: contain;
|
|
26
27
|
}
|
|
27
28
|
.sidebar_nav {
|
|
28
29
|
display: grid;
|
|
29
30
|
gap: 0.25rem;
|
|
30
|
-
padding: 0.5rem 0;
|
|
31
31
|
}
|
|
32
32
|
.sidebar_group {
|
|
33
33
|
display: grid;
|
|
34
34
|
gap: 0.25rem;
|
|
35
35
|
}
|
|
36
36
|
.sidebar_item {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
border: none;
|
|
38
|
+
display: flex;
|
|
39
39
|
align-items: center;
|
|
40
|
-
|
|
40
|
+
justify-content: space-between;
|
|
41
41
|
padding: 0.5rem 0.75rem;
|
|
42
42
|
border-radius: 8px;
|
|
43
43
|
color: #6b7280;
|
|
44
|
-
background: transparent;
|
|
45
|
-
border: 1px solid transparent;
|
|
46
44
|
cursor: pointer;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
transition:
|
|
50
|
-
background-color 0.2s ease-out,
|
|
51
|
-
color 0.2s ease-out,
|
|
52
|
-
border-color 0.2s ease-out;
|
|
45
|
+
background: transparent;
|
|
46
|
+
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
|
|
53
47
|
}
|
|
54
48
|
.sidebar_item:hover {
|
|
55
49
|
background: #fafafa;
|
|
56
50
|
color: #1f2937;
|
|
57
51
|
}
|
|
58
|
-
.sidebar_item:hover .sidebar_icon {
|
|
59
|
-
color: #1f2937;
|
|
60
|
-
}
|
|
61
52
|
.sidebar_item.is_active {
|
|
62
|
-
position: relative;
|
|
63
53
|
background: #ffffff;
|
|
64
|
-
border-color: #e5e5e5;
|
|
65
54
|
color: #1f2937;
|
|
66
55
|
box-shadow: inset 0 0 0 1px #e5e5e5;
|
|
67
56
|
}
|
|
68
|
-
.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
background: #000000;
|
|
57
|
+
.sidebar_item_left {
|
|
58
|
+
display: flex;
|
|
59
|
+
align-items: center;
|
|
60
|
+
gap: 0.5rem;
|
|
61
|
+
}
|
|
62
|
+
.sidebar_item_right {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
77
65
|
}
|
|
78
66
|
.sidebar_icon {
|
|
79
|
-
display:
|
|
67
|
+
display: grid;
|
|
80
68
|
place-items: center;
|
|
81
|
-
color: #6b7280;
|
|
82
|
-
transition: color 0.2s ease-out;
|
|
83
|
-
}
|
|
84
|
-
.sidebar_label {
|
|
85
|
-
white-space: nowrap;
|
|
86
|
-
text-overflow: ellipsis;
|
|
87
|
-
text-align: left;
|
|
88
|
-
}
|
|
89
|
-
.sidebar_label.is_active {
|
|
90
|
-
color: #000000;
|
|
91
|
-
font-weight: 500;
|
|
92
69
|
}
|
|
93
70
|
.sidebar_chevron {
|
|
94
|
-
|
|
95
|
-
place-items: center;
|
|
96
|
-
color: #6b7280;
|
|
97
|
-
transition: transform 0.2s ease-out;
|
|
71
|
+
transition: transform 0.2s ease-in-out;
|
|
98
72
|
}
|
|
99
73
|
.sidebar_chevron.is_open {
|
|
100
74
|
transform: rotate(180deg);
|
|
101
75
|
}
|
|
76
|
+
.sidebar_label {
|
|
77
|
+
font-size: 1rem;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
}
|
|
102
80
|
.sidebar_sub {
|
|
103
81
|
display: grid;
|
|
104
82
|
gap: 0.25rem;
|
|
105
|
-
padding-left:
|
|
83
|
+
padding-left: 0.75rem;
|
|
84
|
+
max-height: 0;
|
|
85
|
+
opacity: 0;
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
transform: translateY(-4px);
|
|
88
|
+
transition:
|
|
89
|
+
max-height 0.3s ease-in-out,
|
|
90
|
+
opacity 0.2s ease-in-out,
|
|
91
|
+
transform 0.2s ease-in-out;
|
|
92
|
+
}
|
|
93
|
+
.sidebar_sub.is_open {
|
|
94
|
+
max-height: 500px;
|
|
95
|
+
opacity: 1;
|
|
96
|
+
transform: translateY(0);
|
|
106
97
|
}
|
|
107
98
|
.sidebar_sub_item {
|
|
99
|
+
display: flex;
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: 0.75rem;
|
|
108
102
|
padding: 0.25rem 0.75rem;
|
|
109
|
-
border-radius:
|
|
103
|
+
border-radius: 8px;
|
|
110
104
|
color: #6b7280;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
background: transparent;
|
|
107
|
+
transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
|
|
111
108
|
}
|
|
112
109
|
.sidebar_sub_item:hover {
|
|
113
110
|
background: #fafafa;
|
|
@@ -117,3 +114,12 @@
|
|
|
117
114
|
color: #000000;
|
|
118
115
|
font-weight: 500;
|
|
119
116
|
}
|
|
117
|
+
.sidebar_sub_icon {
|
|
118
|
+
display: grid;
|
|
119
|
+
place-items: center;
|
|
120
|
+
color: #6b7280;
|
|
121
|
+
}
|
|
122
|
+
.sidebar_sub_label {
|
|
123
|
+
font-size: 0.875rem;
|
|
124
|
+
white-space: nowrap;
|
|
125
|
+
}
|
package/dist/next.d.ts
CHANGED
|
@@ -3,14 +3,12 @@ import * as React from 'react';
|
|
|
3
3
|
import { LucideIcon } from 'lucide-react';
|
|
4
4
|
|
|
5
5
|
type MatchMode = "startsWith" | "exact";
|
|
6
|
-
/** 단일 링크 메뉴 */
|
|
7
6
|
interface SidebarLinkItem {
|
|
8
7
|
type?: "link";
|
|
9
8
|
href: string;
|
|
10
9
|
label: React.ReactNode;
|
|
11
10
|
icon?: LucideIcon;
|
|
12
11
|
}
|
|
13
|
-
/** 서브 메뉴 그룹 */
|
|
14
12
|
interface SidebarGroupItem {
|
|
15
13
|
type: "group";
|
|
16
14
|
id: string;
|
|
@@ -23,12 +21,11 @@ interface SidebarProps {
|
|
|
23
21
|
items?: SidebarItem[];
|
|
24
22
|
activePath?: string;
|
|
25
23
|
onItemSelect?: (href: string) => void;
|
|
26
|
-
width?: number;
|
|
27
24
|
className?: string;
|
|
28
25
|
style?: React.CSSProperties;
|
|
29
26
|
match?: MatchMode;
|
|
30
27
|
brandHref?: string;
|
|
31
28
|
}
|
|
32
|
-
declare const Sidebar: ({ items, activePath, onItemSelect,
|
|
29
|
+
declare const Sidebar: ({ items, activePath, onItemSelect, className, style, match, brandHref, }: SidebarProps) => react_jsx_runtime.JSX.Element;
|
|
33
30
|
|
|
34
31
|
export { Sidebar, type SidebarItem, type SidebarProps };
|
package/dist/next.js
CHANGED
|
@@ -3,7 +3,7 @@ import './next.css';
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import Link from 'next/link';
|
|
5
5
|
import Image from 'next/image';
|
|
6
|
-
import { ChevronDown } from 'lucide-react';
|
|
6
|
+
import { ChevronDown, CornerDownRight } from 'lucide-react';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
// src/ui/navigation/sidebar/index.tsx
|
|
@@ -11,7 +11,6 @@ var Sidebar = ({
|
|
|
11
11
|
items = [],
|
|
12
12
|
activePath,
|
|
13
13
|
onItemSelect,
|
|
14
|
-
width = 240,
|
|
15
14
|
className,
|
|
16
15
|
style,
|
|
17
16
|
match = "startsWith",
|
|
@@ -23,17 +22,17 @@ var Sidebar = ({
|
|
|
23
22
|
};
|
|
24
23
|
const [openGroups, setOpenGroups] = React.useState([]);
|
|
25
24
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
26
|
-
const
|
|
27
|
-
setIsOpen(
|
|
28
|
-
localStorage.setItem("isOpen", JSON.stringify(
|
|
25
|
+
const toggleSidebar = (next) => {
|
|
26
|
+
setIsOpen(next);
|
|
27
|
+
localStorage.setItem("isOpen", JSON.stringify(next));
|
|
29
28
|
};
|
|
30
29
|
React.useEffect(() => {
|
|
31
30
|
if (!activePath) return;
|
|
32
|
-
const
|
|
33
|
-
(item) => item.type === "group" && item.children.some((
|
|
34
|
-
).map((
|
|
31
|
+
const autoOpen = items.filter(
|
|
32
|
+
(item) => item.type === "group" && item.children.some((c) => isActive(c.href))
|
|
33
|
+
).map((g) => g.id);
|
|
35
34
|
setOpenGroups(
|
|
36
|
-
(prev) => Array.from(/* @__PURE__ */ new Set([...prev, ...
|
|
35
|
+
(prev) => Array.from(/* @__PURE__ */ new Set([...prev, ...autoOpen]))
|
|
37
36
|
);
|
|
38
37
|
}, [activePath, items]);
|
|
39
38
|
const toggleGroup = (id) => {
|
|
@@ -41,94 +40,108 @@ var Sidebar = ({
|
|
|
41
40
|
(prev) => prev.includes(id) ? prev.filter((v) => v !== id) : [...prev, id]
|
|
42
41
|
);
|
|
43
42
|
};
|
|
44
|
-
const rootClassName = ["sidebar", className ?? ""].filter(Boolean).join(" ");
|
|
45
43
|
return /* @__PURE__ */ jsx(
|
|
46
44
|
"aside",
|
|
47
45
|
{
|
|
48
|
-
className:
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
className: [
|
|
47
|
+
"sidebar",
|
|
48
|
+
isOpen ? "is_open" : "is_closed",
|
|
49
|
+
className ?? ""
|
|
50
|
+
].filter(Boolean).join(" "),
|
|
51
|
+
style,
|
|
51
52
|
children: isOpen ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
-
/* @__PURE__ */ jsx("div", { className: "sidebar_brand", children: /* @__PURE__ */ jsxs(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
width: 24,
|
|
76
|
-
height: 24,
|
|
77
|
-
onClick: () => handleToggleSidebar(false)
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
) }),
|
|
53
|
+
/* @__PURE__ */ jsx("div", { className: "sidebar_brand", children: /* @__PURE__ */ jsxs(Link, { href: brandHref, className: "sidebar_brand_link", children: [
|
|
54
|
+
/* @__PURE__ */ jsx("div", {}),
|
|
55
|
+
/* @__PURE__ */ jsx(
|
|
56
|
+
Image,
|
|
57
|
+
{
|
|
58
|
+
src: "/images/logo/bigtablet.png",
|
|
59
|
+
alt: "Bigtablet",
|
|
60
|
+
width: 96,
|
|
61
|
+
height: 30,
|
|
62
|
+
priority: true
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
Image,
|
|
67
|
+
{
|
|
68
|
+
src: "/images/sidebar/arrow-close.svg",
|
|
69
|
+
alt: "Close",
|
|
70
|
+
width: 24,
|
|
71
|
+
height: 24,
|
|
72
|
+
onClick: () => toggleSidebar(false)
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
] }) }),
|
|
83
76
|
/* @__PURE__ */ jsx("nav", { className: "sidebar_nav", children: items.map((item) => {
|
|
84
77
|
if (item.type === "group") {
|
|
85
|
-
const
|
|
78
|
+
const open = openGroups.includes(item.id);
|
|
86
79
|
return /* @__PURE__ */ jsxs("div", { className: "sidebar_group", children: [
|
|
87
80
|
/* @__PURE__ */ jsxs(
|
|
88
81
|
"button",
|
|
89
82
|
{
|
|
90
83
|
type: "button",
|
|
91
|
-
className:
|
|
92
|
-
"sidebar_item",
|
|
93
|
-
isOpen2 && "is_open"
|
|
94
|
-
].filter(Boolean).join(" "),
|
|
84
|
+
className: "sidebar_item",
|
|
95
85
|
onClick: () => toggleGroup(item.id),
|
|
96
86
|
children: [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
/* @__PURE__ */ jsxs("div", { className: "sidebar_item_left", children: [
|
|
88
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "sidebar_icon", children: /* @__PURE__ */ jsx(item.icon, { size: 16 }) }),
|
|
89
|
+
/* @__PURE__ */ jsx("span", { className: "sidebar_label", children: item.label })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ jsx("span", { className: "sidebar_item_right", children: /* @__PURE__ */ jsx(
|
|
92
|
+
ChevronDown,
|
|
101
93
|
{
|
|
94
|
+
size: 16,
|
|
102
95
|
className: [
|
|
103
96
|
"sidebar_chevron",
|
|
104
|
-
|
|
105
|
-
].filter(Boolean).join(" ")
|
|
106
|
-
children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 })
|
|
97
|
+
open && "is_open"
|
|
98
|
+
].filter(Boolean).join(" ")
|
|
107
99
|
}
|
|
108
|
-
)
|
|
100
|
+
) })
|
|
109
101
|
]
|
|
110
102
|
}
|
|
111
103
|
),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
104
|
+
/* @__PURE__ */ jsx(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
className: [
|
|
108
|
+
"sidebar_sub",
|
|
109
|
+
open && "is_open"
|
|
110
|
+
].filter(Boolean).join(" "),
|
|
111
|
+
children: item.children.map((child) => {
|
|
112
|
+
const active2 = isActive(
|
|
113
|
+
child.href
|
|
114
|
+
);
|
|
115
|
+
return /* @__PURE__ */ jsxs(
|
|
116
|
+
Link,
|
|
117
|
+
{
|
|
118
|
+
href: child.href,
|
|
119
|
+
className: [
|
|
120
|
+
"sidebar_sub_item",
|
|
121
|
+
active2 && "is_active"
|
|
122
|
+
].filter(Boolean).join(" "),
|
|
123
|
+
onClick: () => onItemSelect?.(
|
|
124
|
+
child.href
|
|
125
|
+
),
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ jsx("span", { className: "sidebar_sub_icon", children: /* @__PURE__ */ jsx(
|
|
128
|
+
CornerDownRight,
|
|
129
|
+
{
|
|
130
|
+
size: 14
|
|
131
|
+
}
|
|
132
|
+
) }),
|
|
133
|
+
/* @__PURE__ */ jsx("span", { className: "sidebar_sub_label", children: child.label })
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
child.href
|
|
137
|
+
);
|
|
138
|
+
})
|
|
139
|
+
}
|
|
140
|
+
)
|
|
128
141
|
] }, item.id);
|
|
129
142
|
}
|
|
130
143
|
const active = isActive(item.href);
|
|
131
|
-
return /* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ jsx(
|
|
132
145
|
Link,
|
|
133
146
|
{
|
|
134
147
|
href: item.href,
|
|
@@ -137,33 +150,24 @@ var Sidebar = ({
|
|
|
137
150
|
active && "is_active"
|
|
138
151
|
].filter(Boolean).join(" "),
|
|
139
152
|
onClick: () => onItemSelect?.(item.href),
|
|
140
|
-
children: [
|
|
153
|
+
children: /* @__PURE__ */ jsxs("div", { className: "sidebar_item_left", children: [
|
|
141
154
|
item.icon && /* @__PURE__ */ jsx("span", { className: "sidebar_icon", children: /* @__PURE__ */ jsx(item.icon, { size: 16 }) }),
|
|
142
|
-
/* @__PURE__ */ jsx(
|
|
143
|
-
|
|
144
|
-
{
|
|
145
|
-
className: [
|
|
146
|
-
"sidebar_label",
|
|
147
|
-
active && "is_active"
|
|
148
|
-
].filter(Boolean).join(" "),
|
|
149
|
-
children: item.label
|
|
150
|
-
}
|
|
151
|
-
)
|
|
152
|
-
]
|
|
155
|
+
/* @__PURE__ */ jsx("span", { className: "sidebar_label", children: item.label })
|
|
156
|
+
] })
|
|
153
157
|
},
|
|
154
158
|
item.href
|
|
155
159
|
);
|
|
156
160
|
}) })
|
|
157
|
-
] }) : /* @__PURE__ */ jsx(
|
|
161
|
+
] }) : /* @__PURE__ */ jsx(
|
|
158
162
|
Image,
|
|
159
163
|
{
|
|
160
164
|
src: "/images/sidebar/menu.svg",
|
|
161
|
-
alt: "
|
|
165
|
+
alt: "Open",
|
|
162
166
|
width: 24,
|
|
163
167
|
height: 24,
|
|
164
|
-
onClick: () =>
|
|
168
|
+
onClick: () => toggleSidebar(true)
|
|
165
169
|
}
|
|
166
|
-
)
|
|
170
|
+
)
|
|
167
171
|
}
|
|
168
172
|
);
|
|
169
173
|
};
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
$transition_fast: 0.1s ease-out;
|
|
2
|
-
$transition_base: 0.2s ease-out;
|
|
3
|
-
$transition_slow: 0.3s ease-out;
|
|
4
|
-
|
|
1
|
+
$transition_fast: 0.1s ease-in-out; // hover, icon
|
|
2
|
+
$transition_base: 0.2s ease-in-out; // 메뉴 열림
|
|
3
|
+
$transition_slow: 0.3s ease-in-out; // 레이아웃 변화
|
|
4
|
+
|
|
5
|
+
$transition_emphasized: 0.25s cubic-bezier(0.4, 0, 0.2, 1); // Material 계열
|
|
6
|
+
$transition_bounce: 0.3s cubic-bezier(0.16, 1, 0.3, 1); // accordion, toast
|
|
7
|
+
|
|
8
|
+
$transition_fade: 0.15s ease-in-out; // opacity
|
|
9
|
+
$transition_slide: 0.25s ease-in-out; // translate
|
|
10
|
+
$transition_scale: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
11
|
+
|
|
12
|
+
$transition_state: 0.18s ease-in-out; // disabled → enabled
|
package/package.json
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
$transition_fast: 0.1s ease-out;
|
|
2
|
-
$transition_base: 0.2s ease-out;
|
|
3
|
-
$transition_slow: 0.3s ease-out;
|
|
4
|
-
|
|
1
|
+
$transition_fast: 0.1s ease-in-out; // hover, icon
|
|
2
|
+
$transition_base: 0.2s ease-in-out; // 메뉴 열림
|
|
3
|
+
$transition_slow: 0.3s ease-in-out; // 레이아웃 변화
|
|
4
|
+
|
|
5
|
+
$transition_emphasized: 0.25s cubic-bezier(0.4, 0, 0.2, 1); // Material 계열
|
|
6
|
+
$transition_bounce: 0.3s cubic-bezier(0.16, 1, 0.3, 1); // accordion, toast
|
|
7
|
+
|
|
8
|
+
$transition_fade: 0.15s ease-in-out; // opacity
|
|
9
|
+
$transition_slide: 0.25s ease-in-out; // translate
|
|
10
|
+
$transition_scale: 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
11
|
+
|
|
12
|
+
$transition_state: 0.18s ease-in-out; // disabled → enabled
|