Files
web/packages/design-system/lib/components/TextLink/variants.ts
Rasmus Langvad d0546926a9 Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo

* Setup prettierrc in root and remove other configs


Approved-by: Joakim Jäderberg
Approved-by: Linus Flood
2026-01-07 12:45:50 +00:00

40 lines
874 B
TypeScript

import { cva } from "class-variance-authority"
import {
config as typographyConfig,
withTypography,
} from "../Typography/variants"
import { deepmerge } from "deepmerge-ts"
import styles from "./textLink.module.css"
export const config = {
variants: {
theme: {
Primary: styles["theme-primary"],
Inverted: styles["theme-inverted"],
InteractiveDefault: styles["theme-interactive-default"],
},
},
defaultVariants: {
theme: "Primary",
},
} as const
const textLinkConfig = {
variants: {
...config.variants,
typography: typographyConfig.variants.variant,
},
defaultVariants: {
...config.defaultVariants,
typography: "Link/md",
},
} as const
export const variants = cva(styles.textLink, withTypography(textLinkConfig))
export function withTextLink<T>(config: T) {
return deepmerge(textLinkConfig, config)
}