From a147fba5aa07d9eba54c0f9c9ee8f2ca60567d07 Mon Sep 17 00:00:00 2001 From: HasithDeAlwis Date: Tue, 19 Nov 2024 19:14:06 -0500 Subject: [PATCH] feat(shared/ui/cuhacking/components): create accordion --- .../components/accordion/accordion.tsx | 56 +++++++++++++++++++ .../cuHacking/components/accordion/index.ts | 1 + 2 files changed, 57 insertions(+) create mode 100644 libs/shared/ui/src/cuHacking/components/accordion/accordion.tsx create mode 100644 libs/shared/ui/src/cuHacking/components/accordion/index.ts diff --git a/libs/shared/ui/src/cuHacking/components/accordion/accordion.tsx b/libs/shared/ui/src/cuHacking/components/accordion/accordion.tsx new file mode 100644 index 00000000..618d8195 --- /dev/null +++ b/libs/shared/ui/src/cuHacking/components/accordion/accordion.tsx @@ -0,0 +1,56 @@ +import * as AccordionPrimitive from '@radix-ui/react-accordion' +import { cn } from '@shadcn/lib/utils' +import { ChevronDown } from 'lucide-react' + +import * as React from 'react' + +const Accordion = AccordionPrimitive.Root + +const AccordionItem = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AccordionItem.displayName = 'AccordionItem' + +const AccordionTrigger = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + svg]:rotate-180 gap-3 text-left', + className, + )} + {...props} + > + + {children} + + +)) +AccordionTrigger.displayName = AccordionPrimitive.Trigger.displayName + +const AccordionContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + +
{children}
+
+)) + +AccordionContent.displayName = AccordionPrimitive.Content.displayName + +export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } diff --git a/libs/shared/ui/src/cuHacking/components/accordion/index.ts b/libs/shared/ui/src/cuHacking/components/accordion/index.ts new file mode 100644 index 00000000..28bcc74b --- /dev/null +++ b/libs/shared/ui/src/cuHacking/components/accordion/index.ts @@ -0,0 +1 @@ +export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './accordion'