import React from "react"; import { XmChatShell as XmChatShellElement } from "../lit/components/chat/index.js"; /** * A generic type for strongly typing custom events with their targets * @template T - The type of the event target (extends EventTarget) * @template D - The type of the detail payload for the custom event */ type TypedEvent = E & { target: T; }; /** `XmChatShell` component event */ export type XmChatShellElementEvent = TypedEvent< XmChatShellElement, E >; export type { XmChatShellElement }; export interface XmChatShellProps extends Pick< React.AllHTMLAttributes, | "children" | "dir" | "hidden" | "id" | "lang" | "slot" | "style" | "title" | "translate" | "onClick" | "onFocus" | "onBlur" > { /** undefined */ processing?: boolean; /** Pin the shell to the viewport (height: 100vh). Default is height: 100% so the shell sizes to its container — embedded hosts get correct sizing for free. Full-bleed previews opt in via the `full-viewport` attribute. */ fullViewport?: boolean; /** undefined */ thinkingLabel?: XmChatShellElement["thinkingLabel"]; /** undefined */ topTitle?: XmChatShellElement["topTitle"]; /** A space-separated list of the classes of the element. Classes allows CSS and JavaScript to select and access specific elements via the class selectors or functions like the method `Document.getElementsByClassName()`. */ className?: string; /** Contains a space-separated list of the part names of the element that should be exposed on the host element. */ exportparts?: string; /** Used for labels to link them with their inputs (using input id). */ htmlFor?: string; /** Used to help React identify which items have changed, are added, or are removed within a list. */ key?: number | string; /** Contains a space-separated list of the part names of the element. Part names allows CSS to select and style specific elements in a shadow tree via the ::part pseudo-element. */ part?: string; /** A mutable ref object whose `.current` property is initialized to the passed argument (`initialValue`). The returned object will persist for the full lifetime of the component. */ ref?: React.Ref; /** Allows developers to make HTML elements focusable, allow or prevent them from being sequentially focusable (usually with the `Tab` key, hence the name) and determine their relative ordering for sequential focus navigation. */ tabIndex?: number; /** Fired when the artifact panel is closed. */ onArtifactClose?: (event: XmChatShellElementEvent) => void; /** Fired when an artifact is opened. */ onArtifactOpen?: (event: XmChatShellElementEvent) => void; /** Fired when the action is cancelled. */ onCancel?: (event: XmChatShellElementEvent) => void; /** Fired when the user sends the composed content. */ onSend?: (event: XmChatShellElementEvent) => void; } /** * * * ## Attributes & Properties * * Component attributes and properties that can be applied to the element or by using JavaScript. * * - `processing`: undefined * - `thinking-label`/`thinkingLabel`: undefined * - `top-title`/`topTitle`: undefined * - `full-viewport`/`fullViewport`: Pin the shell to the viewport (height: 100vh). Default is height: 100% * so the shell sizes to its container — embedded hosts get correct * sizing for free. Full-bleed previews opt in via the `full-viewport` * attribute. * - `conversations`: undefined (property only) * - `thread`: undefined (property only) * * ## Events * * Events that will be emitted by the component. * * - `artifact-close`: Fired when the artifact panel is closed. * - `artifact-open`: Fired when an artifact is opened. * - `cancel`: Fired when the action is cancelled. * - `send`: Fired when the user sends the composed content. */ export const XmChatShell: React.ForwardRefExoticComponent;