import { type ReactNode, type RefObject } from "react"; import { View, type StyleProp, type ViewStyle } from "../../style/index.js"; import { Button as WebButton } from "../button/button.js"; import { type IconName } from "../icon/icon.js"; import { type DropdownSkin } from "./dropdown.styles.js"; export interface DropdownItem { label: string; /** Stable stored value for command or project selection. */ value?: string; /** Muted second line under the label. */ description?: string; /** Muted trailing detail, such as a project count. */ detail?: string; /** Selection state for a mutually exclusive menu choice. */ selected?: boolean; /** Section heading immediately before this item. */ sectionBefore?: string; /** Keep the menu open after this command, such as refreshing its contents. */ keepOpen?: boolean; /** Optional leading Canvas glyph rendered before the label, named from the kit * icon set (e.g. `"user"`, `"settings"`, `"logOut"`). Rendered through the * `Icon` atom, tinted to match the row (destructive rows go red). */ icon?: IconName; /** Optional trailing keyboard shortcut, right-aligned and muted. */ shortcut?: string; /** Red-tinted row for destructive actions (e.g. Delete). */ destructive?: boolean; /** Inert row: skips onSelect and shows the platform's disabled look (the web's muted ink, a dim on iOS and Android). */ disabled?: boolean; /** Draw a hairline separator above this row to start a new group. */ separatorBefore?: boolean; /** The row opens a submenu: a trailing chevron hint (the row's `onSelect` opens it). */ submenu?: boolean; } export interface DropdownProps { /** Use an existing trigger without adding a trigger or layout wrapper. */ anchorRef?: RefObject; /** Explicit accessible name for the menu. */ accessibilityLabel?: string; /** Exact compact web application menu frame and row metrics. */ compact?: boolean; /** Preserve resting row fill and opacity during a press. */ steadyPress?: boolean; /** Width of the floating menu, clamped inside the overlay outlet. */ menuWidth?: number; /** Height cap for the compact menu's scrolling contents. */ maxHeight?: number; /** Muted footnote separated from menu commands by a hairline. */ note?: ReactNode; /** Label for the default outline trigger button. Omit when supplying a custom * trigger via `children`. */ trigger?: string; /** A custom trigger rendered in place of the default outline button, e.g. an * avatar account chip. It is wrapped in a Pressable that toggles the menu; * the menu itself still comes from `items`. */ children?: ReactNode; /** The accessible name for a CUSTOM trigger (`children`). Without it the button * is named from its own contents, which runs the trigger's text together into * one unpunctuated string ("Rachel Chenrachel@example.com") and repeats any * label a nested control already carries. Ignored by the default `trigger` * button, which is named by its own text. */ triggerLabel?: string; /** Optional muted section heading rendered above the rows (e.g. "Actions"). */ label?: string; /** Identity header title, rendered in the popover foreground ABOVE everything * else in the menu (an account name over its email, say). Pair it with * `description`; passing neither omits the header block entirely. */ title?: string; /** Identity header second line, muted, under `title`. */ description?: string; /** The menu rows, top to bottom. */ items: DropdownItem[]; /** Align the menu's TRAILING edge with the trigger's trailing edge instead of * the leading edge (the default). For a trigger parked at the end of a bar, * where a leading-aligned menu would run off the surface. Logical, so a * right-to-left locale mirrors it. */ alignEnd?: boolean; /** Dimmed, inert trigger: the menu never opens and the press is a no-op. */ disabled?: boolean; /** * Draw the menu open and in flow under the trigger instead of floating it over the * page: a specimen of the menu for a docs page or an empty state. The trigger reads as * expanded and the press is inert, a row still fires `onSelect`, and nothing dismisses * the card, so `open` and `onOpenChange` have no effect. `alignEnd` lines the card up * with the trigger's trailing edge, as it does for the floating card. */ inline?: boolean; /** Controlled open state. Omit for uncontrolled (the trigger opens/closes it). */ open?: boolean; /** Fired when the open state changes (trigger press, select, etc.). */ onOpenChange?: (open: boolean) => void; /** Fired with the selected item and its index when a row is pressed. */ onSelect?: (item: DropdownItem, index: number) => void; /** E2E hook forwarded to the root element. */ testID?: string; /** Outer layout composition only (width/flex within a parent), never a restyle hook. */ style?: StyleProp; } /** Build a Dropdown component from a platform skin. */ /** * The components a Dropdown draws with that look different per platform. The web * builds are the defaults; the iOS and Android entries pass their own, so the docs' * platform columns render them truthfully (a device resolves them by platform either way). */ export interface DropdownParts { Button?: typeof WebButton; } export declare function createDropdown(skin: DropdownSkin, parts?: DropdownParts): (props: DropdownProps) => import("react").JSX.Element; //# sourceMappingURL=dropdown.shared.d.ts.map