@brainfish-ai/components 0.28.12 → 0.30.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.
Files changed (56) hide show
  1. package/dist/conversation.d.ts +95 -33
  2. package/dist/esm/chunks/{ChatSearch.DIrtg9k_.js → ChatSearch.DNwmju2M.js} +2 -2
  3. package/dist/esm/chunks/{ChatSearch.DIrtg9k_.js.map → ChatSearch.DNwmju2M.js.map} +1 -1
  4. package/dist/esm/chunks/Conversation.DmVOpOVx.js +29 -0
  5. package/dist/esm/chunks/Conversation.DmVOpOVx.js.map +1 -0
  6. package/dist/esm/chunks/{FormattedMessage.XNMN23hm.js → FormattedMessage.CIbY8Io7.js} +13 -13
  7. package/dist/esm/chunks/{FormattedMessage.XNMN23hm.js.map → FormattedMessage.CIbY8Io7.js.map} +1 -1
  8. package/dist/esm/chunks/ai-logo.Do__PIO3.js +7 -0
  9. package/dist/esm/chunks/ai-logo.Do__PIO3.js.map +1 -0
  10. package/dist/esm/chunks/{combobox.MyoPH18G.js → combobox.DJCyKFxV.js} +4 -4
  11. package/dist/esm/chunks/{combobox.MyoPH18G.js.map → combobox.DJCyKFxV.js.map} +1 -1
  12. package/dist/esm/chunks/{filters.BHp3ukNW.js → filters.DPv-zTEC.js} +3 -3
  13. package/dist/esm/chunks/{filters.BHp3ukNW.js.map → filters.DPv-zTEC.js.map} +1 -1
  14. package/dist/esm/chunks/{font-picker.B9GPXyK4.js → font-picker.BE03shJT.js} +2 -2
  15. package/dist/esm/chunks/{font-picker.B9GPXyK4.js.map → font-picker.BE03shJT.js.map} +1 -1
  16. package/dist/esm/chunks/header-nav.Bo_GNqXn.js +14 -0
  17. package/dist/esm/chunks/header-nav.Bo_GNqXn.js.map +1 -0
  18. package/dist/esm/chunks/{header-pane.1-3lMndU.js → header-pane.hQNeFYWQ.js} +2 -2
  19. package/dist/esm/chunks/{header-pane.1-3lMndU.js.map → header-pane.hQNeFYWQ.js.map} +1 -1
  20. package/dist/esm/chunks/logo.DtwFGMBj.js +5 -0
  21. package/dist/esm/chunks/logo.DtwFGMBj.js.map +1 -0
  22. package/dist/esm/chunks/{status-badge.BLB0pWDn.js → status-badge.Cf3R4nVr.js} +3 -3
  23. package/dist/esm/chunks/{status-badge.BLB0pWDn.js.map → status-badge.Cf3R4nVr.js.map} +1 -1
  24. package/dist/esm/chunks/{suggestion-card.DOmXIRGW.js → suggestion-card.6ETnT7EM.js} +2 -2
  25. package/dist/esm/chunks/{suggestion-card.DOmXIRGW.js.map → suggestion-card.6ETnT7EM.js.map} +1 -1
  26. package/dist/esm/chunks/{two-level-combobox.DJYP--W9.js → two-level-combobox.DQpxBbg3.js} +3 -3
  27. package/dist/esm/chunks/{two-level-combobox.DJYP--W9.js.map → two-level-combobox.DQpxBbg3.js.map} +1 -1
  28. package/dist/esm/components/articles-updated.js +2 -2
  29. package/dist/esm/components/chat-search.js +1 -1
  30. package/dist/esm/components/combobox.js +1 -1
  31. package/dist/esm/components/conversation.js +1 -1
  32. package/dist/esm/components/convos.js +1 -1
  33. package/dist/esm/components/discoveries-created.js +2 -2
  34. package/dist/esm/components/filter.js +1 -1
  35. package/dist/esm/components/font-picker.js +1 -1
  36. package/dist/esm/components/logo.js +1 -1
  37. package/dist/esm/components/markdown.js +1 -1
  38. package/dist/esm/components/metric-card.js +3 -3
  39. package/dist/esm/components/two-level-combobox.js +1 -1
  40. package/dist/esm/components/ui/combobox.js +1 -1
  41. package/dist/esm/components/ui/item.js +5 -5
  42. package/dist/esm/global.css +1 -1
  43. package/dist/esm/index.js +1 -1
  44. package/dist/esm/layouts/full-layout.js +1 -1
  45. package/dist/esm/layouts/header-nav.js +1 -1
  46. package/dist/esm/scenes/knowledge-review.js +8 -8
  47. package/dist/index.d.ts +108 -38
  48. package/dist/logo.d.ts +9 -1
  49. package/dist/stats.html +1 -1
  50. package/package.json +1 -1
  51. package/dist/esm/chunks/Conversation.D1Mqf3Qg.js +0 -15
  52. package/dist/esm/chunks/Conversation.D1Mqf3Qg.js.map +0 -1
  53. package/dist/esm/chunks/header-nav.C9r4A44a.js +0 -10
  54. package/dist/esm/chunks/header-nav.C9r4A44a.js.map +0 -1
  55. package/dist/esm/chunks/logo.CGKfN1U6.js +0 -5
  56. package/dist/esm/chunks/logo.CGKfN1U6.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -227,6 +227,14 @@ export declare function addUtmParameters(url: string, options: {
227
227
  campaign?: string;
228
228
  }): string;
