@brainfish-ai/components 0.16.8 → 0.16.10-alpha.2
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/dist/alert.d.ts +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/card.d.ts +6 -8
- package/dist/chart-area-linear.d.ts +41 -0
- package/dist/chart-radial-stacked.d.ts +31 -0
- package/dist/colors.d.ts +0 -5
- package/dist/components/ui/alert.d.ts +1 -1
- package/dist/components/ui/badge.d.ts +1 -1
- package/dist/components/ui/card.d.ts +8 -9
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/convos.d.ts +107 -0
- package/dist/esm/ChatSearch.css +1 -1
- package/dist/esm/chunks/{ChatSearch.D8_9CRIM.js → ChatSearch.BV8FTS2Y.js} +51 -10
- package/dist/esm/chunks/ChatSearch.BV8FTS2Y.js.map +1 -0
- package/dist/esm/chunks/{FormattedMessage.DdZqirSo.js → FormattedMessage.BcAkzCZt.js} +4 -13
- package/dist/esm/chunks/FormattedMessage.BcAkzCZt.js.map +1 -0
- package/dist/esm/chunks/chart.DGCX9VIn.js +219 -0
- package/dist/esm/chunks/chart.DGCX9VIn.js.map +1 -0
- package/dist/esm/chunks/{combobox.BRm6ZDEB.js → combobox.CkN-wAHB.js} +2 -2
- package/dist/esm/chunks/{combobox.BRm6ZDEB.js.map → combobox.CkN-wAHB.js.map} +1 -1
- package/dist/esm/chunks/{data-table.qS51pU0z.js → data-table.CVyV_UqZ.js} +2 -2
- package/dist/esm/chunks/{data-table.qS51pU0z.js.map → data-table.CVyV_UqZ.js.map} +1 -1
- package/dist/esm/chunks/{date-picker.DqcdwXZS.js → date-picker.sQXSlqNZ.js} +2 -2
- package/dist/esm/chunks/{date-picker.DqcdwXZS.js.map → date-picker.sQXSlqNZ.js.map} +1 -1
- package/dist/esm/chunks/extends.mO86zOh3.js +12 -0
- package/dist/esm/chunks/extends.mO86zOh3.js.map +1 -0
- package/dist/esm/chunks/{file-upload-status.vhPIBONC.js → file-upload-status.Vw0Zxmir.js} +3 -3
- package/dist/esm/chunks/file-upload-status.Vw0Zxmir.js.map +1 -0
- package/dist/esm/chunks/{filters.Bd9OruMH.js → filters.BMbm1LUz.js} +2 -2
- package/dist/esm/chunks/{filters.Bd9OruMH.js.map → filters.BMbm1LUz.js.map} +1 -1
- package/dist/esm/chunks/formatNumber.Bm2k8QrT.js +10 -0
- package/dist/esm/chunks/formatNumber.Bm2k8QrT.js.map +1 -0
- package/dist/esm/chunks/generating-star.COkD0gHd.js +1489 -0
- package/dist/esm/chunks/generating-star.COkD0gHd.js.map +1 -0
- package/dist/esm/chunks/{simpleSelect.BfAgKOea.js → simpleSelect.B1rktKkt.js} +2 -2
- package/dist/esm/chunks/{simpleSelect.BfAgKOea.js.map → simpleSelect.B1rktKkt.js.map} +1 -1
- package/dist/esm/chunks/{two-level-combobox.DFonmrmc.js → two-level-combobox.DsWPDcI6.js} +2 -2
- package/dist/esm/chunks/{two-level-combobox.DFonmrmc.js.map → two-level-combobox.DsWPDcI6.js.map} +1 -1
- package/dist/esm/chunks/{utils.DaMF_LVC.js → utils.Cwtlq8dh.js} +2 -10
- package/dist/esm/chunks/{utils.DaMF_LVC.js.map → utils.Cwtlq8dh.js.map} +1 -1
- package/dist/esm/colors.js +138 -145
- package/dist/esm/colors.js.map +1 -1
- package/dist/esm/components/chart-area-linear.js +87 -0
- package/dist/esm/components/chart-area-linear.js.map +1 -0
- package/dist/esm/components/chart-radial-stacked.js +59 -0
- package/dist/esm/components/chart-radial-stacked.js.map +1 -0
- package/dist/esm/components/chat-search.js +1 -1
- package/dist/esm/components/combobox.js +1 -1
- package/dist/esm/components/convos.js +158 -0
- package/dist/esm/components/convos.js.map +1 -0
- package/dist/esm/components/data-table.js +1 -1
- package/dist/esm/components/date-picker.js +1 -1
- package/dist/esm/components/file-upload.js +1 -1
- package/dist/esm/components/filter.js +1 -1
- package/dist/esm/components/generating-star.js +1 -1
- package/dist/esm/components/markdown.js +1 -1
- package/dist/esm/components/metric-card.js +61 -0
- package/dist/esm/components/metric-card.js.map +1 -0
- package/dist/esm/components/select.js +1 -1
- package/dist/esm/components/two-level-combobox.js +1 -1
- package/dist/esm/components/ui/accordion.js +3 -3
- package/dist/esm/components/ui/accordion.js.map +1 -1
- package/dist/esm/components/ui/alert-dialog.js +1 -1
- package/dist/esm/components/ui/alert.js +1 -1
- package/dist/esm/components/ui/badge.js +6 -6
- package/dist/esm/components/ui/badge.js.map +1 -1
- package/dist/esm/components/ui/button.js +1 -1
- package/dist/esm/components/ui/calendar.js +1 -1
- package/dist/esm/components/ui/card.js +52 -47
- package/dist/esm/components/ui/card.js.map +1 -1
- package/dist/esm/components/ui/command.js +1 -1
- package/dist/esm/components/ui/dialog.js +1 -1
- package/dist/esm/components/ui/div-button.js +1 -1
- package/dist/esm/components/ui/dropdown-menu.js +1 -1
- package/dist/esm/components/ui/input.js +1 -1
- package/dist/esm/components/ui/item.js +179 -0
- package/dist/esm/components/ui/item.js.map +1 -0
- package/dist/esm/components/ui/label.js +1 -1
- package/dist/esm/components/ui/popover.js +1 -1
- package/dist/esm/components/ui/progress.js +1 -1
- package/dist/esm/components/ui/scroll-area.js +1 -1
- package/dist/esm/components/ui/select.js +1 -1
- package/dist/esm/components/ui/separator.js +24 -0
- package/dist/esm/components/ui/separator.js.map +1 -0
- package/dist/esm/components/ui/switch.js +1 -1
- package/dist/esm/components/ui/table.js +1 -1
- package/dist/esm/components/ui/textarea.js +1 -1
- package/dist/esm/components/ui/tooltip.js +1 -1
- package/dist/esm/convos.css +1 -0
- package/dist/esm/index.css +1 -1
- package/dist/esm/index.js +11 -11
- package/dist/generating-star.d.ts +9 -4
- package/dist/index.d.ts +7 -14
- package/dist/item.d.ts +39 -0
- package/dist/metric-card.d.ts +21 -0
- package/dist/separator.d.ts +6 -0
- package/dist/stats.html +1 -1
- package/package.json +4 -1
- package/tailwind.config.js +130 -117
- package/dist/esm/chunks/ChatSearch.D8_9CRIM.js.map +0 -1
- package/dist/esm/chunks/FormattedMessage.DdZqirSo.js.map +0 -1
- package/dist/esm/chunks/file-upload-status.vhPIBONC.js.map +0 -1
- package/dist/esm/chunks/generating-star.DFwZcGvH.js +0 -106
- package/dist/esm/chunks/generating-star.DFwZcGvH.js.map +0 -1
package/dist/alert.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as React_2 from 'react';
|
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
|
|
5
5
|
export declare const Alert: React_2.ForwardRefExoticComponent<Omit<React_2.ClassAttributes<HTMLDivElement> & React_2.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
6
|
-
variant?: "default" | "success" | "
|
|
6
|
+
variant?: "default" | "success" | "warning" | "danger" | "info" | null | undefined;
|
|
7
7
|
} & ClassProp) | undefined) => string>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
|
|
9
9
|
export declare const AlertAction: React_2.ForwardRefExoticComponent<Omit<React_2.DetailedHTMLProps<React_2.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
package/dist/badge.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare interface BadgeProps extends React_2.HTMLAttributes<HTMLDivElemen
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export declare const badgeVariants: (props?: ({
|
|
11
|
-
variant?: "default" | "destructive" | "
|
|
11
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
12
12
|
} & ClassProp) | undefined) => string;
|
|
13
13
|
|
|
14
14
|
export { }
|
package/dist/card.d.ts
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import * as React_2 from 'react';
|
|
2
2
|
|
|
3
|
-
export declare
|
|
3
|
+
export declare const Card: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
|
4
4
|
|
|
5
|
-
export declare
|
|
5
|
+
export declare const CardContent: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
|
|
7
|
-
export declare
|
|
7
|
+
export declare const CardDescription: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
|
|
9
|
-
export declare
|
|
9
|
+
export declare const CardFooter: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
|
|
11
|
-
export declare
|
|
11
|
+
export declare const CardHeader: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
|
|
13
|
-
export declare
|
|
14
|
-
|
|
15
|
-
export declare function CardTitle({ className, ...props }: React_2.ComponentProps<'div'>): React_2.JSX.Element;
|
|
13
|
+
export declare const CardTitle: React_2.ForwardRefExoticComponent<React_2.HTMLAttributes<HTMLDivElement> & React_2.RefAttributes<HTMLDivElement>>;
|
|
16
14
|
|
|
17
15
|
export { }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import * as React_2 from 'react';
|
|
3
|
+
|
|
4
|
+
export declare function ChartAreaLinear({ title, metric, data, chartConfig, locale }: ChartAreaLinearProps): default_2.JSX.Element;
|
|
5
|
+
|
|
6
|
+
export declare interface ChartAreaLinearProps {
|
|
7
|
+
title: string;
|
|
8
|
+
metric: string;
|
|
9
|
+
data: {
|
|
10
|
+
date: Date | string;
|
|
11
|
+
key1: number;
|
|
12
|
+
key2?: number;
|
|
13
|
+
key3?: number;
|
|
14
|
+
key4?: number;
|
|
15
|
+
key5?: number;
|
|
16
|
+
}[];
|
|
17
|
+
chartConfig: ChartConfig;
|
|
18
|
+
locale?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare type ChartConfig = {
|
|
22
|
+
[k in string]: {
|
|
23
|
+
label?: React_2.ReactNode;
|
|
24
|
+
icon?: React_2.ComponentType;
|
|
25
|
+
} & ({
|
|
26
|
+
color?: string;
|
|
27
|
+
theme?: never;
|
|
28
|
+
} | {
|
|
29
|
+
color?: never;
|
|
30
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export declare const description = "A linear area chart";
|
|
35
|
+
|
|
36
|
+
declare const THEMES: {
|
|
37
|
+
readonly light: "";
|
|
38
|
+
readonly dark: ".dark";
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
|
+
import * as React_2 from 'react';
|
|
3
|
+
|
|
4
|
+
declare type ChartConfig = {
|
|
5
|
+
[k in string]: {
|
|
6
|
+
label?: React_2.ReactNode;
|
|
7
|
+
icon?: React_2.ComponentType;
|
|
8
|
+
} & ({
|
|
9
|
+
color?: string;
|
|
10
|
+
theme?: never;
|
|
11
|
+
} | {
|
|
12
|
+
color?: never;
|
|
13
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export declare function ChartRadialStacked({ title, data, chartConfig, className }: ChartRadialStackedProps): default_2.JSX.Element | null;
|
|
18
|
+
|
|
19
|
+
export declare interface ChartRadialStackedProps {
|
|
20
|
+
title: string;
|
|
21
|
+
data: Record<string, number>[];
|
|
22
|
+
chartConfig: ChartConfig;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare const THEMES: {
|
|
27
|
+
readonly light: "";
|
|
28
|
+
readonly dark: ".dark";
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export { }
|
package/dist/colors.d.ts
CHANGED
|
@@ -158,9 +158,4 @@ export declare const BrainfishColors: {
|
|
|
158
158
|
};
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
export declare function customColor(cssVariable: string, fallbackColor?: string): ({ opacityVariable, opacityValue }: {
|
|
162
|
-
opacityVariable: string;
|
|
163
|
-
opacityValue: string;
|
|
164
|
-
}) => string;
|
|
165
|
-
|
|
166
161
|
export { }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const Alert: React.ForwardRefExoticComponent<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
-
variant?: "default" | "success" | "
|
|
4
|
+
variant?: "default" | "success" | "warning" | "danger" | "info" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
declare const AlertTitle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
7
7
|
declare const AlertDescription: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "destructive" | "
|
|
4
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
7
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
declare
|
|
3
|
-
declare
|
|
4
|
-
declare
|
|
5
|
-
declare
|
|
6
|
-
declare
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { Separator } from './separator';
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
6
|
+
declare const itemVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}): React.JSX.Element;
|
|
13
|
+
declare const itemMediaVariants: (props?: ({
|
|
14
|
+
variant?: "image" | "default" | "icon" | null | undefined;
|
|
15
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
16
|
+
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): React.JSX.Element;
|
|
17
|
+
declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
18
|
+
declare function ItemTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
+
declare function ItemDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
20
|
+
declare function ItemActions({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
21
|
+
declare function ItemHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
22
|
+
declare function ItemFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
23
|
+
export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
3
|
+
declare const Separator: React.ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export { Separator };
|
package/dist/convos.d.ts
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
+
import { ClassProp } from 'class-variance-authority/types';
|
|
3
|
+
import { default as default_2 } from 'react';
|
|
4
|
+
import * as React_2 from 'react';
|
|
5
|
+
import { VariantProps } from 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
declare function AccordionItem({ className, ...props }: React_2.ComponentProps<typeof AccordionPrimitive.Item>): React_2.JSX.Element;
|
|
8
|
+
|
|
9
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): React_2.JSX.Element;
|
|
10
|
+
|
|
11
|
+
declare interface BadgeProps extends React_2.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
declare const badgeVariants: (props?: ({
|
|
15
|
+
variant?: "default" | "destructive" | "success" | "warning" | null | undefined;
|
|
16
|
+
} & ClassProp) | undefined) => string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Convo component - A single conversation item in an accordion.
|
|
20
|
+
* Displays conversation metadata and messages, with support for lazy loading.
|
|
21
|
+
*
|
|
22
|
+
* This is a presentational component - it receives messages and loading state as props
|
|
23
|
+
* rather than managing fetching logic itself.
|
|
24
|
+
*/
|
|
25
|
+
export declare function Convo({ locale, value: queryId, question, timestamp, location, source, status, statusMessage, hasAttributes, attributes, messages, isLoading, onClick, className, ...props }: ConvoProps): default_2.JSX.Element;
|
|
26
|
+
|
|
27
|
+
declare interface ConvoInput {
|
|
28
|
+
value: string;
|
|
29
|
+
question: string;
|
|
30
|
+
timestamp: Date;
|
|
31
|
+
location?: string;
|
|
32
|
+
source?: string;
|
|
33
|
+
status?: default_2.ComponentProps<typeof StatusBadge>['variant'];
|
|
34
|
+
statusMessage?: string;
|
|
35
|
+
hasAttributes?: boolean;
|
|
36
|
+
attributes?: Record<string, any>;
|
|
37
|
+
locale?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare type ConvoProps = default_2.ComponentPropsWithRef<typeof AccordionItem> & Props_2;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Convos component - Displays a list of conversations in an accordion.
|
|
44
|
+
* Messages are always lazy loaded when accordion items are opened.
|
|
45
|
+
*
|
|
46
|
+
* @param convos - Array of conversation data
|
|
47
|
+
* @param fetchMessages - Async function to fetch messages for a conversation
|
|
48
|
+
*/
|
|
49
|
+
export declare function Convos({ convos, fetchMessages }: ConvosProps): default_2.JSX.Element;
|
|
50
|
+
|
|
51
|
+
declare interface ConvosProps {
|
|
52
|
+
convos: ConvoInput[];
|
|
53
|
+
fetchMessages: (conversationId: string) => Promise<MessageProps[]>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare enum Feedback {
|
|
57
|
+
Positive = "positive",
|
|
58
|
+
Negative = "negative"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare function Message({ type, role, content, relatedArticles, feedback, timestamp, locale }: MessageProps): default_2.JSX.Element;
|
|
62
|
+
|
|
63
|
+
export declare interface MessageProps {
|
|
64
|
+
id: string;
|
|
65
|
+
role: 'user' | 'ai';
|
|
66
|
+
content: string;
|
|
67
|
+
timestamp: Date;
|
|
68
|
+
relatedArticles?: Array<RelatedArticle>;
|
|
69
|
+
feedback?: Feedback;
|
|
70
|
+
type?: MessageType;
|
|
71
|
+
locale?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export declare enum MessageType {
|
|
75
|
+
ACTION = "action",
|
|
76
|
+
FEEDBACK = "feedback",
|
|
77
|
+
QUESTION = "question",
|
|
78
|
+
ANSWER = "answer"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
declare type Props = default_2.ComponentPropsWithRef<typeof Badge>;
|
|
82
|
+
|
|
83
|
+
declare interface Props_2 {
|
|
84
|
+
locale?: string;
|
|
85
|
+
question: string;
|
|
86
|
+
timestamp: Date;
|
|
87
|
+
location?: string;
|
|
88
|
+
source?: string;
|
|
89
|
+
status?: default_2.ComponentProps<typeof StatusBadge>['variant'];
|
|
90
|
+
statusMessage?: string;
|
|
91
|
+
hasAttributes?: boolean;
|
|
92
|
+
attributes?: Record<string, any>;
|
|
93
|
+
messages?: MessageProps[];
|
|
94
|
+
isLoading?: boolean;
|
|
95
|
+
onClick?: () => void;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export declare interface RelatedArticle {
|
|
99
|
+
id: string;
|
|
100
|
+
title: string;
|
|
101
|
+
url: string;
|
|
102
|
+
score: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export declare function StatusBadge({ ...props }: Props): default_2.JSX.Element;
|
|
106
|
+
|
|
107
|
+
export { }
|
package/dist/esm/ChatSearch.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._followUpSearchBar_x7ads_1{box-shadow:0 -2px 4px #1212170d
|
|
1
|
+
._followUpSearchBar_x7ads_1{box-shadow:0 -2px 4px #1212170d;background-color:var(--bfc-card)}
|
|
@@ -5,7 +5,7 @@ import remarkGfm from 'remark-gfm';
|
|
|
5
5
|
import { TooltipProvider, Tooltip, TooltipTrigger, TooltipContent } from '../components/ui/tooltip.js';
|
|
6
6
|
import { Button } from '../components/ui/button.js';
|
|
7
7
|
import { XCircle, Check, Copy, CaretDown, ArrowSquareOut, CaretRight, ArrowsVertical, ArrowDown, Globe, LockSimple, MagnifyingGlass, X, Image, ArrowRight, ArrowLeft, ArrowsInSimple, ArrowsOutSimple } from '@phosphor-icons/react';
|
|
8
|
-
import { F as FormattedMessage, c as addPopupWidgetUtm, M as MemoizedReactMarkdown } from './FormattedMessage.
|
|
8
|
+
import { F as FormattedMessage, c as addPopupWidgetUtm, M as MemoizedReactMarkdown } from './FormattedMessage.BcAkzCZt.js';
|
|
9
9
|
import { appendErrors, useForm, Controller } from 'react-hook-form';
|
|
10
10
|
import { validateFieldsNatively, toNestErrors } from '@hookform/resolvers';
|
|
11
11
|
import require$$0 from 'ajv';
|
|
@@ -13,19 +13,19 @@ import { g as getDefaultExportFromCjs } from './_commonjsHelpers.BFTU3MAI.js';
|
|
|
13
13
|
import { Input } from '../components/ui/input.js';
|
|
14
14
|
import { Label } from '../components/ui/label.js';
|
|
15
15
|
import { Textarea } from '../components/ui/textarea.js';
|
|
16
|
-
import { S as SimpleSelect } from './simpleSelect.
|
|
17
|
-
import { c as cn, i as isAnswerUncertain } from './utils.
|
|
18
|
-
import { D as DatePicker } from './date-picker.
|
|
16
|
+
import { S as SimpleSelect } from './simpleSelect.B1rktKkt.js';
|
|
17
|
+
import { c as cn, i as isAnswerUncertain } from './utils.Cwtlq8dh.js';
|
|
18
|
+
import { D as DatePicker } from './date-picker.sQXSlqNZ.js';
|
|
19
19
|
import { createId } from '@paralleldrive/cuid2';
|
|
20
20
|
import { useImmerReducer } from 'use-immer';
|
|
21
21
|
import { useSearchParam, useEffectOnce } from 'react-use';
|
|
22
22
|
import { MemoizedIcon } from '../components/ui/icon.js';
|
|
23
23
|
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from '../components/ui/collapsible.js';
|
|
24
24
|
import { F as Feedback } from './feedback.NWn6_mYe.js';
|
|
25
|
-
import { G as GeneratingStar } from './generating-star.
|
|
25
|
+
import { G as GeneratingStar } from './generating-star.COkD0gHd.js';
|
|
26
26
|
import { getCountry } from 'countries-and-timezones';
|
|
27
|
-
import { C as Combobox } from './combobox.
|
|
28
|
-
import { T as TwoLevelCombobox } from './two-level-combobox.
|
|
27
|
+
import { C as Combobox } from './combobox.CkN-wAHB.js';
|
|
28
|
+
import { T as TwoLevelCombobox } from './two-level-combobox.DsWPDcI6.js';
|
|
29
29
|
import { ScrollArea } from '../components/ui/scroll-area.js';
|
|
30
30
|
|
|
31
31
|
import '../ChatSearch.css';function Suggestions({ suggestions, onQuestionClick, title = "Suggested questions" }) {
|
|
@@ -5336,6 +5336,26 @@ const executeClientAction = (key, inputs) => {
|
|
|
5336
5336
|
});
|
|
5337
5337
|
};
|
|
5338
5338
|
|
|
5339
|
+
function cancelStreamReader(reader) {
|
|
5340
|
+
try {
|
|
5341
|
+
void reader.cancel().catch((error) => {
|
|
5342
|
+
console.warn("Error cancelling stream reader:", error);
|
|
5343
|
+
});
|
|
5344
|
+
try {
|
|
5345
|
+
reader.releaseLock();
|
|
5346
|
+
} catch (releaseError) {
|
|
5347
|
+
console.warn("Error releasing stream reader lock:", releaseError);
|
|
5348
|
+
}
|
|
5349
|
+
} catch (error) {
|
|
5350
|
+
console.warn("Error cancelling stream reader:", error);
|
|
5351
|
+
try {
|
|
5352
|
+
reader.releaseLock();
|
|
5353
|
+
} catch (releaseError) {
|
|
5354
|
+
console.warn("Error releasing stream reader lock:", releaseError);
|
|
5355
|
+
}
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5358
|
+
|
|
5339
5359
|
const LoadingConversation = () => {
|
|
5340
5360
|
return /* @__PURE__ */ React__default.createElement(
|
|
5341
5361
|
motion.div,
|
|
@@ -5500,6 +5520,7 @@ const ChatSearchComponent = forwardRef(
|
|
|
5500
5520
|
const primarySearchRef = useRef(null);
|
|
5501
5521
|
const followUpSearchRef = useRef(null);
|
|
5502
5522
|
const bottomRef = useRef(null);
|
|
5523
|
+
const currentReaderRef = useRef(null);
|
|
5503
5524
|
const { suggestions: autocompleteSuggestions } = useAutocomplete({
|
|
5504
5525
|
query,
|
|
5505
5526
|
endpoint: autocompleteEndpoint || "",
|
|
@@ -5539,10 +5560,14 @@ const ChatSearchComponent = forwardRef(
|
|
|
5539
5560
|
conversationId,
|
|
5540
5561
|
onFirstEvent
|
|
5541
5562
|
}) => {
|
|
5563
|
+
currentReaderRef.current = reader;
|
|
5542
5564
|
let accumulatedAnswer = "";
|
|
5543
5565
|
try {
|
|
5544
5566
|
let done = false, isFirstEvent = true, searchIntentId, isUncertain = false, value;
|
|
5545
5567
|
while ({ done, value } = await reader.read(), !done) {
|
|
5568
|
+
if (currentReaderRef.current !== reader) {
|
|
5569
|
+
break;
|
|
5570
|
+
}
|
|
5546
5571
|
if (isFirstEvent) {
|
|
5547
5572
|
isFirstEvent = false;
|
|
5548
5573
|
onFirstEvent?.();
|
|
@@ -5623,8 +5648,16 @@ const ChatSearchComponent = forwardRef(
|
|
|
5623
5648
|
}
|
|
5624
5649
|
}
|
|
5625
5650
|
return { answer: accumulatedAnswer, searchIntentId, isUncertain };
|
|
5651
|
+
} catch (error) {
|
|
5652
|
+
if (currentReaderRef.current !== reader) {
|
|
5653
|
+
return { answer: "", searchIntentId: void 0, isUncertain: false };
|
|
5654
|
+
}
|
|
5655
|
+
throw error;
|
|
5626
5656
|
} finally {
|
|
5627
|
-
reader
|
|
5657
|
+
if (currentReaderRef.current === reader) {
|
|
5658
|
+
currentReaderRef.current = null;
|
|
5659
|
+
reader.releaseLock();
|
|
5660
|
+
}
|
|
5628
5661
|
}
|
|
5629
5662
|
};
|
|
5630
5663
|
const generateAnswerForQuery = async ({
|
|
@@ -5823,6 +5856,12 @@ const ChatSearchComponent = forwardRef(
|
|
|
5823
5856
|
}
|
|
5824
5857
|
};
|
|
5825
5858
|
const createNewThread = (firstQuery) => {
|
|
5859
|
+
if (currentReaderRef.current) {
|
|
5860
|
+
const reader = currentReaderRef.current;
|
|
5861
|
+
currentReaderRef.current = null;
|
|
5862
|
+
cancelStreamReader(reader);
|
|
5863
|
+
}
|
|
5864
|
+
setIsSearching(false);
|
|
5826
5865
|
setQuery("");
|
|
5827
5866
|
setFollowUpQuery("");
|
|
5828
5867
|
setShowResults(false);
|
|
@@ -6075,7 +6114,9 @@ const ChatSearchComponent = forwardRef(
|
|
|
6075
6114
|
},
|
|
6076
6115
|
onBackButtonClick: () => void createNewThread(),
|
|
6077
6116
|
onCloseWidgetClick: () => onCloseWidget?.(),
|
|
6078
|
-
className: cn("@3xl:mb-4",
|
|
6117
|
+
className: cn("@3xl:mb-4", {
|
|
6118
|
+
"!block": showResults && isSearchWidget
|
|
6119
|
+
})
|
|
6079
6120
|
}
|
|
6080
6121
|
),
|
|
6081
6122
|
/* @__PURE__ */ React__default.createElement(
|
|
@@ -6266,4 +6307,4 @@ const ChatSearch = forwardRef(({ featureFlags, ...props }, ref) => /* @__PURE__
|
|
|
6266
6307
|
ChatSearch.displayName = "ChatSearch";
|
|
6267
6308
|
|
|
6268
6309
|
export { ChatSearch as C, ChatSearchProvider as a, useIsChatSearchDirty as b, useChatSearch as u };
|
|
6269
|
-
//# sourceMappingURL=ChatSearch.
|
|
6310
|
+
//# sourceMappingURL=ChatSearch.BV8FTS2Y.js.map
|