@jk-core/components 1.1.15 → 1.1.17

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.
Files changed (84) hide show
  1. package/README.md +73 -73
  2. package/dist/index.js +2 -2
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.umd.cjs +1 -1
  5. package/dist/index.umd.cjs.map +1 -1
  6. package/dist/src/Calendar/index.d.ts +1 -1
  7. package/package.json +99 -99
  8. package/src/Calendar/Calendar.module.scss +213 -213
  9. package/src/Calendar/RangeCalendar.tsx +125 -125
  10. package/src/Calendar/ScrollCalendar.module.scss +214 -214
  11. package/src/Calendar/ScrollCalendar.tsx +124 -124
  12. package/src/Calendar/SingleCalendar.tsx +121 -121
  13. package/src/Calendar/components/DateLabel/DateLabel.module.scss +89 -89
  14. package/src/Calendar/components/DateLabel/index.tsx +91 -91
  15. package/src/Calendar/components/DayTile/DayTile.module.scss +117 -117
  16. package/src/Calendar/components/DayTile/index.tsx +108 -108
  17. package/src/Calendar/components/MonthTile/MonthTile.module.scss +59 -59
  18. package/src/Calendar/components/MonthTile/index.tsx +50 -50
  19. package/src/Calendar/components/ViewSelector/ViewSelector.module.scss +48 -48
  20. package/src/Calendar/components/ViewSelector/index.tsx +49 -49
  21. package/src/Calendar/components/YearTile/YearTile.module.scss +85 -85
  22. package/src/Calendar/components/YearTile/index.tsx +65 -65
  23. package/src/Calendar/hooks/useCalendarNav.ts +83 -83
  24. package/src/Calendar/hooks/useDateSelect.ts +54 -54
  25. package/src/Calendar/index.scss +189 -189
  26. package/src/Calendar/index.tsx +66 -66
  27. package/src/Calendar/type.ts +3 -3
  28. package/src/Calendar/utils/getWeeksInMonth.ts +45 -45
  29. package/src/Calendar/utils/isInRange.ts +8 -8
  30. package/src/Calendar/utils/isSameDay.ts +21 -21
  31. package/src/assets/arrow.svg +11 -11
  32. package/src/assets/close.svg +15 -15
  33. package/src/assets/drop-arrow.svg +3 -3
  34. package/src/common/Accordion/Accordion.module.scss +53 -53
  35. package/src/common/Accordion/arrow-down.svg +3 -3
  36. package/src/common/Accordion/arrow-up.svg +3 -3
  37. package/src/common/Accordion/index.tsx +54 -54
  38. package/src/common/Breadcrumbs/Breadcrumbs.module.scss +46 -46
  39. package/src/common/Breadcrumbs/home.svg +5 -5
  40. package/src/common/Breadcrumbs/index.tsx +82 -82
  41. package/src/common/Button/Button.module.scss +127 -127
  42. package/src/common/Button/index.tsx +60 -60
  43. package/src/common/Card/Card.module.scss +28 -28
  44. package/src/common/Card/index.tsx +19 -19
  45. package/src/common/Divider/Divider.module.scss +101 -101
  46. package/src/common/Divider/index.tsx +24 -24
  47. package/src/common/DropDown/DropDown.module.scss +135 -135
  48. package/src/common/DropDown/List.tsx +156 -156
  49. package/src/common/DropDown/arrow-down.svg +3 -3
  50. package/src/common/DropDown/index.tsx +108 -108
  51. package/src/common/DropDown/search.svg +4 -4
  52. package/src/common/Pagination/Pagination.module.scss +210 -210
  53. package/src/common/Pagination/arrow-left.svg +11 -11
  54. package/src/common/Pagination/arrow-right.svg +11 -11
  55. package/src/common/Pagination/index.tsx +156 -156
  56. package/src/common/SegmentButton/SegmentButton.module.scss +45 -45
  57. package/src/common/SegmentButton/index.tsx +79 -79
  58. package/src/common/Skeleton/Skeleton.module.scss +80 -80
  59. package/src/common/Skeleton/index.tsx +47 -47
  60. package/src/common/SwitchButton/SwitchButton.module.scss +65 -65
  61. package/src/common/SwitchButton/index.tsx +57 -56
  62. package/src/common/Table/Table.module.scss +70 -70
  63. package/src/common/Table/index.tsx +128 -128
  64. package/src/index.scss +1 -1
  65. package/src/index.tsx +21 -21
  66. package/src/styles/color.scss +346 -346
  67. package/src/styles/font-face.scss +18 -18
  68. package/src/styles/font.scss +49 -49
  69. package/src/styles/mediaQuery.scss +22 -22
  70. package/src/styles/scrollbar.scss +71 -71
  71. package/src/svg.d.ts +6 -6
  72. package/src/utils/styles/mediaQuery.scss +22 -22
  73. package/src/utils/ts/allowDecimal.ts +4 -4
  74. package/src/utils/ts/autoHypen.ts +33 -33
  75. package/src/utils/ts/calculateMax.ts +24 -24
  76. package/src/utils/ts/checkIsMobilePlatform.ts +15 -15
  77. package/src/utils/ts/formatFileSize.ts +16 -16
  78. package/src/utils/ts/formatMoney.ts +16 -16
  79. package/src/utils/ts/gradientRatio.ts +61 -61
  80. package/src/utils/ts/kiloToMega.ts +30 -30
  81. package/src/utils/ts/maskingPhone.ts +8 -8
  82. package/src/utils/ts/toQueryString.ts +7 -7
  83. package/src/utils/ts/valueAsNumber.ts +15 -15
  84. package/src/vite-env.d.ts +2 -2
