@1d1s/design-system 1.1.0 → 1.2.1
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/BottomSheet/BottomSheet.d.ts +19 -0
- package/dist/components/BottomSheet/BottomSheet.stories.d.ts +7 -0
- package/dist/components/BottomSheet/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +67 -2
- package/dist/components/Dialog/Dialog.stories.d.ts +6 -4
- package/dist/components/Dialog/index.d.ts +2 -1
- package/dist/components/Heatmap/Heatmap.d.ts +39 -4
- package/dist/components/Heatmap/Heatmap.stories.d.ts +2 -0
- package/dist/components/Snackbar/Snackbar.d.ts +20 -0
- package/dist/components/Snackbar/Snackbar.stories.d.ts +8 -0
- package/dist/components/Snackbar/SnackbarProvider.d.ts +33 -0
- package/dist/components/Snackbar/index.d.ts +4 -0
- package/dist/components/Toast/Toast.d.ts +53 -0
- package/dist/components/Toast/Toast.stories.d.ts +10 -0
- package/dist/components/Toast/ToastProvider.d.ts +40 -0
- package/dist/components/Toast/index.d.ts +4 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/index.es.js +7820 -7215
- package/dist/index.umd.js +13 -13
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
|
+
declare const BottomSheet: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const BottomSheetTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const BottomSheetPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const BottomSheetClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare function BottomSheetOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.ReactElement;
|
|
8
|
+
export interface BottomSheetContentProps extends React.ComponentProps<typeof DialogPrimitive.Content> {
|
|
9
|
+
/** 시트 좌·우·하단 inset (px). 기본 8 */
|
|
10
|
+
inset?: number;
|
|
11
|
+
/** 상단 그립 핸들 노출 (기본 true) */
|
|
12
|
+
showHandle?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function BottomSheetContent({ className, children, inset, showHandle, style, ...props }: BottomSheetContentProps): React.ReactElement;
|
|
15
|
+
declare function BottomSheetHeader({ className, ...props }: React.ComponentProps<"div">): React.ReactElement;
|
|
16
|
+
declare function BottomSheetFooter({ className, ...props }: React.ComponentProps<"div">): React.ReactElement;
|
|
17
|
+
declare function BottomSheetTitle({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.ReactElement;
|
|
18
|
+
declare function BottomSheetDescription({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.ReactElement;
|
|
19
|
+
export { BottomSheet, BottomSheetTrigger, BottomSheetPortal, BottomSheetClose, BottomSheetOverlay, BottomSheetContent, BottomSheetHeader, BottomSheetFooter, BottomSheetTitle, BottomSheetDescription, };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { BottomSheet } from './BottomSheet';
|
|
3
|
+
declare const meta: Meta<typeof BottomSheet>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof BottomSheet>;
|
|
6
|
+
export declare const MoodPicker: Story;
|
|
7
|
+
export declare const Options: Story;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { BottomSheet, BottomSheetTrigger, BottomSheetPortal, BottomSheetClose, BottomSheetOverlay, BottomSheetContent, BottomSheetHeader, BottomSheetFooter, BottomSheetTitle, BottomSheetDescription, } from './BottomSheet';
|
|
2
|
+
export type { BottomSheetContentProps } from './BottomSheet';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { IconName } from '../Icons/Icon';
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
3
5
|
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
@@ -5,9 +7,72 @@ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.Dia
|
|
|
5
7
|
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
8
|
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
9
|
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.ReactElement;
|
|
8
|
-
declare
|
|
10
|
+
declare const dialogContentVariants: (props?: ({
|
|
11
|
+
size?: "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
12
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
13
|
+
export interface DialogContentProps extends React.ComponentProps<typeof DialogPrimitive.Content>, VariantProps<typeof dialogContentVariants> {
|
|
14
|
+
/** 닫기 버튼 노출 (기본 true) */
|
|
15
|
+
showClose?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare function DialogContent({ className, children, size, showClose, ...props }: DialogContentProps): React.ReactElement;
|
|
9
18
|
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.ReactElement;
|
|
19
|
+
declare function DialogBody({ className, ...props }: React.ComponentProps<"div">): React.ReactElement;
|
|
10
20
|
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.ReactElement;
|
|
11
21
|
declare function DialogTitle({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.ReactElement;
|
|
12
22
|
declare function DialogDescription({ className, children, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.ReactElement;
|
|
13
|
-
|
|
23
|
+
declare const confirmToneStyles: {
|
|
24
|
+
brand: {
|
|
25
|
+
iconBg: string;
|
|
26
|
+
iconColor: string;
|
|
27
|
+
buttonVariant: "primary";
|
|
28
|
+
};
|
|
29
|
+
danger: {
|
|
30
|
+
iconBg: string;
|
|
31
|
+
iconColor: string;
|
|
32
|
+
buttonVariant: "danger";
|
|
33
|
+
};
|
|
34
|
+
mint: {
|
|
35
|
+
iconBg: string;
|
|
36
|
+
iconColor: string;
|
|
37
|
+
buttonVariant: "primary";
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export type ConfirmTone = keyof typeof confirmToneStyles;
|
|
41
|
+
export interface ConfirmDialogProps {
|
|
42
|
+
open?: boolean;
|
|
43
|
+
defaultOpen?: boolean;
|
|
44
|
+
onOpenChange?: (open: boolean) => void;
|
|
45
|
+
/** 톤 색상 — `brand` (기본) · `danger` · `mint` */
|
|
46
|
+
tone?: ConfirmTone;
|
|
47
|
+
/** 상단 원형 배지에 들어갈 아이콘 */
|
|
48
|
+
icon?: IconName;
|
|
49
|
+
title: React.ReactNode;
|
|
50
|
+
/** `\n` 줄바꿈을 그대로 렌더 */
|
|
51
|
+
description?: React.ReactNode;
|
|
52
|
+
confirmLabel?: React.ReactNode;
|
|
53
|
+
cancelLabel?: React.ReactNode;
|
|
54
|
+
onConfirm?: () => void;
|
|
55
|
+
onCancel?: () => void;
|
|
56
|
+
/** Trigger 노드 (옵션). 외부에서 `open`을 제어할 때는 생략 */
|
|
57
|
+
children?: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* ConfirmDialog
|
|
61
|
+
* 아이콘 + 제목 + 설명 + 2버튼 형태의 확인 다이얼로그.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```tsx
|
|
65
|
+
* <ConfirmDialog
|
|
66
|
+
* tone="danger"
|
|
67
|
+
* icon="Flame"
|
|
68
|
+
* title="정말 포기하시겠어요?"
|
|
69
|
+
* description={"27일 스트릭이 초기화돼요.\n이 동작은 되돌릴 수 없어요."}
|
|
70
|
+
* confirmLabel="포기"
|
|
71
|
+
* onConfirm={() => stop()}
|
|
72
|
+
* >
|
|
73
|
+
* <Button variant="danger">포기하기</Button>
|
|
74
|
+
* </ConfirmDialog>
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
declare function ConfirmDialog({ open, defaultOpen, onOpenChange, tone, icon, title, description, confirmLabel, cancelLabel, onConfirm, onCancel, children, }: ConfirmDialogProps): React.ReactElement;
|
|
78
|
+
export { Dialog, DialogTrigger, DialogPortal, DialogClose, DialogOverlay, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogDescription, ConfirmDialog, };
|
|
@@ -3,7 +3,9 @@ import { Dialog } from './Dialog';
|
|
|
3
3
|
declare const meta: Meta<typeof Dialog>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Dialog>;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
6
|
+
export declare const SizeSm: Story;
|
|
7
|
+
export declare const SizeMd: Story;
|
|
8
|
+
export declare const SizeLg: Story;
|
|
9
|
+
export declare const ConfirmBrand: Story;
|
|
10
|
+
export declare const ConfirmDanger: Story;
|
|
11
|
+
export declare const ConfirmMint: Story;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { Dialog, DialogTrigger, DialogPortal, DialogClose, DialogOverlay, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, } from './Dialog';
|
|
1
|
+
export { Dialog, DialogTrigger, DialogPortal, DialogClose, DialogOverlay, DialogContent, DialogHeader, DialogBody, DialogFooter, DialogTitle, DialogDescription, ConfirmDialog, } from './Dialog';
|
|
2
|
+
export type { DialogContentProps, ConfirmDialogProps, ConfirmTone } from './Dialog';
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export type HeatmapTone = "main" | "mint" | "blue" | "green" | "gray";
|
|
3
|
-
export interface
|
|
3
|
+
export interface HeatmapCellInfo {
|
|
4
|
+
/** 셀 인덱스 (0-based, column-first) */
|
|
5
|
+
index: number;
|
|
6
|
+
/** 셀 레벨 (0~4) */
|
|
7
|
+
level: number;
|
|
8
|
+
}
|
|
9
|
+
export interface HeatmapProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "onClick"> {
|
|
4
10
|
/** 셀 값 배열 (각 0~4 레벨). 길이는 rows×cols 권장 */
|
|
5
11
|
cells?: number[];
|
|
6
12
|
/** 컬럼 수 (default 20) */
|
|
@@ -15,21 +21,50 @@ export interface HeatmapProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
15
21
|
gap?: number;
|
|
16
22
|
/** 셀 모서리 둥글기 px */
|
|
17
23
|
cellRadius?: number;
|
|
18
|
-
/**
|
|
24
|
+
/** 셀 a11y 라벨 생성 함수 (셀 인덱스/레벨 → 텍스트). */
|
|
19
25
|
ariaLabel?: (index: number, level: number) => string;
|
|
26
|
+
/**
|
|
27
|
+
* Hover/포커스 시 popover로 보여줄 컨텐츠 생성 함수.
|
|
28
|
+
* 지정하면 셀이 인터랙티브해지고 hover/click으로 popover가 열려요.
|
|
29
|
+
*/
|
|
30
|
+
renderCellTooltip?: (info: HeatmapCellInfo) => React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* 셀 클릭 시 popover 하단에 추가로 렌더링할 액션 영역.
|
|
33
|
+
* 클릭으로 선택된 상태에서만 표시되며, 인터랙션을 위해 `renderCellTooltip`이 함께 필요해요.
|
|
34
|
+
*/
|
|
35
|
+
renderCellActions?: (info: HeatmapCellInfo) => React.ReactNode;
|
|
36
|
+
/** 셀 클릭 콜백 */
|
|
37
|
+
onCellClick?: (info: HeatmapCellInfo) => void;
|
|
38
|
+
/** 셀 hover 콜백 */
|
|
39
|
+
onCellHover?: (info: HeatmapCellInfo | null) => void;
|
|
20
40
|
}
|
|
21
41
|
/**
|
|
22
42
|
* Heatmap
|
|
23
43
|
* GitHub-style 활동 잔디. 7행 × N열 그리드, 각 셀 0~4 레벨.
|
|
24
44
|
*
|
|
45
|
+
* `renderCellTooltip`을 넘기면 각 셀에 hover popover + 클릭 선택 인터랙션이 활성화돼요.
|
|
46
|
+
*
|
|
25
47
|
* @param tone `main` (default) · `mint` · `blue` · `green` · `gray`
|
|
26
48
|
* @param cells 길이 rows×cols 의 number[] 0~4
|
|
27
49
|
* @param cols 컬럼 수 (default 20)
|
|
28
50
|
*
|
|
29
51
|
* @example
|
|
30
52
|
* ```tsx
|
|
53
|
+
* // 정적 (인터랙션 없음)
|
|
31
54
|
* <Heatmap cols={20} cells={data} tone="main" />
|
|
32
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* // hover/click 인터랙션
|
|
57
|
+
* <Heatmap
|
|
58
|
+
* cols={20}
|
|
59
|
+
* cells={data}
|
|
60
|
+
* renderCellTooltip={({ index, level }) =>
|
|
61
|
+
* `${dates[index]} · ${level}회 활동`
|
|
62
|
+
* }
|
|
63
|
+
* renderCellActions={({ index }) => (
|
|
64
|
+
* <Button size="xs" onClick={() => openDay(dates[index])}>일지 보기</Button>
|
|
65
|
+
* )}
|
|
66
|
+
* onCellClick={({ index, level }) => track(index, level)}
|
|
67
|
+
* />
|
|
33
68
|
* ```
|
|
34
69
|
*/
|
|
35
|
-
export declare function Heatmap({ cells, cols, rows, tone, palette, gap, cellRadius, ariaLabel, className, ...props }: HeatmapProps): React.ReactElement;
|
|
70
|
+
export declare function Heatmap({ cells, cols, rows, tone, palette, gap, cellRadius, ariaLabel, renderCellTooltip, renderCellActions, onCellClick, onCellHover, className, ...props }: HeatmapProps): React.ReactElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SnackbarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** 표시 텍스트 */
|
|
4
|
+
text: React.ReactNode;
|
|
5
|
+
/** 우측 인라인 액션 라벨 (예: "복구") */
|
|
6
|
+
action?: React.ReactNode;
|
|
7
|
+
/** 액션 클릭 콜백 */
|
|
8
|
+
onAction?: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Snackbar
|
|
12
|
+
* 컴팩트한 다크 톤 알림 — 보통 화면 하단에 1줄 결과 + 1액션 형태로 표시.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <Snackbar text="일지가 임시저장되었어요" action="복구" onAction={() => restore()} />
|
|
17
|
+
* <Snackbar text="링크를 복사했어요" />
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function Snackbar({ text, action, onAction, className, ...props }: SnackbarProps): React.ReactElement;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Snackbar } from './Snackbar';
|
|
3
|
+
declare const meta: Meta<typeof Snackbar>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Snackbar>;
|
|
6
|
+
export declare const WithAction: Story;
|
|
7
|
+
export declare const TextOnly: Story;
|
|
8
|
+
export declare const WithProvider: Story;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SnackbarOptions {
|
|
3
|
+
text: React.ReactNode;
|
|
4
|
+
action?: React.ReactNode;
|
|
5
|
+
onAction?: () => void;
|
|
6
|
+
/** ms 단위 자동 닫힘. 0 또는 음수면 수동 닫기 (기본 3000) */
|
|
7
|
+
duration?: number;
|
|
8
|
+
}
|
|
9
|
+
interface SnackbarContextValue {
|
|
10
|
+
show: (options: SnackbarOptions) => number;
|
|
11
|
+
dismiss: (id: number) => void;
|
|
12
|
+
}
|
|
13
|
+
export type SnackbarPosition = "top" | "bottom";
|
|
14
|
+
export interface SnackbarProviderProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
/** 위치 (기본 `bottom`) */
|
|
17
|
+
position?: SnackbarPosition;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* SnackbarProvider
|
|
21
|
+
* 앱 루트에 한 번 감싸 두면 어디서든 `useSnackbar()`로 스낵바를 띄울 수 있어요.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <SnackbarProvider>
|
|
26
|
+
* <App />
|
|
27
|
+
* </SnackbarProvider>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function SnackbarProvider({ children, position, }: SnackbarProviderProps): React.ReactElement;
|
|
31
|
+
/** 스낵바를 띄우거나 닫을 수 있는 훅. `<SnackbarProvider>` 하위에서만 사용 */
|
|
32
|
+
export declare function useSnackbar(): SnackbarContextValue;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { IconName } from '../Icons/Icon';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare const toastIconStyles: {
|
|
5
|
+
brand: {
|
|
6
|
+
bg: string;
|
|
7
|
+
color: string;
|
|
8
|
+
};
|
|
9
|
+
success: {
|
|
10
|
+
bg: string;
|
|
11
|
+
color: string;
|
|
12
|
+
};
|
|
13
|
+
danger: {
|
|
14
|
+
bg: string;
|
|
15
|
+
color: string;
|
|
16
|
+
};
|
|
17
|
+
info: {
|
|
18
|
+
bg: string;
|
|
19
|
+
color: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type ToastTone = keyof typeof toastIconStyles;
|
|
23
|
+
declare const toastVariants: (props?: import('class-variance-authority/types').ClassProp | undefined) => string;
|
|
24
|
+
export interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof toastVariants> {
|
|
25
|
+
/** 톤 — `brand` (default) · `success` · `danger` · `info` */
|
|
26
|
+
tone?: ToastTone;
|
|
27
|
+
/** 좌측 원형 배지 아이콘 */
|
|
28
|
+
icon?: IconName;
|
|
29
|
+
/** 제목 (1행) */
|
|
30
|
+
title?: React.ReactNode;
|
|
31
|
+
/** 본문 (보조 1행) */
|
|
32
|
+
body?: React.ReactNode;
|
|
33
|
+
/** 우측 액션 라벨 */
|
|
34
|
+
action?: React.ReactNode;
|
|
35
|
+
/** 액션 클릭 콜백 */
|
|
36
|
+
onAction?: () => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Toast
|
|
40
|
+
* 화이트 카드 위에 컬러 아이콘 배지 + 제목/본문/액션을 보여주는 알림.
|
|
41
|
+
*
|
|
42
|
+
* 단독 표시용 프레젠테이션 컴포넌트로, `ToastProvider` + `useToast`와 함께 쓸 수 있어요.
|
|
43
|
+
*
|
|
44
|
+
* @param tone `brand` (default) · `success` · `danger` · `info`
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```tsx
|
|
48
|
+
* <Toast tone="success" icon="Check" title="일지를 저장했어요" body="응원이 도착하면 알려드릴게요" />
|
|
49
|
+
* <Toast tone="info" icon="Bell" title="새 응원 3개" action="보기" onAction={() => view()} />
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function Toast({ tone, icon, title, body, action, onAction, className, ...props }: ToastProps): React.ReactElement;
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Toast } from './Toast';
|
|
3
|
+
declare const meta: Meta<typeof Toast>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Toast>;
|
|
6
|
+
export declare const Brand: Story;
|
|
7
|
+
export declare const Success: Story;
|
|
8
|
+
export declare const Info: Story;
|
|
9
|
+
export declare const Danger: Story;
|
|
10
|
+
export declare const WithProvider: Story;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ToastProps, ToastTone } from './Toast';
|
|
2
|
+
import { IconName } from '../Icons/Icon';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
export interface ToastOptions {
|
|
5
|
+
tone?: ToastTone;
|
|
6
|
+
icon?: IconName;
|
|
7
|
+
title?: React.ReactNode;
|
|
8
|
+
body?: React.ReactNode;
|
|
9
|
+
action?: React.ReactNode;
|
|
10
|
+
onAction?: () => void;
|
|
11
|
+
/** ms 단위 자동 닫힘. 0 또는 음수면 수동 닫기 (기본 4000) */
|
|
12
|
+
duration?: number;
|
|
13
|
+
}
|
|
14
|
+
interface ToastContextValue {
|
|
15
|
+
show: (options: ToastOptions) => number;
|
|
16
|
+
dismiss: (id: number) => void;
|
|
17
|
+
}
|
|
18
|
+
export type ToastPosition = "top" | "top-right" | "top-left" | "bottom" | "bottom-right" | "bottom-left";
|
|
19
|
+
export interface ToastProviderProps {
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/** 토스트 정렬 위치 (기본 `top-right`) */
|
|
22
|
+
position?: ToastPosition;
|
|
23
|
+
/** 동시에 표시되는 최대 토스트 수 (기본 5) */
|
|
24
|
+
max?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* ToastProvider
|
|
28
|
+
* 앱 루트에 한 번 감싸 두면 어디서든 `useToast()`로 토스트를 띄울 수 있어요.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <ToastProvider position="top-right">
|
|
33
|
+
* <App />
|
|
34
|
+
* </ToastProvider>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare function ToastProvider({ children, position, max, }: ToastProviderProps): React.ReactElement;
|
|
38
|
+
/** 토스트를 띄우거나 닫을 수 있는 훅. `<ToastProvider>` 하위에서만 사용 */
|
|
39
|
+
export declare function useToast(): ToastContextValue;
|
|
40
|
+
export type { ToastProps };
|
|
@@ -5,6 +5,7 @@ export * from './AvatarImagePicker';
|
|
|
5
5
|
export * from './Banner';
|
|
6
6
|
export * from './BannerCarousel';
|
|
7
7
|
export * from './BottomNav';
|
|
8
|
+
export * from './BottomSheet';
|
|
8
9
|
export * from './Button';
|
|
9
10
|
export * from './Calendar';
|
|
10
11
|
export * from './Card';
|
|
@@ -31,6 +32,7 @@ export * from './RightSidebar';
|
|
|
31
32
|
export * from './ScheduleCalendar';
|
|
32
33
|
export * from './SectionHeader';
|
|
33
34
|
export * from './Select';
|
|
35
|
+
export * from './Snackbar';
|
|
34
36
|
export * from './StatCard';
|
|
35
37
|
export * from './StatusBadge';
|
|
36
38
|
export * from './StepIndicator';
|
|
@@ -40,6 +42,7 @@ export * from './Tabs';
|
|
|
40
42
|
export * from './Tag';
|
|
41
43
|
export * from './Text';
|
|
42
44
|
export * from './TextField';
|
|
45
|
+
export * from './Toast';
|
|
43
46
|
export * from './Toggle';
|
|
44
47
|
export * from './ToggleGroup';
|
|
45
48
|
export * from './Tooltip';
|