@brainfish-ai/components 0.25.1 → 0.25.3

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.
Files changed (51) hide show
  1. package/dist/conversation.d.ts +222 -0
  2. package/dist/esm/chunks/{ChatSearch.DGeR-vOp.js → ChatSearch.C7aXA1pe.js} +5 -4
  3. package/dist/esm/chunks/ChatSearch.C7aXA1pe.js.map +1 -0
  4. package/dist/esm/chunks/Conversation.BEDav4lr.js +826 -0
  5. package/dist/esm/chunks/Conversation.BEDav4lr.js.map +1 -0
  6. package/dist/esm/chunks/{feature-flags.C57XMODn.js → feature-flags.DeDEcnd1.js} +2 -2
  7. package/dist/esm/chunks/{feature-flags.C57XMODn.js.map → feature-flags.DeDEcnd1.js.map} +1 -1
  8. package/dist/esm/chunks/{filters.LuyM6z8R.js → filters.-7vSLEQ2.js} +2 -2
  9. package/dist/esm/chunks/filters.-7vSLEQ2.js.map +1 -0
  10. package/dist/esm/chunks/{header-nav.BfxbPhBr.js → header-nav.BNurn_vB.js} +2 -2
  11. package/dist/esm/chunks/{header-nav.BfxbPhBr.js.map → header-nav.BNurn_vB.js.map} +1 -1
  12. package/dist/esm/chunks/{layout.r6wmt9tu.js → header-pane.BKCOw7kk.js} +50 -5
  13. package/dist/esm/chunks/header-pane.BKCOw7kk.js.map +1 -0
  14. package/dist/esm/chunks/{hooks.r53voN37.js → hooks.m-nIJmio.js} +2 -2
  15. package/dist/esm/chunks/{hooks.r53voN37.js.map → hooks.m-nIJmio.js.map} +1 -1
  16. package/dist/esm/chunks/input-with-tags.tg2nhPFv.js +110 -0
  17. package/dist/esm/chunks/input-with-tags.tg2nhPFv.js.map +1 -0
  18. package/dist/esm/chunks/{review-list.Gro9EAA8.js → review-list.DjtiIcPl.js} +2 -2
  19. package/dist/esm/chunks/{review-list.Gro9EAA8.js.map → review-list.DjtiIcPl.js.map} +1 -1
  20. package/dist/esm/chunks/{sidebar.BXXr2DBo.js → sidebar.PfXKnt9J.js} +9 -3
  21. package/dist/esm/chunks/sidebar.PfXKnt9J.js.map +1 -0
  22. package/dist/esm/components/article-suggestions-banner.js +2 -3
  23. package/dist/esm/components/article-suggestions-banner.js.map +1 -1
  24. package/dist/esm/components/chat-search.js +1 -1
  25. package/dist/esm/components/conversation.js +2 -0
  26. package/dist/esm/components/conversation.js.map +1 -0
  27. package/dist/esm/components/filter.js +1 -1
  28. package/dist/esm/components/input-with-tags.js +2 -0
  29. package/dist/esm/components/input-with-tags.js.map +1 -0
  30. package/dist/esm/components/ui/tooltip.js +21 -23
  31. package/dist/esm/components/ui/tooltip.js.map +1 -1
  32. package/dist/esm/global.css +1 -1
  33. package/dist/esm/index.js +17 -987
  34. package/dist/esm/index.js.map +1 -1
  35. package/dist/esm/layouts/full-layout.js +1 -7
  36. package/dist/esm/layouts/full-layout.js.map +1 -1
  37. package/dist/esm/layouts/header-nav.js +1 -1
  38. package/dist/esm/layouts/sidebar.js +1 -1
  39. package/dist/esm/scenes/knowledge-review.js +3 -4
  40. package/dist/esm/scenes/knowledge-review.js.map +1 -1
  41. package/dist/full-layout.d.ts +97 -4
  42. package/dist/index.d.ts +2 -4
  43. package/dist/input-with-tags.d.ts +31 -0
  44. package/dist/layouts/full-layout.d.ts +1 -3
  45. package/dist/stats.html +1 -1
  46. package/dist/tooltip.d.ts +2 -4
  47. package/package.json +7 -2
  48. package/dist/esm/chunks/ChatSearch.DGeR-vOp.js.map +0 -1
  49. package/dist/esm/chunks/filters.LuyM6z8R.js.map +0 -1
  50. package/dist/esm/chunks/layout.r6wmt9tu.js.map +0 -1
  51. package/dist/esm/chunks/sidebar.BXXr2DBo.js.map +0 -1
@@ -0,0 +1,222 @@
1
+ import { ConversationActionsProps } from './ConversationActions';
2
+ import { ConversationInputProps } from './ConversationInput';
3
+ import { ConversationLoadingProps } from './ConversationLoading';
4
+ import { ConversationMessagesProps } from './ConversationMessages';
5
+ import { ConversationSuggestionsProps } from './ConversationSuggestions';
6
+ import { default as default_2 } from 'react';
7
+ import { ReactNode } from 'react';
8
+
9
+ export declare type ActionButtonsPart = {
10
+ type: 'action-buttons';
11
+ actions: ConversationAction[];
12
+ };
13
+
14
+ export declare type Attachment = {
15
+ id: string;
16
+ type: 'image' | 'file';
17
+ name: string;
18
+ url: string;
19
+ file?: File;
20
+ };
21
+
22
+ export declare type AttachmentAction = {
23
+ type: 'select-collection';
24
+ collection: Collection;
25
+ } | {
26
+ type: 'attach-tab';
27
+ } | {
28
+ type: 'screenshot';
29
+ } | {
30
+ type: 'record-video';
31
+ } | {
32
+ type: 'add-file';
33
+ };
34
+
35
+ export declare type Citation = {
36
+ id: string;
37
+ index: number;
38
+ title: string;
39
+ url: string;
40
+ };
41
+
42
+ export declare type CitationPart = {
43
+ type: 'citation';
44
+ citations: Citation[];
45
+ };
46
+
47
+ declare type Collection = {
48
+ id: string;
49
+ label: string;
50
+ };
51
+
52
+ export declare type ContextPill = {
53
+ id: string;
54
+ label: string;
55
+ icon?: string;
56
+ };
57
+
58
+ export declare const ContextPillBadge: ({ pill, onRemove }: ContextPillBadgeProps) => default_2.JSX.Element;
59
+
60
+ declare interface ContextPillBadgeProps {
61
+ pill: ContextPill;
62
+ onRemove?: (pill: ContextPill) => void;
63
+ }
64
+
65
+ export declare const Conversation: (({ messages, callbacks, children, suggestions, actions, placeholder, attachments, collections, contextPills, showBranding, className, }: ConversationProps) => default_2.JSX.Element) & {
66
+ Messages: ({ className, bottomPadding, onContentBehind }: ConversationMessagesProps) => default_2.JSX.Element;
67
+ Input: ({ placeholder, attachments, collections, contextPills, disabled, isElevated, className, }: ConversationInputProps) => default_2.JSX.Element;
68
+ Suggestions: ({ items, className }: ConversationSuggestionsProps) => default_2.JSX.Element | null;
69
+ Actions: ({ actions, onActionClick, className }: ConversationActionsProps) => default_2.JSX.Element | null;
70
+ Loading: ({ className }: ConversationLoadingProps) => default_2.JSX.Element;
71
+ };
72
+
73
+ export declare type ConversationAction = {
74
+ id: string;
75
+ label: string;
76
+ icon?: string;
77
+ description?: string;
78
+ };
79
+
80
+ export declare const ConversationActions: ({ actions, onActionClick, className }: ConversationActionsProps_2) => default_2.JSX.Element | null;
81
+
82
+ declare interface ConversationActionsProps_2 {
83
+ actions: ConversationAction[];
84
+ onActionClick?: (action: ConversationAction) => void;
85
+ className?: string;
86
+ }
87
+
88
+ export declare type ConversationCallbacks = {
89
+ onSend?: (text: string, attachments?: Attachment[]) => void;
90
+ onStop?: () => void;
91
+ onSuggestionClick?: (suggestion: Suggestion) => void;
92
+ onActionClick?: (action: ConversationAction, messageId: string) => void;
93
+ onFeedback?: (messageId: string, feedback: 'positive' | 'negative') => void;
94
+ onCitationClick?: (citation: Citation) => void;
95
+ onAttachmentAction?: (action: AttachmentAction) => void;
96
+ onContextPillRemove?: (pill: ContextPill) => void;
97
+ onCopy?: (messageId: string, content: string) => void;
98
+ };
99
+
100
+ export declare interface ConversationContextValue {
101
+ messages: Message[];
102
+ callbacks: ConversationCallbacks;
103
+ isStreaming: boolean;
104
+ }
105
+
106
+ export declare const ConversationInput: ({ placeholder, attachments, collections, contextPills, disabled, isElevated, className, }: ConversationInputProps_2) => default_2.JSX.Element;
107
+
108
+ declare interface ConversationInputProps_2 {
109
+ placeholder?: string;
110
+ attachments?: Attachment[];
111
+ collections?: Collection[];
112
+ contextPills?: ContextPill[];
113
+ disabled?: boolean;
114
+ isElevated?: boolean;
115
+ className?: string;
116
+ }
117
+
118
+ export declare const ConversationLoading: ({ className }: ConversationLoadingProps_2) => default_2.JSX.Element;
119
+
120
+ declare interface ConversationLoadingProps_2 {
121
+ className?: string;
122
+ }
123
+
124
+ export declare const ConversationMessageAssistant: ({ message, className }: ConversationMessageAssistantProps) => default_2.JSX.Element;
125
+
126
+ declare interface ConversationMessageAssistantProps {
127
+ message: Message;
128
+ className?: string;
129
+ }
130
+
131
+ export declare const ConversationMessages: ({ className, bottomPadding, onContentBehind }: ConversationMessagesProps_2) => default_2.JSX.Element;
132
+
133
+ declare interface ConversationMessagesProps_2 {
134
+ className?: string;
135
+ bottomPadding?: number;
136
+ onContentBehind?: (isBehind: boolean) => void;
137
+ }
138
+
139
+ export declare const ConversationMessageUser: ({ message, className }: ConversationMessageUserProps) => default_2.JSX.Element;
140
+
141
+ declare interface ConversationMessageUserProps {
142
+ message: Message;
143
+ className?: string;
144
+ }
145
+
146
+ declare interface ConversationProps {
147
+ messages: Message[];
148
+ callbacks: ConversationCallbacks;
149
+ children?: ReactNode;
150
+ suggestions?: Suggestion[];
151
+ actions?: ConversationAction[];
152
+ placeholder?: string;
153
+ attachments?: Attachment[];
154
+ collections?: Collection[];
155
+ contextPills?: ContextPill[];
156
+ showBranding?: boolean;
157
+ className?: string;
158
+ }
159
+
160
+ export declare function ConversationProvider({ messages, callbacks, children }: ConversationProviderProps): default_2.JSX.Element;
161
+
162
+ declare interface ConversationProviderProps {
163
+ messages: Message[];
164
+ callbacks: ConversationCallbacks;
165
+ children: default_2.ReactNode;
166
+ }
167
+
168
+ export declare const ConversationSuggestions: ({ items, className }: ConversationSuggestionsProps_2) => default_2.JSX.Element | null;
169
+
170
+ declare interface ConversationSuggestionsProps_2 {
171
+ items: Suggestion[];
172
+ className?: string;
173
+ }
174
+
175
+ export declare type ImagePart = {
176
+ type: 'image';
177
+ url: string;
178
+ alt?: string;
179
+ };
180
+
181
+ export declare type Message = {
182
+ id: string;
183
+ role: MessageRole;
184
+ parts: MessagePart[];
185
+ status: MessageStatus;
186
+ createdAt?: Date;
187
+ feedback?: 'positive' | 'negative';
188
+ };
189
+
190
+ export declare type MessagePart = TextPart | ImagePart | CitationPart | ToolCallPart | ThinkingPart | ActionButtonsPart;
191
+
192
+ export declare type MessageRole = 'user' | 'assistant';
193
+
194
+ export declare type MessageStatus = 'pending' | 'streaming' | 'completed' | 'error';
195
+
196
+ export declare type Suggestion = {
197
+ id: string;
198
+ text: string;
199
+ icon?: string;
200
+ };
201
+
202
+ export declare type TextPart = {
203
+ type: 'text';
204
+ text: string;
205
+ };
206
+
207
+ export declare type ThinkingPart = {
208
+ type: 'thinking';
209
+ text: string;
210
+ };
211
+
212
+ export declare type ToolCallPart = {
213
+ type: 'tool-call';
214
+ toolName: string;
215
+ status: 'pending' | 'running' | 'completed' | 'error';
216
+ args?: Record<string, unknown>;
217
+ result?: string;
218
+ };
219
+
220
+ export declare function useConversation(): ConversationContextValue;
221
+
222
+ export { }
@@ -27,9 +27,9 @@ import { getCountry } from 'countries-and-timezones';
27
27
  import { Switch } from '../components/ui/switch.js';
