diff --git a/components/ui/button.tsx b/components/ui/button.tsx new file mode 100644 index 0000000..0947a2b --- /dev/null +++ b/components/ui/button.tsx @@ -0,0 +1,25 @@ +import type { ButtonHTMLAttributes } from 'react' +import { cx } from './cx' + +type Variant = 'primary' | 'secondary' | 'ghost' | 'icon' + +const BASE = + 'inline-flex items-center gap-1.5 text-left font-extrabold text-sm leading-tight ' + + 'border border-transparent cursor-pointer transition-colors ' + + 'disabled:opacity-45 disabled:cursor-not-allowed' + +const VARIANTS: Record = { + primary: 'justify-start bg-accent text-ground px-3.5 py-2 hover:bg-accent-600 active:bg-accent-700', + secondary: 'justify-start border-divider text-ink px-3.5 py-2 hover:bg-ink/7 active:bg-ink/15', + ghost: 'justify-start text-accent-700 px-1 py-2 hover:bg-accent/10 active:bg-accent/20', + icon: 'justify-center w-9 h-9 p-0 text-ink hover:bg-ink/7 active:bg-ink/15', +} + +type Props = ButtonHTMLAttributes & { + variant?: Variant + block?: boolean +} + +export function Button({ variant = 'primary', block = false, className, type = 'button', ...rest }: Props) { + return