import { type CSSProperties, type ReactNode } from "react";
/**
 * ActionsDrawer — left-side panel that exposes the action library so users
 * can drag (or click-add) building blocks onto the canvas. Mirrors the
 * pattern in octaviaflow-ui's `ActionsDrawer` but generalised so the
 * design system has no opinions about which actions exist.
 *
 * Composition model:
 *   - Consumers pass `groups` (categorised) or `items` (flat list).
 *   - Drag-to-canvas works via the native HTML5 DnD API — the drawer sets
 *     `dataTransfer` payloads of shape `{ kind: "ods/action", action }`.
 *     Drop targets read that JSON in their `onDrop` to instantiate a node.
 *   - Click-add is exposed via the `onItemActivate` callback so consumers
 *     that prefer click-to-insert can opt in without enabling drag.
 *   - Search filters across `label`, `description`, and `keywords[]`.
 */
export type ActionItemKind = "trigger" | "action" | "condition" | "transform" | string;
export interface ActionItem<TPayload = unknown> {
    /** Stable identifier — used as React key and as the drag payload id. */
    id: string;
    /** Display name. */
    label: string;
    /** One-line description shown below the label. */
    description?: string;
    /** Optional icon — any ReactNode (inline SVG, design-system icon, etc.). */
    icon?: ReactNode;
    /** Visual category — drives accent colour. Free-form so consumers can
     *  add their own (`"webhook"`, `"slack"`, …) without losing styling. */
    kind?: ActionItemKind;
    /** Search keywords beyond label/description (e.g. SKU codes, aliases). */
    keywords?: string[];
    /** Arbitrary payload echoed back via drag/activate callbacks so the
     *  consumer can instantiate the right node without reverse-lookup. */
    payload?: TPayload;
    /** Optional badge (e.g. "Beta", "Pro") rendered top-right. */
    badge?: ReactNode;
    /** Disable interaction — item still renders but won't drag or activate. */
    disabled?: boolean;
}
export interface ActionGroup<TPayload = unknown> {
    /** Group id — `"triggers"`, `"http"`, etc. */
    id: string;
    /** Group heading. */
    label: ReactNode;
    /**
     * Optional pictogram / icon rendered before the group label. Use this
     * for category-level visual cues (Triggers, Logic, AI, …) — the icon
     * inherits the heading's muted colour by default.
     */
    icon?: ReactNode;
    /** Optional collapsed-by-default flag. */
    defaultCollapsed?: boolean;
    items: ActionItem<TPayload>[];
}
export interface ActionsDrawerProps<TPayload = unknown> {
    /** Categorised library — preferred shape. */
    groups?: ActionGroup<TPayload>[];
    /** Flat list — quicker for small libraries; rendered ungrouped. */
    items?: ActionItem<TPayload>[];
    /** Initial open state. Defaults to true. */
    open?: boolean;
    /** Toggles open state; if omitted the toggle button is hidden. */
    onOpenChange?: (open: boolean) => void;
    /** Width when open. Defaults to 280. */
    width?: number | string;
    /** Show the search input. Defaults to true. */
    searchable?: boolean;
    /** Placeholder for the search input. */
    searchPlaceholder?: string;
    /** Initial search query. Useful for controlled tests. */
    defaultSearch?: string;
    /** Heading rendered above the search bar. */
    title?: ReactNode;
    /** Optional description below the title. */
    description?: ReactNode;
    /** Empty state when no items match the search. */
    emptyState?: ReactNode;
    /** Footer slot (e.g. "Browse all actions" link). */
    footer?: ReactNode;
    /** Click handler — fires when the user activates an item (click or Enter). */
    onItemActivate?: (item: ActionItem<TPayload>) => void;
    /** Drag-start observer — exposed for analytics / pre-drop validation. */
    onItemDragStart?: (item: ActionItem<TPayload>) => void;
    /** MIME type for the drag payload. Defaults to "application/x-ods-action".
     *  Drop targets must read this same MIME via `event.dataTransfer.getData()`. */
    dragMimeType?: string;
    /** Disables drag affordance entirely. Useful when the consumer wants
     *  click-add only (e.g. on touch surfaces). */
    draggable?: boolean;
    className?: string;
    style?: CSSProperties;
}
export declare function ActionsDrawer<TPayload = unknown>({ groups, items, open, onOpenChange, width, searchable, searchPlaceholder, defaultSearch, title, description, emptyState, footer, onItemActivate, onItemDragStart, dragMimeType, draggable, className, style, }: ActionsDrawerProps<TPayload>): import("react/jsx-runtime").JSX.Element;
export declare const ODS_ACTION_DRAG_MIME = "application/x-ods-action";
//# sourceMappingURL=ActionsDrawer.d.ts.map