@@ -28,11 +28,11 @@ import { cn } from '@qwik-ui/utils';
2828
2929import { LuChevronDown } from ' @qwikest/icons/lucide' ;
3030
31- const Root = component$ < PropsOf <typeof HeadlessAccordion .Root >>(( props ) => (
32- <HeadlessAccordion.Root animated { ... props } >
33- < Slot />
31+ const Root = ( props : PropsOf <typeof HeadlessAccordion .Root >) => (
32+ <HeadlessAccordion.Root { ... props } accordionItemComponent = { Item } >
33+ { props . children }
3434 </HeadlessAccordion.Root >
35- )) ;
35+ );
3636
3737const Item = component$ <PropsOf <typeof HeadlessAccordion .Item >>((props ) => {
3838 return (
@@ -52,7 +52,7 @@ const Trigger = component$<
5252 <HeadlessAccordion.Trigger
5353 { ... props }
5454 class = { cn (
55- ' flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-state= open]>svg]:rotate-180' ,
55+ ' flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline [&[data-open]>svg]:rotate-180' ,
5656 props .class ,
5757 )}
5858 >
@@ -68,7 +68,7 @@ const Content = component$<PropsOf<typeof HeadlessAccordion.Content>>((props) =>
6868 <HeadlessAccordion.Content
6969 { ... props }
7070 class = { cn (
71- ' overflow-hidden text-sm data-[state= closed]:animate-accordion-up data-[state= open]:animate-accordion-down' ,
71+ ' overflow-hidden text-sm data-[closed]:animate-accordion-up data-[open]:animate-accordion-down' ,
7272 props .class ,
7373 )}
7474 >
@@ -87,24 +87,6 @@ export const Accordion = {
8787};
8888```
8989
90- ### 2. Update your 'tailwind.config.cjs'
91-
92- Add the following animations to your tailwind.config.js file:
93-
94- ``` tsx
95- /** @type {import('tailwindcss').Config} */
96- module .exports = {
97- theme: {
98- extend: {
99- animation: {
100- ' accordion-down' : ' 0.2s ease-out 0s 1 normal forwards accordion-open' ,
101- ' accordion-up' : ' 0.2s ease-out 0s 1 normal forwards accordion-close' ,
102- },
103- },
104- },
105- };
106- ```
107-
10890## Usage
10991
11092``` tsx
0 commit comments