UNPKG

@arolariu/components

Version:

🎨 70+ beautiful, accessible React components built on Radix UI. TypeScript-first, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡

41 lines (40 loc) • 1.88 kB
"use client"; import { jsx, jsxs } from "react/jsx-runtime"; import { Content, Header, Item, Root, Trigger } from "@radix-ui/react-accordion"; import { ChevronDown } from "lucide-react"; import { forwardRef } from "react"; import { cn } from "../../lib/utilities.js"; const Accordion = Root; const AccordionItem = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx(Item, { ref: ref, className: cn("border-b", className), ...props })); AccordionItem.displayName = "AccordionItem"; const AccordionTrigger = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsx(Header, { className: "flex", children: /*#__PURE__*/ jsxs(Trigger, { ref: ref, className: cn("flex flex-1 items-center justify-between py-4 text-left text-sm font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180", className), ...props, children: [ children, /*#__PURE__*/ jsx(ChevronDown, { className: "h-4 w-4 shrink-0 text-neutral-500 transition-transform duration-200 dark:text-neutral-400" }) ] }) })); AccordionTrigger.displayName = Trigger.displayName; const AccordionContent = /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsx(Content, { ref: ref, className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: /*#__PURE__*/ jsx("div", { className: cn("pt-0 pb-4", className), children: children }) })); AccordionContent.displayName = Content.displayName; export { Accordion, AccordionContent, AccordionItem, AccordionTrigger }; //# sourceMappingURL=accordion.js.map