import * as React from 'react'; import { BaseUIComponentProps, Orientation } from "../../internals/types.js"; import { type BaseUIChangeEventDetails } from "../../internals/createBaseUIEventDetails.js"; import { REASONS } from "../../internals/reasons.js"; /** * Groups all parts of the accordion. * Renders a `
` element. * * Documentation: [Base UI Accordion](https://base-ui.com/react/components/accordion) */ export declare const AccordionRoot: { (props: AccordionRoot.Props): React.JSX.Element; }; export type AccordionValue = Value[]; export interface AccordionRootState { /** * The current value. * Treat it as read-only: it may be a shared frozen array when no value is set. */ value: AccordionValue; /** * Whether the component should ignore user interaction. */ disabled: boolean; /** * The component orientation. * * Deprecated following the [APG guidance update](https://github.com/w3c/aria-practices/pull/3434) * to remove roving focus. * * This state no longer affects keyboard focus behavior. * @deprecated */ orientation: Orientation; } export interface AccordionRootProps extends BaseUIComponentProps<'div', AccordionRoot.State> { /** * The controlled value of the item(s) that should be expanded. * * To render an uncontrolled accordion, use the `defaultValue` prop instead. */ value?: AccordionValue | undefined; /** * The uncontrolled value of the item(s) that should be initially expanded. * * To render a controlled accordion, use the `value` prop instead. */ defaultValue?: AccordionValue | undefined; /** * Whether the component should ignore user interaction. * @default false */ disabled?: boolean | undefined; /** * Allows the browser's built-in page search to find and expand the panel contents. * * Overrides the `keepMounted` prop and uses `hidden="until-found"` * to hide the element without removing it from the DOM. * @default false */ hiddenUntilFound?: boolean | undefined; /** * Whether to keep the element in the DOM while the panel is closed. * This prop is ignored when `hiddenUntilFound` is used. * @default false */ keepMounted?: boolean | undefined; /** * Deprecated following the [APG guidance update](https://github.com/w3c/aria-practices/pull/3434) * to remove roving focus. * * This prop no longer affects keyboard focus behavior. * @deprecated */ loopFocus?: boolean | undefined; /** * Event handler called when an accordion item is expanded or collapsed. * Provides the new value as an argument. */ onValueChange?: ((value: AccordionValue, eventDetails: AccordionRootChangeEventDetails) => void) | undefined; /** * Whether multiple items can be open at the same time. * @default false */ multiple?: boolean | undefined; /** * Deprecated following the [APG guidance update](https://github.com/w3c/aria-practices/pull/3434) * to remove roving focus. * * This prop no longer affects keyboard focus behavior. * @default 'vertical' * @deprecated */ orientation?: Orientation | undefined; } export type AccordionRootChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.none; export type AccordionRootChangeEventDetails = BaseUIChangeEventDetails; export declare namespace AccordionRoot { type Value = AccordionValue; type State = AccordionRootState; type Props = AccordionRootProps; type ChangeEventReason = AccordionRootChangeEventReason; type ChangeEventDetails = AccordionRootChangeEventDetails; }