import "./accordion.css"; import { type ReactNode } from "react"; import type * as React from "react"; import { type CollapsiblePanelProps, type CollapsibleRootProps } from "@base-ui/react/collapsible"; import { useRender } from "@base-ui/react/use-render"; import { type IconName } from "./icon"; import { type StyleProps } from "./style_props"; import { type InkColor } from "./text_ink"; export interface AccordionProps extends StyleProps { /** Content is optional: a header-only Accordion is a plain row with identical rhythm. */ children: ReactNode; /** Uncontrolled initial state. Ignored when `expanded` is provided. */ defaultExpanded?: boolean; /** Controlled open state — provide together with `onToggle`. */ expanded?: boolean; onToggle?: (expanded: boolean) => void; testID?: string; ref?: React.Ref; render?: CollapsibleRootProps["render"]; } /** * A single expand/collapse disclosure over Base UI's Collapsible, which owns the button, * `aria-expanded`, the panel wiring and the body's mount. Controlled via `expanded`/`onToggle` or * uncontrolled via `defaultExpanded`; compose several with Dividers for a list. */ export declare function Accordion({ children, defaultExpanded, expanded, onToggle, testID, render, ref, ...props }: AccordionProps): React.JSX.Element; export interface AccordionHeaderProps extends StyleProps { /** * A layout slot: `AccordionTitle` (+ `AccordionMeta`) for a list-row heading, or * `SectionHeadingTitle`/`SectionHeadingMeta` for a section-style one, plus any right-side node. */ children: ReactNode; accessibilityLabel?: string; testID?: string; ref?: React.Ref; /** * The trigger and the plain box hand a callback different state objects, so only the forms both * accept are offered. */ render?: React.ReactElement | ((props: React.HTMLAttributes) => React.ReactElement); } /** * The always-visible row: a Base UI trigger with a chevron when content exists, else a plain row * with no button role, since a control that refuses every press is worse than none. */ export declare function AccordionHeader(props: AccordionHeaderProps): React.JSX.Element; export interface AccordionTitleProps extends StyleProps { children: ReactNode; icon?: IconName; /** The icon's ink ROLE — the row's severity, where the glyph carries it. */ iconColor?: InkColor; ref?: React.Ref; render?: useRender.RenderProp; } /** Title slot: optional leading icon and label, growing to push meta and badges right. */ export declare function AccordionTitle({ children, icon, iconColor, render, ref, ...props }: AccordionTitleProps): React.ReactElement>; export interface AccordionMetaProps extends StyleProps { children: ReactNode; ref?: React.Ref; render?: useRender.RenderProp; } /** Right-side context: an amount, date or short hint, tabular for numerals. */ export declare function AccordionMeta({ children, render, ref, ...props }: AccordionMetaProps): React.ReactElement>; export interface AccordionContentProps extends StyleProps { children: ReactNode; ref?: React.Ref; render?: CollapsiblePanelProps["render"]; } /** * The collapsible body, flush with the header box's left edge with no tinted well: it belongs to * the section, not the heading. */ export declare function AccordionContent({ children, render, ref, ...props }: AccordionContentProps): React.JSX.Element;