@melony/react 0.1.24 → 0.1.25
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.cjs +623 -464
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +167 -42
- package/dist/index.d.ts +167 -42
- package/dist/index.js +554 -420
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode } from 'react';
|
|
2
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import { ClientState, MelonyClient } from 'melony/client';
|
|
4
|
-
import { Role, Event, Config, UINode } from 'melony';
|
|
4
|
+
import { Role, Event, Config, UINode, UIContract } from 'melony';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
@@ -73,7 +73,6 @@ interface MelonyClientProviderProps {
|
|
|
73
73
|
client: MelonyClient;
|
|
74
74
|
initialEvents?: Event[];
|
|
75
75
|
queryClient?: QueryClient;
|
|
76
|
-
configApi?: string;
|
|
77
76
|
}
|
|
78
77
|
declare const MelonyClientProvider: React__default.FC<MelonyClientProviderProps>;
|
|
79
78
|
|
|
@@ -132,6 +131,20 @@ declare const useAuth: () => AuthContextValue;
|
|
|
132
131
|
|
|
133
132
|
declare const useThreads: () => ThreadContextValue;
|
|
134
133
|
|
|
134
|
+
interface ScreenSize {
|
|
135
|
+
width: number;
|
|
136
|
+
height: number;
|
|
137
|
+
isMobile: boolean;
|
|
138
|
+
isTablet: boolean;
|
|
139
|
+
isDesktop: boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Hook to detect screen size and breakpoints
|
|
143
|
+
* @param mobileBreakpoint - Breakpoint for mobile (default: 768px, Tailwind's md)
|
|
144
|
+
* @param tabletBreakpoint - Breakpoint for tablet (default: 1024px, Tailwind's lg)
|
|
145
|
+
*/
|
|
146
|
+
declare function useScreenSize(mobileBreakpoint?: number, tabletBreakpoint?: number): ScreenSize;
|
|
147
|
+
|
|
135
148
|
interface ThreadProps {
|
|
136
149
|
className?: string;
|
|
137
150
|
placeholder?: string;
|
|
@@ -159,11 +172,8 @@ interface ComposerProps {
|
|
|
159
172
|
maxFiles?: number;
|
|
160
173
|
maxFileSize?: number;
|
|
161
174
|
};
|
|
162
|
-
accept?: string;
|
|
163
|
-
maxFiles?: number;
|
|
164
|
-
maxFileSize?: number;
|
|
165
175
|
}
|
|
166
|
-
declare function Composer({ value, onChange, onSubmit, placeholder, isLoading, className, options, autoFocus, defaultSelectedIds, fileAttachments,
|
|
176
|
+
declare function Composer({ value, onChange, onSubmit, placeholder, isLoading, className, options, autoFocus, defaultSelectedIds, fileAttachments, }: ComposerProps): react_jsx_runtime.JSX.Element;
|
|
167
177
|
|
|
168
178
|
interface ChatHeaderProps {
|
|
169
179
|
/**
|
|
@@ -195,7 +205,7 @@ interface ChatHeaderProps {
|
|
|
195
205
|
* A shared, customizable header component for chat interfaces.
|
|
196
206
|
* Used consistently across ChatFull, ChatSidebar, and ChatPopup components.
|
|
197
207
|
*/
|
|
198
|
-
declare function ChatHeader({
|
|
208
|
+
declare function ChatHeader({ leftContent, rightContent, className, children, }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
199
209
|
|
|
200
210
|
interface ChatPopupProps {
|
|
201
211
|
title?: string;
|
|
@@ -258,38 +268,6 @@ interface ChatFullProps {
|
|
|
258
268
|
* Custom className for the right sidebar container
|
|
259
269
|
*/
|
|
260
270
|
rightSidebarClassName?: string;
|
|
261
|
-
/**
|
|
262
|
-
* Whether the left sidebar is collapsible
|
|
263
|
-
*/
|
|
264
|
-
leftSidebarCollapsible?: boolean;
|
|
265
|
-
/**
|
|
266
|
-
* Whether the right sidebar is collapsible
|
|
267
|
-
*/
|
|
268
|
-
rightSidebarCollapsible?: boolean;
|
|
269
|
-
/**
|
|
270
|
-
* Default collapsed state for the left sidebar
|
|
271
|
-
*/
|
|
272
|
-
defaultLeftSidebarCollapsed?: boolean;
|
|
273
|
-
/**
|
|
274
|
-
* Default collapsed state for the right sidebar
|
|
275
|
-
*/
|
|
276
|
-
defaultRightSidebarCollapsed?: boolean;
|
|
277
|
-
/**
|
|
278
|
-
* Controlled collapsed state for the left sidebar. If provided, component becomes controlled.
|
|
279
|
-
*/
|
|
280
|
-
leftSidebarCollapsed?: boolean;
|
|
281
|
-
/**
|
|
282
|
-
* Controlled collapsed state for the right sidebar. If provided, component becomes controlled.
|
|
283
|
-
*/
|
|
284
|
-
rightSidebarCollapsed?: boolean;
|
|
285
|
-
/**
|
|
286
|
-
* Callback when left sidebar collapse state changes
|
|
287
|
-
*/
|
|
288
|
-
onLeftSidebarCollapseChange?: (collapsed: boolean) => void;
|
|
289
|
-
/**
|
|
290
|
-
* Callback when right sidebar collapse state changes
|
|
291
|
-
*/
|
|
292
|
-
onRightSidebarCollapseChange?: (collapsed: boolean) => void;
|
|
293
271
|
/**
|
|
294
272
|
* Whether the composer should be auto focused
|
|
295
273
|
*/
|
|
@@ -299,7 +277,24 @@ interface ChatFullProps {
|
|
|
299
277
|
*/
|
|
300
278
|
defaultSelectedIds?: string[];
|
|
301
279
|
}
|
|
302
|
-
declare function ChatFull({ title, placeholder, starterPrompts, options, className, headerProps, leftSidebar, rightSidebar, leftSidebarClassName, rightSidebarClassName,
|
|
280
|
+
declare function ChatFull({ title, placeholder, starterPrompts, options, className, headerProps, leftSidebar, rightSidebar, leftSidebarClassName, rightSidebarClassName, autoFocus, defaultSelectedIds, }: ChatFullProps): react_jsx_runtime.JSX.Element;
|
|
281
|
+
|
|
282
|
+
interface SidebarToggleProps {
|
|
283
|
+
side: "left" | "right";
|
|
284
|
+
className?: string;
|
|
285
|
+
}
|
|
286
|
+
declare function SidebarToggle({ side, className }: SidebarToggleProps): react_jsx_runtime.JSX.Element | null;
|
|
287
|
+
|
|
288
|
+
interface ChatSidebarContextValue {
|
|
289
|
+
leftCollapsed: boolean;
|
|
290
|
+
rightCollapsed: boolean;
|
|
291
|
+
setLeftCollapsed: (collapsed: boolean) => void;
|
|
292
|
+
setRightCollapsed: (collapsed: boolean) => void;
|
|
293
|
+
leftCollapsible: boolean;
|
|
294
|
+
rightCollapsible: boolean;
|
|
295
|
+
}
|
|
296
|
+
declare const ChatSidebarContext: React__default.Context<ChatSidebarContextValue | undefined>;
|
|
297
|
+
declare function useChatSidebar(): ChatSidebarContextValue;
|
|
303
298
|
|
|
304
299
|
interface ThreadListProps {
|
|
305
300
|
className?: string;
|
|
@@ -346,6 +341,136 @@ interface UIRendererProps {
|
|
|
346
341
|
*/
|
|
347
342
|
declare function UIRenderer({ node }: UIRendererProps): react_jsx_runtime.JSX.Element;
|
|
348
343
|
|
|
344
|
+
type Spacing = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
345
|
+
type FontSize = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
346
|
+
type FontWeight = "normal" | "medium" | "semibold" | "bold";
|
|
347
|
+
|
|
348
|
+
type Size = "sm" | "md" | "lg";
|
|
349
|
+
type Align = "start" | "center" | "end" | "stretch";
|
|
350
|
+
type Justify = "start" | "center" | "end" | "between" | "around";
|
|
351
|
+
type Orientation = "horizontal" | "vertical";
|
|
352
|
+
interface BaseComponentProps {
|
|
353
|
+
className?: string;
|
|
354
|
+
style?: CSSProperties;
|
|
355
|
+
}
|
|
356
|
+
type CardProps = BaseComponentProps & UIContract["card"] & {
|
|
357
|
+
children?: React__default.ReactNode[];
|
|
358
|
+
};
|
|
359
|
+
type RowProps = BaseComponentProps & UIContract["row"] & {
|
|
360
|
+
children?: React__default.ReactNode[];
|
|
361
|
+
};
|
|
362
|
+
type ColProps = BaseComponentProps & UIContract["col"] & {
|
|
363
|
+
children?: React__default.ReactNode[] | React__default.ReactNode;
|
|
364
|
+
overflow?: "visible" | "hidden" | "scroll" | "auto";
|
|
365
|
+
position?: "static" | "relative" | "absolute" | "fixed" | "sticky";
|
|
366
|
+
};
|
|
367
|
+
type BoxProps = BaseComponentProps & UIContract["box"] & {
|
|
368
|
+
children?: React__default.ReactNode | React__default.ReactNode[];
|
|
369
|
+
overflow?: "visible" | "hidden" | "scroll" | "auto";
|
|
370
|
+
};
|
|
371
|
+
type SpacerProps = BaseComponentProps & UIContract["spacer"];
|
|
372
|
+
type DividerProps = BaseComponentProps & UIContract["divider"] & {
|
|
373
|
+
size?: Size;
|
|
374
|
+
};
|
|
375
|
+
type ListProps = BaseComponentProps & {
|
|
376
|
+
children?: React__default.ReactNode;
|
|
377
|
+
width?: string | number;
|
|
378
|
+
};
|
|
379
|
+
type ListItemProps = BaseComponentProps & UIContract["listItem"] & {
|
|
380
|
+
children?: React__default.ReactNode;
|
|
381
|
+
orientation?: Orientation;
|
|
382
|
+
align?: Align;
|
|
383
|
+
justify?: Justify;
|
|
384
|
+
width?: string | number;
|
|
385
|
+
padding?: Spacing;
|
|
386
|
+
};
|
|
387
|
+
type ImageProps = BaseComponentProps & UIContract["image"] & {
|
|
388
|
+
fallbackText?: string;
|
|
389
|
+
showFallbackIcon?: boolean;
|
|
390
|
+
};
|
|
391
|
+
type ChartProps = BaseComponentProps & UIContract["chart"] & {
|
|
392
|
+
size?: Size;
|
|
393
|
+
showValues?: boolean;
|
|
394
|
+
showGrid?: boolean;
|
|
395
|
+
showTooltips?: boolean;
|
|
396
|
+
};
|
|
397
|
+
type BadgeProps = BaseComponentProps & UIContract["badge"];
|
|
398
|
+
type TextProps = BaseComponentProps & UIContract["text"];
|
|
399
|
+
type HeadingProps = BaseComponentProps & UIContract["heading"];
|
|
400
|
+
type FormProps = BaseComponentProps & UIContract["form"] & {
|
|
401
|
+
children?: React__default.ReactNode[];
|
|
402
|
+
};
|
|
403
|
+
type InputProps = BaseComponentProps & UIContract["input"] & {
|
|
404
|
+
disabled?: boolean;
|
|
405
|
+
value?: string;
|
|
406
|
+
};
|
|
407
|
+
type ButtonProps = BaseComponentProps & UIContract["button"] & {
|
|
408
|
+
fullWidth?: boolean;
|
|
409
|
+
};
|
|
410
|
+
type LabelProps = BaseComponentProps & UIContract["label"] & {
|
|
411
|
+
size?: FontSize;
|
|
412
|
+
weight?: FontWeight;
|
|
413
|
+
};
|
|
414
|
+
type TextareaProps = BaseComponentProps & UIContract["textarea"] & {
|
|
415
|
+
value?: string;
|
|
416
|
+
disabled?: boolean;
|
|
417
|
+
};
|
|
418
|
+
type SelectProps = BaseComponentProps & UIContract["select"] & {
|
|
419
|
+
value?: string;
|
|
420
|
+
disabled?: boolean;
|
|
421
|
+
};
|
|
422
|
+
type CheckboxProps = BaseComponentProps & UIContract["checkbox"] & {
|
|
423
|
+
defaultChecked?: boolean;
|
|
424
|
+
disabled?: boolean;
|
|
425
|
+
};
|
|
426
|
+
type RadioGroupProps = BaseComponentProps & UIContract["radioGroup"] & {
|
|
427
|
+
value?: string;
|
|
428
|
+
defaultValue?: string;
|
|
429
|
+
disabled?: boolean;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
declare const Button: React__default.FC<ButtonProps>;
|
|
433
|
+
|
|
434
|
+
declare const Input: React__default.FC<InputProps>;
|
|
435
|
+
|
|
436
|
+
declare const Textarea: React__default.FC<TextareaProps>;
|
|
437
|
+
|
|
438
|
+
declare const Select: React__default.FC<SelectProps>;
|
|
439
|
+
|
|
440
|
+
declare const Checkbox: React__default.FC<CheckboxProps>;
|
|
441
|
+
|
|
442
|
+
declare const RadioGroup: React__default.FC<RadioGroupProps>;
|
|
443
|
+
|
|
444
|
+
declare const Form: React__default.FC<FormProps>;
|
|
445
|
+
|
|
446
|
+
declare const Heading: React__default.FC<HeadingProps>;
|
|
447
|
+
|
|
448
|
+
declare const Image: React__default.FC<ImageProps>;
|
|
449
|
+
|
|
450
|
+
declare const Label: React__default.FC<LabelProps>;
|
|
451
|
+
|
|
452
|
+
declare const List: React__default.FC<ListProps>;
|
|
453
|
+
|
|
454
|
+
declare const ListItem: React__default.FC<ListItemProps>;
|
|
455
|
+
|
|
456
|
+
declare const Spacer: React__default.FC<SpacerProps>;
|
|
457
|
+
|
|
458
|
+
declare const Divider: React__default.FC<DividerProps>;
|
|
459
|
+
|
|
460
|
+
declare const Box: React__default.FC<BoxProps>;
|
|
461
|
+
|
|
462
|
+
declare const Chart: React__default.FC<ChartProps>;
|
|
463
|
+
|
|
464
|
+
declare const Card: React__default.FC<CardProps>;
|
|
465
|
+
|
|
466
|
+
declare const Row: React__default.FC<RowProps>;
|
|
467
|
+
|
|
468
|
+
declare const Col: React__default.FC<ColProps>;
|
|
469
|
+
|
|
470
|
+
declare const Text: React__default.FC<TextProps>;
|
|
471
|
+
|
|
472
|
+
declare const Badge: React__default.FC<BadgeProps>;
|
|
473
|
+
|
|
349
474
|
declare function groupEventsToMessages(events: Event[]): Message[];
|
|
350
475
|
|
|
351
|
-
export { AccountDialog, type AccountDialogProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, ChatFull, type ChatFullProps, ChatHeader, type ChatHeaderProps, ChatPopup, type ChatPopupProps, ChatSidebar, type ChatSidebarProps, Composer, type ComposerOption, type ComposerOptionGroup, CreateThreadButton, type CreateThreadButtonProps, MelonyClientProvider, type MelonyClientProviderProps, MelonyContext, type MelonyContextValue, type Message, type StarterPrompt, ThemeProvider, ThemeToggle, Thread, ThreadContext, type ThreadContextValue, type ThreadData, ThreadList, type ThreadListProps, ThreadPopover, type ThreadPopoverProps, ThreadProvider, type ThreadProviderProps, type ThreadService, UIRenderer, type UIRendererProps, type UseMelonyOptions, type User, groupEventsToMessages, useAuth, useMelony, useTheme, useThreads };
|
|
476
|
+
export { AccountDialog, type AccountDialogProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, Badge, Box, Button, Card, Chart, ChatFull, type ChatFullProps, ChatHeader, type ChatHeaderProps, ChatPopup, type ChatPopupProps, ChatSidebar, ChatSidebarContext, type ChatSidebarContextValue, type ChatSidebarProps, Checkbox, Col, Composer, type ComposerOption, type ComposerOptionGroup, CreateThreadButton, type CreateThreadButtonProps, Divider, Form, Heading, Image, Input, Label, List, ListItem, MelonyClientProvider, type MelonyClientProviderProps, MelonyContext, type MelonyContextValue, type Message, RadioGroup, Row, type ScreenSize, Select, SidebarToggle, type SidebarToggleProps, Spacer, type StarterPrompt, Text, Textarea, ThemeProvider, ThemeToggle, Thread, ThreadContext, type ThreadContextValue, type ThreadData, ThreadList, type ThreadListProps, ThreadPopover, type ThreadPopoverProps, ThreadProvider, type ThreadProviderProps, type ThreadService, UIRenderer, type UIRendererProps, type UseMelonyOptions, type User, groupEventsToMessages, useAuth, useChatSidebar, useMelony, useScreenSize, useTheme, useThreads };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
|
-
import React__default, { ReactNode } from 'react';
|
|
2
|
+
import React__default, { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
import { ClientState, MelonyClient } from 'melony/client';
|
|
4
|
-
import { Role, Event, Config, UINode } from 'melony';
|
|
4
|
+
import { Role, Event, Config, UINode, UIContract } from 'melony';
|
|
5
5
|
import { QueryClient } from '@tanstack/react-query';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
|
|
@@ -73,7 +73,6 @@ interface MelonyClientProviderProps {
|
|
|
73
73
|
client: MelonyClient;
|
|
74
74
|
initialEvents?: Event[];
|
|
75
75
|
queryClient?: QueryClient;
|
|
76
|
-
configApi?: string;
|
|
77
76
|
}
|
|
78
77
|
declare const MelonyClientProvider: React__default.FC<MelonyClientProviderProps>;
|
|
79
78
|
|
|
@@ -132,6 +131,20 @@ declare const useAuth: () => AuthContextValue;
|
|
|
132
131
|
|
|
133
132
|
declare const useThreads: () => ThreadContextValue;
|
|
134
133
|
|
|
134
|
+
interface ScreenSize {
|
|
135
|
+
width: number;
|
|
136
|
+
height: number;
|
|
137
|
+
isMobile: boolean;
|
|
138
|
+
isTablet: boolean;
|
|
139
|
+
isDesktop: boolean;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Hook to detect screen size and breakpoints
|
|
143
|
+
* @param mobileBreakpoint - Breakpoint for mobile (default: 768px, Tailwind's md)
|
|
144
|
+
* @param tabletBreakpoint - Breakpoint for tablet (default: 1024px, Tailwind's lg)
|
|
145
|
+
*/
|
|
146
|
+
declare function useScreenSize(mobileBreakpoint?: number, tabletBreakpoint?: number): ScreenSize;
|
|
147
|
+
|
|
135
148
|
interface ThreadProps {
|
|
136
149
|
className?: string;
|
|
137
150
|
placeholder?: string;
|
|
@@ -159,11 +172,8 @@ interface ComposerProps {
|
|
|
159
172
|
maxFiles?: number;
|
|
160
173
|
maxFileSize?: number;
|
|
161
174
|
};
|
|
162
|
-
accept?: string;
|
|
163
|
-
maxFiles?: number;
|
|
164
|
-
maxFileSize?: number;
|
|
165
175
|
}
|
|
166
|
-
declare function Composer({ value, onChange, onSubmit, placeholder, isLoading, className, options, autoFocus, defaultSelectedIds, fileAttachments,
|
|
176
|
+
declare function Composer({ value, onChange, onSubmit, placeholder, isLoading, className, options, autoFocus, defaultSelectedIds, fileAttachments, }: ComposerProps): react_jsx_runtime.JSX.Element;
|
|
167
177
|
|
|
168
178
|
interface ChatHeaderProps {
|
|
169
179
|
/**
|
|
@@ -195,7 +205,7 @@ interface ChatHeaderProps {
|
|
|
195
205
|
* A shared, customizable header component for chat interfaces.
|
|
196
206
|
* Used consistently across ChatFull, ChatSidebar, and ChatPopup components.
|
|
197
207
|
*/
|
|
198
|
-
declare function ChatHeader({
|
|
208
|
+
declare function ChatHeader({ leftContent, rightContent, className, children, }: ChatHeaderProps): react_jsx_runtime.JSX.Element;
|
|
199
209
|
|
|
200
210
|
interface ChatPopupProps {
|
|
201
211
|
title?: string;
|
|
@@ -258,38 +268,6 @@ interface ChatFullProps {
|
|
|
258
268
|
* Custom className for the right sidebar container
|
|
259
269
|
*/
|
|
260
270
|
rightSidebarClassName?: string;
|
|
261
|
-
/**
|
|
262
|
-
* Whether the left sidebar is collapsible
|
|
263
|
-
*/
|
|
264
|
-
leftSidebarCollapsible?: boolean;
|
|
265
|
-
/**
|
|
266
|
-
* Whether the right sidebar is collapsible
|
|
267
|
-
*/
|
|
268
|
-
rightSidebarCollapsible?: boolean;
|
|
269
|
-
/**
|
|
270
|
-
* Default collapsed state for the left sidebar
|
|
271
|
-
*/
|
|
272
|
-
defaultLeftSidebarCollapsed?: boolean;
|
|
273
|
-
/**
|
|
274
|
-
* Default collapsed state for the right sidebar
|
|
275
|
-
*/
|
|
276
|
-
defaultRightSidebarCollapsed?: boolean;
|
|
277
|
-
/**
|
|
278
|
-
* Controlled collapsed state for the left sidebar. If provided, component becomes controlled.
|
|
279
|
-
*/
|
|
280
|
-
leftSidebarCollapsed?: boolean;
|
|
281
|
-
/**
|
|
282
|
-
* Controlled collapsed state for the right sidebar. If provided, component becomes controlled.
|
|
283
|
-
*/
|
|
284
|
-
rightSidebarCollapsed?: boolean;
|
|
285
|
-
/**
|
|
286
|
-
* Callback when left sidebar collapse state changes
|
|
287
|
-
*/
|
|
288
|
-
onLeftSidebarCollapseChange?: (collapsed: boolean) => void;
|
|
289
|
-
/**
|
|
290
|
-
* Callback when right sidebar collapse state changes
|
|
291
|
-
*/
|
|
292
|
-
onRightSidebarCollapseChange?: (collapsed: boolean) => void;
|
|
293
271
|
/**
|
|
294
272
|
* Whether the composer should be auto focused
|
|
295
273
|
*/
|
|
@@ -299,7 +277,24 @@ interface ChatFullProps {
|
|
|
299
277
|
*/
|
|
300
278
|
defaultSelectedIds?: string[];
|
|
301
279
|
}
|
|
302
|
-
declare function ChatFull({ title, placeholder, starterPrompts, options, className, headerProps, leftSidebar, rightSidebar, leftSidebarClassName, rightSidebarClassName,
|
|
280
|
+
declare function ChatFull({ title, placeholder, starterPrompts, options, className, headerProps, leftSidebar, rightSidebar, leftSidebarClassName, rightSidebarClassName, autoFocus, defaultSelectedIds, }: ChatFullProps): react_jsx_runtime.JSX.Element;
|
|
281
|
+
|
|
282
|
+
interface SidebarToggleProps {
|
|
283
|
+
side: "left" | "right";
|
|
284
|
+
className?: string;
|
|
285
|
+
}
|
|
286
|
+
declare function SidebarToggle({ side, className }: SidebarToggleProps): react_jsx_runtime.JSX.Element | null;
|
|
287
|
+
|
|
288
|
+
interface ChatSidebarContextValue {
|
|
289
|
+
leftCollapsed: boolean;
|
|
290
|
+
rightCollapsed: boolean;
|
|
291
|
+
setLeftCollapsed: (collapsed: boolean) => void;
|
|
292
|
+
setRightCollapsed: (collapsed: boolean) => void;
|
|
293
|
+
leftCollapsible: boolean;
|
|
294
|
+
rightCollapsible: boolean;
|
|
295
|
+
}
|
|
296
|
+
declare const ChatSidebarContext: React__default.Context<ChatSidebarContextValue | undefined>;
|
|
297
|
+
declare function useChatSidebar(): ChatSidebarContextValue;
|
|
303
298
|
|
|
304
299
|
interface ThreadListProps {
|
|
305
300
|
className?: string;
|
|
@@ -346,6 +341,136 @@ interface UIRendererProps {
|
|
|
346
341
|
*/
|
|
347
342
|
declare function UIRenderer({ node }: UIRendererProps): react_jsx_runtime.JSX.Element;
|
|
348
343
|
|
|
344
|
+
type Spacing = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
345
|
+
type FontSize = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
|
|
346
|
+
type FontWeight = "normal" | "medium" | "semibold" | "bold";
|
|
347
|
+
|
|
348
|
+
type Size = "sm" | "md" | "lg";
|
|
349
|
+
type Align = "start" | "center" | "end" | "stretch";
|
|
350
|
+
type Justify = "start" | "center" | "end" | "between" | "around";
|
|
351
|
+
type Orientation = "horizontal" | "vertical";
|
|
352
|
+
interface BaseComponentProps {
|
|
353
|
+
className?: string;
|
|
354
|
+
style?: CSSProperties;
|
|
355
|
+
}
|
|
356
|
+
type CardProps = BaseComponentProps & UIContract["card"] & {
|
|
357
|
+
children?: React__default.ReactNode[];
|
|
358
|
+
};
|
|
359
|
+
type RowProps = BaseComponentProps & UIContract["row"] & {
|
|
360
|
+
children?: React__default.ReactNode[];
|
|
361
|
+
};
|
|
362
|
+
type ColProps = BaseComponentProps & UIContract["col"] & {
|
|
363
|
+
children?: React__default.ReactNode[] | React__default.ReactNode;
|
|
364
|
+
overflow?: "visible" | "hidden" | "scroll" | "auto";
|
|
365
|
+
position?: "static" | "relative" | "absolute" | "fixed" | "sticky";
|
|
366
|
+
};
|
|
367
|
+
type BoxProps = BaseComponentProps & UIContract["box"] & {
|
|
368
|
+
children?: React__default.ReactNode | React__default.ReactNode[];
|
|
369
|
+
overflow?: "visible" | "hidden" | "scroll" | "auto";
|
|
370
|
+
};
|
|
371
|
+
type SpacerProps = BaseComponentProps & UIContract["spacer"];
|
|
372
|
+
type DividerProps = BaseComponentProps & UIContract["divider"] & {
|
|
373
|
+
size?: Size;
|
|
374
|
+
};
|
|
375
|
+
type ListProps = BaseComponentProps & {
|
|
376
|
+
children?: React__default.ReactNode;
|
|
377
|
+
width?: string | number;
|
|
378
|
+
};
|
|
379
|
+
type ListItemProps = BaseComponentProps & UIContract["listItem"] & {
|
|
380
|
+
children?: React__default.ReactNode;
|
|
381
|
+
orientation?: Orientation;
|
|
382
|
+
align?: Align;
|
|
383
|
+
justify?: Justify;
|
|
384
|
+
width?: string | number;
|
|
385
|
+
padding?: Spacing;
|
|
386
|
+
};
|
|
387
|
+
type ImageProps = BaseComponentProps & UIContract["image"] & {
|
|
388
|
+
fallbackText?: string;
|
|
389
|
+
showFallbackIcon?: boolean;
|
|
390
|
+
};
|
|
391
|
+
type ChartProps = BaseComponentProps & UIContract["chart"] & {
|
|
392
|
+
size?: Size;
|
|
393
|
+
showValues?: boolean;
|
|
394
|
+
showGrid?: boolean;
|
|
395
|
+
showTooltips?: boolean;
|
|
396
|
+
};
|
|
397
|
+
type BadgeProps = BaseComponentProps & UIContract["badge"];
|
|
398
|
+
type TextProps = BaseComponentProps & UIContract["text"];
|
|
399
|
+
type HeadingProps = BaseComponentProps & UIContract["heading"];
|
|
400
|
+
type FormProps = BaseComponentProps & UIContract["form"] & {
|
|
401
|
+
children?: React__default.ReactNode[];
|
|
402
|
+
};
|
|
403
|
+
type InputProps = BaseComponentProps & UIContract["input"] & {
|
|
404
|
+
disabled?: boolean;
|
|
405
|
+
value?: string;
|
|
406
|
+
};
|
|
407
|
+
type ButtonProps = BaseComponentProps & UIContract["button"] & {
|
|
408
|
+
fullWidth?: boolean;
|
|
409
|
+
};
|
|
410
|
+
type LabelProps = BaseComponentProps & UIContract["label"] & {
|
|
411
|
+
size?: FontSize;
|
|
412
|
+
weight?: FontWeight;
|
|
413
|
+
};
|
|
414
|
+
type TextareaProps = BaseComponentProps & UIContract["textarea"] & {
|
|
415
|
+
value?: string;
|
|
416
|
+
disabled?: boolean;
|
|
417
|
+
};
|
|
418
|
+
type SelectProps = BaseComponentProps & UIContract["select"] & {
|
|
419
|
+
value?: string;
|
|
420
|
+
disabled?: boolean;
|
|
421
|
+
};
|
|
422
|
+
type CheckboxProps = BaseComponentProps & UIContract["checkbox"] & {
|
|
423
|
+
defaultChecked?: boolean;
|
|
424
|
+
disabled?: boolean;
|
|
425
|
+
};
|
|
426
|
+
type RadioGroupProps = BaseComponentProps & UIContract["radioGroup"] & {
|
|
427
|
+
value?: string;
|
|
428
|
+
defaultValue?: string;
|
|
429
|
+
disabled?: boolean;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
declare const Button: React__default.FC<ButtonProps>;
|
|
433
|
+
|
|
434
|
+
declare const Input: React__default.FC<InputProps>;
|
|
435
|
+
|
|
436
|
+
declare const Textarea: React__default.FC<TextareaProps>;
|
|
437
|
+
|
|
438
|
+
declare const Select: React__default.FC<SelectProps>;
|
|
439
|
+
|
|
440
|
+
declare const Checkbox: React__default.FC<CheckboxProps>;
|
|
441
|
+
|
|
442
|
+
declare const RadioGroup: React__default.FC<RadioGroupProps>;
|
|
443
|
+
|
|
444
|
+
declare const Form: React__default.FC<FormProps>;
|
|
445
|
+
|
|
446
|
+
declare const Heading: React__default.FC<HeadingProps>;
|
|
447
|
+
|
|
448
|
+
declare const Image: React__default.FC<ImageProps>;
|
|
449
|
+
|
|
450
|
+
declare const Label: React__default.FC<LabelProps>;
|
|
451
|
+
|
|
452
|
+
declare const List: React__default.FC<ListProps>;
|
|
453
|
+
|
|
454
|
+
declare const ListItem: React__default.FC<ListItemProps>;
|
|
455
|
+
|
|
456
|
+
declare const Spacer: React__default.FC<SpacerProps>;
|
|
457
|
+
|
|
458
|
+
declare const Divider: React__default.FC<DividerProps>;
|
|
459
|
+
|
|
460
|
+
declare const Box: React__default.FC<BoxProps>;
|
|
461
|
+
|
|
462
|
+
declare const Chart: React__default.FC<ChartProps>;
|
|
463
|
+
|
|
464
|
+
declare const Card: React__default.FC<CardProps>;
|
|
465
|
+
|
|
466
|
+
declare const Row: React__default.FC<RowProps>;
|
|
467
|
+
|
|
468
|
+
declare const Col: React__default.FC<ColProps>;
|
|
469
|
+
|
|
470
|
+
declare const Text: React__default.FC<TextProps>;
|
|
471
|
+
|
|
472
|
+
declare const Badge: React__default.FC<BadgeProps>;
|
|
473
|
+
|
|
349
474
|
declare function groupEventsToMessages(events: Event[]): Message[];
|
|
350
475
|
|
|
351
|
-
export { AccountDialog, type AccountDialogProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, ChatFull, type ChatFullProps, ChatHeader, type ChatHeaderProps, ChatPopup, type ChatPopupProps, ChatSidebar, type ChatSidebarProps, Composer, type ComposerOption, type ComposerOptionGroup, CreateThreadButton, type CreateThreadButtonProps, MelonyClientProvider, type MelonyClientProviderProps, MelonyContext, type MelonyContextValue, type Message, type StarterPrompt, ThemeProvider, ThemeToggle, Thread, ThreadContext, type ThreadContextValue, type ThreadData, ThreadList, type ThreadListProps, ThreadPopover, type ThreadPopoverProps, ThreadProvider, type ThreadProviderProps, type ThreadService, UIRenderer, type UIRendererProps, type UseMelonyOptions, type User, groupEventsToMessages, useAuth, useMelony, useTheme, useThreads };
|
|
476
|
+
export { AccountDialog, type AccountDialogProps, AuthContext, type AuthContextValue, AuthProvider, type AuthProviderProps, type AuthService, Badge, Box, Button, Card, Chart, ChatFull, type ChatFullProps, ChatHeader, type ChatHeaderProps, ChatPopup, type ChatPopupProps, ChatSidebar, ChatSidebarContext, type ChatSidebarContextValue, type ChatSidebarProps, Checkbox, Col, Composer, type ComposerOption, type ComposerOptionGroup, CreateThreadButton, type CreateThreadButtonProps, Divider, Form, Heading, Image, Input, Label, List, ListItem, MelonyClientProvider, type MelonyClientProviderProps, MelonyContext, type MelonyContextValue, type Message, RadioGroup, Row, type ScreenSize, Select, SidebarToggle, type SidebarToggleProps, Spacer, type StarterPrompt, Text, Textarea, ThemeProvider, ThemeToggle, Thread, ThreadContext, type ThreadContextValue, type ThreadData, ThreadList, type ThreadListProps, ThreadPopover, type ThreadPopoverProps, ThreadProvider, type ThreadProviderProps, type ThreadService, UIRenderer, type UIRendererProps, type UseMelonyOptions, type User, groupEventsToMessages, useAuth, useChatSidebar, useMelony, useScreenSize, useTheme, useThreads };
|