import { ReorderableListingKey as CoreReorderableListingKey } from '../../.deps/ui/core-web/src'; import { IconName } from '../Icon/IconName'; import * as React from 'react'; export type ReorderableListingKey = CoreReorderableListingKey; export interface ReorderableListingSubitem { /** Stable unique key. */ id: ReorderableListingKey; /** Row label. */ label: React.ReactNode; /** Leading icon. */ icon?: IconName; /** Renders the row in the hidden state (muted, eye-off action). */ hidden?: boolean; /** Renders the row in the disabled state (muted, no action). */ disabled?: boolean; /** Text used for accessibility / typeahead. Falls back to `label` when it is a string. */ textValue?: string; } export interface ReorderableListingItemData extends ReorderableListingSubitem { /** Subitems. They move with their parent and are not independently draggable. */ children?: ReorderableListingSubitem[]; /** * Whether the row can be dragged to reorder. Unlike `disabled`, a non-draggable row remains * selectable and keeps its own actions — only the drag affordance is disabled. * @default true */ draggable?: boolean; } export interface ReorderableListingProps extends Omit, 'className'> { /** Items to render (controlled). */ items?: ReorderableListingItemData[]; /** Initial items (uncontrolled). */ defaultItems?: ReorderableListingItemData[]; /** Called with the new top-level order after a drag-and-drop reorder. */ onReorder?: (orderedIds: ReorderableListingKey[], items: ReorderableListingItemData[], movedId: ReorderableListingKey) => void; /** Called when a top-level row is pressed (click or Enter) — e.g. to select it. */ onAction?: (id: ReorderableListingKey) => void; /** Called when a row's hide action is toggled. `parentId` is set for subitems. */ onHiddenChange?: (id: ReorderableListingKey, hidden: boolean, parentId?: ReorderableListingKey) => void; /** * Renders custom action-area content for a row (e.g. multiple buttons). When it returns a node, * it replaces the built-in hide button for that row. `parentId` is set for subitems. */ renderActions?: (item: ReorderableListingSubitem, context: { mode: 'parent' | 'subitem'; parentId?: ReorderableListingKey; }) => React.ReactNode; /** Renders custom leading content (e.g. a thumbnail) for a row. Replaces the row's icon. */ renderMedia?: (item: ReorderableListingSubitem, context: { mode: 'parent' | 'subitem'; }) => React.ReactNode; /** Footer content (e.g. an action button). */ footer?: React.ReactNode; /** Accessible label for the list. */ 'aria-label': string; /** Additional class name. */ className?: string; } export declare const reorder: (list: ReorderableListingItemData[], keys: Set, targetKey: ReorderableListingKey, position: "before" | "after") => ReorderableListingItemData[]; export declare const ReorderableListing: ({ items, defaultItems, onReorder, onAction, onHiddenChange, renderActions, renderMedia, footer, "aria-label": ariaLabel, className, ...rest }: ReorderableListingProps) => React.JSX.Element;