File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
packages/sdk-components-react-radix/src Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,13 @@ import {
99 createElement ,
1010 type ElementRef ,
1111} from "react" ;
12- import { Root , Item , Trigger , Content } from "@radix-ui/react-accordion" ;
12+ import {
13+ Root ,
14+ Item ,
15+ Header ,
16+ Trigger ,
17+ Content ,
18+ } from "@radix-ui/react-accordion" ;
1319import {
1420 getIndexWithinAncestorFromProps ,
1521 getTagFromProps ,
@@ -47,11 +53,12 @@ export const AccordionItem = forwardRef<
4753} ) ;
4854
4955const defaultTag = "h3" ;
50- type Props = ComponentProps < typeof defaultTag > & { tag ?: string } ;
51- export const AccordionHeader = forwardRef < ElementRef < typeof defaultTag > , Props > (
56+ type Tag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" ;
57+ type Props = ComponentPropsWithoutRef < typeof Header > & { tag ?: Tag } ;
58+ export const AccordionHeader = forwardRef < HTMLHeadingElement , Props > (
5259 ( { tag : legacyTag , ...props } , ref ) => {
5360 const tag = getTagFromProps ( props ) ?? legacyTag ?? defaultTag ;
54- return createElement ( tag , { ...props , ref } ) ;
61+ return < Header asChild > { createElement ( tag , { ...props , ref } ) } </ Header > ;
5562 }
5663) ;
5764
You can’t perform that action at this time.
0 commit comments