Files
web/packages/design-system/lib/components/TextLinkButton/TextLinkButton.tsx
Matilda Landström b122f2ff4f Merged in feat/LOY-490-cleanup-profiling-consent (pull request #3237)
Feat/LOY-490 cleanup profiling consent

* chore(LOY-490): cleanup accordion

* xhore(LOY-490): cleanup signup

* fix(LOY-490): use correct tokens

* fi(LOY-490): change button to correct color

* fix(LOY-490): switch deprecated Link


Approved-by: Chuma Mcphoy (We Ahead)
2025-11-27 07:48:34 +00:00

41 lines
923 B
TypeScript

import { cx } from 'class-variance-authority'
import { TextLinkProps } from '../TextLink/types'
import { getTextLinkClasses } from './textLinkStyles'
import styles from './textLinkButton.module.css'
export type TextLinkButtonProps = {
theme?: TextLinkProps['theme']
typography?: TextLinkProps['typography']
isDisabled?: TextLinkProps['isDisabled']
isInline?: TextLinkProps['isInline']
} & React.ButtonHTMLAttributes<HTMLButtonElement>
/* A Button with the same styling as a TextLink to handle an edge case. */
export function TextLinkButton({
theme,
isDisabled,
isInline,
typography,
className,
...props
}: TextLinkButtonProps) {
const classNames = getTextLinkClasses({
theme,
isDisabled,
isInline,
typography,
className,
})
return (
<button
{...props}
type="button"
disabled={isDisabled}
className={cx(classNames, styles.button)}
/>
)
}