{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "button",
  "type": "registry:component",
  "title": "Button",
  "description": "A CTA pill button — accent-filled (primary) or bordered (ghost). It fades and rises in on the house entrance, then plays an optional deterministic click-dip at pressFrame: a quick scale down to 0.94 and back that reads as a press.",
  "dependencies": [
    "remotion",
    "zod",
    "react"
  ],
  "registryDependencies": [
    "lib-canvas",
    "lib-hooks"
  ],
  "files": [
    {
      "path": "registry/components/button/Button.tsx",
      "type": "registry:component",
      "target": "components/onda/button/Button.tsx",
      "content": "import React from 'react';\nimport { useCurrentFrame, useVideoConfig, interpolate, Easing } from 'remotion';\nimport { PlacementBox, resolveSize } from '../../../lib/canvas';\nimport { useEntrance } from '../../../lib/hooks';\nimport { buttonSchema, type ButtonProps } from './schema';\n\nexport { buttonSchema, type ButtonProps };\n\n// Press-dip envelope: scale eases down to PRESS_SCALE over PRESS_IN frames,\n// then springs back to 1 over PRESS_OUT. Short and tight so it reads as a\n// physical click, not a bounce — no overshoot (CLAUDE.md §3).\nconst PRESS_SCALE = 0.94;\nconst PRESS_IN = 3;\nconst PRESS_OUT = 7;\n\n/**\n * A CTA pill button — accent-filled (`primary`) or bordered (`ghost`). It\n * fades and rises in on the house entrance, then plays an optional click-dip\n * at `pressFrame`: a quick scale down to 0.94 and back, reading as a press.\n *\n * Fully deterministic (CLAUDE.md §1) — the dip is a pure function of the\n * frame's distance from `pressFrame`, no timers or state.\n *\n * @example\n * <Button label=\"Get started\" placement=\"lower-third\" />\n */\nexport const Button: React.FC<ButtonProps> = ({\n  label,\n  variant,\n  accent,\n  press,\n  pressFrame,\n  delay,\n  width,\n  fontSize,\n  size,\n  fontFamily,\n  placement,\n}) => {\n  const frame = useCurrentFrame();\n  const { width: cw, height: ch } = useVideoConfig();\n  const entrance = useEntrance({ type: 'rise', delay });\n\n  const resolvedFontSize = size ? resolveSize(size, { width: cw, height: ch }) : fontSize;\n\n  // Click-dip: down on the house ease into pressFrame, back out after it.\n  // interpolate clamps outside the window, so the scale sits at 1 until the\n  // dip begins and returns to 1 once it settles.\n  const pressScale = press\n    ? interpolate(\n        frame,\n        [pressFrame - PRESS_IN, pressFrame, pressFrame + PRESS_OUT],\n        [1, PRESS_SCALE, 1],\n        {\n          extrapolateLeft: 'clamp',\n          extrapolateRight: 'clamp',\n          easing: Easing.bezier(0.16, 1, 0.3, 1),\n        },\n      )\n    : 1;\n\n  const isPrimary = variant === 'primary';\n  const padV = Math.round(resolvedFontSize * 0.62);\n  const padH = Math.round(resolvedFontSize * 1.4);\n\n  return (\n    <PlacementBox placement={placement}>\n      <div style={{ opacity: entrance.opacity, transform: entrance.transform }}>\n        <div\n          style={{\n            display: 'inline-flex',\n            alignItems: 'center',\n            justifyContent: 'center',\n            boxSizing: 'border-box',\n            width: width ?? 'auto',\n            padding: `${padV}px ${padH}px`,\n            borderRadius: 999,\n            background: isPrimary ? accent : 'transparent',\n            border: isPrimary\n              ? '1px solid rgba(255,255,255,0.14)'\n              : `1px solid ${accent}`,\n            // Soft accent glow on primary; a quiet lift on ghost. Depth, not decoration.\n            boxShadow: isPrimary\n              ? `0 18px 40px -20px ${accent}, inset 0 1px 0 rgba(255,255,255,0.22)`\n              : 'inset 0 1px 0 rgba(255,255,255,0.05)',\n            transform: `scale(${pressScale})`,\n            transformOrigin: 'center',\n          }}\n        >\n          <span\n            style={{\n              color: isPrimary ? 'var(--onda-bg, #08080A)' : accent,\n              fontFamily,\n              fontSize: resolvedFontSize,\n              fontWeight: 600,\n              letterSpacing: '-0.01em',\n              lineHeight: 1,\n              whiteSpace: 'nowrap',\n            }}\n          >\n            {label}\n          </span>\n        </div>\n      </div>\n    </PlacementBox>\n  );\n};\n\nexport default Button;\n"
    },
    {
      "path": "registry/components/button/schema.ts",
      "type": "registry:component",
      "target": "components/onda/button/schema.ts",
      "content": "import { z } from 'zod';\nimport { placementSchema, sizeRoleSchema } from '../../../lib/canvas-schemas';\n\n/** Zod schema for {@link Button} props. */\nexport const buttonSchema = z.object({\n  /** Discriminator literal — matches this entry's registry slug. Auto-populated when omitted (`schema.parse({})` works as before). Lets consumers build `z.discriminatedUnion('kind', [...])` directly over onda schemas. */\n  kind: z.literal('button').default('button'),\n  /** The button label. */\n  label: z.string().default('Get started'),\n  /** `'primary'` = accent fill, `'ghost'` = transparent with a bordered outline. */\n  variant: z.enum(['primary', 'ghost']).default('primary'),\n  /** The earned accent — drives the primary fill and the ghost border/text tint. */\n  accent: z.string().default('var(--onda-accent, #D96B82)'),\n  /** Play the click-dip press animation. */\n  press: z.boolean().default(true),\n  /** Frame the press dip lands on (relative to the component's local timeline). */\n  pressFrame: z.number().int().min(0).default(30),\n  /** Frames before the button fades and rises in. */\n  delay: z.number().int().min(0).default(0),\n  /** Button width in px. Omit for auto width that hugs the label. */\n  width: z.number().optional(),\n  /** Label font size in px. Wins over `size` when both are passed. */\n  fontSize: z.number().default(24),\n  /** Semantic role for the label — resolves to canvas-aware pixels. `fontSize` wins when both are passed. */\n  size: sizeRoleSchema.optional(),\n  /** Onda display font. */\n  fontFamily: z.string().default('var(--onda-font-display, \"Clash Display\", sans-serif)'),\n  /** Where on the canvas this sits. Region (`'center'`, `'lower-third'`, ...) or `{ x, y, anchor }` in 0..1 canvas fractions. Defaults to centered. */\n  placement: placementSchema.optional(),\n});\n\n/** Inferred props for {@link Button}. */\nexport type ButtonProps = z.infer<typeof buttonSchema>;\n"
    },
    {
      "path": "registry/components/button/button.meta.json",
      "type": "registry:file",
      "target": "components/onda/button/button.meta.json",
      "content": "{\n  \"name\": \"button\",\n  \"title\": \"Button\",\n  \"description\": \"A CTA pill button — accent-filled (primary) or bordered (ghost). It fades and rises in on the house entrance, then plays an optional deterministic click-dip at pressFrame: a quick scale down to 0.94 and back that reads as a press.\",\n  \"pickWhen\": \"a CTA needs to read as clickable — landing button, end-card action. Pair `pressFrame` with `cursor` for product demos.\",\n  \"category\": \"interface\",\n  \"tags\": [\n    \"button\",\n    \"cta\",\n    \"pill\",\n    \"press\",\n    \"ui\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"zod\",\n    \"react\"\n  ]\n}\n"
    },
    {
      "path": "registry/components/button/README.md",
      "type": "registry:file",
      "target": "components/onda/button/README.md",
      "content": "# Button\n\nA CTA pill button. `variant=\"primary\"` fills with the earned accent; `variant=\"ghost\"` is transparent with an accent border. It fades and rises in on the house entrance, then plays an optional click-dip at `pressFrame` — a quick scale down to `0.94` and back that reads as a press. Fully deterministic: the dip is a pure function of the frame's distance from `pressFrame`, no timers or state.\n\n## Props\n\n| Prop | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `label` | `string` | `\"Get started\"` | Button text. |\n| `variant` | `'primary' \\| 'ghost'` | `'primary'` | Accent fill vs. bordered outline. |\n| `accent` | `string` | `#D96B82` | Drives the fill, glow, and ghost border/text. |\n| `press` | `boolean` | `true` | Play the click-dip. |\n| `pressFrame` | `number` | `30` | Frame the dip lands on (local timeline). |\n| `delay` | `number` | `0` | Frames before the entrance. |\n| `width` | `number` | — | Fixed width in px; omit for auto width. |\n| `fontSize` | `number` | `24` | Label size; wins over `size`. |\n| `size` | size role | — | Canvas-aware label size; `fontSize` wins when both passed. |\n| `fontFamily` | `string` | Clash Display | Label font. |\n| `placement` | region or `{x,y,anchor}` | — | Canvas placement. |\n\n## Usage\n\n```tsx\nimport { Button } from './components/onda/button/Button';\n\nexport const CtaScene = () => (\n  <Button label=\"Get started\" variant=\"primary\" pressFrame={30} placement=\"lower-third\" />\n);\n```\n"
    }
  ]
}
