feat(SW-375): new tokens
new asset generation logic BREAKING CHANGE: New tokens.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { cloneElement, isValidElement } from 'react'
|
||||
|
||||
import { variants } from './variants'
|
||||
|
||||
import type { TypographyProps } from './types'
|
||||
|
||||
export function Typography({ variant, children }: TypographyProps) {
|
||||
if (!isValidElement(children)) return null
|
||||
|
||||
const classNames = variants({
|
||||
variant,
|
||||
})
|
||||
|
||||
return cloneElement(children, {
|
||||
...children.props,
|
||||
className: [children.props.className, classNames].filter(Boolean).join(' '),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user