@elevenlabs/convai-widget-core 0.2.0 → 0.5.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 ElevenLabs
3
+ Copyright (c) 2025 ElevenLabs
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -5,6 +5,7 @@ import { Signalish } from "../utils/signalish";
5
5
  declare const VARIANT_CLASSES: {
6
6
  primary: string;
7
7
  secondary: string;
8
+ ghost: string;
8
9
  };
9
10
  export interface BaseButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
10
11
  iconClassName?: string;
@@ -0,0 +1,6 @@
1
+ import type { IconName } from "./Icon";
2
+ interface FeedbackProps {
3
+ icon?: IconName;
4
+ }
5
+ export declare function Feedback({ icon }: FeedbackProps): import("preact").JSX.Element;
6
+ export {};
@@ -9,10 +9,12 @@ declare const ICON_MAP: {
9
9
  "chevron-down": typeof ChevronDownIcon;
10
10
  "chevron-up": typeof ChevronUpIcon;
11
11
  send: typeof SendIcon;
12
+ star: typeof StarIcon;
12
13
  };
13
14
  declare const SIZE_CLASSES: {
14
15
  sm: string;
15
16
  md: string;
17
+ lg: string;
16
18
  };
17
19
  export type IconName = keyof typeof ICON_MAP;
18
20
  interface IconProps {
@@ -30,4 +32,11 @@ declare function ChevronDownIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.
30
32
  declare function ChevronUpIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
31
33
  declare function CheckIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
32
34
  declare function SendIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
35
+ declare function StarIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
36
+ export declare function FeedbackIcon({ orbColor, circleBackgroundColor, starColor, className, }: {
37
+ orbColor: string;
38
+ circleBackgroundColor: string;
39
+ starColor: string;
40
+ className?: string;
41
+ }): JSX.Element;
33
42
  export {};
@@ -0,0 +1,15 @@
1
+ import type { Signalish } from "../utils/signalish";
2
+ import { type IconName } from "./Icon";
3
+ export declare const Rating: ({ onRate, min, max, ariaLabel, icon, }: {
4
+ onRate: (rating: number) => void;
5
+ ariaLabel: Signalish<string>;
6
+ min?: number;
7
+ max?: number;
8
+ icon?: IconName;
9
+ }) => import("preact").JSX.Element;
10
+ export declare function RatingResult({ rating, min, max, icon, }: {
11
+ rating: number;
12
+ min?: number;
13
+ max?: number;
14
+ icon?: IconName;
15
+ }): import("preact").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { type Signal } from "@preact/signals";
2
+ import type { ComponentChildren } from "preact";
3
+ type FeedbackStep = "initial" | "submitted-rating" | "submitted-follow-up";
4
+ interface FeedbackStore {
5
+ rating: Signal<number | null>;
6
+ feedbackText: Signal<string>;
7
+ feedbackProgress: Signal<FeedbackStep>;
8
+ submitRating: (rating: number) => Promise<void>;
9
+ submitFeedback: () => Promise<void>;
10
+ reset: () => void;
11
+ }
12
+ export declare function FeedbackProvider({ children, }: {
13
+ children: ComponentChildren;
14
+ }): import("preact").JSX.Element;
15
+ export declare function useFeedback(): FeedbackStore;
16
+ export {};
@@ -0,0 +1,16 @@
1
+ import { type Signal } from "@preact/signals";
2
+ import type { ComponentChildren } from "preact";
3
+ type SheetContentType = "transcript" | "feedback";
4
+ export interface PageConfig {
5
+ showHeaderBack: boolean;
6
+ onHeaderBack?: () => void;
7
+ }
8
+ export declare function SheetContentProvider({ defaultContent, children, }: {
9
+ defaultContent?: SheetContentType;
10
+ children: ComponentChildren;
11
+ }): import("preact").JSX.Element;
12
+ export declare function useSheetContent(): {
13
+ currentContent: Signal<SheetContentType>;
14
+ currentConfig: PageConfig;
15
+ };
16
+ export {};
@@ -10,4 +10,5 @@ export declare function useTextOnly(): ReadonlySignal<boolean>;
10
10
  export declare function useIsConversationTextOnly(): ReadonlySignal<boolean>;
11
11
  export declare function useFirstMessage(): ReadonlySignal<string | null>;
12
12
  export declare function useWebRTC(): ReadonlySignal<boolean>;
13
+ export declare function useShouldShowFeedbackAtEnd(): ReadonlySignal<boolean>;
13
14
  export {};