2025-11-21 08:38:46 +01:00
|
|
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
|
|
|
|
|
|
|
|
export { default as Button } from './Button.vue'
|
|
|
|
|
|
|
|
|
|
export const buttonVariants = cva(
|
2026-02-17 10:35:03 +01:00
|
|
|
'relative inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium shadow-sm ' +
|
|
|
|
|
'focusactive:shadow-none active:shadow-none active:inset-shadow-xs active:inset-shadow-black/30 active:border-transparent active:top-[1px] transition-shadow transition-top disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=\'size-\'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive ' +
|
|
|
|
|
'text-foreground border-b-1 border-t-1 border-t-white/50 border-b-black/20 dark:border-t-white/30 dark:border-b-black/30',
|
2025-11-21 08:38:46 +01:00
|
|
|
{
|
|
|
|
|
variants: {
|
|
|
|
|
variant: {
|
|
|
|
|
default:
|
2026-02-17 10:35:03 +01:00
|
|
|
'bg-zinc-100 hover:bg-zinc-200 active:bg-zinc-300 dark:bg-neutral-600 dark:hover:bg-neutral-700 dark:active:bg-neutral-800',
|
|
|
|
|
outline:
|
|
|
|
|
'border shadow-none bg-transparent border-border dark:border-border hover:bg-accent active:bg-zinc-200 dark:hover:bg-input/50',
|
|
|
|
|
primary:
|
|
|
|
|
'bg-primary hover:bg-orange-600 active:bg-orange-700 text-primary-foreground',
|
2025-11-21 08:38:46 +01:00
|
|
|
action:
|
2026-02-17 10:35:03 +01:00
|
|
|
'bg-action hover:bg-blue-600 active:bg-blue-700 text-action-foreground',
|
2025-11-21 08:38:46 +01:00
|
|
|
destructive:
|
2026-02-17 10:35:03 +01:00
|
|
|
'bg-destructive hover:bg-red-600 active:bg-red-700 dark:bg-red-700 text-white',
|
2025-11-21 08:38:46 +01:00
|
|
|
success:
|
|
|
|
|
'bg-success text-success-foreground border-b-1 border-t-1 border-t-lime-200 border-b-lime-500 dark:border-t-lime-400 dark:border-b-lime-800 hover:bg-lime-500 active:bg-lime-500 active:inset-shadow-lime-600 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',
|
|
|
|
|
ghost:
|
2026-02-17 10:35:03 +01:00
|
|
|
'border-none shadow-none hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
2025-11-21 08:38:46 +01:00
|
|
|
pressed:
|
2026-02-17 10:35:03 +01:00
|
|
|
'bg-zinc-100 dark:bg-neutral-700 shadow-none inset-shadow-2xs inset-shadow-black/15 border-none top-[1px]',
|
2025-11-21 08:38:46 +01:00
|
|
|
},
|
|
|
|
|
size: {
|
2026-02-17 10:35:03 +01:00
|
|
|
default: 'h-8 px-6 has-[>svg]:px-3',
|
2025-11-21 08:38:46 +01:00
|
|
|
sm: 'h-7 px-4 rounded-md gap-1.5 has-[>svg]:px-2.5',
|
|
|
|
|
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
|
|
|
|
icon: 'size-9',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
defaultVariants: {
|
|
|
|
|
variant: 'default',
|
|
|
|
|
size: 'default',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
export type ButtonVariants = VariantProps<typeof buttonVariants>
|