/**
 * DataList Molecule
 *
 * A simplified, schema-driven list for iterating over entity data.
 * Extracted from the List organism with all complexity removed:
 * no built-in search, sort, filter, selection, bulk actions, or custom renderers.
 *
 * Accepts `fields` config for per-field rendering control (icon, variant, format)
 * and `itemActions` for per-item event bus wiring.
 *
 * Uses atoms only internally: Box, VStack, HStack, Typography, Badge, Button, Icon.
 */
import React from 'react';
import type { EntityRow, EventKey } from "@almadar/core";
import { type DataDndProps } from './useDataDnd';
export interface DataListField {
    /** Entity field name (dot-notation supported) */
    name: string;
    /** Display label (auto-generated from name if omitted) */
    label?: string;
    /** Lucide icon name to show beside the field */
    icon?: string;
    /** Rendering variant: 'h3'/'h4' for title, 'body' for text, 'caption' for small,
     *  'badge' for status badge, 'progress' for progress bar */
    variant?: 'h3' | 'h4' | 'body' | 'caption' | 'badge' | 'small' | 'progress';
    /** Optional format: 'date', 'currency', 'number', 'boolean', 'percent' */
    format?: 'date' | 'currency' | 'number' | 'boolean' | 'percent';
}
export interface DataListItemAction {
    /** Button label */
    label: string;
    /** Event name to emit (dispatched as UI:{event} with { id, row: itemData }) */
    event: EventKey;
    /** Lucide icon name */
    icon?: string;
    /** Button variant */
    variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
}
export interface DataListProps<T extends EntityRow = EntityRow> extends DataDndProps {
    /**
     * Schema entity data — single record or collection, typed against
     * `@almadar/core`'s `EntityRow` so the narrow type declared on the
     * emitting trait's `Event { data : [X] }` flows through to the prop
     * without widening. The generic `T` lets consumers pass a narrower
     * entity (e.g. `CartItem`) and have the `children` render function
     * receive items of that exact shape.
     */
    entity: T | readonly T[];
    /**
     * Field definitions for rendering each row. The pattern contract in
     * `@almadar/patterns` documents `columns` as the wire-format alias the
     * compiler emits — both names resolve to the same shape here. Pass either.
     */
    fields?: readonly DataListField[];
    /** Alias for `fields` — the compiler emits `columns` for field defs. */
    columns?: readonly DataListField[];
    /** Per-item action buttons */
    itemActions?: readonly DataListItemAction[];
    /** Gap between rows */
    gap?: 'none' | 'sm' | 'md' | 'lg';
    /** Visual variant */
    variant?: 'default' | 'card' | 'compact' | 'message';
    /** Group items by a field value (renders section headers between groups) */
    groupBy?: string;
    /** Field name identifying the sender (used with variant: "message") */
    senderField?: string;
    /** Current user identifier; messages matching this value align right (used with variant: "message") */
    currentUser?: string;
    /** Additional CSS classes */
    className?: string;
    /** Loading state */
    isLoading?: boolean;
    /** Error state */
    error?: Error | null;
    /** Enable drag-to-reorder with grip handles */
    reorderable?: boolean;
    /** Event emitted on reorder: UI:{reorderEvent} with { fromIndex, toIndex } */
    reorderEvent?: EventKey;
    /** Event emitted on left swipe: UI:{swipeLeftEvent} with { row } */
    swipeLeftEvent?: EventKey;
    /** Actions revealed on left swipe */
    swipeLeftActions?: readonly {
        label: string;
        icon?: string;
        variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
    }[];
    /** Event emitted on right swipe: UI:{swipeRightEvent} with { row } */
    swipeRightEvent?: EventKey;
    /** Actions revealed on right swipe */
    swipeRightActions?: readonly {
        label: string;
        icon?: string;
        variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
    }[];
    /** Event emitted on long press: UI:{longPressEvent} with { row } */
    longPressEvent?: EventKey;
    /** Enable infinite scroll loading */
    infiniteScroll?: boolean;
    /** Event emitted when more items needed: UI:{loadMoreEvent} */
    loadMoreEvent?: EventKey;
    /** Whether more items are available for infinite scroll */
    hasMore?: boolean;
    /** Render prop for custom per-item content. When provided, `fields` and `itemActions` are ignored. */
    /**
     * Render function for each row's content. Receives an item of the
     * component's entity type `T` (narrowed via the generic parameter)
     * and the row's index in the materialised array.
     */
    children?: (item: T, index: number) => React.ReactNode;
    /**
     * Per-item render function (schema-level alias for children render prop).
     * In .orb schemas: ["fn", "item", { pattern tree with @item.field bindings }]
     * The compiler converts this to the children render prop.
     * @deprecated Use children render prop in React code. This prop exists for pattern registry sync.
     */
    renderItem?: (item: T, index: number) => React.ReactNode;
    /** Max items to show before "Show More" button. Defaults to 5. Set to 0 to disable. */
    pageSize?: number;
}
export declare function DataList<T extends EntityRow = EntityRow>({ entity, fields, columns, itemActions, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, dragGroup, accepts, sortable: sortableProp, dropEvent, reorderEvent: dndReorderEvent, positionEvent, dndItemIdField, dndRoot, }: DataListProps<T>): string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | undefined;
export declare namespace DataList {
    var displayName: string;
}
