{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button",
  "type": "registry:component",
  "title": "Button",
  "description": "Native button or link with shared variants and an optional crystal shape.",
  "dependencies": [],
  "registryDependencies": [
    "https://steez-ui.thomasjvu.com/r-steez/theme-tokens.json",
    "https://steez-ui.thomasjvu.com/r-steez/button-styles.json",
    "https://steez-ui.thomasjvu.com/r-steez/button-shape-styles.json"
  ],
  "docs": "Files install at the project root. Import styles/steez/tokens.css once from your global stylesheet or root layout, then import components from components/steez. No Steez npm packages are required.",
  "files": [
    {
      "path": "components/steez/Button.tsx",
      "type": "registry:file",
      "target": "components/steez/Button.tsx",
      "content": "\"use client\";\n\nimport React from \"react\";\nimport styles from \"../styles/Buttons.module.css\";\nimport shapeStyles from \"./ButtonShape.module.css\";\n\ntype ButtonVariant = \"primary\" | \"secondary\" | \"danger\" | \"cyberpunk3\" | \"cyberpunk6\";\ntype ButtonSize = \"small\" | \"medium\" | \"large\";\nexport type IconActionProps =\n  | { iconOnly?: false }\n  | ({ iconOnly: true } & ({ \"aria-label\": string } | { \"aria-labelledby\": string }));\ntype ButtonAppearance = {\n  variant?: ButtonVariant;\n  size?: ButtonSize;\n  shape?: \"default\" | \"crystal\" | \"cut\";\n  cutCorners?: readonly (\"top-left\" | \"top-right\" | \"bottom-right\" | \"bottom-left\")[];\n  cutSize?: string;\n  orientation?: \"horizontal\" | \"vertical\";\n  children: React.ReactNode;\n  disabled?: boolean;\n};\nexport type ButtonProps = ButtonAppearance & IconActionProps & (\n  | (React.ButtonHTMLAttributes<HTMLButtonElement> & { href?: never })\n  | (React.AnchorHTMLAttributes<HTMLAnchorElement> & { href: string })\n);\n\n/** Native action or link; crystal is a shape of the same button. */\nexport function Button({\n  variant = \"primary\", size = \"medium\", shape = \"default\",\n  orientation = \"horizontal\", cutCorners = [\"top-right\", \"bottom-left\"], cutSize = \"12px\", style, className = \"\", children, iconOnly,\n  disabled = false, ...props\n}: ButtonProps) {\n  const sizeClass = size === \"small\" ? styles.small : size === \"large\" ? styles.large : \"\";\n  const crystal = shape === \"crystal\";\n  const shaped = shape !== \"default\";\n  const corner = (name: typeof cutCorners[number]) => cutCorners.includes(name) ? `min(${cutSize}, 50%)` : \"0px\";\n  const shapeStyle = { \"--cut-tl\": corner(\"top-left\"), \"--cut-tr\": corner(\"top-right\"), \"--cut-br\": corner(\"bottom-right\"), \"--cut-bl\": corner(\"bottom-left\"), ...style } as React.CSSProperties;\n  const classes = `${styles[variant]} ${sizeClass} ${shaped ? shapeStyles.root : \"\"} ${crystal && orientation === \"vertical\" ? shapeStyles.vertical : \"\"} ${className}`.trim();\n  const content = shaped ? <>\n    <span className={shapeStyles.shape} aria-hidden=\"true\" />\n    <span className={shapeStyles.content} aria-hidden={iconOnly || undefined}>{children}</span>\n  </> : iconOnly ? <span aria-hidden=\"true\">{children}</span> : children;\n  const appearance = { className: classes, style: shapeStyle, \"data-shape\": shape, \"data-variant\": variant };\n  if (props.href !== undefined) {\n    const { href, onClick, ...linkProps } = props;\n    return <a {...linkProps} {...appearance} href={disabled ? undefined : href}\n      role={disabled ? \"link\" : linkProps.role}\n      aria-disabled={disabled || undefined} tabIndex={disabled ? -1 : linkProps.tabIndex}\n      onClick={event => {\n        if (disabled) { event.preventDefault(); return; }\n        onClick?.(event);\n      }}>{content}</a>;\n  }\n  const { type = \"button\", ...buttonProps } = props;\n  return <button {...buttonProps} {...appearance} type={type} disabled={disabled}>{content}</button>;\n}\nexport default Button;\n",
      "source": "packages/ui/src/components/Button.tsx"
    }
  ]
}
