import { useState } from 'react'; import type { ReactNode } from 'react'; import { ChevronDown } from 'lucide-react'; interface CollapsibleProps { summary: ReactNode; children: ReactNode; defaultOpen?: boolean; className?: string; summaryClassName?: string; /** When provided, the component is controlled — parent owns the open state. */ open?: boolean; /** Called when the user clicks the toggle. Use with `open` for controlled mode. */ onToggle?: (open: boolean) => void; } /** * Lightweight disclosure widget. * Renders a clickable summary row and conditionally displays children. * * The toggle region is a plain
with role="button" so that the summary * slot may safely contain interactive elements (buttons, links) without * nesting a