@plaidlabs/ui 0.0.8 → 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.
@@ -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
- xlarge: (string | {
4
+ xl: (string | {
5
5
  borderRadius: "0.375rem";
6
6
  gap: "0.5rem";
7
7
  })[];
8
- large: (string | {
8
+ lg: (string | {
9
9
  borderRadius: "0.375rem";
10
10
  gap: "0.5rem";
11
11
  })[];
12
- medium: (string | {
12
+ md: (string | {
13
13
  borderRadius: "0.25rem";
14
14
  gap: "0.5rem";
15
15
  })[];
16
- small: (string | {
16
+ sm: (string | {
17
17
  borderRadius: "0.25rem";
18
18
  gap: "0.5rem";
19
19
  })[];
20
- xsmall: (string | {
20
+ xs: (string | {
21
21
  borderRadius: "0.25rem";
22
22
  gap: "0.25rem";
23
23
  })[];
24
- xxsmall: (string | {
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 = 'xxsmall' | 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
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;
@@ -10,7 +10,7 @@ declare const meta: {
10
10
  args: {
11
11
  variant: "filled";
12
12
  color: "blue";
13
- size: "medium";
13
+ size: "md";
14
14
  };
15
15
  argTypes: {
16
16
  variant: {
@@ -18,13 +18,13 @@ export declare const chipRecipe: import("@vanilla-extract/recipes").RuntimeFn<{
18
18
  };
19
19
  };
20
20
  size: {
21
- large: (string | {
21
+ lg: (string | {
22
22
  height: "1.75rem";
23
23
  })[];
24
- medium: (string | {
24
+ md: (string | {
25
25
  height: "1.5rem";
26
26
  })[];
27
- small: (string | {
27
+ sm: (string | {
28
28
  height: "1.25rem";
29
29
  })[];
30
30
  };
@@ -40,7 +40,7 @@ declare const meta: {
40
40
  children: string;
41
41
  variant: "filled";
42
42
  color: "blue";
43
- size: "medium";
43
+ size: "md";
44
44
  shape: "round";
45
45
  };
46
46
  };
@@ -1,7 +1,7 @@
1
1
  export declare const link: import("@vanilla-extract/recipes").RuntimeFn<{
2
2
  size: {
3
- medium: string[];
4
- small: string[];
3
+ md: string[];
4
+ sm: string[];
5
5
  };
6
6
  color: {
7
7
  blue: {
@@ -1,5 +1,5 @@
1
1
  export type LinkColor = 'blue' | 'gray700' | 'gray500';
2
- export type LinkSize = 'medium' | 'small';
2
+ export type LinkSize = 'md' | 'sm';
3
3
  export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
4
4
  size: LinkSize;
5
5
  color: LinkColor;
@@ -10,7 +10,7 @@ declare const meta: {
10
10
  args: {
11
11
  href: string;
12
12
  children: string;
13
- size: "medium";
13
+ size: "md";
14
14
  color: "blue";
15
15
  };
16
16
  argTypes: {
@@ -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
- medium: {
14
+ md: {
15
15
  height: "2rem";
16
16
  minWidth: "2rem";
17
17
  padding: "0.5rem";
18
18
  };
19
- small: {
19
+ sm: {
20
20
  height: "1.5rem";
21
21
  minWidth: "1.5rem";
22
22
  padding: "0.25rem";
@@ -1,5 +1,5 @@
1
1
  export type StepperColor = 'blue' | 'gray';
2
- export type StepperSize = 'medium' | 'small';
2
+ export type StepperSize = 'md' | 'sm';
3
3
  export interface StepperProps {
4
4
  totalSteps: number;
5
5
  currentStep: number;
@@ -10,7 +10,7 @@ declare const meta: {
10
10
  args: {
11
11
  totalSteps: number;
12
12
  currentStep: number;
13
- size: "medium";
13
+ size: "md";
14
14
  color: "blue";
15
15
  };
16
16
  argTypes: {
@@ -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>;
@@ -0,0 +1,2 @@
1
+ export { default as ChatWidget } from './ChatWidget.tsx';
2
+ export type { ChatWidgetProps } from './ChatWidget.tsx';
@@ -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
- small: {
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
- medium: {
16
+ md: {
17
17
  width: "26rem";
18
18
  maxWidth: "26rem";
19
19
  };
20
- large: {
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
- small: {};
31
- medium: {};
32
- large: {};
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 = 'small' | 'medium' | 'large';
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;
@@ -17,3 +17,4 @@ export * from './complex/popup/index.ts';
17
17
  export * from './basic/bottom-tab/index.ts';
18
18
  export * from './basic/page-header/index.ts';
19
19
  export * from './basic/tab/index.ts';
20
+ export * from './complex/chat-widget/index.ts';
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import type { IconProps } from '@icons/types';
3
+ export declare const IconFilledMessage2: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
@@ -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 };