import React from "react"; import UI from "#components/ui"; /** * Props for the Details component. * * Combines native HTML details element props with custom styling and interaction handlers. * The Details component uses the native `
` element for progressive disclosure, * providing built-in keyboard support and semantic HTML. * * @example * ```tsx *
} * onToggle={(e) => console.log('Toggled:', e.currentTarget.open)} * > *

Hidden content revealed when opened

*
* ``` */ export type DetailsProps = { /** * The summary text or element shown in the clickable header. * This is always visible and acts as the toggle control. * * @required * @example * ```tsx * summary="Shipping Information" * // or * summary={<> Shipping Information} * ``` */ summary: React.ReactNode; /** * Optional icon displayed before the summary text. * Commonly used for chevron/arrow indicators. * * @example * ```tsx * icon={} * ``` */ icon?: React.ReactNode; /** * Accessible label for screen readers. * If not provided, the native `
` semantic will be used. * * Note: Native `
` elements are already semantic and announced properly * by screen readers. Only provide this if you need to override the default behavior. * * @optional * @example * ```tsx * ariaLabel="Product details section" * ``` */ ariaLabel?: string; /** * Groups multiple details elements into an accordion where only one can be open. * Multiple details elements with the same `name` will behave as a mutually exclusive group. * * @optional * @example * ```tsx *
...
*
...
* ``` */ name?: string; } & React.ComponentProps<"details"> & Partial>;