UNPKG

@kitn.ai/ui

Version:

Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. Authored in SolidJS.

42 lines (41 loc) 1.57 kB
import { JSX, Accessor } from 'solid-js'; declare module 'solid-js' { namespace JSX { interface ExplicitBoolAttributes { inert: boolean; } } } /** Imperative open controller, handed to a parent (e.g. the kai-tool facade) * via `controllerRef` so it can drive/observe open state — mirrors * HoverCardController. Only available when the Collapsible is UNCONTROLLED * (no `open` prop); in controlled mode the parent already owns the state. */ export interface CollapsibleController { open: Accessor<boolean>; setOpen: (v: boolean) => void; } export declare function Collapsible(props: { open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; /** When true, the trigger no longer toggles (programmatic show/hide still work * via the controller; this only gates the user-facing trigger). */ disabled?: boolean; /** Receive the open controller (open accessor + setOpen) once mounted. * Only meaningful in uncontrolled mode (no `open` prop). */ controllerRef?: (api: CollapsibleController) => void; children: JSX.Element; class?: string; }): JSX.Element; export declare function CollapsibleTrigger(props: { children?: JSX.Element; class?: string; as?: (props: Record<string, any>) => JSX.Element; onClick?: JSX.EventHandlerUnion<HTMLButtonElement, MouseEvent>; [k: string]: any; }): JSX.Element; export declare function CollapsibleContent(props: { children?: JSX.Element; class?: string; [k: string]: any; }): JSX.Element;