feat(SW-1806): Implemented design systems button inside buttonLink component and changed teasercard buttons
Approved-by: Matilda Landström
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { cva } from 'class-variance-authority'
|
||||
|
||||
import { withTypography } from '../Typography/variants'
|
||||
import {
|
||||
config as typographyConfig,
|
||||
withTypography,
|
||||
} from '../Typography/variants'
|
||||
|
||||
import { deepmerge } from 'deepmerge-ts'
|
||||
import styles from './button.module.css'
|
||||
|
||||
export const config = {
|
||||
@@ -32,3 +36,18 @@ export const config = {
|
||||
} as const
|
||||
|
||||
export const variants = cva(styles.button, withTypography(config))
|
||||
|
||||
const buttonConfig = {
|
||||
variants: {
|
||||
...config.variants,
|
||||
typography: typographyConfig.variants.variant,
|
||||
},
|
||||
defaultVariants: {
|
||||
...config.defaultVariants,
|
||||
typography: typographyConfig.defaultVariants.variant,
|
||||
},
|
||||
} as const
|
||||
|
||||
export function withButton<T>(config: T) {
|
||||
return deepmerge(buttonConfig, config)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user