@emblemvault/hustle-react 1.2.0 → 1.4.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,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { C as ChatMessage, T as ToolCall } from '../hustle-S48t4lTZ.cjs';
3
+ import React from 'react';
3
4
  import 'hustle-incognito';
4
5
 
5
6
  /**
@@ -14,6 +15,8 @@ interface HustleChatProps {
14
15
  showSettings?: boolean;
15
16
  /** Show debug info */
16
17
  showDebug?: boolean;
18
+ /** Hide the header (useful when embedding in a widget with its own header) */
19
+ hideHeader?: boolean;
17
20
  /** Initial system prompt */
18
21
  initialSystemPrompt?: string;
19
22
  /** Callback when message is sent */
@@ -40,7 +43,150 @@ interface HustleChatProps {
40
43
  * />
41
44
  * ```
42
45
  */
43
- declare function HustleChat({ className, placeholder, showSettings, showDebug, initialSystemPrompt, onMessage, onToolCall, onResponse, }: HustleChatProps): react_jsx_runtime.JSX.Element;
46
+ declare function HustleChat({ className, placeholder, showSettings, showDebug, hideHeader, initialSystemPrompt, onMessage, onToolCall, onResponse, }: HustleChatProps): react_jsx_runtime.JSX.Element;
47
+
48
+ /**
49
+ * Position options for the widget
50
+ */
51
+ type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
52
+ /**
53
+ * Size options for the chat panel
54
+ */
55
+ type WidgetSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
56
+ /**
57
+ * Configuration for the floating chat widget
58
+ */
59
+ interface HustleChatWidgetConfig {
60
+ /**
61
+ * Position of the widget on the screen
62
+ * @default 'bottom-right'
63
+ */
64
+ position?: WidgetPosition;
65
+ /**
66
+ * Size of the chat panel when open
67
+ * @default 'md'
68
+ */
69
+ size?: WidgetSize;
70
+ /**
71
+ * Title shown in the chat header
72
+ * @default 'Chat'
73
+ */
74
+ title?: string;
75
+ /**
76
+ * Whether the widget starts open
77
+ * @default false
78
+ */
79
+ defaultOpen?: boolean;
80
+ /**
81
+ * Custom icon for the launcher button (React node)
82
+ */
83
+ launcherIcon?: React.ReactNode;
84
+ /**
85
+ * Offset from the edge of the screen
86
+ * @default { x: 24, y: 24 }
87
+ */
88
+ offset?: {
89
+ x: number;
90
+ y: number;
91
+ };
92
+ /**
93
+ * Z-index for the widget
94
+ * @default 9999
95
+ */
96
+ zIndex?: number;
97
+ /**
98
+ * Whether to show a badge on the launcher
99
+ * @default false
100
+ */
101
+ showBadge?: boolean;
102
+ /**
103
+ * Badge content (number or string)
104
+ */
105
+ badgeContent?: string | number;
106
+ /**
107
+ * Custom styles for the launcher button
108
+ */
109
+ launcherStyle?: React.CSSProperties;
110
+ /**
111
+ * Custom styles for the chat panel
112
+ */
113
+ panelStyle?: React.CSSProperties;
114
+ /**
115
+ * Callback when widget opens
116
+ */
117
+ onOpen?: () => void;
118
+ /**
119
+ * Callback when widget closes
120
+ */
121
+ onClose?: () => void;
122
+ /**
123
+ * Storage key for persisting open/close state
124
+ * Set to false to disable persistence
125
+ * @default 'hustle-widget-open'
126
+ */
127
+ storageKey?: string | false;
128
+ }
129
+ /**
130
+ * Props for HustleChatWidget component
131
+ */
132
+ interface HustleChatWidgetProps extends Omit<HustleChatProps, 'className'> {
133
+ /**
134
+ * Widget configuration
135
+ */
136
+ config?: HustleChatWidgetConfig;
137
+ }
138
+ /**
139
+ * Floating chat widget that can be placed anywhere on your site.
140
+ *
141
+ * Designed for easy integration - just drop it into your Next.js layout
142
+ * and it will persist across page navigations.
143
+ *
144
+ * @example Basic usage in Next.js layout
145
+ * ```tsx
146
+ * // app/layout.tsx
147
+ * import { HustleProvider, HustleChatWidget } from '@emblemvault/hustle-react';
148
+ *
149
+ * export default function RootLayout({ children }) {
150
+ * return (
151
+ * <html>
152
+ * <body>
153
+ * <HustleProvider>
154
+ * {children}
155
+ * <HustleChatWidget />
156
+ * </HustleProvider>
157
+ * </body>
158
+ * </html>
159
+ * );
160
+ * }
161
+ * ```
162
+ *
163
+ * @example With custom configuration
164
+ * ```tsx
165
+ * <HustleChatWidget
166
+ * config={{
167
+ * position: 'bottom-right',
168
+ * size: 'lg',
169
+ * title: 'Support',
170
+ * defaultOpen: false,
171
+ * offset: { x: 24, y: 24 },
172
+ * }}
173
+ * showSettings
174
+ * placeholder="How can we help?"
175
+ * />
176
+ * ```
177
+ *
178
+ * @example With badge notification
179
+ * ```tsx
180
+ * <HustleChatWidget
181
+ * config={{
182
+ * showBadge: true,
183
+ * badgeContent: 3,
184
+ * onOpen: () => clearNotifications(),
185
+ * }}
186
+ * />
187
+ * ```
188
+ */
189
+ declare function HustleChatWidget({ config, ...chatProps }: HustleChatWidgetProps): react_jsx_runtime.JSX.Element | null;
44
190
 
45
191
  /**
46
192
  * MarkdownContent - Renders markdown using marked + highlight.js
@@ -55,4 +201,4 @@ interface MarkdownContentProps {
55
201
  }
56
202
  declare function MarkdownContent({ content, className }: MarkdownContentProps): react_jsx_runtime.JSX.Element;
57
203
 
58
- export { HustleChat, type HustleChatProps, MarkdownContent };
204
+ export { HustleChat, type HustleChatProps, HustleChatWidget, type HustleChatWidgetConfig, type HustleChatWidgetProps, MarkdownContent, type WidgetPosition, type WidgetSize };
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { C as ChatMessage, T as ToolCall } from '../hustle-S48t4lTZ.js';
3
+ import React from 'react';
3
4
  import 'hustle-incognito';
4
5
 
5
6
  /**
@@ -14,6 +15,8 @@ interface HustleChatProps {
14
15
  showSettings?: boolean;
15
16
  /** Show debug info */
16
17
  showDebug?: boolean;
18
+ /** Hide the header (useful when embedding in a widget with its own header) */
19
+ hideHeader?: boolean;
17
20
  /** Initial system prompt */
18
21
  initialSystemPrompt?: string;
19
22
  /** Callback when message is sent */
@@ -40,7 +43,150 @@ interface HustleChatProps {
40
43
  * />
41
44
  * ```
42
45
  */
43
- declare function HustleChat({ className, placeholder, showSettings, showDebug, initialSystemPrompt, onMessage, onToolCall, onResponse, }: HustleChatProps): react_jsx_runtime.JSX.Element;
46
+ declare function HustleChat({ className, placeholder, showSettings, showDebug, hideHeader, initialSystemPrompt, onMessage, onToolCall, onResponse, }: HustleChatProps): react_jsx_runtime.JSX.Element;
47
+
48
+ /**
49
+ * Position options for the widget
50
+ */
51
+ type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
52
+ /**
53
+ * Size options for the chat panel
54
+ */
55
+ type WidgetSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
56
+ /**
57
+ * Configuration for the floating chat widget
58
+ */
59
+ interface HustleChatWidgetConfig {
60
+ /**
61
+ * Position of the widget on the screen
62
+ * @default 'bottom-right'
63
+ */
64
+ position?: WidgetPosition;
65
+ /**
66
+ * Size of the chat panel when open
67
+ * @default 'md'
68
+ */
69
+ size?: WidgetSize;
70
+ /**
71
+ * Title shown in the chat header
72
+ * @default 'Chat'
73
+ */
74
+ title?: string;
75
+ /**
76
+ * Whether the widget starts open
77
+ * @default false
78
+ */
79
+ defaultOpen?: boolean;
80
+ /**
81
+ * Custom icon for the launcher button (React node)
82
+ */
83
+ launcherIcon?: React.ReactNode;
84
+ /**
85
+ * Offset from the edge of the screen
86
+ * @default { x: 24, y: 24 }
87
+ */
88
+ offset?: {
89
+ x: number;
90
+ y: number;
91
+ };
92
+ /**
93
+ * Z-index for the widget
94
+ * @default 9999
95
+ */
96
+ zIndex?: number;
97
+ /**
98
+ * Whether to show a badge on the launcher
99
+ * @default false
100
+ */
101
+ showBadge?: boolean;
102
+ /**
103
+ * Badge content (number or string)
104
+ */
105
+ badgeContent?: string | number;
106
+ /**
107
+ * Custom styles for the launcher button
108
+ */
109
+ launcherStyle?: React.CSSProperties;
110
+ /**
111
+ * Custom styles for the chat panel
112
+ */
113
+ panelStyle?: React.CSSProperties;
114
+ /**
115
+ * Callback when widget opens
116
+ */
117
+ onOpen?: () => void;
118
+ /**
119
+ * Callback when widget closes
120
+ */
121
+ onClose?: () => void;
122
+ /**
123
+ * Storage key for persisting open/close state
124
+ * Set to false to disable persistence
125
+ * @default 'hustle-widget-open'
126
+ */
127
+ storageKey?: string | false;
128
+ }
129
+ /**
130
+ * Props for HustleChatWidget component
131
+ */
132
+ interface HustleChatWidgetProps extends Omit<HustleChatProps, 'className'> {
133
+ /**
134
+ * Widget configuration
135
+ */
136
+ config?: HustleChatWidgetConfig;
137
+ }
138
+ /**
139
+ * Floating chat widget that can be placed anywhere on your site.
140
+ *
141
+ * Designed for easy integration - just drop it into your Next.js layout
142
+ * and it will persist across page navigations.
143
+ *
144
+ * @example Basic usage in Next.js layout
145
+ * ```tsx
146
+ * // app/layout.tsx
147
+ * import { HustleProvider, HustleChatWidget } from '@emblemvault/hustle-react';
148
+ *
149
+ * export default function RootLayout({ children }) {
150
+ * return (
151
+ * <html>
152
+ * <body>
153
+ * <HustleProvider>
154
+ * {children}
155
+ * <HustleChatWidget />
156
+ * </HustleProvider>
157
+ * </body>
158
+ * </html>
159
+ * );
160
+ * }
161
+ * ```
162
+ *
163
+ * @example With custom configuration
164
+ * ```tsx
165
+ * <HustleChatWidget
166
+ * config={{
167
+ * position: 'bottom-right',
168
+ * size: 'lg',
169
+ * title: 'Support',
170
+ * defaultOpen: false,
171
+ * offset: { x: 24, y: 24 },
172
+ * }}
173
+ * showSettings
174
+ * placeholder="How can we help?"
175
+ * />
176
+ * ```
177
+ *
178
+ * @example With badge notification
179
+ * ```tsx
180
+ * <HustleChatWidget
181
+ * config={{
182
+ * showBadge: true,
183
+ * badgeContent: 3,
184
+ * onOpen: () => clearNotifications(),
185
+ * }}
186
+ * />
187
+ * ```
188
+ */
189
+ declare function HustleChatWidget({ config, ...chatProps }: HustleChatWidgetProps): react_jsx_runtime.JSX.Element | null;
44
190
 
45
191
  /**
46
192
  * MarkdownContent - Renders markdown using marked + highlight.js
@@ -55,4 +201,4 @@ interface MarkdownContentProps {
55
201
  }
56
202
  declare function MarkdownContent({ content, className }: MarkdownContentProps): react_jsx_runtime.JSX.Element;
57
203
 
58
- export { HustleChat, type HustleChatProps, MarkdownContent };
204
+ export { HustleChat, type HustleChatProps, HustleChatWidget, type HustleChatWidgetConfig, type HustleChatWidgetProps, MarkdownContent, type WidgetPosition, type WidgetSize };