import type { ReactNode } from "react"; import { type ComponentProps, type FC } from "react"; import { Box } from "../Box/Box"; import { Stack } from "../Stack/Stack"; type Props = Omit>, "as"> & { children?: ReactNode; /** * This attribute enables multiple
elements to be connected, with only one open at a time. * * This allows developers to easily create UI features such as accordions without scripting. * * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#name */ name?: string; /** * When set to true will omit the border around the DetailsDisclosure component. * * @default false */ omitBorder?: boolean; /** * When set to true will omit the divider between the summary and the details content, * which is visible when the details content is open. * * @default false */ omitSummaryDivider?: boolean; /** * Called when the details component opens or closes. */ onToggleDetails?: ( /** * Indicates wether the toggle actions resulted in an open or closed DetailsDisclosure component */ isOpen: boolean) => void; } /** * Enforce usage of either open or openByDefault through the type system. */ & ({ open?: never; /** * Used when this component is used as an uncontrolled component. * * This sets the initial open state after which control is delegated to the component. * * When using this prop the `open` prop should be omitted. */ openByDefault?: boolean; } | { /** * Passed to the internal `
` element. * * This value should be used to use the component as a controlled component. * * When using this prop the `openByDefault` prop should be omitted. * * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details#open */ open?: boolean; openByDefault?: never; }); /** * The `DetailsDisclosure` component provides a description of which more information can be disclosed when the widget is toggled to its open state. * * It is a reflection of the `
` HTML elements. * * @example * * * Title * details content * */ export declare const DetailsDisclosure: FC & { Summary: typeof Summary; }; type SummaryProps = Omit>, "as"> & { /** * When set to true will omit the open indicator which is presented as a chevron by default. * * Omitting the open indicator allows the implementer to set a custom indicator using the DetailsDisclosure.OpenIndicator component. * * @default false */ omitOpenIndicator?: boolean; }; export declare const OpenIndicator: FC<{ component: FC<{ isOpen: boolean; }>; }>; export declare const Summary: FC & { OpenIndicator: typeof OpenIndicator; DefaultOpenIndicator: React.ComponentType; }; export {};