/**
* Accordion: stacked, togglable sections. `type="single"` keeps at most one
* section open (optionally `collapsible` back to none); `type="multiple"` lets
* any number stay open. The Accordion owns the single/multiple/collapsible
* coordination; each item's collapse MECHANICS come from the active adapter's
* `disclosure` slot (`useAdapter().disclosure`), controlled by that coordination
* - so an engine swap drives every item's collapse. Each header's open state is
* exposed as `data-state="open" | "closed"`; skinned with the veryfront theme
* tokens.
*
* @example Single, collapsible
* ```tsx
* import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "veryfront/ui";
*
*
*
* Shipping
* Ships in 2-3 days.
*
* ;
* ```
*
* @module react/components/ui/accordion
*/
import * as React from "react";
/** Props accepted by ``. */
interface AccordionBaseProps extends Omit, "onChange" | "defaultValue"> {
children?: React.ReactNode;
ref?: React.Ref;
}
export interface SingleAccordionProps extends AccordionBaseProps {
type?: "single";
/** When `type="single"`, allow closing the open section back to none. */
collapsible?: boolean;
value?: string;
defaultValue?: string;
onValueChange?: (value: string) => void;
}
export interface MultipleAccordionProps extends AccordionBaseProps {
type: "multiple";
collapsible?: never;
value?: string[];
defaultValue?: string[];
onValueChange?: (value: string[]) => void;
}
export type AccordionProps = SingleAccordionProps | MultipleAccordionProps;
/** Render a set of togglable sections. */
export declare function Accordion({ type, collapsible, value, defaultValue, onValueChange, className, children, ref, ...props }: AccordionProps): React.ReactElement;
/** Props accepted by ``. */
export interface AccordionItemProps extends React.HTMLAttributes {
/** Identifies this section within the accordion's open value(s). */
value: string;
/**
* Stable id for the trigger and the content's `aria-labelledby`. Set this to
* a custom composed-child id when static SSR content must reference that
* child directly; otherwise the containing heading is the pre-hydration
* label.
*/
triggerId?: string;
/** Stable id for the content and the trigger's `aria-controls`. */
contentId?: string;
/** React 19: ref is a regular prop. */
ref?: React.Ref;
}
/**
* A single togglable section. Its open/collapse MECHANICS come from the active
* adapter's `disclosure` slot (controlled by the Accordion's single/multiple
* coordination), so an engine swap drives every item's collapse while the
* Accordion keeps owning which sections may be open.
*/
export declare function AccordionItem({ value, className, children, triggerId: explicitTriggerId, contentId: explicitContentId, ...props }: AccordionItemProps): React.ReactElement;
/** Props accepted by ``. */
export interface AccordionTriggerProps extends React.ButtonHTMLAttributes {
/** Render as a Slot, merging the trigger behaviour onto the child element. */
asChild?: boolean;
/** React 19: ref is a regular prop. */
ref?: React.Ref;
/** Semantic heading level wrapped around the trigger. @default 3 */
headingLevel?: 2 | 3 | 4 | 5 | 6;
}
/** The clickable header that toggles its section (via the disclosure slot). */
export declare function AccordionTrigger({ asChild, className, children, id, ref, headingLevel, ...props }: AccordionTriggerProps): React.ReactElement;
/** Props accepted by ``. */
export interface AccordionContentProps extends React.HTMLAttributes {
/** React 19: ref is a regular prop. */
ref?: React.Ref;
}
/** The section body: retained in the DOM and hidden while its section is closed. */
export declare function AccordionContent({ className, children, id, "aria-labelledby": ariaLabelledBy, ...props }: AccordionContentProps): React.ReactElement | null;
export {};
//# sourceMappingURL=accordion.d.ts.map