import React from 'react'; import type { ReactNode } from 'react'; import type { Size } from '../../util/variant-types'; import { type HeadingElement } from '../Heading'; import { type IconName } from '../Icon'; type AccordionProps = { /** * Child node(s) that can be nested inside component. */ children: ReactNode; /** * Additional classnames passed in for styling. */ className?: string; /** * Used to specify which heading element should be rendered for each `Accordion.Title` child. * * **Default is `"h2"`**. */ headingAs: HeadingElement; /** * Various sizes supported by the `Accordion`. * * **Default is `"md"`**. * @deprecated */ size?: Extract; }; type AccordionButtonProps = { /** * Child node(s) that can be nested inside component. */ children?: ReactNode; /** * Additional classnames passed in for styling */ className?: string; /** * Callback for when accordion is closed. */ onClose?: () => void; /** * Callback for when according is opened. */ onOpen?: () => void; /** * Used to specify which heading element should be rendered for the title. * If provided, overrides parent headingAs prop. */ headingAs?: HeadingElement; /** * Icon to preceed the text in an accordion header */ leadingIcon?: ReactNode; /** * Secondary text used to describe the content in more detail */ subTitle?: ReactNode; /** * The title/heading of the component */ title?: string; /** * Slot which follows the text in an accordion header */ trailingContent?: ReactNode; /** * Icon override for component's expand/collapse indicator. * * **Default is `"chevron-down"`**. */ trailingIcon?: Extract; }; type AccordionPanelProps = { /** * Child node(s) that can be nested inside component. */ children: ReactNode; /** * Additional class names passed in for styling */ className?: string; }; type AccordionRowProps = { /** * Child node(s) that can be nested inside component. */ children: ReactNode | (({ open }: { open: boolean; }) => ReactNode); /** * Additional class names passed in for styling. */ className?: string; /** * Whether panel is expanded by default. */ defaultOpen?: boolean; /** * Whether the row can show expandable content */ isExpandable?: boolean; /** * Whether the row has content on the row's trigger that leads in front of the title */ hasLeadingIcon?: boolean; /** * Whether the row has a content on the row's trigger that trails the title */ hasTrailingContent?: boolean; }; /** * `import {Accordion} from "@chanzuckerberg/eds;` * * Displays one or more headers stacked on top of one another that can reveal or hide associated content. * This component is based on the [Disclosure](https://headlessui.com/react/disclosure) component, provided by HeadlessUI. * * More Information: https://headlessui.com/react/disclosure * */ export declare const Accordion: { ({ children, className, headingAs, size, ...other }: AccordionProps): React.JSX.Element; displayName: string; Button: { ({ children, className, headingAs, leadingIcon, title, trailingIcon, trailingContent, subTitle, onClose, onOpen, ...other }: AccordionButtonProps): React.JSX.Element; displayName: string; }; Panel: { ({ className, children, ...other }: AccordionPanelProps): React.JSX.Element; displayName: string; }; Row: { ({ className, defaultOpen, children, isExpandable, hasLeadingIcon, hasTrailingContent, ...other }: AccordionRowProps): React.JSX.Element; displayName: string; }; }; export {};