Merged in feat/sw-3226-move-buttonlink-to-design-system (pull request #2613)

feat(SW-3226): Move ButtonLink to design-system

* Move ButtonLink to design-system

* Fix Button import


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-08-11 10:53:00 +00:00
parent 3cca4ff394
commit 00b124d15a
37 changed files with 89 additions and 99 deletions

View File

@@ -0,0 +1,10 @@
.buttonLink {
border-radius: var(--Corner-radius-rounded);
border-width: 2px;
border-style: solid;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: var(--Space-x05);
}

View File

@@ -0,0 +1,45 @@
'use client'
import Link from 'next/link'
import { type ComponentProps, type PropsWithChildren } from 'react'
import { variants } from './variants'
import type { VariantProps } from 'class-variance-authority'
export interface ButtonLinkProps
extends PropsWithChildren,
Omit<ComponentProps<typeof Link>, 'color'>,
VariantProps<typeof variants> {}
export default function ButtonLink({
variant,
color,
size,
typography,
wrapping,
className,
href,
target,
onClick = () => {},
...props
}: ButtonLinkProps) {
const classNames = variants({
variant,
color,
size,
wrapping,
typography,
className,
})
return (
<Link
className={classNames}
href={href}
target={target}
onClick={onClick}
{...props}
/>
)
}

View File

@@ -0,0 +1,7 @@
import { cva } from 'class-variance-authority'
import { withButton } from '../Button'
import styles from './buttonLink.module.css'
export const variants = cva(styles.buttonLink, withButton({}))

View File

@@ -9,6 +9,7 @@
"./BackToTopButton": "./dist/components/BackToTopButton/index.js",
"./Body": "./dist/components/Body/index.js",
"./Button": "./dist/components/Button/index.js",
"./ButtonLink": "./dist/components/ButtonLink/index.js",
"./Caption": "./dist/components/Caption/index.js",
"./Card": "./dist/components/Card/index.js",
"./ChipButton": "./dist/components/ChipButton/index.js",
@@ -162,6 +163,7 @@
"peerDependencies": {
"@internationalized/date": "^3.8.0",
"@radix-ui/react-slot": "^1.2.2",
"next": "^15",
"react": "^19.1.0",
"react-aria-components": "^1.8.0",
"react-dom": "^19.1.0",