-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new styles to the accordion (#268)
- Loading branch information
Sebastián García
authored
May 10, 2024
1 parent
0cc8f4c
commit 3b6a17b
Showing
4 changed files
with
121 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
import type { VariantProps } from '@openui-org/theme' | ||
import React from 'react' | ||
import * as AccordionPrimitive from '@radix-ui/react-accordion' | ||
import { accordion, cn } from '@openui-org/theme' | ||
|
||
const Accordion = AccordionPrimitive.Root | ||
export interface Comp extends React.ElementRef<typeof AccordionPrimitive.Root> {} | ||
export type Props = React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Root> & VariantProps<typeof accordion> | ||
|
||
const Accordion = React.forwardRef<Comp, Props>(({ className, shadow, radius, bordered, ...props }, ref) => ( | ||
<AccordionPrimitive.Root | ||
ref={ref} | ||
className={cn(accordion({ shadow, radius, bordered }), className)} | ||
{...props} | ||
/> | ||
)) | ||
|
||
Accordion.displayName = 'Accordion' | ||
|
||
export default Accordion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters