{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"button","title":"Button","author":"brijr","description":"A button primitive built on UI SDK.","dependencies":["@ui-sdk/react","@ui-sdk/core","class-variance-authority","cn"],"files":[{"path":"components/ui/button.tsx","content":"import * as React from \"react\"\nimport { Button as ButtonPrimitive } from \"@ui-sdk/react/button\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { cn } from \"cn\"\n\n// Two leading spans marked data-show=\"idle\" and \"pending\" stack in one grid\n// cell (see the base CSS), so a label swap never changes the button's width.\nconst buttonVariants = cva(\n  \"group/button relative inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 not-data-disabled:active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none has-[>span[data-show=idle]:first-child+span[data-show=pending]]:inline-grid has-[>span[data-show=idle]:first-child+span[data-show=pending]]:grid-flow-col aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:focus-visible:ring-destructive/60 data-pending:cursor-progress data-pending:opacity-70 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:aria-invalid:focus-visible:ring-destructive/70 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 data-disabled:cursor-not-allowed data-disabled:opacity-50 data-disabled:not-[button]:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n  {\n    variants: {\n      variant: {\n        default:\n          \"bg-primary text-primary-foreground not-data-disabled:hover:bg-primary/80\",\n        outline:\n          \"border-border bg-background shadow-(--elevation-control) not-data-disabled:hover:bg-muted not-data-disabled:hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:not-data-disabled:hover:bg-input/50\",\n        secondary:\n          \"bg-secondary text-secondary-foreground not-data-disabled:hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground\",\n        ghost:\n          \"not-data-disabled:hover:bg-muted not-data-disabled:hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:not-data-disabled:hover:bg-muted/50\",\n        destructive:\n          \"bg-destructive/10 text-destructive not-data-disabled:hover:bg-destructive/15 focus-visible:border-destructive focus-visible:ring-destructive/50 dark:bg-destructive/20 dark:not-data-disabled:hover:bg-destructive/25 dark:focus-visible:ring-destructive/60\",\n        link: \"text-primary underline-offset-4 not-data-disabled:hover:underline\",\n      },\n      size: {\n        default:\n          \"h-9 gap-1.5 px-3 has-data-[icon=inline-end]:pr-2.5 has-data-[icon=inline-start]:pl-2.5 pointer-coarse:after:-inset-y-1.25\",\n        xs: \"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 pointer-coarse:after:-inset-y-2.25 [&_svg:not([class*='size-'])]:size-3.5\",\n        sm: \"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 pointer-coarse:after:-inset-y-1.75\",\n        lg: \"h-10 gap-2 px-4 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 pointer-coarse:after:-inset-y-0.75\",\n        icon: \"size-9 pointer-coarse:after:-inset-1.25\",\n        \"icon-xs\":\n          \"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg pointer-coarse:after:-inset-2.25\",\n        \"icon-sm\": \"size-8 pointer-coarse:after:-inset-1.75\",\n        \"icon-lg\": \"size-10 pointer-coarse:after:-inset-0.75\",\n      },\n    },\n    defaultVariants: {\n      variant: \"default\",\n      size: \"default\",\n    },\n  }\n)\n\nfunction Button({\n  className,\n  variant = \"default\",\n  size = \"default\",\n  ...props\n}: Omit<React.ComponentProps<typeof ButtonPrimitive>, \"className\"> &\n  VariantProps<typeof buttonVariants> & { className?: string }) {\n  return (\n    <ButtonPrimitive\n      className={cn(buttonVariants({ variant, size }), className)}\n      {...props}\n    />\n  )\n}\n\nexport { Button, buttonVariants }\n","type":"registry:ui"}],"type":"registry:ui"}