import { define } from 'forge' import { theme } from './theme' import { VStack, HStack } from './stack' import { Section } from './section' import { H2 } from './text' export const Button = define('Button', { base: 'button', display: 'inline-flex', alignItems: 'center', justifyContent: 'center', fontWeight: 500, transition: 'all 0.2s', cursor: 'pointer', borderRadius: theme('radius-sm'), border: '1px solid transparent', outline: 'none', // Default: primary + md background: theme('colors-primary'), color: theme('colors-bg'), height: 40, padding: `0 ${theme('spacing-4')}`, fontSize: theme('fontSize-sm'), states: { ':not(:disabled):hover': { background: theme('colors-primaryHover'), }, ':disabled': { opacity: 0.5, cursor: 'not-allowed', }, }, variants: { variant: { primary: { background: theme('colors-primary'), color: theme('colors-bg'), states: { ':not(:disabled):hover': { background: theme('colors-primaryHover'), }, }, }, secondary: { background: theme('colors-secondary'), color: theme('colors-bg'), states: { ':not(:disabled):hover': { background: theme('colors-secondaryHover'), }, }, }, outline: { background: 'transparent', color: theme('colors-fg'), borderColor: theme('colors-border'), states: { ':not(:disabled):hover': { borderColor: theme('colors-borderActive'), }, }, }, ghost: { background: 'transparent', color: theme('colors-fg'), border: 'none', states: { ':not(:disabled):hover': { background: theme('colors-bgMuted'), }, }, }, destructive: { background: theme('colors-destructive'), color: theme('colors-bg'), states: { ':not(:disabled):hover': { background: theme('colors-destructiveHover'), }, }, }, }, size: { sm: { height: 32, padding: `0 ${theme('spacing-3')}`, fontSize: theme('fontSize-sm'), }, md: { height: 40, padding: `0 ${theme('spacing-4')}`, fontSize: theme('fontSize-sm'), }, lg: { height: 48, padding: `0 ${theme('spacing-6')}`, fontSize: theme('fontSize-base'), }, }, }, }) export type ButtonProps = Parameters[0] export const Test = () => { return (
{/* Variants */}

Button Variants

{/* Sizes */}

Button Sizes

{/* With custom content */}

Custom Content

{/* Native attributes work */}

Native Attributes

) }