fix: Added fullWidth property on button components to set them as full width

Approved-by: Matilda Landström
This commit is contained in:
Erik Tiekstra
2025-12-16 14:37:10 +00:00
parent 1dce74c95f
commit d8c19c8917
10 changed files with 26 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ export function Button({
color,
size,
wrapping,
fullWidth,
typography,
className,
children,
@@ -21,6 +21,7 @@ export function Button({
size,
wrapping,
typography,
fullWidth,
className,
})

View File

@@ -9,6 +9,10 @@
justify-content: center;
gap: var(--Space-x05);
&.full-width {
width: 100%;
}
&[data-disabled] {
cursor: unset;
}

View File

@@ -30,12 +30,17 @@ export const config = {
true: undefined,
false: styles['no-wrapping'],
},
fullWidth: {
true: styles['full-width'],
false: undefined,
},
},
defaultVariants: {
variant: 'Primary',
color: 'Primary',
size: 'Large',
wrapping: true,
fullWidth: false,
},
} as const

View File

@@ -9,7 +9,8 @@ import Link from 'next/link'
import { useIntl } from 'react-intl'
export interface ButtonLinkProps
extends Omit<ComponentProps<typeof Link>, 'color'>,
extends
Omit<ComponentProps<typeof Link>, 'color'>,
VariantProps<typeof variants> {}
export default function ButtonLink({
@@ -18,6 +19,7 @@ export default function ButtonLink({
size,
typography,
wrapping,
fullWidth,
className,
href,
target,
@@ -29,6 +31,7 @@ export default function ButtonLink({
size,
wrapping,
typography,
fullWidth,
className,
})

View File

@@ -6,7 +6,8 @@ import { cx, type VariantProps } from 'class-variance-authority'
import type { HTMLAttributes } from 'react'
interface FakeButtonProps
extends Omit<HTMLAttributes<HTMLSpanElement>, 'color'>,
extends
Omit<HTMLAttributes<HTMLSpanElement>, 'color'>,
VariantProps<typeof variants> {
isDisabled?: boolean
}
@@ -16,6 +17,7 @@ export function FakeButton({
color,
size,
typography,
fullWidth,
children,
className,
isHovered,
@@ -27,6 +29,7 @@ export function FakeButton({
size,
variant,
typography,
fullWidth,
isHovered,
className,
})