@brainfish-ai/components 0.19.7 → 0.20.1

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.
@@ -15,14 +15,20 @@ declare interface AccountDropdownProps extends React_2.ComponentPropsWithoutRef<
15
15
 
16
16
  declare const DropdownMenu: React_2.FC<DropdownMenuPrimitive.DropdownMenuProps>;
17
17
 
18
+ export declare const HEADER_NAV_HEIGHT = 60;
19
+
18
20
  export declare const HeaderNav: React_2.ForwardRefExoticComponent<HeaderNavProps & React_2.RefAttributes<HTMLElement>>;
19
21
 
20
22
  declare interface HeaderNavProps extends React_2.ComponentPropsWithoutRef<'header'>, Omit<AccountDropdownProps, 'dir'> {
23
+ isSideNavOpen?: boolean;
21
24
  onSideNavigationToggle: () => void;
22
25
  onHelpClick: () => void;
23
26
  showSuggestionAction?: boolean;
24
27
  suggestionAction?: React_2.ReactNode;
25
28
  onSuggestionActionClick?: () => void;
29
+ showSidebarToggle?: boolean;
30
+ /** Ref for the sidebar toggle button; used by layout to move focus here when sidebar is collapsed. */
31
+ sidebarToggleRef?: React_2.Ref<HTMLButtonElement>;
26
32
  }
27
33
 
28
34
  export { }
