{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"shine-button","type":"registry:ui","title":"Shine button","description":"Pill button with a soft light sweep on hover, three variants, three sizes and an arrow that nudges forward.","dependencies":["lucide-react"],"registryDependencies":["utils"],"files":[{"path":"registry/items/shine-button/shine-button.tsx","type":"registry:ui","target":"components/facade/shine-button.tsx","content":"import * as React from \"react\";\nimport { ArrowRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ShineButtonVariant = \"brand\" | \"solid\" | \"outline\";\nexport type ShineButtonSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface ShineButtonBaseProps {\n  /** Visual style. Defaults to \"brand\". */\n  variant?: ShineButtonVariant;\n  /** Height and padding scale. Defaults to \"md\". */\n  size?: ShineButtonSize;\n  /** Optional leading icon. */\n  icon?: React.ReactNode;\n  /** Show a trailing arrow that nudges forward on hover. */\n  arrow?: boolean;\n  className?: string;\n  children?: React.ReactNode;\n}\n\ntype ShineButtonAsButton = ShineButtonBaseProps &\n  Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof ShineButtonBaseProps> & {\n    href?: undefined;\n  };\n\ntype ShineButtonAsAnchor = ShineButtonBaseProps &\n  Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof ShineButtonBaseProps> & {\n    href: string;\n  };\n\n/** Pass `href` to render an `<a>`, otherwise a `<button>` is rendered. */\nexport type ShineButtonProps = ShineButtonAsButton | ShineButtonAsAnchor;\n\nconst variantClasses: Record<ShineButtonVariant, string> = {\n  brand: \"bg-brand text-brand-foreground hover:bg-[color-mix(in_srgb,var(--brand)_88%,black)]\",\n  solid: \"bg-foreground text-background hover:opacity-90\",\n  outline: \"bg-muted text-foreground hover:bg-foreground/10\",\n};\n\nconst shineClasses: Record<ShineButtonVariant, string> = {\n  brand: \"via-brand-foreground/30\",\n  solid: \"via-background/20\",\n  outline: \"via-foreground/[0.07]\",\n};\n\nconst sizeClasses: Record<ShineButtonSize, string> = {\n  sm: \"h-9 gap-1.5 px-4 text-[13px] [&_svg]:size-3.5\",\n  md: \"h-11 gap-2 px-5 text-sm [&_svg]:size-4\",\n  lg: \"h-12 gap-2.5 px-6 text-[15px] [&_svg]:size-[18px]\",\n};\n\nexport function ShineButton(props: ShineButtonProps) {\n  const { variant = \"brand\", size = \"md\", icon, arrow = false, className, children } = props;\n\n  const classes = cn(\n    \"group relative isolate inline-flex shrink-0 select-none items-center justify-center overflow-hidden whitespace-nowrap rounded-full font-medium tracking-[-0.01em]\",\n    \"transition-[background-color,opacity,transform] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] active:scale-[0.98]\",\n    \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n    \"disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50\",\n    variantClasses[variant],\n    sizeClasses[size],\n    className,\n  );\n\n  const inner = (\n    <>\n      <span aria-hidden className=\"pointer-events-none absolute inset-0 -z-10 overflow-hidden rounded-[inherit]\">\n        <span\n          className={cn(\n            \"absolute inset-y-0 -left-1/2 w-1/2 -skew-x-[20deg] bg-linear-to-r from-transparent to-transparent opacity-0\",\n            \"transition-none group-hover:translate-x-[320%] group-hover:opacity-100 group-hover:transition-[transform,opacity] group-hover:duration-[900ms] group-hover:ease-[cubic-bezier(0.16,1,0.3,1)]\",\n            \"group-focus-visible:translate-x-[320%] group-focus-visible:opacity-100 group-focus-visible:transition-[transform,opacity] group-focus-visible:duration-[900ms]\",\n            shineClasses[variant],\n          )}\n        />\n      </span>\n      {icon ? <span className=\"inline-flex shrink-0 items-center\">{icon}</span> : null}\n      {children ? <span className=\"relative\">{children}</span> : null}\n      {arrow ? (\n        <ArrowRight\n          aria-hidden\n          className=\"shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] group-hover:translate-x-0.5\"\n        />\n      ) : null}\n    </>\n  );\n\n  if (props.href !== undefined) {\n    const {\n      variant: _variant,\n      size: _size,\n      icon: _icon,\n      arrow: _arrow,\n      className: _className,\n      children: _children,\n      ...anchorProps\n    } = props;\n    return (\n      <a {...anchorProps} className={classes}>\n        {inner}\n      </a>\n    );\n  }\n\n  const {\n    variant: _variant,\n    size: _size,\n    icon: _icon,\n    arrow: _arrow,\n    className: _className,\n    children: _children,\n    href: _href,\n    type = \"button\",\n    ...buttonProps\n  } = props;\n  return (\n    <button {...buttonProps} type={type} className={classes}>\n      {inner}\n    </button>\n  );\n}\n\nexport default ShineButton;\n"}],"categories":["buttons"],"meta":{"tier":"free","demo":"import { Phone, Shield, Star } from \"lucide-react\";\nimport { ShineButton } from \"./shine-button\";\n\nexport default function Demo() {\n  return (\n    <div className=\"w-full max-w-2xl rounded-[28px] bg-muted p-7 text-foreground sm:p-10\">\n      <p className=\"text-xs font-medium uppercase tracking-wider text-muted-foreground\">Summit Roofing, Denver</p>\n      <h3 className=\"mt-3 max-w-md font-display text-[30px] font-semibold leading-[1.1] tracking-[-0.03em] sm:text-[36px]\">\n        Get a free roof inspection before hail season hits.\n      </h3>\n      <p className=\"mt-4 max-w-md text-[15px] leading-relaxed text-muted-foreground\">\n        A licensed inspector on your roof within 48 hours, with photos and a written report you can send to your insurer.\n      </p>\n\n      <div className=\"mt-8 flex flex-wrap items-center gap-3\">\n        <ShineButton size=\"lg\" arrow>\n          Book my free inspection\n        </ShineButton>\n        <ShineButton size=\"lg\" variant=\"outline\" href=\"tel:+13035550142\" icon={<Phone aria-hidden />} className=\"bg-background dark:bg-secondary\">\n          (303) 555-0142\n        </ShineButton>\n      </div>\n\n      <div className=\"mt-8 flex flex-wrap items-center gap-x-6 gap-y-3 text-[13px] text-muted-foreground\">\n        <span className=\"inline-flex items-center gap-1.5\">\n          <Star className=\"size-3.5 fill-star text-star\" aria-hidden />\n          4.9 from 812 Google reviews\n        </span>\n        <span className=\"inline-flex items-center gap-1.5\">\n          <Shield className=\"size-3.5\" aria-hidden />\n          Licensed and insured in Colorado\n        </span>\n        <div className=\"ml-auto hidden items-center gap-2 sm:flex\">\n          <ShineButton size=\"sm\" variant=\"solid\">\n            Solid\n          </ShineButton>\n          <ShineButton size=\"sm\" variant=\"outline\" className=\"bg-background dark:bg-secondary\">\n            Outline\n          </ShineButton>\n        </div>\n      </div>\n    </div>\n  );\n}\n"}}