feat(SW-1806): Implemented design systems button inside buttonLink component and changed teasercard buttons

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-03-28 06:56:08 +00:00
parent 2f0224cfd5
commit 45c992dcef
14 changed files with 152 additions and 91 deletions

View File

@@ -3,6 +3,9 @@
border-width: 2px;
border-style: solid;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.size-large {
@@ -85,10 +88,6 @@
color: inherit;
padding: 0;
margin: 0;
display: flex;
align-items: center;
justify-content: center;
}
.color-icon-default {

View File

@@ -1 +1,3 @@
export { Button } from './Button'
// eslint-disable-next-line react-refresh/only-export-components
export { withButton } from './variants'

View File

@@ -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)
}