import * as RadixAccordion from "@radix-ui/react-accordion"; import type { FC, ReactNode } from "react"; import type { VariantProps } from "tailwind-variants"; import { accordionStyles } from "./Accordion.styles"; import type { IconComponentType } from "../../Icons"; type AccordionVariants = VariantProps; type AccordionSharedProps = { /** * The content of the `Accordion`. */ children: ReactNode; /** * The class name of the `Accordion`. */ className?: string; /** * Whether the `Accordion` is disabled, preventing the user from interacting with the accordion and all its items. */ disabled?: boolean; /** * Display the Accordion in normal or a more compact style (no meta or description, smaller paddings). * @default normal */ variant?: AccordionVariants["variant"]; }; type AccordionSingleProps = { /** * Whether a single or multiple items can be expanded at a time. * @default false */ multiple?: false; /** * The controlled value of the item to expand when `multiple` is `false`. * Must be used in conjunction with `onValueChange`. */ value?: RadixAccordion.AccordionSingleProps["value"]; /** * The value of the item to expand when initially rendered and `multiple` is `false`. * Use when you do not need to control the state of the items. */ defaultValue?: RadixAccordion.AccordionSingleProps["defaultValue"]; /** * The event handler called when the expanded state of an item changes and `multiple` is `false`. */ onChange?: RadixAccordion.AccordionSingleProps["onValueChange"]; /** * Allows closing content when clicking trigger for an open item when `multiple` is `false`. * @default true */ collapsible?: boolean; }; type AccordionMultipleProps = { /** * Whether a single or multiple items can be expanded at a time. * @default false */ multiple: true; /** * The controlled value of the item to expand when `multiple` is `true`. * Must be used in conjunction with `onValueChange`. */ value?: RadixAccordion.AccordionMultipleProps["value"]; /** * The value of the item to expand when initially rendered when `multiple` is `true`. * Use when you do not need to control the state of the items. */ defaultValue?: RadixAccordion.AccordionMultipleProps["defaultValue"]; /** * The event handler called when the expanded state of an item changes and `multiple` is `true`. */ onChange?: RadixAccordion.AccordionMultipleProps["onValueChange"]; /** * Only available when `multiple` is `false`. */ collapsible?: never; }; export type AccordionProps = AccordionSharedProps & (AccordionSingleProps | AccordionMultipleProps); export type AccordionItemProps = { /** * Defines the content of the `AccordionItem`. */ children: ReactNode; /** * Defines a class name for the `AccordionItem`. */ className?: string; /** * Defines a unique value for the `AccordionItem`. */ value: string; /** * Defines whether the `AccordionItem` is disabled, preventing the user from interacting with it. */ disabled?: boolean; }; export type AccordionHeaderProps = { /** * Defines the title of the `AccordionHeader`. */ children: ReactNode; /** * Defines a class name for the `AccordionHeader`. */ className?: string; /** * Defines a class name for the title wrapper. */ titleWrapperClassName?: string; /** * Defines a class name for the title. */ titleClassName?: string; /** * Defines an icon to display next to the title and description. */ icon?: IconComponentType; /** * Defines a class name for the icon. */ iconClassName?: string; /** * Defines a class name for the icon background. */ iconBgClassName?: string; /** * Defines a description for the `AccordionHeader`. */ description?: ReactNode; /** * Defines a meta value for the `AccordionHeader`. */ meta?: ReactNode; /** * Defines an icon to display as the trigger. * Defaults to a chevron icon. */ triggerIcon?: IconComponentType; /** * Defines a class name for the trigger. */ triggerClassName?: string; }; export type AccordionContentProps = { /** * Defines the content of the `AccordionContent`. */ children: ReactNode; /** * Defines a class name for the `AccordionContent`. */ className?: string; }; type AccordionComponent = FC & { Item: typeof AccordionItem; Header: typeof AccordionHeader; Content: typeof AccordionContent; }; /** * The `Accordion` component is a compact section for revealing and hiding content, ideal for keeping interfaces clean. * * See the [Accordion documentation page](https://satellite.algolia.com/8261d6576/p/55ec92-accordion) for more information. */ export declare const Accordion: AccordionComponent; declare const AccordionItem: import("react").ForwardRefExoticComponent>; declare const AccordionHeader: import("react").ForwardRefExoticComponent>; declare const AccordionContent: import("react").ForwardRefExoticComponent>; export {};