feat(WEB-304): remaning UI from design system primitives
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
|
||||
import { captionVariants } from "./variants"
|
||||
|
||||
import type { CaptionProps } from "./caption"
|
||||
|
||||
export default function Caption({
|
||||
children,
|
||||
asChild = false,
|
||||
className = "",
|
||||
color,
|
||||
textTransform,
|
||||
...props
|
||||
}: CaptionProps) {
|
||||
const Comp = asChild ? Slot : "p"
|
||||
const classNames = captionVariants({
|
||||
className,
|
||||
color,
|
||||
textTransform,
|
||||
})
|
||||
return <p className={classNames}>{children}</p>
|
||||
return <Comp className={classNames} {...props} />
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user