@brainfish-ai/components 0.0.0-alpha.test
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/.vscode/settings.json +8 -0
- package/.vscode /extensions.json +3 -0
- package/.vscode /settings.json +4 -0
- package/LICENSE +21 -0
- package/README.md +121 -0
- package/components.json +16 -0
- package/dist/esm/index.css +4 -0
- package/dist/esm/index.css.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.ts +522 -0
- package/package.json +141 -0
- package/stats.html +4949 -0
- package/tailwind.config.js +139 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,522 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
|
+
import React__default, { ReactNode, FC } from 'react';
|
|
4
|
+
import { JSONSchemaType } from 'ajv';
|
|
5
|
+
import { FeatureFlags } from '@/lib/feature-flags';
|
|
6
|
+
import { Options } from 'react-markdown';
|
|
7
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
8
|
+
import { VariantProps } from 'class-variance-authority';
|
|
9
|
+
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
10
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
11
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
12
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
13
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
14
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
15
|
+
|
|
16
|
+
declare function customColor(cssVariable: string, fallbackColor?: string): ({ opacityVariable, opacityValue }: {
|
|
17
|
+
opacityVariable: string;
|
|
18
|
+
opacityValue: string;
|
|
19
|
+
}) => string;
|
|
20
|
+
|
|
21
|
+
declare const BrainfishColors: {
|
|
22
|
+
primary: {
|
|
23
|
+
50: string;
|
|
24
|
+
100: string;
|
|
25
|
+
200: string;
|
|
26
|
+
300: string;
|
|
27
|
+
400: string;
|
|
28
|
+
500: string;
|
|
29
|
+
600: string;
|
|
30
|
+
700: string;
|
|
31
|
+
800: string;
|
|
32
|
+
900: string;
|
|
33
|
+
DEFAULT: ({ opacityVariable, opacityValue }: {
|
|
34
|
+
opacityVariable: string;
|
|
35
|
+
opacityValue: string;
|
|
36
|
+
}) => string;
|
|
37
|
+
foreground: ({ opacityVariable, opacityValue }: {
|
|
38
|
+
opacityVariable: string;
|
|
39
|
+
opacityValue: string;
|
|
40
|
+
}) => string;
|
|
41
|
+
};
|
|
42
|
+
dark: {
|
|
43
|
+
50: string;
|
|
44
|
+
100: string;
|
|
45
|
+
200: string;
|
|
46
|
+
300: string;
|
|
47
|
+
400: string;
|
|
48
|
+
500: string;
|
|
49
|
+
600: string;
|
|
50
|
+
700: string;
|
|
51
|
+
800: string;
|
|
52
|
+
900: string;
|
|
53
|
+
DEFAULT: string;
|
|
54
|
+
};
|
|
55
|
+
orange: {
|
|
56
|
+
50: string;
|
|
57
|
+
100: string;
|
|
58
|
+
200: string;
|
|
59
|
+
300: string;
|
|
60
|
+
400: string;
|
|
61
|
+
500: string;
|
|
62
|
+
600: string;
|
|
63
|
+
700: string;
|
|
64
|
+
800: string;
|
|
65
|
+
900: string;
|
|
66
|
+
DEFAULT: string;
|
|
67
|
+
};
|
|
68
|
+
yellow: {
|
|
69
|
+
50: string;
|
|
70
|
+
100: string;
|
|
71
|
+
200: string;
|
|
72
|
+
300: string;
|
|
73
|
+
400: string;
|
|
74
|
+
500: string;
|
|
75
|
+
600: string;
|
|
76
|
+
700: string;
|
|
77
|
+
800: string;
|
|
78
|
+
900: string;
|
|
79
|
+
DEFAULT: string;
|
|
80
|
+
};
|
|
81
|
+
green: {
|
|
82
|
+
50: string;
|
|
83
|
+
100: string;
|
|
84
|
+
200: string;
|
|
85
|
+
300: string;
|
|
86
|
+
400: string;
|
|
87
|
+
500: string;
|
|
88
|
+
600: string;
|
|
89
|
+
700: string;
|
|
90
|
+
800: string;
|
|
91
|
+
900: string;
|
|
92
|
+
DEFAULT: string;
|
|
93
|
+
};
|
|
94
|
+
blue: {
|
|
95
|
+
50: string;
|
|
96
|
+
100: string;
|
|
97
|
+
200: string;
|
|
98
|
+
300: string;
|
|
99
|
+
400: string;
|
|
100
|
+
500: string;
|
|
101
|
+
600: string;
|
|
102
|
+
700: string;
|
|
103
|
+
800: string;
|
|
104
|
+
900: string;
|
|
105
|
+
DEFAULT: string;
|
|
106
|
+
};
|
|
107
|
+
purple: {
|
|
108
|
+
50: string;
|
|
109
|
+
100: string;
|
|
110
|
+
200: string;
|
|
111
|
+
300: string;
|
|
112
|
+
400: string;
|
|
113
|
+
500: string;
|
|
114
|
+
600: string;
|
|
115
|
+
700: string;
|
|
116
|
+
800: string;
|
|
117
|
+
900: string;
|
|
118
|
+
DEFAULT: string;
|
|
119
|
+
};
|
|
120
|
+
pink: {
|
|
121
|
+
50: string;
|
|
122
|
+
100: string;
|
|
123
|
+
200: string;
|
|
124
|
+
300: string;
|
|
125
|
+
400: string;
|
|
126
|
+
500: string;
|
|
127
|
+
600: string;
|
|
128
|
+
700: string;
|
|
129
|
+
800: string;
|
|
130
|
+
900: string;
|
|
131
|
+
DEFAULT: string;
|
|
132
|
+
};
|
|
133
|
+
red: {
|
|
134
|
+
50: string;
|
|
135
|
+
100: string;
|
|
136
|
+
200: string;
|
|
137
|
+
300: string;
|
|
138
|
+
400: string;
|
|
139
|
+
500: string;
|
|
140
|
+
600: string;
|
|
141
|
+
700: string;
|
|
142
|
+
800: string;
|
|
143
|
+
900: string;
|
|
144
|
+
DEFAULT: string;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
type JSONSchema<T> = JSONSchemaType<T>;
|
|
149
|
+
interface TextConfig {
|
|
150
|
+
headerText?: string;
|
|
151
|
+
searchPlaceholder?: string;
|
|
152
|
+
attachImageText?: string;
|
|
153
|
+
allDocumentsText?: string;
|
|
154
|
+
loadingSearchText?: string;
|
|
155
|
+
loadingAnswerText?: string;
|
|
156
|
+
errorText?: string;
|
|
157
|
+
followUpPlaceholder?: string;
|
|
158
|
+
positiveAnswerText?: string;
|
|
159
|
+
negativeAnswerText?: string;
|
|
160
|
+
suggestionsTitle?: string;
|
|
161
|
+
uncertaintyFallbackText?: Record<string, string>;
|
|
162
|
+
}
|
|
163
|
+
type FeedbackResponse = 'accept' | 'reject';
|
|
164
|
+
type MarkdownTextBlock = {
|
|
165
|
+
id: string;
|
|
166
|
+
type: 'markdown-text';
|
|
167
|
+
text: string;
|
|
168
|
+
};
|
|
169
|
+
type ActionButtonsBlock = {
|
|
170
|
+
id: string;
|
|
171
|
+
type: 'action-buttons';
|
|
172
|
+
};
|
|
173
|
+
type ActionInputFormBlock = {
|
|
174
|
+
id: string;
|
|
175
|
+
type: 'action-input-form';
|
|
176
|
+
state: 'ready' | 'processing' | 'completed';
|
|
177
|
+
actionId: string;
|
|
178
|
+
initialValues: ActionInputs;
|
|
179
|
+
schema: ActionInputsSchema;
|
|
180
|
+
onSubmit?: (inputs: ActionInputs) => void;
|
|
181
|
+
};
|
|
182
|
+
type AnswerBlock = MarkdownTextBlock | ActionButtonsBlock | ActionInputFormBlock;
|
|
183
|
+
type AnswerState = 'fetching-search-results' | 'fetching-stream' | 'streaming' | 'getting-action-inputs' | 'completed';
|
|
184
|
+
interface Answer {
|
|
185
|
+
id: string;
|
|
186
|
+
state: AnswerState;
|
|
187
|
+
question: string;
|
|
188
|
+
blocks: AnswerBlock[];
|
|
189
|
+
searchResults?: SearchResult[];
|
|
190
|
+
followUpQuestions?: string[];
|
|
191
|
+
searchQueryId?: string;
|
|
192
|
+
feedback?: FeedbackResponse;
|
|
193
|
+
isUncertain?: boolean;
|
|
194
|
+
uncertaintyLanguage?: string | null;
|
|
195
|
+
uncertaintyFallbackText?: string;
|
|
196
|
+
searchIntentId?: string;
|
|
197
|
+
}
|
|
198
|
+
type ActionInputValue = string | number | boolean | null;
|
|
199
|
+
type ActionInputs = Record<string, ActionInputValue>;
|
|
200
|
+
type ActionInputsSchema = JSONSchemaType<ActionInputs>;
|
|
201
|
+
interface SearchResult {
|
|
202
|
+
id: string;
|
|
203
|
+
title: string;
|
|
204
|
+
url: string;
|
|
205
|
+
}
|
|
206
|
+
interface Collection {
|
|
207
|
+
id: string;
|
|
208
|
+
name: string;
|
|
209
|
+
}
|
|
210
|
+
interface Suggestion {
|
|
211
|
+
id: string;
|
|
212
|
+
question: string;
|
|
213
|
+
conversationId?: string;
|
|
214
|
+
messageCount?: number;
|
|
215
|
+
}
|
|
216
|
+
interface ChatSearchProps {
|
|
217
|
+
suggestions?: Suggestion[];
|
|
218
|
+
collections?: Array<{
|
|
219
|
+
id: string;
|
|
220
|
+
name: string;
|
|
221
|
+
}>;
|
|
222
|
+
selectedCollectionId?: string;
|
|
223
|
+
onCollectionChange?: (collectionId: string) => void;
|
|
224
|
+
searchEndpoint: string;
|
|
225
|
+
answerEndpoint: string;
|
|
226
|
+
answerStreamEndpoint: string;
|
|
227
|
+
feedbackEndpoint?: string;
|
|
228
|
+
loadConversationEndpoint?: string;
|
|
229
|
+
followUpQuestionsEndpoint?: string;
|
|
230
|
+
autocompleteEndpoint?: string;
|
|
231
|
+
disableFollowUpQuestions?: boolean;
|
|
232
|
+
disableImageAttachment?: boolean;
|
|
233
|
+
disableFeedback?: boolean;
|
|
234
|
+
siblingNode?: React.ReactNode;
|
|
235
|
+
offset?: number;
|
|
236
|
+
headers?: Record<string, string>;
|
|
237
|
+
textConfig?: TextConfig;
|
|
238
|
+
searchPath?: string;
|
|
239
|
+
className?: string;
|
|
240
|
+
onToggleSizeButtonClick?: () => void;
|
|
241
|
+
trackEvent?: (eventName: string, data?: Record<string, any>) => void;
|
|
242
|
+
featureFlags?: FeatureFlags;
|
|
243
|
+
onCloseWidget?: () => void;
|
|
244
|
+
isWidgetMode?: boolean;
|
|
245
|
+
nextBestActions?: NextBestAction[];
|
|
246
|
+
onNextBestActionClick?: ({ action, searchQueryId, query, answer, }: {
|
|
247
|
+
action: NextBestAction;
|
|
248
|
+
searchQueryId: string;
|
|
249
|
+
query: string;
|
|
250
|
+
answer: string;
|
|
251
|
+
}) => void;
|
|
252
|
+
}
|
|
253
|
+
interface ChatSearchState {
|
|
254
|
+
showResults: boolean;
|
|
255
|
+
answers: Answer[];
|
|
256
|
+
isLoading: boolean;
|
|
257
|
+
error?: string;
|
|
258
|
+
}
|
|
259
|
+
type UrlString = string & {
|
|
260
|
+
__url: never;
|
|
261
|
+
};
|
|
262
|
+
type NextBestActionType = 'link' | 'email' | 'phone' | 'callback' | 'function';
|
|
263
|
+
type NextBestAction = {
|
|
264
|
+
id?: string;
|
|
265
|
+
label: string;
|
|
266
|
+
type: NextBestActionType;
|
|
267
|
+
icon: string | UrlString;
|
|
268
|
+
value: any;
|
|
269
|
+
};
|
|
270
|
+
|
|
271
|
+
interface ChatSearchHandle {
|
|
272
|
+
createNewThread: (firstQuery?: string) => void;
|
|
273
|
+
showFollowUpThread: (show: boolean) => void;
|
|
274
|
+
subscribeToStateChanges: (callback: (state: ChatSearchState) => void) => () => void;
|
|
275
|
+
focusSearchField: () => void;
|
|
276
|
+
showCloseButton: (showButton: boolean) => void;
|
|
277
|
+
}
|
|
278
|
+
declare const ChatSearch: React__default.ForwardRefExoticComponent<ChatSearchProps & React__default.RefAttributes<ChatSearchHandle>>;
|
|
279
|
+
|
|
280
|
+
declare const AnswersActions: {
|
|
281
|
+
readonly SET_ANSWERS: "answers/set_answers";
|
|
282
|
+
readonly CLEAR_ALL: "answers/clear_all";
|
|
283
|
+
readonly APPEND_NEW_ANSWER: "answers/create_empty_answer";
|
|
284
|
+
readonly APPEND_BLOCK: "answers/append_block";
|
|
285
|
+
readonly APPEND_ANSWER_CHUNK: "answers/append_stream_chunk";
|
|
286
|
+
readonly SET_SEARCH_RESULTS: "answers/update_search_results";
|
|
287
|
+
readonly SET_FOLLOW_UP_QUESTIONS: "answers/set_follow_up_questions";
|
|
288
|
+
readonly COMPLETE_ANSWER: "answers/finish_streaming";
|
|
289
|
+
readonly SET_ANSWER_ERROR: "answers/set_error_state";
|
|
290
|
+
readonly SET_USER_FEEDBACK: "answers/set_user_feedback";
|
|
291
|
+
readonly CLEAR_USER_FEEDBACK: "answers/clear_user_feedback";
|
|
292
|
+
readonly MARK_AS_UNCERTAIN: "answers/mark_as_uncertain";
|
|
293
|
+
readonly GET_ACTION_INPUTS: "answers/request_action_inputs";
|
|
294
|
+
readonly INVOKE_ACTION: "answers/invoke_action";
|
|
295
|
+
readonly ADD_ACTION_BUTTONS: "answers/add_action_buttons";
|
|
296
|
+
};
|
|
297
|
+
type SetAnswers = {
|
|
298
|
+
type: typeof AnswersActions.SET_ANSWERS;
|
|
299
|
+
payload: {
|
|
300
|
+
answers: Answer[];
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
type ClearAll = {
|
|
304
|
+
type: typeof AnswersActions.CLEAR_ALL;
|
|
305
|
+
};
|
|
306
|
+
type AppendNewAnswer = {
|
|
307
|
+
type: typeof AnswersActions.APPEND_NEW_ANSWER;
|
|
308
|
+
payload: {
|
|
309
|
+
id?: string;
|
|
310
|
+
query: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
type SetSearchResults = {
|
|
314
|
+
type: typeof AnswersActions.SET_SEARCH_RESULTS;
|
|
315
|
+
payload: {
|
|
316
|
+
searchQueryId: string;
|
|
317
|
+
results: SearchResult[];
|
|
318
|
+
index?: number;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
type AppendAnswerChunk = {
|
|
322
|
+
type: typeof AnswersActions.APPEND_ANSWER_CHUNK;
|
|
323
|
+
payload: {
|
|
324
|
+
text: string;
|
|
325
|
+
index?: number;
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
type SetAnswerError = {
|
|
329
|
+
type: typeof AnswersActions.SET_ANSWER_ERROR;
|
|
330
|
+
payload: {
|
|
331
|
+
error: string;
|
|
332
|
+
index?: number;
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
type SetUserFeedback = {
|
|
336
|
+
type: typeof AnswersActions.SET_USER_FEEDBACK;
|
|
337
|
+
payload: {
|
|
338
|
+
feedback: FeedbackResponse;
|
|
339
|
+
index?: number;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
type ClearUserFeedback = {
|
|
343
|
+
type: typeof AnswersActions.CLEAR_USER_FEEDBACK;
|
|
344
|
+
payload: {
|
|
345
|
+
index?: number;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
type SetFollowUpQuestions = {
|
|
349
|
+
type: typeof AnswersActions.SET_FOLLOW_UP_QUESTIONS;
|
|
350
|
+
payload: {
|
|
351
|
+
questions: string[];
|
|
352
|
+
index?: number;
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
type AppendBlock = {
|
|
356
|
+
type: typeof AnswersActions.APPEND_BLOCK;
|
|
357
|
+
payload: {
|
|
358
|
+
block: AnswerBlock;
|
|
359
|
+
index?: number;
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
type CompleteAnswer = {
|
|
363
|
+
type: typeof AnswersActions.COMPLETE_ANSWER;
|
|
364
|
+
payload: {
|
|
365
|
+
index?: number;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
type MarkAsUncertain = {
|
|
369
|
+
type: typeof AnswersActions.MARK_AS_UNCERTAIN;
|
|
370
|
+
payload: {
|
|
371
|
+
uncertaintyText: string;
|
|
372
|
+
index?: number;
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
type GetActionInputs = {
|
|
376
|
+
type: typeof AnswersActions.GET_ACTION_INPUTS;
|
|
377
|
+
payload: {
|
|
378
|
+
searchIntentId: string;
|
|
379
|
+
actionId: string;
|
|
380
|
+
schema: JSONSchema<ActionInputs>;
|
|
381
|
+
initialValues: ActionInputs;
|
|
382
|
+
onSubmit: (parameters: ActionInputs) => void;
|
|
383
|
+
index?: number;
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
type AddActionButtons = {
|
|
387
|
+
type: typeof AnswersActions.ADD_ACTION_BUTTONS;
|
|
388
|
+
payload: {
|
|
389
|
+
searchIntentId: string;
|
|
390
|
+
index?: number;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
type InvokeAction = {
|
|
394
|
+
type: typeof AnswersActions.INVOKE_ACTION;
|
|
395
|
+
payload: {
|
|
396
|
+
index?: number;
|
|
397
|
+
};
|
|
398
|
+
};
|
|
399
|
+
type AnswerListAction = SetAnswers | ClearAll | AppendNewAnswer | SetSearchResults | AppendAnswerChunk | SetAnswerError | SetUserFeedback | ClearUserFeedback | SetFollowUpQuestions | AppendBlock | CompleteAnswer | MarkAsUncertain | InvokeAction | GetActionInputs | AddActionButtons;
|
|
400
|
+
|
|
401
|
+
interface ChatSearchContextProps {
|
|
402
|
+
query: string;
|
|
403
|
+
setQuery: React__default.Dispatch<React__default.SetStateAction<string>>;
|
|
404
|
+
queryId: string;
|
|
405
|
+
setQueryId: React__default.Dispatch<React__default.SetStateAction<string>>;
|
|
406
|
+
followUpQuery: string;
|
|
407
|
+
setFollowUpQuery: React__default.Dispatch<React__default.SetStateAction<string>>;
|
|
408
|
+
isSearching: boolean;
|
|
409
|
+
setIsSearching: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
410
|
+
showResults: boolean;
|
|
411
|
+
setShowResults: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
412
|
+
answers: Answer[];
|
|
413
|
+
answerListDispatch: React__default.Dispatch<AnswerListAction>;
|
|
414
|
+
activeAnswerIndex: number;
|
|
415
|
+
setActiveAnswerIndex: React__default.Dispatch<React__default.SetStateAction<number>>;
|
|
416
|
+
conversationId: string | undefined;
|
|
417
|
+
setConversationId: (id: string) => void;
|
|
418
|
+
clearConversationId: () => void;
|
|
419
|
+
isLoadingConversation: boolean;
|
|
420
|
+
setIsLoadingConversation: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
421
|
+
loadError: string;
|
|
422
|
+
setLoadError: React__default.Dispatch<React__default.SetStateAction<string>>;
|
|
423
|
+
showMobileCloseWidgetButton: boolean;
|
|
424
|
+
setShowMobileCloseWidgetButton: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
425
|
+
}
|
|
426
|
+
declare const ChatSearchProvider: React__default.FC<{
|
|
427
|
+
children: ReactNode;
|
|
428
|
+
searchPath?: string;
|
|
429
|
+
}>;
|
|
430
|
+
declare const useChatSearch: () => ChatSearchContextProps;
|
|
431
|
+
|
|
432
|
+
declare const useIsChatSearchDirty: () => boolean;
|
|
433
|
+
|
|
434
|
+
interface Props$1 {
|
|
435
|
+
language: string;
|
|
436
|
+
value: string;
|
|
437
|
+
}
|
|
438
|
+
declare const CodeBlock: FC<Props$1>;
|
|
439
|
+
|
|
440
|
+
type Message = {
|
|
441
|
+
content: string;
|
|
442
|
+
uncertaintyFallbackText?: Record<string, string>;
|
|
443
|
+
};
|
|
444
|
+
interface Props {
|
|
445
|
+
message: Message;
|
|
446
|
+
isStreaming?: boolean;
|
|
447
|
+
}
|
|
448
|
+
declare const FormattedMessage: FC<Props>;
|
|
449
|
+
|
|
450
|
+
declare const MemoizedReactMarkdown: FC<Options>;
|
|
451
|
+
|
|
452
|
+
interface MermaidDiagramProps {
|
|
453
|
+
content: string;
|
|
454
|
+
}
|
|
455
|
+
declare const MermaidDiagram: React__default.FC<MermaidDiagramProps>;
|
|
456
|
+
|
|
457
|
+
interface ZoomableImageProps {
|
|
458
|
+
src?: string;
|
|
459
|
+
alt?: string;
|
|
460
|
+
}
|
|
461
|
+
declare const ZoomableImage: React$1.FC<ZoomableImageProps>;
|
|
462
|
+
|
|
463
|
+
declare const buttonVariants: (props?: ({
|
|
464
|
+
variant?: "link" | "dark" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
465
|
+
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
466
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
467
|
+
interface ButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
468
|
+
asChild?: boolean;
|
|
469
|
+
}
|
|
470
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
471
|
+
|
|
472
|
+
declare const Collapsible: React__default.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
473
|
+
declare const CollapsibleTrigger: React__default.ForwardRefExoticComponent<CollapsiblePrimitive.CollapsibleTriggerProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
474
|
+
declare const CollapsibleContent: React__default.FC<CollapsiblePrimitive.CollapsibleContentProps>;
|
|
475
|
+
|
|
476
|
+
declare const DropdownMenu: React$1.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
477
|
+
declare const DropdownMenuTrigger: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
478
|
+
declare const DropdownMenuGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
479
|
+
declare const DropdownMenuPortal: React$1.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
480
|
+
declare const DropdownMenuSub: React$1.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
481
|
+
declare const DropdownMenuRadioGroup: React$1.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
482
|
+
declare const DropdownMenuSubTrigger: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
483
|
+
inset?: boolean | undefined;
|
|
484
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
485
|
+
declare const DropdownMenuSubContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
486
|
+
declare const DropdownMenuContent: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
487
|
+
declare const DropdownMenuItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
488
|
+
inset?: boolean | undefined;
|
|
489
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
490
|
+
declare const DropdownMenuCheckboxItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
491
|
+
declare const DropdownMenuRadioItem: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
492
|
+
declare const DropdownMenuLabel: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
493
|
+
inset?: boolean | undefined;
|
|
494
|
+
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
495
|
+
declare const DropdownMenuSeparator: React$1.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
496
|
+
declare const DropdownMenuShortcut: {
|
|
497
|
+
({ className, ...props }: React$1.HTMLAttributes<HTMLSpanElement>): React$1.JSX.Element;
|
|
498
|
+
displayName: string;
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
declare const Switch: React$1.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
502
|
+
|
|
503
|
+
declare const TooltipProvider: ({ delayDuration, ...props }: TooltipPrimitive.TooltipProviderProps) => React$1.JSX.Element;
|
|
504
|
+
declare const Tooltip: React$1.FC<TooltipPrimitive.TooltipProps>;
|
|
505
|
+
declare const TooltipTrigger: React$1.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
506
|
+
interface TooltipContentProps extends React$1.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> {
|
|
507
|
+
background?: string;
|
|
508
|
+
textColor?: string;
|
|
509
|
+
borderColor?: string;
|
|
510
|
+
}
|
|
511
|
+
declare const TooltipContent: React$1.ForwardRefExoticComponent<TooltipContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
512
|
+
|
|
513
|
+
declare const Textarea: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React$1.RefAttributes<HTMLTextAreaElement>>;
|
|
514
|
+
|
|
515
|
+
declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
516
|
+
declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
517
|
+
|
|
518
|
+
declare const Label: React$1.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React$1.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: class_variance_authority_dist_types.ClassProp | undefined) => string> & React$1.RefAttributes<HTMLLabelElement>>;
|
|
519
|
+
|
|
520
|
+
declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
521
|
+
|
|
522
|
+
export { type Answer, BrainfishColors, Button, type ButtonProps, ChatSearch, type ChatSearchHandle, type ChatSearchProps, ChatSearchProvider, type ChatSearchState, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, type Collection, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FormattedMessage, Input, Label, MemoizedReactMarkdown, MermaidDiagram, type Props, ScrollArea, ScrollBar, Switch, Textarea, Tooltip, TooltipContent, type TooltipContentProps, TooltipProvider, TooltipTrigger, ZoomableImage, buttonVariants, customColor, useChatSearch, useIsChatSearchDirty };
|
package/package.json
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@brainfish-ai/components",
|
|
3
|
+
"version": "0.0.0-alpha.test",
|
|
4
|
+
"description": "Brainfish Components",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"module": "./dist/esm/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/esm/index.js",
|
|
13
|
+
"default": "./dist/esm/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./styles.css": "./dist/esm/index.css"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"**/*.css"
|
|
19
|
+
],
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=18"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"start": "NODE_ENV=development BABEL_ENV=development yarn storybook",
|
|
25
|
+
"build": "rimraf dist && NODE_ENV=production BABEL_ENV=production rollup -c",
|
|
26
|
+
"watch": "rollup -c -w",
|
|
27
|
+
"lint": "yarn check-types && yarn eslint && yarn stylelint",
|
|
28
|
+
"lint:fix": "yarn eslint:fix && yarn stylelint:fix",
|
|
29
|
+
"eslint": "eslint . --ext .js,.jsx,.tsx,.ts",
|
|
30
|
+
"eslint:fix": "eslint . --ext .js,.jsx,.tsx,.ts --fix",
|
|
31
|
+
"check-types": "tsc --noEmit true",
|
|
32
|
+
"ci": "yarn lint && yarn test --watch=false",
|
|
33
|
+
"test": "vitest --config ./vitest.config.ts",
|
|
34
|
+
"release": "yarn ci && yarn build && npm publish",
|
|
35
|
+
"storybook": "storybook dev -p 6006",
|
|
36
|
+
"storybook:build": "storybook build",
|
|
37
|
+
"storybook:deploy": "yarn storybook:build && touch ./storybook-static/.nojekyll && gh-pages -d ./storybook-static -t true"
|
|
38
|
+
},
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@phosphor-icons/react": "^2.1.7",
|
|
41
|
+
"class-variance-authority": "^0.7.0",
|
|
42
|
+
"clsx": "2.x",
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"react-dom": "^18.2.0",
|
|
45
|
+
"tailwind-merge": "^2.0.0",
|
|
46
|
+
"tailwindcss-animate": "^1.0.7"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@radix-ui/react-slot": "^1.1.1",
|
|
50
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
51
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
52
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
53
|
+
"@rollup/plugin-url": "^8.0.2",
|
|
54
|
+
"@storybook/addon-docs": "^7.5.2",
|
|
55
|
+
"@storybook/addon-essentials": "^7.5.2",
|
|
56
|
+
"@storybook/addon-interactions": "^7.5.2",
|
|
57
|
+
"@storybook/addon-links": "^7.5.2",
|
|
58
|
+
"@storybook/addon-onboarding": "^1.0.8",
|
|
59
|
+
"@storybook/addon-styling": "^1.3.7",
|
|
60
|
+
"@storybook/addon-themes": "^7.5.2",
|
|
61
|
+
"@storybook/blocks": "^7.5.2",
|
|
62
|
+
"@storybook/react": "^7.5.2",
|
|
63
|
+
"@storybook/react-vite": "^7.5.2",
|
|
64
|
+
"@storybook/testing-library": "^0.2.2",
|
|
65
|
+
"@svgr/rollup": "^8.1.0",
|
|
66
|
+
"@tailwindcss/container-queries": "^0.1.1",
|
|
67
|
+
"@testing-library/jest-dom": "^6.1.4",
|
|
68
|
+
"@testing-library/react": "^14.0.0",
|
|
69
|
+
"@testing-library/user-event": "^14.5.1",
|
|
70
|
+
"@types/mermaid": "^9.2.0",
|
|
71
|
+
"@types/node": "^20.8.10",
|
|
72
|
+
"@types/react": "^18.2.34",
|
|
73
|
+
"@types/react-dom": "^18.2.14",
|
|
74
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
75
|
+
"@typescript-eslint/eslint-plugin": "latest",
|
|
76
|
+
"@typescript-eslint/parser": "latest",
|
|
77
|
+
"autoprefixer": "^10.4.16",
|
|
78
|
+
"class-variance-authority": "0.7.0",
|
|
79
|
+
"clsx": "^2.0.0",
|
|
80
|
+
"eslint": "^8.52.0",
|
|
81
|
+
"eslint-config-prettier": "^9.0.0",
|
|
82
|
+
"eslint-plugin-import": "^2.29.0",
|
|
83
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
84
|
+
"eslint-plugin-prettier": "^5.0.1",
|
|
85
|
+
"eslint-plugin-react": "^7.33.2",
|
|
86
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
87
|
+
"eslint-plugin-react-refresh": "^0.4.4",
|
|
88
|
+
"eslint-plugin-storybook": "^0.6.15",
|
|
89
|
+
"gh-pages": "^6.0.0",
|
|
90
|
+
"jsdom": "^22.1.0",
|
|
91
|
+
"postcss": "^8.4.31",
|
|
92
|
+
"postcss-scss": "^4.0.9",
|
|
93
|
+
"prettier": "3.0.3",
|
|
94
|
+
"react": "^18.2.0",
|
|
95
|
+
"react-dom": "^18.2.0",
|
|
96
|
+
"regenerator-runtime": "^0.14.0",
|
|
97
|
+
"rimraf": "^5.0.5",
|
|
98
|
+
"rollup": "^4.3.0",
|
|
99
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
100
|
+
"rollup-plugin-filesize": "^10.0.0",
|
|
101
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
102
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
103
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
104
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
|
105
|
+
"storybook": "^7.5.2",
|
|
106
|
+
"tailwind-merge": "^2.0.0",
|
|
107
|
+
"tailwindcss": "^3.4.1",
|
|
108
|
+
"tailwindcss-animate": "^1.0.7",
|
|
109
|
+
"tslib": "^2.6.2",
|
|
110
|
+
"typescript": "5.2.2",
|
|
111
|
+
"vite": "^4.5.0",
|
|
112
|
+
"vite-plugin-svgr": "^4.1.0",
|
|
113
|
+
"vitest": "^0.34.6"
|
|
114
|
+
},
|
|
115
|
+
"packageManager": "yarn@3.6.3",
|
|
116
|
+
"dependencies": {
|
|
117
|
+
"@hookform/resolvers": "^3.10.0",
|
|
118
|
+
"@paralleldrive/cuid2": "^2.2.2",
|
|
119
|
+
"@phosphor-icons/react": "^2.1.7",
|
|
120
|
+
"@radix-ui/react-collapsible": "^1.1.2",
|
|
121
|
+
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
|
122
|
+
"@radix-ui/react-icons": "^1.3.2",
|
|
123
|
+
"@radix-ui/react-label": "^2.1.2",
|
|
124
|
+
"@radix-ui/react-scroll-area": "^1.2.2",
|
|
125
|
+
"@radix-ui/react-switch": "^1.1.2",
|
|
126
|
+
"@radix-ui/react-tooltip": "^1.1.6",
|
|
127
|
+
"ajv": "^8.17.1",
|
|
128
|
+
"ajv-errors": "^3.0.0",
|
|
129
|
+
"ajv-formats": "^3.0.1",
|
|
130
|
+
"framer-motion": "^11.15.0",
|
|
131
|
+
"immer": "^10.1.1",
|
|
132
|
+
"mermaid": "^11.4.0",
|
|
133
|
+
"react-hook-form": "^7.54.2",
|
|
134
|
+
"react-markdown": "^9.0.3",
|
|
135
|
+
"react-syntax-highlighter": "^15.6.1",
|
|
136
|
+
"react-use": "^17.6.0",
|
|
137
|
+
"rehype-raw": "^7.0.0",
|
|
138
|
+
"remark-gfm": "^4.0.0",
|
|
139
|
+
"use-immer": "^0.11.0"
|
|
140
|
+
}
|
|
141
|
+
}
|