package/dist/index.d.ts CHANGED
@@ -35,6 +35,18 @@ export declare function AccordionItem({ className, ...props }: React_2.Component
35
35
 
36
36
  export declare function AccordionTrigger({ className, children, ...props }: React_2.ComponentProps<typeof AccordionPrimitive.Trigger>): React_2.JSX.Element;
37
37
 
38
+ export declare type AccountDropdownItem = {
39
+ id: string;
40
+ label: string;
41
+ onClick: () => void;
42
+ };
43
+
44
+ declare interface AccountDropdownProps extends React_2.ComponentPropsWithoutRef<typeof DropdownMenu> {
45
+ accountPhoto: string;
46
+ accountName: string;
47
+ accountDropdownItems: AccountDropdownItem[];
48
+ }
49
+
38
50
  declare type Action = {
39
51
  id: string;
40
52
  type: ActionType;
@@ -259,6 +271,11 @@ declare type AppendNewAnswer = {
259
271
  };
260
272
  };
261
273
 
274
+ export declare interface ArticleNavItem extends Omit<SidebarNavItem, 'Icon' | 'items'> {
275
+ status?: 'discovery' | 'unpublished';
276
+ items?: ArticleNavItem[];
277
+ }
278
+
262
279
  export declare function Badge({ className, variant, ...props }: BadgeProps): React_2.JSX.Element;
263
280
 
264
281
  export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
@@ -1029,6 +1046,22 @@ declare type GetActionInputs = {
1029
1046
  */
1030
1047
  export declare const getCachedFonts: () => FontOption[] | null;
1031
1048
 
1049
+ export declare const HEADER_NAV_HEIGHT = 60;
1050
+
1051
+ export declare const HeaderNav: React_2.ForwardRefExoticComponent<HeaderNavProps & React_2.RefAttributes<HTMLElement>>;
1052
+
1053
+ declare interface HeaderNavProps extends React_2.ComponentPropsWithoutRef<'header'>, Omit<AccountDropdownProps, 'dir'> {
1054
+ isSideNavOpen?: boolean;
1055
+ onSideNavigationToggle: () => void;
1056
+ onHelpClick: () => void;
1057
+ showSuggestionAction?: boolean;
1058
+ suggestionAction?: React_2.ReactNode;
1059
+ onSuggestionActionClick?: () => void;
1060
+ showSidebarToggle?: boolean;
1061
+ /** Ref for the sidebar toggle button; used by layout to move focus here when sidebar is collapsed. */
1062
+ sidebarToggleRef?: React_2.Ref<HTMLButtonElement>;
1063
+ }
1064
+
1032
1065
  /**
1033
1066
  * A flexible icon component that supports both Phosphor icons and image-based icons.
1034
1067
  *
@@ -1098,6 +1131,11 @@ export declare function ItemGroup({ className, ...props }: React_2.ComponentProp
1098
1131
 
1099
1132
  export declare function ItemHeader({ className, ...props }: React_2.ComponentProps<"div">): React_2.JSX.Element;
1100
1133
 
1134
+ export declare type ItemLinkComponent = React_2.ComponentType<React_2.ComponentPropsWithoutRef<'a'> & {
1135
+ 'data-sidebar-item-id'?: string;
1136
+ 'data-sidebar-item-type'?: 'app' | 'article' | 'section';
1137
+ }>;
1138
+
1101
1139
  export declare function ItemMedia({ className, variant, ...props }: React_2.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): React_2.JSX.Element;
1102
1140
 
1103
1141
  declare const itemMediaVariants: (props?: ({
@@ -1358,6 +1396,46 @@ declare const sheetVariants: (props?: ({
1358
1396
  side?: "left" | "right" | "bottom" | "top" | null | undefined;
1359
1397
  } & ClassProp) | undefined) => string;
1360
1398
 
1399
+ export declare const Sidebar: React_2.ForwardRefExoticComponent<SidebarProps & React_2.RefAttributes<HTMLElement>>;
1400
+
1401
+ declare interface SidebarContextProps {
1402
+ collapsed: boolean;
1403
+ ItemLinkComponent: ItemLinkComponent;
1404
+ activeArticleId?: string;
1405
+ onSelectArticle?: (id: string) => void;
1406
+ onSearchArticles?: (value: string) => void;
1407
+ onAddArticle?: (parentId: string | null) => void;
1408
+ onMoveArticle?: (moved: {
1409
+ id: string;
1410
+ parentId: string | null;
1411
+ index: number;
1412
+ }) => void;
1413
+ }
1414
+
1415
+ export declare interface SidebarContextValue extends SidebarContextProps {
1416
+ handleSearchArticles: (value: string) => void;
1417
+ isSearching: boolean;
1418
+ }
1419
+
1420
+ export declare interface SidebarNavItem {
1421
+ id: string;
1422
+ label: string;
1423
+ href: string;
1424
+ Icon?: Icon_2;
1425
+ items?: SidebarNavItem[];
1426
+ }
1427
+
1428
+ export declare interface SidebarProps extends React_2.ComponentPropsWithoutRef<'aside'>, SidebarContextProps {
1429
+ showAppBack?: boolean;
1430
+ onAppBack?: () => void;
1431
+ appNavItems?: SidebarNavItem[];
1432
+ appNavActiveId?: string;
1433
+ showArticles?: boolean;
1434
+ articles?: ArticleNavItem[];
1435
+ sectionNavItems?: SidebarNavItem[];
1436
+ sectionNavActiveId?: string;
1437
+ }
1438
+
1361
1439
  export declare function SimpleSelect({ options, value, onChange, placeholder, disabled, className, appendToBody, }: SimpleSelectProps): React_2.JSX.Element;
1362
1440
 
1363
1441
  export declare interface SimpleSelectProps {
@@ -1504,6 +1582,8 @@ export declare interface UseFontOptionsReturn {
1504
1582
 
1505
1583
  export declare const useIsChatSearchDirty: () => boolean;
1506
1584
 
1585
+ export declare function useSidebar(): SidebarContextValue;
1586
+
1507
1587
  export declare const ZoomableImage: React_2.FC<ZoomableImageProps>;
1508
1588
 
1509
1589
  declare interface ZoomableImageProps {
@@ -0,0 +1,4 @@
1
+ export {}
2
+ import _default from '../src/layouts/full-layout/layout'
3
+ export default _default
4
+ export {}
@@ -0,0 +1,2 @@
1
+ export * from '../src/layouts/header-nav/index'
2
+ export {}
@@ -0,0 +1,2 @@
1
+ export * from '../src/layouts/sidebar/index'
2
+ export {}