28
28
  import { C as Combobox } from './combobox.CJKym3Z1.js';
29
29
  import { T as TwoLevelCombobox } from './two-level-combobox.BXs2z9u5.js';
30
- import { u as useBooleanFlagValue, F as FeatureFlagProvider } from './feature-flags.C57XMODn.js';
30
+ import { u as useBooleanFlagValue, F as FeatureFlagProvider } from './feature-flags.DeDEcnd1.js';
31
31
  import { X as X$1 } from 'lucide-react';
32
- import { l as loadConversation, c as createConversationId, a as uploadFileToApi, b as useAutocomplete, s as sendFeedbackReason, d as sendFeedback, e as searchApi, f as fetchAnswerStream, g as fetchFollowUpQuestions } from './hooks.r53voN37.js';
32
+ import { l as loadConversation, c as createConversationId, a as uploadFileToApi, b as useAutocomplete, s as sendFeedbackReason, d as sendFeedback, e as searchApi, f as fetchAnswerStream, g as fetchFollowUpQuestions } from './hooks.m-nIJmio.js';
33
33
  import { ScrollArea } from '../components/ui/scroll-area.js';
34
34
 
35
35
  import '../ChatSearch.css';function Suggestions({ suggestions, onQuestionClick, title = "Suggested questions" }) {
@@ -4964,7 +4964,8 @@ function TimelineNavigation({ questions, activeIndex, onNavigate, offset }) {
4964
4964
  {
4965
4965
  side: "right",
4966
4966
  sideOffset: 8,
4967
- className: "max-w-[300px] bg-card text-card-foreground border-foreground/35"
4967
+ bgColor: "--bfc-card",
4968
+ className: "max-w-[300px] text-card-foreground border-foreground/35"
4968
4969
  },
4969
4970
  /* @__PURE__ */ React__default.createElement("p", { className: "break-words leading-relaxed" }, question)
4970
4971
  )))
@@ -6667,4 +6668,4 @@ const ChatSearch = forwardRef(({ featureFlags, ...props }, ref) => /* @__PURE__
6667
6668
  ChatSearch.displayName = "ChatSearch";
6668
6669
 
6669
6670
  export { ChatSearch as C, ChatSearchProvider as a, useIsChatSearchDirty as b, useChatSearch as u };
6670
- //# sourceMappingURL=ChatSearch.DGeR-vOp.js.map
6671
+ //# sourceMappingURL=ChatSearch.C7aXA1pe.js.map