feat: layout component

This commit is contained in:
2023-12-30 15:19:19 +01:00
parent 0ccc447e40
commit bb59863441
13 changed files with 132 additions and 54 deletions

View File

@@ -16,8 +16,7 @@ export type ButtonProps<T extends ElementType = 'button'> = {
children: ReactNode
className?: string
fullWidth?: boolean
rounded?: boolean
variant?: 'icon' | 'link' | 'primary' | 'secondary' | 'tertiary'
variant?: 'link' | 'primary' | 'secondary' | 'tertiary'
} & ComponentPropsWithoutRef<T>
const ButtonPolymorph = <T extends ElementType = 'button'>(props: ButtonProps<T>, ref: any) => {
@@ -32,13 +31,7 @@ const ButtonPolymorph = <T extends ElementType = 'button'>(props: ButtonProps<T>
return (
<Component
className={clsx(
s.button,
s[variant],
fullWidth && s.fullWidth,
className,
rounded && s.rounded
)}
className={clsx(s.button, s[variant], fullWidth && s.fullWidth, className)}
{...rest}
ref={ref}
/>