{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "button", "type": "registry:ui", "title": "Button", "description": "A customizable button component", "dependencies": [ "tailwind-variants", "clsx", "tailwind-merge", "@base-ui/react" ], "registryDependencies": [ "classes" ], "files": [ { "path": "src/registry/pure-ui/ui/button/index.tsx", "content": "\"use client\";\n\nimport { tv, type VariantProps } from \"tailwind-variants\";\nimport {\n Button as BaseButton,\n type ButtonProps as BaseButtonProps,\n} from \"@base-ui/react/button\";\n\nimport { cn } from \"@/lib/classes\";\n\nconst buttonVariants = tv({\n base: [\n `group inline-flex relative isolate shrink-0 items-center gap-1.5 text-sm justify-center w-fit touch-none whitespace-nowrap cursor-pointer outline-hidden transform-gpu motion-reduce:transform-none overflow-hidden`,\n `focus-visible:ring-ring focus-visible:ring-2 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-secondary-foreground`,\n `disabled:cursor-not-allowed disabled:scale-100 disabled:opacity-60 disabled:bg-secondary`,\n `[transition:scale_0.1s,box-shadow_0.2s,background_0.20s,width_0.2s] [transition-timing-function:cubic-bezier(.6,.04,.98,.335)] will-change-transform`,\n `[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none active:scale-98`,\n ],\n variants: {\n variant: {\n default: `bg-linear-to-b from-primary/80 dark:from-primary to-primary text-primary-foreground hover:from-primary/75 dark:hover:from-primary/95`,\n secondary:\n \"border-secondary bg-secondary text-secondary-foreground hover:bg-secondary/90 data-pressed:bg-secondary/90\",\n outline: `border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,\n ghost: `text-primary hover:bg-primary/10 focus-vislbe:bg-primary/10 focus-visible:border-primary/25`,\n link: `text-primary hover:underline hover:underline-offset-4 hover:decoration-1 focus-visible:underline focus-visible:underline-offset-4 focus-visible:decoration-1`,\n destructive:\n \"bg-destructive text-white hover:bg-destructive/90 focus-visible:border-destructive focus-visible:bg-destructive/90 focus-visible:ring-destructive bg-linear-to-t from-destructive/90 to-destructive\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n xs: \"h-6 gap-1 rounded-md px-[calc(--spacing(2)-1px)] py-[calc(--spacing(1)-1px)] text-xs [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n xl: \"h-12 px-[calc(--spacing(4)-1px)] py-[calc(--spacing(2)-1px)] text-base [&_svg:not([class*='size-'])]:size-4.5\",\n \"icon-sm\": \"size-8 [&_svg:not([class*='size-'])]:size-3.5\",\n icon: \"size-9 [&_svg:not([class*='size-'])]:size-4\",\n \"icon-lg\": \"size-10 [&_svg:not([class*='size-'])]:size-4.5\",\n \"icon-xl\": \"size-12 [&_svg:not([class*='size-'])]:size-4.5\",\n },\n radius: {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n default: \"rounded-md\",\n lg: \"rounded-lg\",\n xl: \"rounded-xl\",\n full: \"rounded-full\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n radius: \"default\",\n },\n});\n\ntype ButtonProps = BaseButtonProps & {\n variant?: VariantProps[\"variant\"];\n size?: VariantProps[\"size\"];\n radius?: VariantProps[\"radius\"];\n};\n\nfunction Button({\n className,\n variant = \"default\",\n size = \"default\",\n radius = \"default\",\n ...props\n}: ButtonProps) {\n return (\n \n );\n}\n\nexport { Button, buttonVariants };\n", "type": "registry:ui", "target": "components/ui/button.tsx" } ] }