UNPKG

@assistant-ui/react

Version:

Open-source TypeScript/React library for building production-grade AI chat experiences

34 lines • 1.55 kB
import { type ActionButtonElement, type ActionButtonProps } from "../../utils/createActionButton.js"; import type { MouseEvent } from "react"; declare const useComposerCancel: () => ((event: MouseEvent<HTMLButtonElement>) => void) | null; export declare namespace ComposerPrimitiveCancel { type Element = ActionButtonElement; /** * Props for the ComposerPrimitive.Cancel component. * Inherits all button element props and action button functionality. */ type Props = ActionButtonProps<typeof useComposerCancel>; } /** * A button component that cancels the current message composition. * * This component automatically handles the cancel functionality and is disabled * when canceling is not available. * Keyboard or assistive-technology activation after editing returns focus to the * main thread composer when available, unless a handler has moved focus elsewhere. * Pointer activation preserves the existing focus behavior. * * @example * ```tsx * <ComposerPrimitive.Cancel> * Cancel * </ComposerPrimitive.Cancel> * ``` */ export declare const ComposerPrimitiveCancel: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & { asChild?: boolean | undefined; }, "ref"> & { render?: import("react").ReactElement | undefined; } & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>; export {}; //# sourceMappingURL=ComposerCancel.d.ts.map