{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "timeline",
  "type": "registry:component",
  "title": "Timeline",
  "description": "A horizontal timeline: a thin line strokes itself on, then dots cascade in at each anchor with the canonical Onda stagger, then labels fade in beneath. The final dot earns the dusty-rose accent — one focal moment, the rest neutral.",
  "dependencies": [
    "remotion",
    "@remotion/paths",
    "zod",
    "react"
  ],
  "files": [
    {
      "path": "registry/components/timeline/Timeline.tsx",
      "type": "registry:component",
      "target": "components/onda/timeline/Timeline.tsx",
      "content": "import React from 'react';\nimport { useCurrentFrame, useVideoConfig, spring } from 'remotion';\nimport { evolvePath } from '@remotion/paths';\nimport { SPRING_SMOOTH, staggerFrames } from '../../../lib/motion';\nimport { entryScale, entryFade } from '../../../lib/choreography';\nimport { PlacementBox } from '../../../lib/canvas';\nimport { timelineSchema, type TimelineProps } from './schema';\n\nexport { timelineSchema, type TimelineProps };\n\n// SVG path coordinate space. The path is drawn in this 0..LINE_VB_WIDTH x\n// 0..LINE_VB_HEIGHT box and stretched to the rendered container width via\n// preserveAspectRatio='none' on the <svg>.\nconst LINE_VB_WIDTH = 1000;\nconst LINE_VB_HEIGHT = 4;\nconst LINE_PATH = `M 0 ${LINE_VB_HEIGHT / 2} L ${LINE_VB_WIDTH} ${LINE_VB_HEIGHT / 2}`;\n\n/**\n * A horizontal timeline: line draws on first, then dots cascade in at each\n * anchor with the canonical stagger, then labels fade in beneath. The final\n * dot earns the dusty-rose accent — one focal moment, the rest neutral.\n *\n * @example\n * <Timeline points={[{ label: 'Concept' }, { label: 'Ship' }]} />\n */\nexport const Timeline: React.FC<TimelineProps> = ({\n  points,\n  delay,\n  lineDuration,\n  dotDelay,\n  dotStagger,\n  dotDuration,\n  dotSize,\n  lineColor,\n  dotColor,\n  accentColor,\n  labelColor,\n  fontSize,\n  fontFamily,\n  placement,\n}) => {\n  const frame = useCurrentFrame();\n  const { fps } = useVideoConfig();\n\n  // Spring-driven progress for the line draw. SPRING_SMOOTH lands the line\n  // at full length and stays — no overshoot, no re-stroke flicker.\n  const lineLocal = Math.max(0, frame - delay);\n  const lineProgress = spring({\n    frame: lineLocal,\n    fps,\n    config: SPRING_SMOOTH,\n    durationInFrames: lineDuration,\n  });\n  const { strokeDasharray, strokeDashoffset } = evolvePath(lineProgress, LINE_PATH);\n\n  // Anchor positions as percentages along the line. With N points the dots\n  // sit at i/(N-1) — first at 0%, last at 100%. With a single point it sits\n  // centered at 50% (avoids divide-by-zero, keeps the layout symmetric).\n  const positionPct = (i: number): number => {\n    if (points.length <= 1) return 50;\n    return (i / (points.length - 1)) * 100;\n  };\n\n  const lastIndex = points.length - 1;\n\n  return (\n    <PlacementBox placement={placement}>\n    <div\n      style={{\n        // Without an explicit width the flex column shrinks to its content\n        // and the line/dot row collapses. 80% of canvas with a generous max\n        // gives the timeline somewhere to live while keeping the edge margins\n        // that the Onda layout language calls for.\n        width: '80%',\n        maxWidth: 1200,\n        color: labelColor,\n        fontFamily,\n        fontSize,\n        fontWeight: 500,\n      }}\n    >\n      {/* The line layer. SVG stretches to the container width; the dots and\n          labels are positioned absolutely on top so their geometry is in\n          container coordinates, not SVG coordinates. */}\n      <div style={{ position: 'relative', width: '100%', height: dotSize * 2 }}>\n        <svg\n          viewBox={`0 0 ${LINE_VB_WIDTH} ${LINE_VB_HEIGHT}`}\n          preserveAspectRatio=\"none\"\n          width=\"100%\"\n          height={LINE_VB_HEIGHT}\n          style={{\n            position: 'absolute',\n            left: 0,\n            top: '50%',\n            transform: 'translateY(-50%)',\n            overflow: 'visible',\n          }}\n        >\n          <path\n            d={LINE_PATH}\n            stroke={lineColor}\n            strokeWidth={LINE_VB_HEIGHT}\n            strokeDasharray={strokeDasharray}\n            strokeDashoffset={strokeDashoffset}\n            fill=\"none\"\n            strokeLinecap=\"round\"\n          />\n        </svg>\n\n        {/* Dots — entryScale per point with canonical stagger. */}\n        {points.map((_, i) => {\n          const thisDotDelay = delay + lineDuration + dotDelay + staggerFrames(i, dotStagger);\n          const { opacity, transform } = entryScale({\n            frame,\n            fps,\n            delay: thisDotDelay,\n            durationInFrames: dotDuration,\n          });\n          const isLast = i === lastIndex;\n          return (\n            <div\n              key={`dot-${i}`}\n              style={{\n                position: 'absolute',\n                left: `${positionPct(i)}%`,\n                top: '50%',\n                width: dotSize,\n                height: dotSize,\n                marginLeft: -dotSize / 2,\n                marginTop: -dotSize / 2,\n                borderRadius: '50%',\n                background: isLast ? accentColor : dotColor,\n                opacity,\n                transform,\n              }}\n            />\n          );\n        })}\n      </div>\n\n      {/* Label row. Each label fades in shortly after its dot — dot lands,\n          label settles beneath. Labels share the row so vertical rhythm stays\n          consistent regardless of point count. */}\n      <div style={{ position: 'relative', width: '100%', marginTop: 20 }}>\n        {points.map((p, i) => {\n          const thisDotDelay = delay + lineDuration + dotDelay + staggerFrames(i, dotStagger);\n          // Labels trail their dot by a couple frames — small lag so the dot\n          // reads as the lead and the label as its consequence.\n          const labelDelay = thisDotDelay + 2;\n          const { opacity } = entryFade({\n            frame,\n            fps,\n            delay: labelDelay,\n            durationInFrames: dotDuration,\n          });\n          return (\n            <div\n              key={`label-${i}`}\n              style={{\n                position: 'absolute',\n                left: `${positionPct(i)}%`,\n                top: 0,\n                transform: 'translateX(-50%)',\n                opacity,\n                color: labelColor,\n                whiteSpace: 'nowrap',\n                letterSpacing: '-0.01em',\n              }}\n            >\n              {p.label}\n            </div>\n          );\n        })}\n      </div>\n    </div>\n    </PlacementBox>\n  );\n};\n"
    },
    {
      "path": "registry/components/timeline/schema.ts",
      "type": "registry:component",
      "target": "components/onda/timeline/schema.ts",
      "content": "import { z } from 'zod';\nimport { DURATION, STAGGER } from '../../../lib/motion';\nimport { placementSchema } from '../../../lib/canvas-schemas';\n\n/** Zod schema for {@link Timeline} props. */\nexport const timelineSchema = 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('timeline').default('timeline'),\n  /** Anchor points along the timeline. Order is preserved — left to right. */\n  points: z\n    .array(z.object({ label: z.string() }))\n    .default([\n      { label: 'Concept' },\n      { label: 'Build' },\n      { label: 'Ship' },\n      { label: 'Iterate' },\n    ]),\n  /** Frames before the line begins to draw. */\n  delay: z.number().int().min(0).default(0),\n  /** Frames over which the horizontal line strokes itself on. */\n  lineDuration: z.number().int().min(1).default(DURATION.slow),\n  /** Frames between the line completing and the first dot appearing. */\n  dotDelay: z.number().int().min(0).default(8),\n  /** Frames between consecutive dot entrances. Canonical Onda stagger is `4`. */\n  dotStagger: z.number().int().min(0).default(STAGGER),\n  /** Per-dot entrance duration. */\n  dotDuration: z.number().int().min(1).default(DURATION.base),\n  /** Dot diameter in px. */\n  dotSize: z.number().default(14),\n  /** Line color. Defaults to `--onda-border`. */\n  lineColor: z.string().default('var(--onda-border-lit, #26262E)'),\n  /** Non-final dot color. Defaults to `--onda-text`. */\n  dotColor: z.string().default('var(--onda-text, #F2F2F4)'),\n  /** Final dot color — the earned accent. Defaults to `--onda-accent`. */\n  accentColor: z.string().default('var(--onda-accent, #D96B82)'),\n  /** Label color. Defaults to `--onda-dim`. */\n  labelColor: z.string().default('var(--onda-dim, #8E8E98)'),\n  /** Label font size in px. */\n  fontSize: z.number().default(22),\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'`, `'upper-third'`, ...) or `{ x, y, anchor }` in 0..1 canvas fractions. Coordinates may be negative or >1 for off-canvas. */\n  placement: placementSchema.optional(),\n});\n\n/** Inferred props for {@link Timeline}. */\nexport type TimelineProps = z.infer<typeof timelineSchema>;\n"
    },
    {
      "path": "registry/components/timeline/timeline.meta.json",
      "type": "registry:file",
      "target": "components/onda/timeline/timeline.meta.json",
      "content": "{\n  \"name\": \"timeline\",\n  \"title\": \"Timeline\",\n  \"description\": \"A horizontal timeline: a thin line strokes itself on, then dots cascade in at each anchor with the canonical Onda stagger, then labels fade in beneath. The final dot earns the dusty-rose accent — one focal moment, the rest neutral.\",\n  \"pickWhen\": \"an ordered sequence with milestones — roadmap, company history, release cadence. Use `progress-steps` for active state through a flow.\",\n  \"category\": \"data\",\n  \"tags\": [\n    \"timeline\",\n    \"data\",\n    \"stagger\",\n    \"dots\",\n    \"draw\",\n    \"spring\",\n    \"primitive\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"@remotion/paths\",\n    \"zod\",\n    \"react\"\n  ]\n}\n"
    },
    {
      "path": "registry/components/timeline/README.md",
      "type": "registry:file",
      "target": "components/onda/timeline/README.md",
      "content": "# Timeline\n\nA horizontal timeline data primitive. A thin line strokes itself on, then a dot lands at each anchor point with the canonical Onda stagger, then a label fades in beneath each dot. The final dot earns the dusty-rose accent — every other dot stays neutral, so the eye walks the line and lands on the present.\n\n## Props\n\n| Name | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `points` | `{ label: string }[]` | `[{label:'Concept'},{label:'Build'},{label:'Ship'},{label:'Iterate'}]` | Anchor points along the line, left to right. |\n| `delay` | `integer ≥ 0` | `0` | Frames before the line begins to draw. |\n| `lineDuration` | `integer ≥ 1` | `DURATION.slow` (24) | Frames over which the line strokes on. |\n| `dotDelay` | `integer ≥ 0` | `8` | Frames between the line completing and the first dot appearing. |\n| `dotStagger` | `integer ≥ 0` | `STAGGER` (4) | Frames between consecutive dots. |\n| `dotDuration` | `integer ≥ 1` | `DURATION.base` (18) | Per-dot entrance duration. |\n| `dotSize` | `number` | `14` | Dot diameter in px. |\n| `lineColor` | `string` | `\"#26262E\"` | Defaults to `--onda-border-lit`. |\n| `dotColor` | `string` | `\"#F2F2F4\"` | Defaults to `--onda-text`. |\n| `accentColor` | `string` | `\"#D96B82\"` | Defaults to `--onda-accent`. Applied only to the **last** dot. |\n| `labelColor` | `string` | `\"#8E8E98\"` | Defaults to `--onda-dim`. |\n| `fontSize` | `number` | `22` | Label size in px. |\n| `fontFamily` | `string` | `'\"Clash Display\", sans-serif'` | The Onda display font. Never default to Inter / Arial / system. |\n| `placement` | `Placement?` | – | Where on the canvas this sits. Region (`\"center\"`, `\"upper-third\"`, …) or `{ x, y, anchor }` in 0..1 canvas fractions. Coordinates may be negative or >1 for off-canvas. |\n\n## Usage\n\n```tsx\nimport { Composition } from 'remotion';\nimport { Timeline, timelineSchema } from './components/onda/timeline/Timeline';\n\nexport const Root: React.FC = () => (\n  <Composition\n    id=\"MyTimeline\"\n    component={Timeline}\n    durationInFrames={120}\n    fps={30}\n    width={1920}\n    height={1080}\n    schema={timelineSchema}\n    defaultProps={{\n      points: [\n        { label: 'Concept' },\n        { label: 'Build' },\n        { label: 'Ship' },\n        { label: 'Iterate' },\n      ],\n      delay: 0,\n      lineDuration: 24,\n      dotDelay: 8,\n      dotStagger: 4,\n      dotDuration: 18,\n      dotSize: 14,\n      lineColor: '#26262E',\n      dotColor: '#F2F2F4',\n      accentColor: '#D96B82',\n      labelColor: '#8E8E98',\n      fontSize: 22,\n      fontFamily: '\"Clash Display\", sans-serif',\n    }}\n  />\n);\n```\n\n## Motion notes\n\n- **Line** uses `@remotion/paths`'s `evolvePath` driven by `SPRING_SMOOTH` (via Remotion's `spring`) — the same pattern as `DrawOn`. Lands at full length and stays. No overshoot.\n- **Dots** compose `entryScale` from `lib/choreography.ts` with `delay = delay + lineDuration + dotDelay + i * dotStagger`. Spring-driven 0.9 → 1 scale, no bounce.\n- **Labels** compose `entryFade`, trailing each dot by 2 frames so the dot reads as the lead and the label as its consequence.\n- **One accent moment**: only the final dot uses `accentColor`. Every other dot is `dotColor`. The line is `lineColor`. The colour palette stays neutral so the rose lands.\n- Container is `width: 80%; maxWidth: 1200` — without an explicit width the flex column collapses to its label content and the line vanishes.\n- Deterministic: the entire scene is a pure function of `frame`. Safe to scrub, safe to render in parallel.\n"
    }
  ],
  "registryDependencies": [
    "lib-choreography",
    "lib-motion"
  ]
}
