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)
41 lines
923 B
TypeScript
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)}
|
|
/>
|
|
)
|
|
}
|