@plaidlabs/ui 0.1.3 → 0.1.5

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.
@@ -0,0 +1,104 @@
1
+ export declare const region: string;
2
+ export declare const toast: import("@vanilla-extract/recipes").RuntimeFn<{
3
+ variant: {
4
+ default: {
5
+ backgroundColor: string;
6
+ borderColor: string;
7
+ };
8
+ error: {
9
+ backgroundColor: string;
10
+ borderColor: string;
11
+ };
12
+ warning: {
13
+ backgroundColor: string;
14
+ borderColor: string;
15
+ };
16
+ info: {
17
+ backgroundColor: string;
18
+ borderColor: string;
19
+ };
20
+ success: {
21
+ backgroundColor: string;
22
+ borderColor: string;
23
+ };
24
+ loading: {
25
+ backgroundColor: string;
26
+ borderColor: "transparent";
27
+ borderWidth: number;
28
+ borderRadius: "0.25rem";
29
+ width: "15.25rem";
30
+ minWidth: "15.25rem";
31
+ maxWidth: "15.25rem";
32
+ gap: "0.625rem";
33
+ };
34
+ };
35
+ size: {
36
+ sm: {};
37
+ md: {};
38
+ };
39
+ }>;
40
+ export declare const content: string;
41
+ export declare const textStack: string;
42
+ export declare const title: import("@vanilla-extract/recipes").RuntimeFn<{
43
+ size: {
44
+ sm: string;
45
+ md: string;
46
+ };
47
+ }>;
48
+ export declare const description: import("@vanilla-extract/recipes").RuntimeFn<{
49
+ size: {
50
+ sm: string;
51
+ md: string;
52
+ };
53
+ }>;
54
+ export declare const iconWrapper: import("@vanilla-extract/recipes").RuntimeFn<{
55
+ variant: {
56
+ default: {
57
+ color: string;
58
+ };
59
+ error: {
60
+ color: string;
61
+ };
62
+ warning: {
63
+ color: string;
64
+ };
65
+ info: {
66
+ color: string;
67
+ };
68
+ success: {
69
+ color: string;
70
+ };
71
+ loading: {
72
+ color: string;
73
+ };
74
+ };
75
+ size: {
76
+ sm: {
77
+ width: "1rem";
78
+ height: "1rem";
79
+ };
80
+ md: {
81
+ width: "1.25rem";
82
+ height: "1.25rem";
83
+ };
84
+ };
85
+ }>;
86
+ export declare const loadingIconWrapper: string;
87
+ export declare const loadingIcon: import("@vanilla-extract/recipes").RuntimeFn<{
88
+ size: {
89
+ sm: {
90
+ transform: "scale(1)";
91
+ };
92
+ md: {
93
+ transform: "scale(1.25)";
94
+ };
95
+ };
96
+ }>;
97
+ export declare const actionWrapper: string;
98
+ export declare const actionButton: import("@vanilla-extract/recipes").RuntimeFn<{
99
+ size: {
100
+ sm: string;
101
+ md: string;
102
+ };
103
+ }>;
104
+ export declare const closeButton: string;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { UNSTABLE_ToastQueue as ToastQueue, type ToastProps, type ToastRegionProps as AriaToastRegionProps } from 'react-aria-components';
3
+ export type ToastVariant = 'default' | 'error' | 'warning' | 'info' | 'success' | 'loading';
4
+ export type ToastSize = 'sm' | 'md';
5
+ export interface ToastAction {
6
+ label: React.ReactNode;
7
+ onPress?: () => void;
8
+ }
9
+ export interface DSYToastContent {
10
+ title: React.ReactNode;
11
+ description?: React.ReactNode;
12
+ variant?: ToastVariant;
13
+ size?: ToastSize;
14
+ action?: ToastAction;
15
+ showCloseButton?: boolean;
16
+ }
17
+ export declare const toastQueue: ToastQueue<DSYToastContent>;
18
+ export declare const queue: ToastQueue<DSYToastContent>;
19
+ export type ToastQueueOptions = Parameters<typeof toastQueue.add>[1];
20
+ export type ToastAddContent = Omit<DSYToastContent, 'variant'> & {
21
+ variant?: ToastVariant;
22
+ };
23
+ export declare const toast: {
24
+ add: (content: ToastAddContent, options?: ToastQueueOptions) => string;
25
+ default: (content: Omit<ToastAddContent, "variant">, options?: ToastQueueOptions) => string;
26
+ info: (content: Omit<ToastAddContent, "variant">, options?: ToastQueueOptions) => string;
27
+ success: (content: Omit<ToastAddContent, "variant">, options?: ToastQueueOptions) => string;
28
+ warning: (content: Omit<ToastAddContent, "variant">, options?: ToastQueueOptions) => string;
29
+ error: (content: Omit<ToastAddContent, "variant">, options?: ToastQueueOptions) => string;
30
+ loading: (content: Omit<ToastAddContent, "variant">, options?: ToastQueueOptions) => string;
31
+ close: (key: string) => void;
32
+ };
33
+ export interface ToastRegionProps extends Omit<AriaToastRegionProps<DSYToastContent>, 'queue' | 'children'> {
34
+ className?: string;
35
+ queue?: ToastQueue<DSYToastContent>;
36
+ }
37
+ export declare function ToastRegion({ className, queue, ...props }: ToastRegionProps): import("react/jsx-runtime").JSX.Element;
38
+ export declare function DSYToast({ className, toast, ...props }: ToastProps<DSYToastContent>): import("react/jsx-runtime").JSX.Element;
39
+ export default DSYToast;
@@ -0,0 +1,125 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ import { type ToastVariant, type ToastSize } from './Toast.tsx';
3
+ interface ToastStoryArgs {
4
+ variant: ToastVariant;
5
+ size: ToastSize;
6
+ showCloseButton: boolean;
7
+ withDescription: boolean;
8
+ withAction: boolean;
9
+ title: string;
10
+ description: string;
11
+ timeout?: number;
12
+ }
13
+ declare function ToastPlayground(args: ToastStoryArgs): import("react/jsx-runtime").JSX.Element;
14
+ declare const meta: {
15
+ title: string;
16
+ component: typeof ToastPlayground;
17
+ parameters: {
18
+ layout: string;
19
+ docs: {
20
+ description: {
21
+ component: string;
22
+ };
23
+ story: {
24
+ inline: boolean;
25
+ };
26
+ };
27
+ };
28
+ tags: string[];
29
+ argTypes: {
30
+ variant: {
31
+ control: "select";
32
+ options: string[];
33
+ description: string;
34
+ };
35
+ size: {
36
+ control: "select";
37
+ options: string[];
38
+ description: string;
39
+ };
40
+ showCloseButton: {
41
+ control: "boolean";
42
+ description: string;
43
+ };
44
+ withDescription: {
45
+ control: "boolean";
46
+ description: string;
47
+ };
48
+ withAction: {
49
+ control: "boolean";
50
+ description: string;
51
+ };
52
+ title: {
53
+ control: "text";
54
+ description: string;
55
+ };
56
+ description: {
57
+ control: "text";
58
+ description: string;
59
+ };
60
+ timeout: {
61
+ control: "number";
62
+ description: string;
63
+ };
64
+ };
65
+ args: {
66
+ variant: "info";
67
+ size: "md";
68
+ showCloseButton: true;
69
+ withDescription: true;
70
+ withAction: false;
71
+ title: string;
72
+ description: string;
73
+ timeout: number;
74
+ };
75
+ };
76
+ export default meta;
77
+ type Story = StoryObj<typeof meta>;
78
+ /**
79
+ * 1. Playground
80
+ * - 운영에서 가장 많이 쓰는 조합을 빠르게 확인합니다.
81
+ * - 설명 텍스트/액션/닫기 버튼 유무를 토글하여 확인합니다.
82
+ */
83
+ export declare const Playground: Story;
84
+ /**
85
+ * 2. Variant 비교
86
+ * - 각 상태별 컬러/아이콘 적용 상태를 확인합니다.
87
+ * - 기본(default)과 로딩(loading)도 함께 확인합니다.
88
+ */
89
+ export declare const Variants: Story;
90
+ /**
91
+ * 3. Size 비교
92
+ * - sm/md 사이즈 차이를 확인합니다.
93
+ * - 텍스트 길이 변화에 대한 여유 공간도 같이 체크합니다.
94
+ */
95
+ export declare const Sizes: Story;
96
+ /**
97
+ * 4. Description 없는 경우
98
+ * - 타이틀만 있는 짧은 알림 케이스입니다.
99
+ * - 액션/설명 없이도 수직 정렬이 자연스러운지 확인합니다.
100
+ */
101
+ export declare const TitleOnly: Story;
102
+ /**
103
+ * 5. 액션 버튼 포함
104
+ * - 되돌리기 등 1차 액션 제공 케이스입니다.
105
+ * - 액션 버튼 규격/컬러가 Figma와 일치하는지 확인합니다.
106
+ */
107
+ export declare const WithAction: Story;
108
+ /**
109
+ * 6. 닫기 버튼 없음
110
+ * - 비차단성 정보성 알림에 사용되는 케이스입니다.
111
+ * - 접근성상 자동 닫힘 시간을 충분히 확보하는 것을 권장합니다.
112
+ */
113
+ export declare const NoCloseButton: Story;
114
+ /**
115
+ * 7. 긴 텍스트 케이스
116
+ * - 긴 제목/설명에서 레이아웃 깨짐 여부를 확인합니다.
117
+ * - 줄바꿈/overflow 정책을 점검합니다.
118
+ */
119
+ export declare const LongText: Story;
120
+ /**
121
+ * 8. Programmatic 닫기 예시
122
+ * - `toast.loading()`으로 시작 후 `toast.close()`로 종료하는 흐름입니다.
123
+ * - 진행 중 상태 표시와 사용자 취소 흐름을 검증합니다.
124
+ */
125
+ export declare const ProgrammaticDismiss: Story;
@@ -0,0 +1,2 @@
1
+ export { default as Toast, ToastRegion, toastQueue, queue, toast } from './Toast.tsx';
2
+ export type { ToastVariant, ToastSize, ToastAction, DSYToastContent, ToastQueueOptions, ToastAddContent, ToastRegionProps, } from './Toast.tsx';
@@ -20,3 +20,4 @@ export * from './basic/bottom-tab/index.ts';
20
20
  export * from './basic/page-header/index.ts';
21
21
  export * from './basic/tab/index.ts';
22
22
  export * from './complex/chat-widget/index.ts';
23
+ export * from './complex/toast/index.ts';