@@ -1,127 +1,127 @@
1
- @keyframes loading {
2
- 0%,
3
- 100% {
4
- transform: scale(1);
5
- }
6
-
7
- 50% {
8
- transform: scale(1.3);
9
- }
10
- }
11
-
12
- .loading-dot {
13
- position: absolute;
14
- top: 50%;
15
- left: 50%;
16
- transform: translate(-50%, -50%);
17
- display: flex;
18
- align-items: center;
19
- justify-content: center;
20
- gap: 5px;
21
-
22
- div {
23
- width: 6px;
24
- height: 6px;
25
- background-color: var(--white);
26
- border-radius: 100%;
27
-
28
- &:nth-child(1) {
29
- animation: loading 1s infinite;
30
- }
31
-
32
- &:nth-child(2) {
33
- animation: loading 1s 0.25s infinite;
34
- }
35
-
36
- &:nth-child(3) {
37
- animation: loading 1s 0.5s infinite;
38
- }
39
- }
40
- }
41
-
42
- .button {
43
- position: relative;
44
- border-radius: 8px;
45
- padding: 10px 24px;
46
- transition: background-color 0.1s;
47
- font-size: 1em;
48
-
49
- &__loading {
50
- color: transparent !important;
51
- user-select: none;
52
- pointer-events: none;
53
- cursor: default !important;
54
-
55
- &:hover,
56
- &:active {
57
- background-color: inherit;
58
- border-color: inherit;
59
- }
60
- }
61
-
62
- &__tertiary {
63
- border: 1px solid var(--G-40);
64
-
65
- &:hover {
66
- background-color: var(--G-5);
67
- }
68
-
69
- &:active {
70
- background-color: var(--G-10);
71
- }
72
- }
73
-
74
- &__secondary {
75
- color: var(--P-50);
76
- background-color: var(--P-5);
77
- border: 1px solid var(--P-50);
78
-
79
- &:hover {
80
- background-color: var(--P-10);
81
- }
82
-
83
- &:active {
84
- background-color: var(--P-20);
85
- }
86
- }
87
-
88
- &__primary {
89
- color: var(--white);
90
- background-color: var(--P-50);
91
-
92
- &:hover {
93
- background-color: var(--P-60);
94
- }
95
-
96
- &:active {
97
- background-color: var(--P-70);
98
- }
99
- }
100
-
101
- &__cancel {
102
- color: var(--white);
103
- background-color: var(--Point-50);
104
-
105
- &:hover {
106
- background-color: var(--Point-60);
107
- }
108
-
109
- &:active {
110
- background-color: var(--Point-70);
111
- }
112
- }
113
-
114
- &__disabled {
115
- color: var(--white);
116
- background-color: var(--G-40) !important;
117
- cursor: default;
118
-
119
- &:hover {
120
- background-color: var(--P-60);
121
- }
122
-
123
- &:active {
124
- background-color: var(--P-70);
125
- }
126
- }
127
- }
1
+ @keyframes loading {
2
+ 0%,
3
+ 100% {
4
+ transform: scale(1);
5
+ }
6
+
7
+ 50% {
8
+ transform: scale(1.3);
9
+ }
10
+ }
11
+
12
+ .loading-dot {
13
+ position: absolute;
14
+ top: 50%;
15
+ left: 50%;
16
+ transform: translate(-50%, -50%);
17
+ display: flex;
18
+ align-items: center;
19
+ justify-content: center;
20
+ gap: 5px;
21
+
22
+ div {
23
+ width: 6px;
24
+ height: 6px;
25
+ background-color: var(--white);
26
+ border-radius: 100%;
27
+
28
+ &:nth-child(1) {
29
+ animation: loading 1s infinite;
30
+ }
31
+
32
+ &:nth-child(2) {
33
+ animation: loading 1s 0.25s infinite;
34
+ }
35
+
36
+ &:nth-child(3) {
37
+ animation: loading 1s 0.5s infinite;
38
+ }
39
+ }
40
+ }
41
+
42
+ .button {
43
+ position: relative;
44
+ border-radius: 8px;
45
+ padding: 10px 24px;
46
+ transition: background-color 0.1s;
47
+ font-size: 1em;
48
+
49
+ &__loading {
50
+ color: transparent !important;
51
+ user-select: none;
52
+ pointer-events: none;
53
+ cursor: default !important;
54
+
55
+ &:hover,
56
+ &:active {
57
+ background-color: inherit;
58
+ border-color: inherit;
59
+ }
60
+ }
61
+
62
+ &__tertiary {
63
+ border: 1px solid var(--G-40);
64
+
65
+ &:hover {
66
+ background-color: var(--G-5);
67
+ }
68
+
69
+ &:active {
70
+ background-color: var(--G-10);
71
+ }
72
+ }
73
+
74
+ &__secondary {
75
+ color: var(--P-50);
76
+ background-color: var(--P-5);
77
+ border: 1px solid var(--P-50);
78
+
79
+ &:hover {
80
+ background-color: var(--P-10);
81
+ }
82
+
83
+ &:active {
84
+ background-color: var(--P-20);
85
+ }
86
+ }
87
+
88
+ &__primary {
89
+ color: var(--white);
90
+ background-color: var(--P-50);
91
+
92
+ &:hover {
93
+ background-color: var(--P-60);
94
+ }
95
+
96
+ &:active {
97
+ background-color: var(--P-70);
98
+ }
99
+ }
100
+
101
+ &__cancel {
102
+ color: var(--white);
103
+ background-color: var(--Point-50);
104
+
105
+ &:hover {
106
+ background-color: var(--Point-60);
107
+ }
108
+
109
+ &:active {
110
+ background-color: var(--Point-70);
111
+ }
112
+ }
113
+
114
+ &__disabled {
115
+ color: var(--white);
116
+ background-color: var(--G-40) !important;
117
+ cursor: default;
118
+
119
+ &:hover {
120
+ background-color: var(--P-60);
121
+ }
122
+
123
+ &:active {
124
+ background-color: var(--P-70);
125
+ }
126
+ }
127
+ }
@@ -1,61 +1,61 @@
1
- import { ReactNode } from 'react';
2
- import { cn } from '@jk-core/utils';
3
- import styles from './Button.module.scss';
4
-
5
- interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
- /** 버튼 내용 */
7
- children: ReactNode;
8
- /** 버튼 등급 (Primary, Secondary, Tertiary, Cancel) */
9
- grade?: 'tertiary' | 'secondary' | 'primary' | 'cancel';
10
- /** 버튼 비활성화 여부 */
11
- disabled?: boolean;
12
- /** 버튼 클래스 */
13
- className?: string;
14
- /** 로딩 중 여부, 버튼 내부 스피너 표시 */
15
- isLoading?: boolean;
16
- /** 버튼 클릭 이벤트 핸들러 */
17
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
18
- }
19
-
20
- /**
21
- * 공용 버튼 컴포넌트입니다.
22
- *
23
- * 다양한 등급(grade)과 상태(로딩, 비활성화 등)를 지원하며, 텍스트와 클릭 이벤트를 전달할 수 있습니다.
24
- *
25
- * - `grade` prop을 통해 버튼의 스타일(Primary, Secondary, Tertiary, Cancel)을 지정할 수 있습니다.
26
- * - `isLoading`이 true일 때 로딩 애니메이션이 표시됩니다.
27
- * - `disabled`가 true이면 버튼이 비활성화됩니다.
28
- * - `text` prop으로 버튼에 표시할 텍스트를 지정합니다.
29
- * - 추가적으로 button의 모든 기본 속성(React.)을 지원합니다.
30
- */
31
- export default function Button({
32
- children, grade = 'primary', disabled = false, onClick, className = '', isLoading = false, ...props
33
- }: Props) {
34
- return (
35
- <button
36
- className={cn({
37
- [styles.button]: true,
38
- [styles.button__loading]: isLoading,
39
- [styles.button__disabled]: !!disabled,
40
- [styles.button__tertiary]: grade === 'tertiary',
41
- [styles.button__secondary]: grade === 'secondary',
42
- [styles.button__primary]: grade === 'primary',
43
- [styles.button__cancel]: grade === 'cancel',
44
- [className]: !!className,
45
- })}
46
- type="button"
47
- disabled={disabled}
48
- onClick={onClick}
49
- {...props}
50
- >
51
- {children}
52
- {isLoading && (
53
- <div className={styles['loading-dot']}>
54
- <div />
55
- <div />
56
- <div />
57
- </div>
58
- )}
59
- </button>
60
- );
1
+ import { ReactNode } from 'react';
2
+ import { cn } from '@jk-core/utils';
3
+ import styles from './Button.module.scss';
4
+
5
+ interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
+ /** 버튼 내용 */
7
+ children: ReactNode;
8
+ /** 버튼 등급 (Primary, Secondary, Tertiary, Cancel) */
9
+ grade?: 'tertiary' | 'secondary' | 'primary' | 'cancel';
10
+ /** 버튼 비활성화 여부 */
11
+ disabled?: boolean;
12
+ /** 버튼 클래스 */
13
+ className?: string;
14
+ /** 로딩 중 여부, 버튼 내부 스피너 표시 */
15
+ isLoading?: boolean;
16
+ /** 버튼 클릭 이벤트 핸들러 */
17
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
18
+ }
19
+
20
+ /**
21
+ * 공용 버튼 컴포넌트입니다.
22
+ *
23
+ * 다양한 등급(grade)과 상태(로딩, 비활성화 등)를 지원하며, 텍스트와 클릭 이벤트를 전달할 수 있습니다.
24
+ *
25
+ * - `grade` prop을 통해 버튼의 스타일(Primary, Secondary, Tertiary, Cancel)을 지정할 수 있습니다.
26
+ * - `isLoading`이 true일 때 로딩 애니메이션이 표시됩니다.
27
+ * - `disabled`가 true이면 버튼이 비활성화됩니다.
28
+ * - `text` prop으로 버튼에 표시할 텍스트를 지정합니다.
29
+ * - 추가적으로 button의 모든 기본 속성(React.)을 지원합니다.
30
+ */
31
+ export default function Button({
32
+ children, grade = 'primary', disabled = false, onClick, className = '', isLoading = false, ...props
33
+ }: Props) {
34
+ return (
35
+ <button
36
+ className={cn({
37
+ [styles.button]: true,
38
+ [styles.button__loading]: isLoading,
39
+ [styles.button__disabled]: !!disabled,
40
+ [styles.button__tertiary]: grade === 'tertiary',
41
+ [styles.button__secondary]: grade === 'secondary',
42
+ [styles.button__primary]: grade === 'primary',
43
+ [styles.button__cancel]: grade === 'cancel',
44
+ [className]: !!className,
45
+ })}
46
+ type="button"
47
+ disabled={disabled}
48
+ onClick={onClick}
49
+ {...props}
50
+ >
51
+ {children}
52
+ {isLoading && (
53
+ <div className={styles['loading-dot']}>
54
+ <div />
55
+ <div />
56
+ <div />
57
+ </div>
58
+ )}
59
+ </button>
60
+ );
61
61
  }
