@plaidlabs/ui 0.0.7 → 0.1.0
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/LICENSE +21 -0
- package/dist/components/basic/button/Button.css.d.ts +6 -6
- package/dist/components/basic/button/Button.d.ts +1 -1
- package/dist/components/basic/button/Button.stories.d.ts +1 -1
- package/dist/components/basic/chip/Chip.css.d.ts +3 -3
- package/dist/components/basic/chip/Chip.stories.d.ts +1 -1
- package/dist/components/basic/link/Link.css.d.ts +2 -2
- package/dist/components/basic/link/Link.d.ts +1 -1
- package/dist/components/basic/link/Link.stories.d.ts +1 -1
- package/dist/components/basic/stepper/Stepper.css.d.ts +2 -2
- package/dist/components/basic/stepper/Stepper.d.ts +1 -1
- package/dist/components/basic/stepper/Stepper.stories.d.ts +1 -1
- package/dist/components/complex/chat-widget/ChatWidget.css.d.ts +13 -0
- package/dist/components/complex/chat-widget/ChatWidget.d.ts +43 -0
- package/dist/components/complex/chat-widget/ChatWidget.stories.d.ts +56 -0
- package/dist/components/complex/chat-widget/chatWidgetConfig.d.ts +38 -0
- package/dist/components/complex/chat-widget/index.d.ts +2 -0
- package/dist/components/complex/modal/Modal.css.d.ts +6 -6
- package/dist/components/complex/modal/Modal.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/icons/components/filled/IconFilledMessage2.d.ts +3 -0
- package/dist/icons/components/filled/index.d.ts +2 -0
- package/dist/index.js +20542 -7334
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Plaid Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
export declare const loadingWrapper: string;
|
|
2
2
|
export declare const buttonRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
3
3
|
size: {
|
|
4
|
-
|
|
4
|
+
xl: (string | {
|
|
5
5
|
borderRadius: "0.375rem";
|
|
6
6
|
gap: "0.5rem";
|
|
7
7
|
})[];
|
|
8
|
-
|
|
8
|
+
lg: (string | {
|
|
9
9
|
borderRadius: "0.375rem";
|
|
10
10
|
gap: "0.5rem";
|
|
11
11
|
})[];
|
|
12
|
-
|
|
12
|
+
md: (string | {
|
|
13
13
|
borderRadius: "0.25rem";
|
|
14
14
|
gap: "0.5rem";
|
|
15
15
|
})[];
|
|
16
|
-
|
|
16
|
+
sm: (string | {
|
|
17
17
|
borderRadius: "0.25rem";
|
|
18
18
|
gap: "0.5rem";
|
|
19
19
|
})[];
|
|
20
|
-
|
|
20
|
+
xs: (string | {
|
|
21
21
|
borderRadius: "0.25rem";
|
|
22
22
|
gap: "0.25rem";
|
|
23
23
|
})[];
|
|
24
|
-
|
|
24
|
+
xxs: (string | {
|
|
25
25
|
borderRadius: "0.25rem";
|
|
26
26
|
gap: "0.25rem";
|
|
27
27
|
})[];
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { type ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
3
|
export type ButtonVariant = 'filled' | 'outline' | 'light' | 'no_bg';
|
|
4
4
|
export type ButtonColor = 'blue' | 'green' | 'red' | 'gray';
|
|
5
|
-
export type ButtonSize = '
|
|
5
|
+
export type ButtonSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
6
|
export type ButtonIconPosition = 'none' | 'left' | 'right' | 'duo' | 'only';
|
|
7
7
|
export interface ButtonProps extends Omit<AriaButtonProps, 'children'> {
|
|
8
8
|
variant: ButtonVariant;
|
|
@@ -18,13 +18,13 @@ export declare const chipRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
size: {
|
|
21
|
-
|
|
21
|
+
lg: (string | {
|
|
22
22
|
height: "1.75rem";
|
|
23
23
|
})[];
|
|
24
|
-
|
|
24
|
+
md: (string | {
|
|
25
25
|
height: "1.5rem";
|
|
26
26
|
})[];
|
|
27
|
-
|
|
27
|
+
sm: (string | {
|
|
28
28
|
height: "1.25rem";
|
|
29
29
|
})[];
|
|
30
30
|
};
|
|
@@ -11,12 +11,12 @@ export declare const container: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
|
11
11
|
export declare const stepList: string;
|
|
12
12
|
export declare const stepItem: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
13
13
|
size: {
|
|
14
|
-
|
|
14
|
+
md: {
|
|
15
15
|
height: "2rem";
|
|
16
16
|
minWidth: "2rem";
|
|
17
17
|
padding: "0.5rem";
|
|
18
18
|
};
|
|
19
|
-
|
|
19
|
+
sm: {
|
|
20
20
|
height: "1.5rem";
|
|
21
21
|
minWidth: "1.5rem";
|
|
22
22
|
padding: "0.25rem";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const themeVars: {
|
|
2
|
+
mainColor: `var(--${string})`;
|
|
3
|
+
backgroundColor: `var(--${string})`;
|
|
4
|
+
userBubbleBg: `var(--${string})`;
|
|
5
|
+
userTextColor: `var(--${string})`;
|
|
6
|
+
zIndex: `var(--${string})`;
|
|
7
|
+
};
|
|
8
|
+
export declare const root: string;
|
|
9
|
+
export declare const launcherButton: string;
|
|
10
|
+
export declare const header: string;
|
|
11
|
+
export declare const headerLeft: string;
|
|
12
|
+
export declare const headerTitle: string;
|
|
13
|
+
export declare const closeButton: string;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ChatWidgetTheme {
|
|
2
|
+
mainColor?: string;
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
userBubbleBg?: string;
|
|
5
|
+
userTextColor?: string;
|
|
6
|
+
zIndex?: number | string;
|
|
7
|
+
}
|
|
8
|
+
export interface ChatWidgetHeaderConfig {
|
|
9
|
+
title?: string;
|
|
10
|
+
avatarSrc?: string;
|
|
11
|
+
avatarAlt?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ChatWidgetInputConfig {
|
|
14
|
+
label?: string;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
maxLength?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface ChatWidgetProps {
|
|
19
|
+
flow: unknown;
|
|
20
|
+
onUserInput?: ChatExternalHandler;
|
|
21
|
+
settings?: unknown;
|
|
22
|
+
themes?: unknown;
|
|
23
|
+
chatbotStyles?: Record<string, unknown>;
|
|
24
|
+
theme?: ChatWidgetTheme;
|
|
25
|
+
header?: ChatWidgetHeaderConfig;
|
|
26
|
+
input?: ChatWidgetInputConfig;
|
|
27
|
+
slots?: Record<string, unknown>;
|
|
28
|
+
isOpen?: boolean;
|
|
29
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
30
|
+
portal?: boolean;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export type ChatContext = Record<string, unknown>;
|
|
34
|
+
export type ChatExternalHandler = (params: {
|
|
35
|
+
input: string;
|
|
36
|
+
nodeId: string | null;
|
|
37
|
+
context: ChatContext;
|
|
38
|
+
}) => Promise<{
|
|
39
|
+
message?: string;
|
|
40
|
+
nextNode?: string;
|
|
41
|
+
context?: Partial<ChatContext>;
|
|
42
|
+
}>;
|
|
43
|
+
export default function ChatWidget({ flow, onUserInput, settings, themes, chatbotStyles, theme, header, input, slots, isOpen, onOpenChange, portal, className, }: ChatWidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import ChatWidget from './ChatWidget';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof ChatWidget;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
docs: {
|
|
9
|
+
story: {
|
|
10
|
+
inline: boolean;
|
|
11
|
+
iframeHeight: number;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
tags: string[];
|
|
16
|
+
args: {
|
|
17
|
+
flow: {
|
|
18
|
+
readonly start: {
|
|
19
|
+
readonly message: "안녕하세요! 무엇을 도와드릴까요?";
|
|
20
|
+
readonly options: readonly ["주문/배송", "기타"];
|
|
21
|
+
readonly path: (params: {
|
|
22
|
+
userInput: string;
|
|
23
|
+
}) => "waitInput" | "order";
|
|
24
|
+
};
|
|
25
|
+
readonly order: {
|
|
26
|
+
readonly message: "주문/배송 문의네요. 주문번호를 알려주세요.";
|
|
27
|
+
readonly path: "waitInput";
|
|
28
|
+
};
|
|
29
|
+
readonly waitInput: {
|
|
30
|
+
readonly message: (params: {
|
|
31
|
+
userInput: string;
|
|
32
|
+
}) => string;
|
|
33
|
+
readonly path: "end";
|
|
34
|
+
};
|
|
35
|
+
readonly end: {
|
|
36
|
+
readonly message: "감사합니다! 필요하면 언제든 다시 불러주세요.";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
argTypes: {
|
|
41
|
+
theme: {
|
|
42
|
+
control: "object";
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
48
|
+
export declare const Default: Story;
|
|
49
|
+
/**
|
|
50
|
+
* 사내 챗봇 케이스: Pladdy Bot
|
|
51
|
+
**/
|
|
52
|
+
export declare const PladdyBot: Story;
|
|
53
|
+
/**
|
|
54
|
+
* 커스텀 케이스: 브랜드 챗봇
|
|
55
|
+
**/
|
|
56
|
+
export declare const Custom: Story;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import { type ChatWidgetInputConfig, type ChatWidgetProps, type ChatWidgetTheme } from './ChatWidget';
|
|
3
|
+
export type ThemeValues = {
|
|
4
|
+
mainColor: string;
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
userBubbleBg: string;
|
|
7
|
+
userTextColor: string;
|
|
8
|
+
zIndex: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function createThemeValues(theme: ChatWidgetTheme): ThemeValues;
|
|
11
|
+
export declare function createMergedSettings(settings: ChatWidgetProps['settings'], input: ChatWidgetInputConfig | undefined, themeValues: ThemeValues, sendButtonIcon: unknown): {
|
|
12
|
+
tooltip: {
|
|
13
|
+
mode: unknown;
|
|
14
|
+
text: unknown;
|
|
15
|
+
};
|
|
16
|
+
chatHistory: {
|
|
17
|
+
viewChatHistoryButtonText: string;
|
|
18
|
+
chatHistoryLineBreakText: string;
|
|
19
|
+
};
|
|
20
|
+
chatInput: {
|
|
21
|
+
enabledPlaceholderText: string;
|
|
22
|
+
characterLimit: number | undefined;
|
|
23
|
+
sendButtonIcon: unknown;
|
|
24
|
+
};
|
|
25
|
+
general: {
|
|
26
|
+
embedded: boolean;
|
|
27
|
+
showFooter: boolean;
|
|
28
|
+
primaryColor?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
device: {
|
|
31
|
+
applyMobileOptimizations: boolean;
|
|
32
|
+
desktopEnabled: boolean;
|
|
33
|
+
};
|
|
34
|
+
chatWindow: {
|
|
35
|
+
defaultOpen: boolean;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare function createMergedStyles(chatbotStyles: ChatWidgetProps['chatbotStyles'], themeValues: ThemeValues): Record<string, CSSProperties>;
|
|
@@ -2,7 +2,7 @@ export declare const overlay: string;
|
|
|
2
2
|
export declare const dialog: string;
|
|
3
3
|
export declare const content: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
4
4
|
size: {
|
|
5
|
-
|
|
5
|
+
sm: {
|
|
6
6
|
width: "19.5rem";
|
|
7
7
|
maxWidth: "19.5rem";
|
|
8
8
|
minWidth: "14.5rem";
|
|
@@ -13,11 +13,11 @@ export declare const content: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
md: {
|
|
17
17
|
width: "26rem";
|
|
18
18
|
maxWidth: "26rem";
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
lg: {
|
|
21
21
|
width: "57.625rem";
|
|
22
22
|
maxWidth: "57.625rem";
|
|
23
23
|
};
|
|
@@ -27,9 +27,9 @@ export declare const wrapper: string;
|
|
|
27
27
|
export declare const closeButtonWrapper: string;
|
|
28
28
|
export declare const titleArea: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
29
29
|
size: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
sm: {};
|
|
31
|
+
md: {};
|
|
32
|
+
lg: {};
|
|
33
33
|
};
|
|
34
34
|
}>;
|
|
35
35
|
export declare const title: import("@vanilla-extract/recipes").RuntimeFn<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DialogProps as AriaDialogProps, ModalOverlayProps } from 'react-aria-components';
|
|
3
|
-
export type ModalSize = '
|
|
3
|
+
export type ModalSize = 'sm' | 'md' | 'lg';
|
|
4
4
|
export interface ModalProps extends Omit<AriaDialogProps, 'children'> {
|
|
5
5
|
size: ModalSize;
|
|
6
6
|
children: React.ReactNode;
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 이 파일은 자동 생성됩니다. 수동으로 수정하지 마세요.
|
|
5
5
|
*/
|
|
6
|
+
import { IconFilledMessage2 } from './IconFilledMessage2.tsx';
|
|
6
7
|
import { IconOnline } from './IconOnline.tsx';
|
|
7
8
|
import { IconUserProfile } from './IconUserProfile.tsx';
|
|
9
|
+
export { IconFilledMessage2 };
|
|
8
10
|
export { IconOnline };
|
|
9
11
|
export { IconUserProfile };
|