{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "button", "title": "Button", "description": "A button component with Formance brand variants.", "dependencies": [ "class-variance-authority", "lucide-react", "radix-ui" ], "files": [ { "path": "registry/default/ui/button.tsx", "content": "import { cva, type VariantProps } from 'class-variance-authority';\nimport { Loader2 } from 'lucide-react';\nimport { Slot as SlotPrimitive } from 'radix-ui';\nimport * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nconst buttonVariants = cva(\n 'relative inline-flex cursor-pointer items-center justify-center whitespace-nowrap rounded-md text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 font-mono font-medium leading-normal',\n {\n variants: {\n variant: {\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90',\n secondary:\n 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n\n emerald: 'bg-emerald-600 text-emerald-50 hover:bg-emerald-500',\n emeraldDark: 'bg-emerald-700 text-emerald-200 hover:bg-emerald-500',\n slate: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n gold: 'bg-gold-500 text-gold-100 hover:bg-gold-400',\n lilac: 'bg-lilac-500 text-emerald-900 hover:bg-lilac-400',\n cobalt:\n 'bg-cobalt-500 text-emerald-50 hover:bg-cobalt-600 dark:bg-cobalt-800 dark:text-emerald-50',\n cobaltDark: 'bg-cobalt-700 text-emerald-50 hover:bg-cobalt-600',\n mint: 'bg-mint-500 text-mint-900 hover:bg-mint-400',\n mintDark: 'bg-mint-700 text-mint-300 hover:bg-mint-800',\n\n outline:\n 'border border-border bg-background hover:bg-muted hover:text-foreground dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground',\n outlineDashed:\n 'border border-dashed border-input bg-background hover:bg-accent hover:text-accent-foreground',\n outlineDestructive:\n 'border border-destructive-foreground bg-transparent text-destructive-foreground hover:bg-destructive/10',\n ghost:\n 'hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground',\n bracketed:\n 'bg-transparent text-muted-foreground hover:text-foreground before:content-[\"[\"] after:content-[\"]\"] before:mr-1 after:ml-1 rounded-none px-0',\n link: 'text-primary underline-offset-4 hover:underline',\n valid: 'bg-valid text-valid-foreground hover:bg-valid/90',\n destructive:\n 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\n info: 'bg-info text-info-foreground hover:bg-info/90',\n warning: 'bg-warning text-warning-foreground hover:bg-warning/90',\n },\n size: {\n sm: 'px-3 h-7',\n md: 'px-4 h-8',\n lg: 'px-8 h-9',\n 'icon-xs': 'h-5 w-5 p-0.5 [&>svg]:size-3.5',\n 'icon-sm': 'h-7 w-7 p-0.5 [&>svg]:size-3.5',\n 'icon-md': 'h-8 w-8 p-1.5 [&>svg]:size-4',\n 'icon-lg': 'h-9 w-9 p-2 [&>svg]:size-4',\n 'icon-xl': 'h-16 w-16 p-2 [&>svg]:size-10',\n },\n notClickable: {\n true: 'pointer-events-none focus-visible:ring-0',\n },\n caseSensitive: {\n true: 'normal-case',\n false: 'uppercase',\n },\n },\n defaultVariants: {\n variant: 'primary',\n notClickable: false,\n caseSensitive: false,\n size: 'md',\n },\n }\n);\n\nexport type TButtonProps = React.ComponentProps<'button'> &\n VariantProps & {\n asChild?: boolean;\n loading?: boolean;\n };\n\nfunction Button({\n className,\n variant,\n size,\n notClickable,\n caseSensitive,\n asChild = false,\n loading = false,\n ...props\n}: TButtonProps) {\n const Comp = asChild ? SlotPrimitive.Slot : 'button';\n\n return (\n \n {asChild ? (\n props.children\n ) : (\n <>\n {props.children}\n {loading && }\n \n )}\n \n );\n}\n\nexport { Button, buttonVariants };\n", "type": "registry:ui" } ], "type": "registry:ui" }