229
229
 
230
+ export declare const AILogo: React_2.ForwardRefExoticComponent<Omit<AILogoProps, "ref"> & React_2.RefAttributes<SVGSVGElement>>;
231
+
232
+ export declare interface AILogoProps extends React_2.SVGProps<SVGSVGElement> {
233
+ variant: AILogoVariant;
234
+ }
235
+
236
+ export declare type AILogoVariant = 'dark' | 'light' | 'yellowfin';
237
+
230
238
  export declare const Alert: React_2.ForwardRefExoticComponent<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
231
239
  variant?: "default" | "success" | "warning" | "danger" | "info" | null | undefined;
232
240
  layout?: "compact" | "longForm" | null | undefined;
@@ -360,6 +368,12 @@ declare type AppendNewAnswer = {
360
368
  };
361
369
  };
362
370
 
371
+ export declare type Article = {
372
+ id: string;
373
+ title: string;
374
+ url: string;
375
+ };
376
+
363
377
  export declare interface ArticleNavItem extends Omit<SidebarNavItem, 'Icon' | 'items'> {
364
378
  status?: 'discovery' | 'unpublished' | 'draft';
365
379
  hasChildren?: boolean;
@@ -367,24 +381,21 @@ export declare interface ArticleNavItem extends Omit<SidebarNavItem, 'Icon' | 'i
367
381
  items?: ArticleNavItem[];
368
382
  }
369
383
 
370
- export declare type Attachment = {
371
- id: string;
372
- type: 'image' | 'file';
373
- name: string;
374
- url: string;
375
- file?: File;
376
- };
384
+ export declare type Attachment = FileAttachment | PageAttachment | EntityAttachment;
377
385
 
