feat(SW-2038): refactor and create wrapper for static map and button * feat(SW-2038): refactor and create wrapper for static map and button * feature: use button from design-system over creating a new one * remove unused fragment * fix(SW-2038): add removed css * fix(SW-2038): update fake button component * fix(SW-2038): move FakeButton to design system Approved-by: Erik Tiekstra Approved-by: Joakim Jäderberg
40 lines
766 B
TypeScript
40 lines
766 B
TypeScript
'use client'
|
|
|
|
import { variants } from './variants'
|
|
|
|
import type { VariantProps } from 'class-variance-authority'
|
|
import type { ComponentProps, PropsWithChildren } from 'react'
|
|
import type { Button } from 'react-aria-components'
|
|
|
|
interface FakeButtonProps
|
|
extends PropsWithChildren,
|
|
Omit<ComponentProps<typeof Button>, 'children' | 'onPress'>,
|
|
VariantProps<typeof variants> {}
|
|
|
|
export function FakeButton({
|
|
variant,
|
|
color,
|
|
size,
|
|
typography,
|
|
children,
|
|
className,
|
|
...props
|
|
}: FakeButtonProps) {
|
|
const classNames = variants({
|
|
color,
|
|
size,
|
|
variant,
|
|
typography,
|
|
className,
|
|
})
|
|
|
|
return (
|
|
<span
|
|
className={classNames}
|
|
{...(props as React.HTMLProps<HTMLSpanElement>)}
|
|
>
|
|
{children}
|
|
</span>
|
|
)
|
|
}
|