@@ -1,28 +1,28 @@
1
- .card {
2
- position: relative;
3
- width: 100%;
4
- background-color: var(--white);
5
- border-radius: 5px;
6
- padding: 10px;
7
- display: flex;
8
- flex-direction: column;
9
- box-shadow:
10
- 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
11
- 0px 1px 1px 0px rgba(0, 0, 0, 0.14),
12
- 0px 1px 3px 0px rgba(0, 0, 0, 0.12),
13
- 0px 1px 3px 0px rgba(0, 0, 0, 0.14);
14
- }
15
-
16
- .title {
17
- color: var(--G-80);
18
- margin-bottom: 10px;
19
- font-size: 20px;
20
- font-weight: 600;
21
- }
22
-
23
- .content {
24
- color: var(--G-60);
25
- white-space: pre-wrap;
26
- font-size: 16px;
27
- font-weight: 500;
28
- }
1
+ .card {
2
+ position: relative;
3
+ width: 100%;
4
+ background-color: var(--white);
5
+ border-radius: 5px;
6
+ padding: 10px;
7
+ display: flex;
8
+ flex-direction: column;
9
+ box-shadow:
10
+ 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
11
+ 0px 1px 1px 0px rgba(0, 0, 0, 0.14),
12
+ 0px 1px 3px 0px rgba(0, 0, 0, 0.12),
13
+ 0px 1px 3px 0px rgba(0, 0, 0, 0.14);
14
+ }
15
+
16
+ .title {
17
+ color: var(--G-80);
18
+ margin-bottom: 10px;
19
+ font-size: 20px;
20
+ font-weight: 600;
21
+ }
22
+
23
+ .content {
24
+ color: var(--G-60);
25
+ white-space: pre-wrap;
26
+ font-size: 16px;
27
+ font-weight: 500;
28
+ }
@@ -1,19 +1,19 @@
1
- import styles from './Card.module.scss';
2
-
3
- interface CardProps {
4
- title: string | React.ReactNode;
5
- children?: React.ReactNode;
6
- }
7
-
8
- export default function Card({ title, children }:CardProps) {
9
- return (
10
- <div className={styles.card}>
11
- <div className={styles.title}>
12
- {title}
13
- </div>
14
- <div className={styles.content}>
15
- {children}
16
- </div>
17
- </div>
18
- );
19
- }
1
+ import styles from './Card.module.scss';
2
+
3
+ interface CardProps {
4
+ title: string | React.ReactNode;
5
+ children?: React.ReactNode;
6
+ }
7
+
8
+ export default function Card({ title, children }:CardProps) {
9
+ return (
10
+ <div className={styles.card}>
11
+ <div className={styles.title}>
12
+ {title}
13
+ </div>
14
+ <div className={styles.content}>
15
+ {children}
16
+ </div>
17
+ </div>
18
+ );
19
+ }
@@ -1,101 +1,101 @@
1
- .divider {
2
- display: flex;
3
- align-items: center;
4
- margin: 16px 0;
5
- align-self: center;
6
- justify-self: center;
7
-
8
- &.vertical {
9
- flex-direction: column;
10
- height: 100px;
11
- width: auto;
12
- margin: 0 16px;
13
- }
14
- }
15
-
16
- .content {
17
- display: flex;
18
- align-items: center;
19
- width: 100%;
20
-
21
- &::before,
22
- &::after {
23
- content: "";
24
- flex: 1;
25
- height: 1px;
26
- background-color: var(--G-30);
27
- }
28
-
29
- .vertical & {
30
- flex-direction: column;
31
- height: 100%;
32
- width: auto;
33
-
34
- &::before,
35
- &::after {
36
- width: 1px;
37
- height: auto;
38
- flex: 1;
39
- }
40
- }
41
- }
42
-
43
- .text {
44
- padding: 0 16px;
45
- color: var(--G-70);
46
- font-size: 14px;
47
- white-space: nowrap;
48
-
49
- .vertical & {
50
- padding: 16px 0;
51
- writing-mode: vertical-rl;
52
- }
53
- }
54
-
55
- // 텍스트가 없을 때는 전체 라인만 표시
56
- .noText .content {
57
- &::before {
58
- flex: 1;
59
- }
60
-
61
- &::after {
62
- display: none;
63
- }
64
- }
65
-
66
- // 정렬 옵션
67
- .left .content::before {
68
- flex: 0.2;
69
- }
70
-
71
- .right .content::after {
72
- flex: 0.2;
73
- }
74
-
75
- .center .content::before,
76
- .center .content::after {
77
- flex: 1;
78
- }
79
-
80
- .full {
81
- width: 100%;
82
- height: 100%;
83
- }
84
-
85
- .middle {
86
- width: 80%;
87
- height: 80%;
88
- }
89
-
90
- .short {
91
- width: 50%;
92
- height: 50%;
93
- }
94
-
95
- .horizontal {
96
- height: 1px !important;
97
- }
98
-
99
- .vertical {
100
- width: 1px !important;
101
- }
1
+ .divider {
2
+ display: flex;
3
+ align-items: center;
4
+ margin: 16px 0;
5
+ align-self: center;
6
+ justify-self: center;
7
+
8
+ &.vertical {
9
+ flex-direction: column;
10
+ height: 100px;
11
+ width: auto;
12
+ margin: 0 16px;
13
+ }
14
+ }
15
+
16
+ .content {
17
+ display: flex;
18
+ align-items: center;
19
+ width: 100%;
20
+
21
+ &::before,
22
+ &::after {
23
+ content: "";
24
+ flex: 1;
25
+ height: 1px;
26
+ background-color: var(--G-30);
27
+ }
28
+
29
+ .vertical & {
30
+ flex-direction: column;
31
+ height: 100%;
32
+ width: auto;
33
+
34
+ &::before,
35
+ &::after {
36
+ width: 1px;
37
+ height: auto;
38
+ flex: 1;
39
+ }
40
+ }
41
+ }
42
+
43
+ .text {
44
+ padding: 0 16px;
45
+ color: var(--G-70);
46
+ font-size: 14px;
47
+ white-space: nowrap;
48
+
49
+ .vertical & {
50
+ padding: 16px 0;
51
+ writing-mode: vertical-rl;
52
+ }
53
+ }
54
+
55
+ // 텍스트가 없을 때는 전체 라인만 표시
56
+ .noText .content {
57
+ &::before {
58
+ flex: 1;
59
+ }
60
+
61
+ &::after {
62
+ display: none;
63
+ }
64
+ }
65
+
66
+ // 정렬 옵션
67
+ .left .content::before {
68
+ flex: 0.2;
69
+ }
70
+
71
+ .right .content::after {
72
+ flex: 0.2;
73
+ }
74
+
75
+ .center .content::before,
76
+ .center .content::after {
77
+ flex: 1;
78
+ }
79
+
80
+ .full {
81
+ width: 100%;
82
+ height: 100%;
83
+ }
84
+
85
+ .middle {
86
+ width: 80%;
87
+ height: 80%;
88
+ }
89
+
90
+ .short {
91
+ width: 50%;
92
+ height: 50%;
93
+ }
94
+
95
+ .horizontal {
96
+ height: 1px !important;
97
+ }
98
+
99
+ .vertical {
100
+ width: 1px !important;
101
+ }