378
- export declare type AttachmentAction = {
379
- type: 'select-collection';
380
- collection: Collection_2;
386
+ export declare type AttachmentAddAction = {
387
+ type: 'select-entity';
388
+ entity: BaseEntity;
381
389
  } | {
382
- type: 'select-tab';
383
- tab: Tab;
390
+ type: 'select-page';
391
+ page: Page;
384
392
  } | {
385
- type: SimpleAttachmentActionType;
393
+ type: 'add-files';
394
+ files: File[];
386
395
  };
387
396
 
397
+ export declare type AttachmentBlock = FileAttachmentBlock | EntityAttachmentBlock | PageAttachmentBlock;
398
+
388
399
  declare type AttachmentType = 'image' | 'file';
389
400
 
390
401
  export declare function Avatar({ className, size, ...props }: React_2.ComponentProps<typeof AvatarPrimitive.Root> & {
@@ -410,6 +421,13 @@ export declare const badgeVariants: (props?: ({
410
421
  variant?: "default" | "disabled" | "destructive" | "success" | "warning" | null | undefined;
411
422
  } & ClassProp) | undefined) => string;
412
423
 
424
+ declare type BaseEntity = {
425
+ id: string;
426
+ type: 'collection' | 'article' | 'channel';
427
+ title: string;
428
+ url: string;
429
+ };
430
+
413
431
  declare function Body_2({ children }: {
414
432
  children?: default_2.ReactNode;
415
433
  }): default_2.JSX.Element;
@@ -624,6 +642,12 @@ export declare const CardHeader: React_2.ForwardRefExoticComponent<React_2.HTMLA
624
642
 
625
643
  export declare const CardTitle: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
626
644
 
645
+ export declare type Channel = {
646
+ id: string;
647
+ title: string;
648
+ url: string;
649
+ };
650
+
627
651
  export declare function ChatLogo({ size, className, color }: ChatLogoProps): default_2.JSX.Element;
628
652
 
629
653
  declare interface ChatLogoProps {
@@ -788,7 +812,8 @@ export declare interface Collection {
788
812
 
789
813
  declare type Collection_2 = {
790
814
  id: string;
791
- label: string;
815
+ title: string;
816
+ url: string;
792
817
  };
793
818
 
794
819
  export declare function Combobox<T extends ComboboxItem = ComboboxItem>({ options, defaultValueLabel, placeholder, noResultsLabel, className, onOpenChange, onChange, dropdownWidth, value: controlledValue, disabled, renderItem, renderValue, renderTrigger, appendToBody, }: ComboboxProps<T>): React_2.JSX.Element;
@@ -941,12 +966,14 @@ declare namespace Compounds {
941
966
  }
942
967
  }
943
968
 
944
- export declare type ContentBlock = TextBlock;
969
+ export declare type ContentBlock = TextBlock | AttachmentBlock;
945
970
 
946
- export declare type ContextPill = {
971
+ declare type ContextPill = {
947
972
  id: string;
948
973
  label: string;
949
- icon?: string;
974
+ iconType?: ContextPillIconType;
975
+ loading?: boolean;
976
+ progress?: number;
950
977
  };
951
978
 
952
979
  export declare const ContextPillBadge: ({ pill, onRemove }: ContextPillBadgeProps) => default_2.JSX.Element;
@@ -956,9 +983,11 @@ declare interface ContextPillBadgeProps {
956
983
  onRemove?: (pill: ContextPill) => void;
957
984
  }
958
985
 
959
- export declare const Conversation: (({ messages, callbacks, children, suggestions, actions, placeholder, attachments, collections, tabs, attachmentActions, contextPills, showBranding, className, }: ConversationProps) => default_2.JSX.Element) & {
986
+ export declare type ContextPillIconType = 'image' | 'video' | 'pdf' | 'doc' | 'file' | 'channel' | 'collection' | 'article' | 'page';
987
+
988
+ export declare const Conversation: (({ messages, callbacks, children, suggestions, actions, placeholder, attachments, collections, pages, acceptedFileTypes, showBranding, className, }: ConversationProps) => default_2.JSX.Element) & {
960
989
  Messages: ({ className, bottomPadding, onContentBehind }: ConversationMessagesProps) => default_2.JSX.Element;
961
- Input: ({ placeholder, attachments, collections, tabs, attachmentActions, contextPills, disabled, isElevated, className, }: ConversationInputProps) => default_2.JSX.Element;
990
+ Input: ({ placeholder, attachments, collections, pages, acceptedFileTypes, disabled, isElevated, className, }: ConversationInputProps) => default_2.JSX.Element;
962
991
  Suggestions: ({ items, className }: ConversationSuggestionsProps) => default_2.JSX.Element | null;
963
992
  Actions: ({ actions, onActionClick, className }: ConversationActionsProps) => default_2.JSX.Element | null;
964
993
  Loading: ({ className }: ConversationStatusProps) => default_2.JSX.Element;
@@ -985,8 +1014,8 @@ export declare type ConversationCallbacks = {
985
1014
  onSuggestionClick?: (suggestion: Suggestion) => void;
986
1015
  onActionClick?: (action: ConversationAction, messageId: string) => void;
987
1016
  onCitationClick?: (citation: Citation) => void;
988
- onAttachmentAction?: (action: AttachmentAction) => void;
989
- onContextPillRemove?: (pill: ContextPill) => void;
1017
+ onAttachmentAdd?: (action: AttachmentAddAction) => void;
1018
+ onAttachmentRemove?: (attachment: Attachment) => void;
990
1019
  onCopy?: (messageId: string, content: string) => void;
991
1020
  };
992
1021
 
@@ -1001,15 +1030,14 @@ export declare interface ConversationContextValue {
1001
1030
  isStreaming: boolean;
1002
1031
  }
1003
1032
 
1004
- export declare const ConversationInput: ({ placeholder, attachments, collections, tabs, attachmentActions, contextPills, disabled, isElevated, className, }: ConversationInputProps_2) => default_2.JSX.Element;
1033
+ export declare const ConversationInput: ({ placeholder, attachments, collections, pages, acceptedFileTypes, disabled, isElevated, className, }: ConversationInputProps_2) => default_2.JSX.Element;
1005
1034
 
1006
1035
  declare interface ConversationInputProps_2 {
1007
1036
  placeholder?: string;
1008
1037
  attachments?: Attachment[];
1009
1038
  collections?: Collection_2[];
1010
- tabs?: Tab[];
1011
- attachmentActions?: SimpleAttachmentActionType[];
1012
- contextPills?: ContextPill[];
1039
+ pages?: Page[];
1040
+ acceptedFileTypes?: string[];
1013
1041
  disabled?: boolean;
1014
1042
  isElevated?: boolean;
1015
1043
  className?: string;
@@ -1051,9 +1079,8 @@ declare interface ConversationProps {
1051
1079
  placeholder?: string;
1052
1080
  attachments?: Attachment[];
1053
1081
  collections?: Collection_2[];
1054
- tabs?: Tab[];
1055
- attachmentActions?: SimpleAttachmentActionType[];
1056
- contextPills?: ContextPill[];
1082
+ pages?: Page[];
1083
+ acceptedFileTypes?: string[];
1057
1084
  showBranding?: boolean;
1058
1085
  className?: string;
1059
1086
  }
@@ -1182,6 +1209,17 @@ export declare const DropdownMenuSubTrigger: React_2.ForwardRefExoticComponent<O
1182
1209
 
1183
1210
  export declare const DropdownMenuTrigger: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
1184
1211
 
1212
+ export declare type EntityAttachment = {
1213
+ id: string;
1214
+ type: 'entity';
1215
+ entity: BaseEntity;
1216
+ };
1217
+
1218
+ export declare type EntityAttachmentBlock = {
1219
+ type: 'entity';
1220
+ entity: BaseEntity;
1221
+ };
1222
+
1185
1223
  export declare type ExtendedColumnDef<TData, TValue = unknown> = ColumnDef<TData, TValue> & {
1186
1224
  expandedContent?: (row: Row<TData>) => default_2.ReactNode;
1187
1225
  };
@@ -1192,6 +1230,28 @@ declare type FeatureFlags = {
1192
1230
 
1193
1231
  declare type FeedbackResponse = 'accept' | 'reject';
1194
1232
 
1233
+ export declare type FileAttachment = {
1234
+ id: string;
1235
+ type: 'file';
1236
+ raw: File;
1237
+ loading?: boolean;
1238
+ progress?: number;
1239
+ file: {
1240
+ name: string;
1241
+ mimeType: string;
1242
+ url?: string;
1243
+ storageKey?: string;
1244
+ };
1245
+ };
1246
+
1247
+ export declare type FileAttachmentBlock = {
1248
+ type: 'file';
1249
+ fileName: string;
1250
+ mimeType: string;
1251
+ storageKey: string;
1252
+ url?: string;
1253
+ };
1254
+
1195
1255
  export declare function FileUpload({ onDropAccepted, onDropRejected, accept, maxSize, // 5MB
1196
1256
  maxFiles, multiple, className, disabled, title, description, supportsMessage, children, }: FileUploadProps): default_2.JSX.Element;
1197
1257
 
@@ -1599,7 +1659,7 @@ export declare const loadFont: (fontFamily: string) => void;
1599
1659
 
1600
1660
  export declare const Logo: React_2.ForwardRefExoticComponent<Omit<LogoProps, "ref"> & React_2.RefAttributes<SVGSVGElement>>;
1601
1661
 
1602
- export declare type LogoColor = 'default' | 'outline' | 'fill';
1662
+ export declare type LogoColor = 'default' | 'outline' | 'fill' | 'fill-light';
1603
1663
 
1604
1664
  export declare interface LogoProps extends React_2.SVGProps<SVGSVGElement> {
1605
1665
  variant: LogoVariant;
@@ -1727,6 +1787,25 @@ export declare enum Operator {
1727
1787
  STARTS_WITH = "starts with"
1728
1788
  }
1729
1789
 
1790
+ export declare type Page = {
1791
+ url: string;
1792
+ title: string;
1793
+ textContent?: string;
1794
+ };
1795
+
1796
+ export declare type PageAttachment = {
1797
+ id: string;
1798
+ type: 'page';
1799
+ page: Page;
1800
+ };
1801
+
1802
+ export declare type PageAttachmentBlock = {
1803
+ type: 'page';
1804
+ url: string;
1805
+ title: string;
1806
+ textContent?: string;
1807
+ };
1808
+
1730
1809
  declare interface PhosphorIconProps extends IconProps {
1731
1810
  iconName: string;
1732
1811
  }
@@ -2041,8 +2120,6 @@ export declare interface SidebarProps extends React_2.ComponentPropsWithoutRef<'
2041
2120
  sectionNavActiveId?: string;
2042
2121
  }
2043
2122
 
2044
- declare type SimpleAttachmentActionType = 'screenshot' | 'record-video' | 'add-file';
2045
-
2046
2123
  export declare function SimpleSelect({ options, value, onChange, placeholder, disabled, className, appendToBody, }: SimpleSelectProps): React_2.JSX.Element;
2047
2124
 
2048
2125
  export declare interface SimpleSelectProps {
@@ -2172,13 +2249,6 @@ export declare interface SuggestionCardSource {
2172
2249
 
2173
2250
  export declare const Switch: React_2.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
2174
2251
 
2175
- declare type Tab = {
2176
- id: string;
2177
- title: string;
2178
- url: string;
2179
- favIconUrl?: string;
2180
- };
2181
-
2182
2252
  export declare const Table: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableElement> & React_2.RefAttributes<HTMLTableElement>>;
2183
2253
 
2184
2254
  export declare const TableBody: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLTableSectionElement> & React_2.RefAttributes<HTMLTableSectionElement>>;
package/dist/logo.d.ts CHANGED
@@ -1,6 +1,14 @@
1
1
  import { default as default_2 } from 'react';
2
2
  import * as React_2 from 'react';
3
3
 
4
+ export declare const AILogo: React_2.ForwardRefExoticComponent<Omit<AILogoProps, "ref"> & React_2.RefAttributes<SVGSVGElement>>;
5
+
6
+ export declare interface AILogoProps extends React_2.SVGProps<SVGSVGElement> {
7
+ variant: AILogoVariant;
8
+ }
9
+
10
+ export declare type AILogoVariant = 'dark' | 'light' | 'yellowfin';
11
+
4
12
  export declare function ChatLogo({ size, className, color }: ChatLogoProps): default_2.JSX.Element;
5
13
 
6
14
  declare interface ChatLogoProps {
@@ -11,7 +19,7 @@ declare interface ChatLogoProps {
11
19
 
12
20
  export declare const Logo: React_2.ForwardRefExoticComponent<Omit<LogoProps, "ref"> & React_2.RefAttributes<SVGSVGElement>>;
13
21
 
14
- export declare type LogoColor = 'default' | 'outline' | 'fill';
22
+ export declare type LogoColor = 'default' | 'outline' | 'fill' | 'fill-light';
15
23
 
16
24
  export declare interface LogoProps extends React_2.SVGProps<SVGSVGElement> {
17
25
  variant: LogoVariant;