{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "input-field",
  "type": "registry:component",
  "title": "InputField",
  "description": "A rounded glass text input on the Onda Surface, with an optional label above and a placeholder. With `typed` on, the value types itself in (via useTextReveal) behind a blinking caret, with an accent focus ring — all frame-driven and deterministic.",
  "dependencies": [
    "remotion",
    "zod",
    "react"
  ],
  "registryDependencies": [
    "lib-canvas",
    "lib-hooks",
    "lib-primitives"
  ],
  "files": [
    {
      "path": "registry/components/input-field/InputField.tsx",
      "type": "registry:component",
      "target": "components/onda/input-field/InputField.tsx",
      "content": "import React from 'react';\nimport { useCurrentFrame, useVideoConfig } from 'remotion';\nimport { PlacementBox, resolveSize } from '../../../lib/canvas';\nimport { Surface } from '../../../lib/primitives';\nimport { useTextReveal } from '../../../lib/hooks';\nimport { inputFieldSchema, type InputFieldProps } from './schema';\n\nexport { inputFieldSchema, type InputFieldProps };\n\n/**\n * A UI text input field on the Onda glass surface: an optional label sits above\n * a rounded glass field. With `typed` on, the `value` types itself in character\n * by character (via `useTextReveal`) behind a blinking caret; otherwise the\n * value (or placeholder) shows statically. The caret blink and the focus ring\n * are keyed off `useCurrentFrame()`, so the whole field is deterministic\n * (CLAUDE.md §1). The caret and ring carry the one earned accent.\n *\n * @example\n * <InputField label=\"Email\" value=\"hello@onda.video\" placement=\"center\" />\n */\nexport const InputField: React.FC<InputFieldProps> = ({\n  value, placeholder, label, typed, delay, typeDuration, focusRing, width,\n  fontSize, size, fontFamily, textColor, placeholderColor, labelColor,\n  accentColor, placement,\n}) => {\n  const frame = useCurrentFrame();\n  const { width: canvasW, height: canvasH } = useVideoConfig();\n  const resolvedFontSize = size ? resolveSize(size, { width: canvasW, height: canvasH }) : fontSize;\n\n  // How much of the value is visible. With typing off, the whole value shows.\n  const shown = useTextReveal({ length: value.length, delay, durationInFrames: typeDuration });\n  const visible = typed ? value.slice(0, shown) : value;\n  const typing = typed && shown < value.length;\n\n  // Caret blinks while typing (faster, tracking each keystroke) and after it\n  // settles (slower, an idle cursor). Pure frame math — no timer.\n  const blinkOn = typing\n    ? Math.floor(frame / 8) % 2 === 0\n    : Math.floor(frame / 18) % 2 === 0;\n  const showCaret = typed && blinkOn;\n\n  // Focus ring only reads as \"focused\" once typing is underway / done.\n  const focused = focusRing && (!typed || frame >= delay);\n\n  const showPlaceholder = visible.length === 0 && !showCaret;\n\n  return (\n    <PlacementBox placement={placement}>\n      <div style={{ display: 'flex', flexDirection: 'column', gap: 14, width }}>\n        {label && (\n          <span\n            style={{\n              fontFamily,\n              fontSize: resolvedFontSize * 0.52,\n              color: labelColor,\n              letterSpacing: '0.08em',\n              textTransform: 'uppercase',\n            }}\n          >\n            {label}\n          </span>\n        )}\n        <Surface\n          variant=\"glass\"\n          width={width}\n          padding={0}\n          borderColor={focused ? accentColor : 'var(--onda-border, #1C1C22)'}\n        >\n          <div\n            style={{\n              position: 'relative',\n              padding: '22px 28px',\n              display: 'flex',\n              alignItems: 'center',\n              fontFamily,\n              fontSize: resolvedFontSize,\n              lineHeight: 1.2,\n              minHeight: resolvedFontSize * 1.2,\n            }}\n          >\n            {/* Accent focus ring — a soft glow inside the field border. */}\n            {focused && (\n              <div\n                aria-hidden\n                style={{\n                  position: 'absolute',\n                  inset: 0,\n                  borderRadius: 'inherit',\n                  boxShadow: `0 0 0 3px ${accentColor}33`,\n                  pointerEvents: 'none',\n                }}\n              />\n            )}\n            <span style={{ color: textColor, whiteSpace: 'pre' }}>{visible}</span>\n            {showCaret && (\n              <span\n                aria-hidden\n                style={{\n                  display: 'inline-block',\n                  width: Math.max(2, resolvedFontSize * 0.06),\n                  height: resolvedFontSize,\n                  marginLeft: 2,\n                  background: accentColor,\n                  verticalAlign: 'middle',\n                }}\n              />\n            )}\n            {showPlaceholder && (\n              <span style={{ color: placeholderColor, whiteSpace: 'pre' }}>{placeholder}</span>\n            )}\n          </div>\n        </Surface>\n      </div>\n    </PlacementBox>\n  );\n};\n\nexport default InputField;\n"
    },
    {
      "path": "registry/components/input-field/schema.ts",
      "type": "registry:component",
      "target": "components/onda/input-field/schema.ts",
      "content": "import { z } from 'zod';\nimport { placementSchema, sizeRoleSchema } from '../../../lib/canvas-schemas';\n\n/** Zod schema for {@link InputField} props. */\nexport const inputFieldSchema = z.object({\n  /** Discriminator literal — matches this entry's registry slug. Auto-populated when omitted. */\n  kind: z.literal('input-field').default('input-field'),\n  /** The field's value. With `typed` on, this is what types itself in. */\n  value: z.string().default('hello@onda.video'),\n  /** Placeholder shown while the field is empty. */\n  placeholder: z.string().default('Enter your email'),\n  /** Label above the field. Empty hides it. */\n  label: z.string().default('Email'),\n  /** Animate `value` typing itself in character by character (via `useTextReveal`). */\n  typed: z.boolean().default(true),\n  /** Frames before typing starts. */\n  delay: z.number().int().min(0).default(0),\n  /** Frames to type the whole value. */\n  typeDuration: z.number().int().min(1).default(36),\n  /** Show the accent focus ring around the field. */\n  focusRing: z.boolean().default(true),\n  /** Field width in px. Sized for a 1080p+ video canvas, not a screen UI. */\n  width: z.number().default(640),\n  /** Text size in px. Wins over `size` if both are passed. */\n  fontSize: z.number().default(36),\n  /** Semantic role for the text — resolves to canvas-aware pixels. `fontSize` wins when both are passed. */\n  size: sizeRoleSchema.optional(),\n  /** UI font stack. */\n  fontFamily: z.string().default('var(--onda-font-body, \"Space Grotesk\", sans-serif)'),\n  /** Value text color. */\n  textColor: z.string().default('var(--onda-text, #F2F2F4)'),\n  /** Placeholder text color. */\n  placeholderColor: z.string().default('var(--onda-faint, #56565F)'),\n  /** Label text color. */\n  labelColor: z.string().default('var(--onda-dim, #8E8E98)'),\n  /** Caret + focus-ring color — the earned accent. */\n  accentColor: z.string().default('var(--onda-accent, #D96B82)'),\n  /** Where on the canvas this sits. Region (`'center'`, `'upper-third'`, ...) or `{ x, y, anchor }` in 0..1 canvas fractions. */\n  placement: placementSchema.optional(),\n});\n\n/** Inferred props for {@link InputField}. */\nexport type InputFieldProps = z.infer<typeof inputFieldSchema>;\n"
    },
    {
      "path": "registry/components/input-field/input-field.meta.json",
      "type": "registry:file",
      "target": "components/onda/input-field/input-field.meta.json",
      "content": "{\n  \"name\": \"input-field\",\n  \"title\": \"InputField\",\n  \"description\": \"A rounded glass text input on the Onda Surface, with an optional label above and a placeholder. With `typed` on, the value types itself in (via useTextReveal) behind a blinking caret, with an accent focus ring — all frame-driven and deterministic.\",\n  \"pickWhen\": \"a form field in a UI demo — login, signup, AI prompt box. Set `typed` to show the user filling it in.\",\n  \"category\": \"interface\",\n  \"tags\": [\n    \"input\",\n    \"field\",\n    \"form\",\n    \"typing\",\n    \"ui\",\n    \"glass\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"zod\",\n    \"react\"\n  ]\n}\n"
    },
    {
      "path": "registry/components/input-field/README.md",
      "type": "registry:file",
      "target": "components/onda/input-field/README.md",
      "content": "# InputField\n\nA UI text input field on the Onda glass surface: a rounded glass field with an optional uppercase label above and a placeholder. With `typed` on, the `value` types itself in character by character (via `useTextReveal`) behind a blinking accent caret, and an accent focus ring lights the border once typing begins. The caret blink and focus ring are keyed off the frame (not a timer), so the field is fully deterministic. The caret and ring carry the one earned accent.\n\n## Props\n\n| Prop | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `value` | `string` | sample email | The field's value; what types in when `typed`. |\n| `placeholder` | `string` | sample | Shown while the field is empty. |\n| `label` | `string` | `\"Email\"` | Label above the field. Empty hides it. |\n| `typed` | `boolean` | `true` | Animate the value typing itself in. |\n| `delay` | `number` | `0` | Frames before typing starts. |\n| `typeDuration` | `number` | `36` | Frames to type the whole value. |\n| `focusRing` | `boolean` | `true` | Accent focus ring around the field. |\n| `width` | `number` | `640` | Field width in px (sized for video). |\n| `fontSize` | `number` | `36` | Text size in px. Wins over `size`. |\n| `size` | size role | — | Semantic role resolved to canvas-aware px. |\n| `fontFamily` | `string` | Space Grotesk | UI font stack. |\n| `textColor` / `placeholderColor` / `labelColor` / `accentColor` | `string` | token defaults | — |\n| `placement` | region or `{x,y,anchor}` | — | Canvas placement. |\n\n## Usage\n\n```tsx\nimport { InputField } from './components/onda/input-field/InputField';\n\nexport const SignupScene = () => (\n  <InputField label=\"Email\" value=\"hello@onda.video\" typed placement=\"center\" />\n);\n```\n"
    }
  ]
}
