"use client"; import * as React from "react"; import * as AccordionPrimitive from "@radix-ui/react-accordion"; import { ChevronDownIcon, CircleCheckIcon, CircleIcon, MinusIcon, PlusIcon, } from "lucide-react"; import { useComponentLabels } from "./component-labels"; import { cn } from "../lib/cn"; // The design system's Accordion. `list` (the default, and the look the // dashboard had) divides the sections with a rule and turns a chevron: a form // in parts. `boxed` puts each in its own white box, 12px apart, with a plus // that becomes a minus: questions and answers. // // A section of a form can carry a `status` on its trigger: `done` (a green // check in a circle) or `todo` (an empty circle). The mark is decoration; the // words that say it, "(completa)" or "(da completare)" unless the caller // gives its own `statusLabel`, are part of the button's name. function Accordion({ className, variant = "list", ...props }: React.ComponentProps & { variant?: "list" | "boxed"; }): React.ReactNode { return ( ); } function AccordionItem({ className, ...props }: React.ComponentProps): React.ReactNode { return ( ); } function AccordionTrigger({ className, children, status, statusLabel, ...props }: React.ComponentProps & { /** Marks a section of a form as done or still to do. */ status?: "done" | "todo"; /** The mark in words, for assistive technology; the page's own by default. */ statusLabel?: string; }): React.ReactNode { const labels = useComponentLabels(); const StatusIcon = status === "done" ? CircleCheckIcon : CircleIcon; return ( {status ? ( ) : ( children )} ); } function AccordionContent({ className, children, ...props }: React.ComponentProps): React.ReactNode { return (
{children}
); } export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };