@jk-core/components 1.1.10 → 1.1.11
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 +73 -73
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +99 -99
- package/src/Calendar/Calendar.module.scss +213 -213
- package/src/Calendar/RangeCalendar.tsx +125 -125
- package/src/Calendar/ScrollCalendar.module.scss +214 -214
- package/src/Calendar/ScrollCalendar.tsx +124 -124
- package/src/Calendar/SingleCalendar.tsx +121 -121
- package/src/Calendar/components/DateLabel/DateLabel.module.scss +89 -89
- package/src/Calendar/components/DateLabel/index.tsx +91 -91
- package/src/Calendar/components/DayTile/DayTile.module.scss +117 -117
- package/src/Calendar/components/DayTile/index.tsx +108 -108
- package/src/Calendar/components/MonthTile/MonthTile.module.scss +59 -59
- package/src/Calendar/components/MonthTile/index.tsx +50 -50
- package/src/Calendar/components/ViewSelector/ViewSelector.module.scss +48 -48
- package/src/Calendar/components/ViewSelector/index.tsx +49 -49
- package/src/Calendar/components/YearTile/YearTile.module.scss +85 -85
- package/src/Calendar/components/YearTile/index.tsx +65 -65
- package/src/Calendar/hooks/useCalendarNav.ts +83 -83
- package/src/Calendar/hooks/useDateSelect.ts +54 -54
- package/src/Calendar/index.scss +189 -189
- package/src/Calendar/index.tsx +66 -66
- package/src/Calendar/type.ts +3 -3
- package/src/Calendar/utils/getWeeksInMonth.ts +45 -45
- package/src/Calendar/utils/isInRange.ts +8 -8
- package/src/Calendar/utils/isSameDay.ts +21 -21
- package/src/assets/arrow.svg +11 -11
- package/src/assets/close.svg +15 -15
- package/src/assets/drop-arrow.svg +3 -3
- package/src/common/Accordion/Accordion.module.scss +53 -53
- package/src/common/Accordion/arrow-down.svg +3 -3
- package/src/common/Accordion/arrow-up.svg +3 -3
- package/src/common/Accordion/index.tsx +54 -54
- package/src/common/Breadcrumbs/Breadcrumbs.module.scss +46 -46
- package/src/common/Breadcrumbs/home.svg +5 -5
- package/src/common/Breadcrumbs/index.tsx +82 -82
- package/src/common/Button/Button.module.scss +127 -127
- package/src/common/Button/index.tsx +60 -60
- package/src/common/Card/Card.module.scss +28 -28
- package/src/common/Card/index.tsx +19 -19
- package/src/common/Divider/Divider.module.scss +101 -101
- package/src/common/Divider/index.tsx +24 -24
- package/src/common/DropDown/DropDown.module.scss +135 -135
- package/src/common/DropDown/List.tsx +156 -156
- package/src/common/DropDown/arrow-down.svg +3 -3
- package/src/common/DropDown/index.tsx +103 -103
- package/src/common/DropDown/search.svg +4 -4
- package/src/common/Pagination/Pagination.module.scss +210 -210
- package/src/common/Pagination/arrow-left.svg +11 -11
- package/src/common/Pagination/arrow-right.svg +11 -11
- package/src/common/Pagination/index.tsx +156 -156
- package/src/common/SegmentButton/SegmentButton.module.scss +45 -45
- package/src/common/SegmentButton/index.tsx +79 -79
- package/src/common/Skeleton/Skeleton.module.scss +80 -80
- package/src/common/Skeleton/index.tsx +47 -47
- package/src/common/SwitchButton/SwitchButton.module.scss +65 -65
- package/src/common/SwitchButton/index.tsx +56 -56
- package/src/common/Table/Table.module.scss +70 -70
- package/src/common/Table/index.tsx +128 -128
- package/src/index.scss +1 -1
- package/src/index.tsx +21 -21
- package/src/styles/color.scss +346 -94
- package/src/styles/font-face.scss +18 -18
- package/src/styles/font.scss +49 -49
- package/src/styles/mediaQuery.scss +22 -22
- package/src/styles/scrollbar.scss +71 -71
- package/src/svg.d.ts +6 -6
- package/src/utils/styles/mediaQuery.scss +22 -22
- package/src/utils/ts/allowDecimal.ts +4 -4
- package/src/utils/ts/autoHypen.ts +33 -33
- package/src/utils/ts/calculateMax.ts +24 -24
- package/src/utils/ts/checkIsMobilePlatform.ts +15 -15
- package/src/utils/ts/formatFileSize.ts +16 -16
- package/src/utils/ts/formatMoney.ts +16 -16
- package/src/utils/ts/gradientRatio.ts +61 -61
- package/src/utils/ts/kiloToMega.ts +30 -30
- package/src/utils/ts/maskingPhone.ts +8 -8
- package/src/utils/ts/toQueryString.ts +7 -7
- package/src/utils/ts/valueAsNumber.ts +15 -15
- package/src/vite-env.d.ts +2 -2
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
$color: #eeeeee;
|
|
2
|
-
$shadow: #e5e5e5;
|
|
3
|
-
|
|
4
|
-
@keyframes skeleton-blink {
|
|
5
|
-
0% {
|
|
6
|
-
left: -100%;
|
|
7
|
-
}
|
|
8
|
-
99.9% {
|
|
9
|
-
left: 100%;
|
|
10
|
-
}
|
|
11
|
-
100% {
|
|
12
|
-
left: -100%;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@keyframes skeleton-glow {
|
|
17
|
-
0% {
|
|
18
|
-
background-color: $color;
|
|
19
|
-
}
|
|
20
|
-
50% {
|
|
21
|
-
background-color: $shadow;
|
|
22
|
-
}
|
|
23
|
-
100% {
|
|
24
|
-
background-color: $color;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.skeleton-circle {
|
|
29
|
-
width: 100%;
|
|
30
|
-
height: 100%;
|
|
31
|
-
position: relative;
|
|
32
|
-
background-color: $color;
|
|
33
|
-
border-radius: 100%;
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
flex-shrink: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.skeleton-round {
|
|
39
|
-
width: 100%;
|
|
40
|
-
height: 100%;
|
|
41
|
-
position: relative;
|
|
42
|
-
background-color: $color;
|
|
43
|
-
border-radius: 10px;
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
flex-shrink: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.skeleton-rectangle {
|
|
49
|
-
width: 100%;
|
|
50
|
-
height: 100%;
|
|
51
|
-
position: relative;
|
|
52
|
-
background-color: $color;
|
|
53
|
-
flex-shrink: 0;
|
|
54
|
-
overflow: hidden;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.skeleton--glow {
|
|
58
|
-
&::before {
|
|
59
|
-
content: "";
|
|
60
|
-
position: absolute;
|
|
61
|
-
top: 0;
|
|
62
|
-
width: 100%;
|
|
63
|
-
height: 100%;
|
|
64
|
-
left: 0;
|
|
65
|
-
animation: skeleton-glow 2s infinite;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.skeleton--blink {
|
|
70
|
-
&::before {
|
|
71
|
-
content: "";
|
|
72
|
-
position: absolute;
|
|
73
|
-
top: 0;
|
|
74
|
-
left: -100%;
|
|
75
|
-
width: 100%;
|
|
76
|
-
height: 100%;
|
|
77
|
-
background: linear-gradient(to right, transparent, $shadow, transparent);
|
|
78
|
-
animation: skeleton-blink 3s infinite;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
1
|
+
$color: #eeeeee;
|
|
2
|
+
$shadow: #e5e5e5;
|
|
3
|
+
|
|
4
|
+
@keyframes skeleton-blink {
|
|
5
|
+
0% {
|
|
6
|
+
left: -100%;
|
|
7
|
+
}
|
|
8
|
+
99.9% {
|
|
9
|
+
left: 100%;
|
|
10
|
+
}
|
|
11
|
+
100% {
|
|
12
|
+
left: -100%;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@keyframes skeleton-glow {
|
|
17
|
+
0% {
|
|
18
|
+
background-color: $color;
|
|
19
|
+
}
|
|
20
|
+
50% {
|
|
21
|
+
background-color: $shadow;
|
|
22
|
+
}
|
|
23
|
+
100% {
|
|
24
|
+
background-color: $color;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.skeleton-circle {
|
|
29
|
+
width: 100%;
|
|
30
|
+
height: 100%;
|
|
31
|
+
position: relative;
|
|
32
|
+
background-color: $color;
|
|
33
|
+
border-radius: 100%;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
flex-shrink: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.skeleton-round {
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
position: relative;
|
|
42
|
+
background-color: $color;
|
|
43
|
+
border-radius: 10px;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.skeleton-rectangle {
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
position: relative;
|
|
52
|
+
background-color: $color;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.skeleton--glow {
|
|
58
|
+
&::before {
|
|
59
|
+
content: "";
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 0;
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
left: 0;
|
|
65
|
+
animation: skeleton-glow 2s infinite;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.skeleton--blink {
|
|
70
|
+
&::before {
|
|
71
|
+
content: "";
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 0;
|
|
74
|
+
left: -100%;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
background: linear-gradient(to right, transparent, $shadow, transparent);
|
|
78
|
+
animation: skeleton-blink 3s infinite;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import styles from './Skeleton.module.scss';
|
|
2
|
-
|
|
3
|
-
interface SkeletonProps {
|
|
4
|
-
/**
|
|
5
|
-
* 스켈레톤의 모양을 지정합니다. 'circle', 'rectangle', 'round' 중 하나를 선택할 수 있습니다.
|
|
6
|
-
* 기본값은 'rectangle'입니다.
|
|
7
|
-
*/
|
|
8
|
-
shape?: 'circle' | 'rectangle' | 'round';
|
|
9
|
-
/**
|
|
10
|
-
* 스켈레톤의 너비를 지정합니다. 기본값은 '100%'입니다.
|
|
11
|
-
* 'auto'로 설정하면 콘텐츠에 맞게 자동으로 조정됩니다.
|
|
12
|
-
*/
|
|
13
|
-
width?: string | number;
|
|
14
|
-
/**
|
|
15
|
-
* 스켈레톤의 높이를 지정합니다. 기본값은 '20px'입니다.
|
|
16
|
-
* 'auto'로 설정하면 콘텐츠에 맞게 자동으로 조정됩니다.
|
|
17
|
-
*/
|
|
18
|
-
height?: string | number;
|
|
19
|
-
/**
|
|
20
|
-
* 스켈레톤 애니메이션 효과를 지정합니다. 'glow' 또는 'blink' 중 하나를 선택할 수 있습니다.
|
|
21
|
-
* 기본값은 'glow'입니다.
|
|
22
|
-
*/
|
|
23
|
-
animation?: 'glow' | 'blink';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 스켈레톤 컴포넌트는 로딩 상태를 나타내기 위해 사용됩니다.
|
|
28
|
-
* 다양한 모양과 크기를 지원하며, 애니메이션 효과를 적용할 수 있습니다.
|
|
29
|
-
*/
|
|
30
|
-
export default function Skeleton({ shape, width, height, animation = 'glow' }: SkeletonProps) {
|
|
31
|
-
const animationClass = animation === 'glow' ? styles['skeleton--glow'] : styles['skeleton--blink'];
|
|
32
|
-
|
|
33
|
-
if (shape === 'circle') {
|
|
34
|
-
return (
|
|
35
|
-
<div className={`${styles['skeleton-circle']} ${animationClass}`} style={{ width, height }} />
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (shape === 'round') {
|
|
40
|
-
return (
|
|
41
|
-
<div className={`${styles['skeleton-round']} ${animationClass}`} style={{ width, height }} />
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<div className={`${styles['skeleton-rectangle']} ${animationClass}`} style={{ width, height }} />
|
|
47
|
-
);
|
|
1
|
+
import styles from './Skeleton.module.scss';
|
|
2
|
+
|
|
3
|
+
interface SkeletonProps {
|
|
4
|
+
/**
|
|
5
|
+
* 스켈레톤의 모양을 지정합니다. 'circle', 'rectangle', 'round' 중 하나를 선택할 수 있습니다.
|
|
6
|
+
* 기본값은 'rectangle'입니다.
|
|
7
|
+
*/
|
|
8
|
+
shape?: 'circle' | 'rectangle' | 'round';
|
|
9
|
+
/**
|
|
10
|
+
* 스켈레톤의 너비를 지정합니다. 기본값은 '100%'입니다.
|
|
11
|
+
* 'auto'로 설정하면 콘텐츠에 맞게 자동으로 조정됩니다.
|
|
12
|
+
*/
|
|
13
|
+
width?: string | number;
|
|
14
|
+
/**
|
|
15
|
+
* 스켈레톤의 높이를 지정합니다. 기본값은 '20px'입니다.
|
|
16
|
+
* 'auto'로 설정하면 콘텐츠에 맞게 자동으로 조정됩니다.
|
|
17
|
+
*/
|
|
18
|
+
height?: string | number;
|
|
19
|
+
/**
|
|
20
|
+
* 스켈레톤 애니메이션 효과를 지정합니다. 'glow' 또는 'blink' 중 하나를 선택할 수 있습니다.
|
|
21
|
+
* 기본값은 'glow'입니다.
|
|
22
|
+
*/
|
|
23
|
+
animation?: 'glow' | 'blink';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 스켈레톤 컴포넌트는 로딩 상태를 나타내기 위해 사용됩니다.
|
|
28
|
+
* 다양한 모양과 크기를 지원하며, 애니메이션 효과를 적용할 수 있습니다.
|
|
29
|
+
*/
|
|
30
|
+
export default function Skeleton({ shape, width, height, animation = 'glow' }: SkeletonProps) {
|
|
31
|
+
const animationClass = animation === 'glow' ? styles['skeleton--glow'] : styles['skeleton--blink'];
|
|
32
|
+
|
|
33
|
+
if (shape === 'circle') {
|
|
34
|
+
return (
|
|
35
|
+
<div className={`${styles['skeleton-circle']} ${animationClass}`} style={{ width, height }} />
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (shape === 'round') {
|
|
40
|
+
return (
|
|
41
|
+
<div className={`${styles['skeleton-round']} ${animationClass}`} style={{ width, height }} />
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div className={`${styles['skeleton-rectangle']} ${animationClass}`} style={{ width, height }} />
|
|
47
|
+
);
|
|
48
48
|
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
$main: #246beb;
|
|
2
|
-
$main-shadow: #113475;
|
|
3
|
-
$background: #eeeeee;
|
|
4
|
-
$shadow: #bcbcbc;
|
|
5
|
-
|
|
6
|
-
.button {
|
|
7
|
-
display: flex;
|
|
8
|
-
align-items: center;
|
|
9
|
-
height: 20px;
|
|
10
|
-
border: none;
|
|
11
|
-
background-color: transparent;
|
|
12
|
-
margin: 0 5px;
|
|
13
|
-
cursor: pointer;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.switch {
|
|
17
|
-
position: relative;
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
width: 50px;
|
|
21
|
-
height: 25px;
|
|
22
|
-
border-radius: 100px;
|
|
23
|
-
background-color: $background;
|
|
24
|
-
box-shadow: inset 0 0 3px 1px $shadow;
|
|
25
|
-
transition: background-color 0.2s;
|
|
26
|
-
|
|
27
|
-
&__off {
|
|
28
|
-
background-color: $main;
|
|
29
|
-
border-color: $main;
|
|
30
|
-
box-shadow: inset 0 0 3px 1px $main-shadow;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
&__button {
|
|
34
|
-
position: absolute;
|
|
35
|
-
width: 25px;
|
|
36
|
-
height: 25px;
|
|
37
|
-
border-radius: 100px;
|
|
38
|
-
transition: 0.2s;
|
|
39
|
-
padding: 2px;
|
|
40
|
-
overflow: hidden;
|
|
41
|
-
|
|
42
|
-
&--circle {
|
|
43
|
-
width: 100%;
|
|
44
|
-
height: 100%;
|
|
45
|
-
background-color: #ffffff;
|
|
46
|
-
border-radius: 100%;
|
|
47
|
-
box-shadow: 0 0 5px 1px $shadow;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&--circle-on {
|
|
51
|
-
box-shadow: none;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
&--off {
|
|
55
|
-
left: 0px;
|
|
56
|
-
transition: 0.2s;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&--on {
|
|
60
|
-
left: 25px;
|
|
61
|
-
transition: 0.2s;
|
|
62
|
-
border-color: $main;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
$main: #246beb;
|
|
2
|
+
$main-shadow: #113475;
|
|
3
|
+
$background: #eeeeee;
|
|
4
|
+
$shadow: #bcbcbc;
|
|
5
|
+
|
|
6
|
+
.button {
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
height: 20px;
|
|
10
|
+
border: none;
|
|
11
|
+
background-color: transparent;
|
|
12
|
+
margin: 0 5px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.switch {
|
|
17
|
+
position: relative;
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
width: 50px;
|
|
21
|
+
height: 25px;
|
|
22
|
+
border-radius: 100px;
|
|
23
|
+
background-color: $background;
|
|
24
|
+
box-shadow: inset 0 0 3px 1px $shadow;
|
|
25
|
+
transition: background-color 0.2s;
|
|
26
|
+
|
|
27
|
+
&__off {
|
|
28
|
+
background-color: $main;
|
|
29
|
+
border-color: $main;
|
|
30
|
+
box-shadow: inset 0 0 3px 1px $main-shadow;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__button {
|
|
34
|
+
position: absolute;
|
|
35
|
+
width: 25px;
|
|
36
|
+
height: 25px;
|
|
37
|
+
border-radius: 100px;
|
|
38
|
+
transition: 0.2s;
|
|
39
|
+
padding: 2px;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
|
|
42
|
+
&--circle {
|
|
43
|
+
width: 100%;
|
|
44
|
+
height: 100%;
|
|
45
|
+
background-color: #ffffff;
|
|
46
|
+
border-radius: 100%;
|
|
47
|
+
box-shadow: 0 0 5px 1px $shadow;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&--circle-on {
|
|
51
|
+
box-shadow: none;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&--off {
|
|
55
|
+
left: 0px;
|
|
56
|
+
transition: 0.2s;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--on {
|
|
60
|
+
left: 25px;
|
|
61
|
+
transition: 0.2s;
|
|
62
|
+
border-color: $main;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { cn } from '@jk-core/utils';
|
|
3
|
-
import styles from './SwitchButton.module.scss';
|
|
4
|
-
|
|
5
|
-
interface SwitchButtonProps {
|
|
6
|
-
/**
|
|
7
|
-
* 스위치 버튼의 상태를 나타냅니다.
|
|
8
|
-
* true이면 스위치가 켜진 상태, false이면 꺼진 상태입니다.
|
|
9
|
-
* 기본값은 false로 설정되어 있습니다.
|
|
10
|
-
*/
|
|
11
|
-
checked?: boolean,
|
|
12
|
-
/**
|
|
13
|
-
* 스위치 버튼의 상태가 변경될 때 호출되는 함수입니다.
|
|
14
|
-
*/
|
|
15
|
-
onChange?: (value: boolean) => void
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* SwitchButton 컴포넌트
|
|
20
|
-
* 스위치 버튼을 표시하며, 클릭 시 상태가 변경됩니다.
|
|
21
|
-
* checked 속성으로 초기 상태를 설정할 수 있으며, onChange 함수를 통해 상태 변경을 처리할 수 있습니다.
|
|
22
|
-
*/
|
|
23
|
-
export default function SwitchButton({ checked = false, onChange = () => { } }: SwitchButtonProps) {
|
|
24
|
-
const [isChecked, setIsChecked] = useState(checked);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<button
|
|
28
|
-
className={styles.button}
|
|
29
|
-
type="button"
|
|
30
|
-
onClick={() => {
|
|
31
|
-
setIsChecked(!isChecked);
|
|
32
|
-
onChange(!isChecked);
|
|
33
|
-
}}
|
|
34
|
-
>
|
|
35
|
-
<div
|
|
36
|
-
className={cn({
|
|
37
|
-
[styles.switch]: true,
|
|
38
|
-
[styles.switch__off]: checked,
|
|
39
|
-
})}
|
|
40
|
-
>
|
|
41
|
-
<div className={cn({
|
|
42
|
-
[styles.switch__button]: true,
|
|
43
|
-
[styles['switch__button--off']]: !checked,
|
|
44
|
-
[styles['switch__button--on']]: checked,
|
|
45
|
-
})}
|
|
46
|
-
>
|
|
47
|
-
<div className={cn({
|
|
48
|
-
[styles['switch__button--circle']]: true,
|
|
49
|
-
[styles['switch__button--circle-on']]: checked,
|
|
50
|
-
})}
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</button>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { cn } from '@jk-core/utils';
|
|
3
|
+
import styles from './SwitchButton.module.scss';
|
|
4
|
+
|
|
5
|
+
interface SwitchButtonProps {
|
|
6
|
+
/**
|
|
7
|
+
* 스위치 버튼의 상태를 나타냅니다.
|
|
8
|
+
* true이면 스위치가 켜진 상태, false이면 꺼진 상태입니다.
|
|
9
|
+
* 기본값은 false로 설정되어 있습니다.
|
|
10
|
+
*/
|
|
11
|
+
checked?: boolean,
|
|
12
|
+
/**
|
|
13
|
+
* 스위치 버튼의 상태가 변경될 때 호출되는 함수입니다.
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (value: boolean) => void
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* SwitchButton 컴포넌트
|
|
20
|
+
* 스위치 버튼을 표시하며, 클릭 시 상태가 변경됩니다.
|
|
21
|
+
* checked 속성으로 초기 상태를 설정할 수 있으며, onChange 함수를 통해 상태 변경을 처리할 수 있습니다.
|
|
22
|
+
*/
|
|
23
|
+
export default function SwitchButton({ checked = false, onChange = () => { } }: SwitchButtonProps) {
|
|
24
|
+
const [isChecked, setIsChecked] = useState(checked);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<button
|
|
28
|
+
className={styles.button}
|
|
29
|
+
type="button"
|
|
30
|
+
onClick={() => {
|
|
31
|
+
setIsChecked(!isChecked);
|
|
32
|
+
onChange(!isChecked);
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<div
|
|
36
|
+
className={cn({
|
|
37
|
+
[styles.switch]: true,
|
|
38
|
+
[styles.switch__off]: checked,
|
|
39
|
+
})}
|
|
40
|
+
>
|
|
41
|
+
<div className={cn({
|
|
42
|
+
[styles.switch__button]: true,
|
|
43
|
+
[styles['switch__button--off']]: !checked,
|
|
44
|
+
[styles['switch__button--on']]: checked,
|
|
45
|
+
})}
|
|
46
|
+
>
|
|
47
|
+
<div className={cn({
|
|
48
|
+
[styles['switch__button--circle']]: true,
|
|
49
|
+
[styles['switch__button--circle-on']]: checked,
|
|
50
|
+
})}
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</button>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
.wrapper {
|
|
2
|
-
width: 100%;
|
|
3
|
-
max-height: 60dvh;
|
|
4
|
-
overflow: auto;
|
|
5
|
-
|
|
6
|
-
&__rounded {
|
|
7
|
-
border-radius: 10px;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
&__border {
|
|
11
|
-
border: 1px solid var(--G-30);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.table {
|
|
16
|
-
width: 100%;
|
|
17
|
-
border-collapse: separate;
|
|
18
|
-
border-spacing: 0;
|
|
19
|
-
table-layout: fixed; // 이 줄을 추가하세요!
|
|
20
|
-
|
|
21
|
-
thead {
|
|
22
|
-
position: sticky;
|
|
23
|
-
top: 0;
|
|
24
|
-
z-index: 1;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
tbody > tr > td:last-child {
|
|
28
|
-
border-right: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
th {
|
|
32
|
-
flex-shrink: 0;
|
|
33
|
-
background-color: var(--G-5);
|
|
34
|
-
padding: 10px;
|
|
35
|
-
font-size: 1em;
|
|
36
|
-
font-weight: 600;
|
|
37
|
-
color: var(--G-80);
|
|
38
|
-
border-right: 1px solid var(--G-30);
|
|
39
|
-
border-bottom: 1px solid var(--G-30);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
tr {
|
|
43
|
-
min-width: 100%;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
tbody > tr > th {
|
|
47
|
-
position: sticky;
|
|
48
|
-
left: 0;
|
|
49
|
-
white-space: pre-wrap;
|
|
50
|
-
max-width: 200px;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
td {
|
|
54
|
-
padding: 10px;
|
|
55
|
-
background-color: var(--white);
|
|
56
|
-
word-break: break-all;
|
|
57
|
-
color: var(--G-80);
|
|
58
|
-
font-weight: 400;
|
|
59
|
-
border-bottom: 1px solid var(--G-30);
|
|
60
|
-
border-right: 1px solid var(--G-30);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.fixed {
|
|
65
|
-
position: sticky;
|
|
66
|
-
left: 0;
|
|
67
|
-
top: 0;
|
|
68
|
-
background-color: var(--G-5);
|
|
69
|
-
z-index: 1;
|
|
70
|
-
}
|
|
1
|
+
.wrapper {
|
|
2
|
+
width: 100%;
|
|
3
|
+
max-height: 60dvh;
|
|
4
|
+
overflow: auto;
|
|
5
|
+
|
|
6
|
+
&__rounded {
|
|
7
|
+
border-radius: 10px;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&__border {
|
|
11
|
+
border: 1px solid var(--G-30);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.table {
|
|
16
|
+
width: 100%;
|
|
17
|
+
border-collapse: separate;
|
|
18
|
+
border-spacing: 0;
|
|
19
|
+
table-layout: fixed; // 이 줄을 추가하세요!
|
|
20
|
+
|
|
21
|
+
thead {
|
|
22
|
+
position: sticky;
|
|
23
|
+
top: 0;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
tbody > tr > td:last-child {
|
|
28
|
+
border-right: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
th {
|
|
32
|
+
flex-shrink: 0;
|
|
33
|
+
background-color: var(--G-5);
|
|
34
|
+
padding: 10px;
|
|
35
|
+
font-size: 1em;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
color: var(--G-80);
|
|
38
|
+
border-right: 1px solid var(--G-30);
|
|
39
|
+
border-bottom: 1px solid var(--G-30);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
tr {
|
|
43
|
+
min-width: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
tbody > tr > th {
|
|
47
|
+
position: sticky;
|
|
48
|
+
left: 0;
|
|
49
|
+
white-space: pre-wrap;
|
|
50
|
+
max-width: 200px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
td {
|
|
54
|
+
padding: 10px;
|
|
55
|
+
background-color: var(--white);
|
|
56
|
+
word-break: break-all;
|
|
57
|
+
color: var(--G-80);
|
|
58
|
+
font-weight: 400;
|
|
59
|
+
border-bottom: 1px solid var(--G-30);
|
|
60
|
+
border-right: 1px solid var(--G-30);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.fixed {
|
|
65
|
+
position: sticky;
|
|
66
|
+
left: 0;
|
|
67
|
+
top: 0;
|
|
68
|
+
background-color: var(--G-5);
|
|
69
|
+
z-index: 1;
|
|
70
|
+
}
|