@jk-core/components 1.1.0 → 1.1.2
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.js +81 -81
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +5 -5
- package/dist/index.umd.cjs.map +1 -1
- package/dist/src/common/Button/index.d.ts +4 -3
- package/dist/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/common/Button/Button.module.scss +0 -1
- package/src/common/Button/index.tsx +7 -6
- package/src/index.tsx +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
2
3
|
/** 버튼 내용 */
|
|
3
|
-
|
|
4
|
+
children: ReactNode;
|
|
4
5
|
/** 버튼 등급 (Primary, Secondary, Tertiary, Cancel) */
|
|
5
6
|
grade?: 'tertiary' | 'secondary' | 'primary' | 'cancel';
|
|
6
7
|
/** 버튼 비활성화 여부 */
|
|
@@ -10,7 +11,7 @@ interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
10
11
|
/** 로딩 중 여부, 버튼 내부 스피너 표시 */
|
|
11
12
|
isLoading?: boolean;
|
|
12
13
|
/** 버튼 클릭 이벤트 핸들러 */
|
|
13
|
-
onClick?: () => void;
|
|
14
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* 공용 버튼 컴포넌트입니다.
|
|
@@ -23,5 +24,5 @@ interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
23
24
|
* - `text` prop으로 버튼에 표시할 텍스트를 지정합니다.
|
|
24
25
|
* - 추가적으로 button의 모든 기본 속성(React.)을 지원합니다.
|
|
25
26
|
*/
|
|
26
|
-
export
|
|
27
|
+
export default function Button({ children, grade, disabled, onClick, className, isLoading, ...props }: Props): import("react/jsx-runtime").JSX.Element;
|
|
27
28
|
export {};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as Breadcrumbs, BreadcrumbsItem } from './common/Breadcrumbs';
|
|
2
|
-
import { Button } from './common/Button';
|
|
2
|
+
import { default as Button } from './common/Button';
|
|
3
3
|
import { default as Pagination } from './common/Pagination';
|
|
4
4
|
import { default as Skeleton } from './common/Skeleton';
|
|
5
5
|
import { default as SwitchButton } from './common/SwitchButton';
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { cn } from '@jk-core/utils';
|
|
2
3
|
import styles from './Button.module.scss';
|
|
3
4
|
|
|
4
5
|
interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
6
|
/** 버튼 내용 */
|
|
6
|
-
|
|
7
|
+
children: ReactNode;
|
|
7
8
|
/** 버튼 등급 (Primary, Secondary, Tertiary, Cancel) */
|
|
8
9
|
grade?: 'tertiary' | 'secondary' | 'primary' | 'cancel';
|
|
9
10
|
/** 버튼 비활성화 여부 */
|
|
@@ -13,7 +14,7 @@ interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
13
14
|
/** 로딩 중 여부, 버튼 내부 스피너 표시 */
|
|
14
15
|
isLoading?: boolean;
|
|
15
16
|
/** 버튼 클릭 이벤트 핸들러 */
|
|
16
|
-
onClick?: () => void;
|
|
17
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -27,8 +28,8 @@ interface Props extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
27
28
|
* - `text` prop으로 버튼에 표시할 텍스트를 지정합니다.
|
|
28
29
|
* - 추가적으로 button의 모든 기본 속성(React.)을 지원합니다.
|
|
29
30
|
*/
|
|
30
|
-
export function Button({
|
|
31
|
-
|
|
31
|
+
export default function Button({
|
|
32
|
+
children, grade = 'primary', disabled = false, onClick, className = '', isLoading = false, ...props
|
|
32
33
|
}: Props) {
|
|
33
34
|
return (
|
|
34
35
|
<button
|
|
@@ -47,7 +48,7 @@ export function Button({
|
|
|
47
48
|
onClick={onClick}
|
|
48
49
|
{...props}
|
|
49
50
|
>
|
|
50
|
-
{
|
|
51
|
+
{children}
|
|
51
52
|
{isLoading && (
|
|
52
53
|
<div className={styles['loading-dot']}>
|
|
53
54
|
<div />
|
|
@@ -57,4 +58,4 @@ export function Button({
|
|
|
57
58
|
)}
|
|
58
59
|
</button>
|
|
59
60
|
);
|
|
60
|
-
}
|
|
61
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Breadcrumbs, { BreadcrumbsItem } from '@/common/Breadcrumbs';
|
|
2
|
-
import
|
|
2
|
+
import Button from '@/common/Button';
|
|
3
3
|
import Pagination from '@/common/Pagination';
|
|
4
4
|
import Skeleton from '@/common/Skeleton';
|
|
5
5
|
import SwitchButton from '@/common/SwitchButton';
|