{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "expand-morph",
  "type": "registry:component",
  "title": "expandMorph",
  "description": "A rounded card starts at a small origin rect — a region of the outgoing scene — and smoothly expands (position, size and corner radius interpolated together) to fill the screen, revealing the incoming scene as it grows. Onda's calm take on a morphing modal / image-expand-to-fullscreen reveal, with no overshoot. Onda-original.",
  "dependencies": [
    "remotion",
    "@remotion/transitions",
    "zod"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/transitions/expand-morph/expandMorph.tsx",
      "type": "registry:component",
      "target": "components/onda/transitions/expand-morph/expandMorph.tsx",
      "content": "import React from 'react';\nimport type { TransitionPresentation, TransitionPresentationComponentProps } from '@remotion/transitions';\nimport { AbsoluteFill, Easing, interpolate } from 'remotion';\nimport { expandMorphSchema, type ExpandMorphOptions } from './schema';\n\nexport { expandMorphSchema, type ExpandMorphOptions };\n\ntype ExpandMorphProps = {\n  fromX: number;\n  fromY: number;\n  fromWidth: number;\n  fromHeight: number;\n  borderRadiusFrom: number;\n  borderRadiusTo: number;\n  background: string;\n};\n\n// House easing — settles with no overshoot.\nconst HOUSE_EASING = Easing.bezier(0.16, 1, 0.3, 1);\n\nfunction lerp(from: number, to: number, t: number): number {\n  return interpolate(t, [0, 1], [from, to], {\n    extrapolateLeft: 'clamp',\n    extrapolateRight: 'clamp',\n  });\n}\n\nconst ExpandMorphPresentation: React.FC<\n  TransitionPresentationComponentProps<ExpandMorphProps>\n> = ({ presentationProgress, presentationDirection, children, passedProps }) => {\n  const { fromX, fromY, fromWidth, fromHeight, borderRadiusFrom, borderRadiusTo, background } =\n    passedProps;\n  const isEntering = presentationDirection === 'entering';\n\n  // Single eased timeline drives the whole morph — no springs, no overshoot.\n  const t = HOUSE_EASING(presentationProgress);\n\n  // The card grows from the origin rect (fractions of the canvas) to fullscreen.\n  // top/left/width/height + radius all interpolate together so it reads as one\n  // shared element expanding, not a crop reveal.\n  const left = lerp(fromX * 100, 0, t);\n  const top = lerp(fromY * 100, 0, t);\n  const width = lerp(fromWidth * 100, 100, t);\n  const height = lerp(fromHeight * 100, 100, t);\n  const radius = lerp(borderRadiusFrom, borderRadiusTo, t);\n\n  if (!isEntering) {\n    // Outgoing scene: fades in over the first third, so the moment the card\n    // starts growing the source it morphs from is already softening away.\n    const opacity = interpolate(t, [0, 1 / 3], [1, 0], {\n      extrapolateLeft: 'clamp',\n      extrapolateRight: 'clamp',\n    });\n    return <AbsoluteFill style={{ opacity }}>{children}</AbsoluteFill>;\n  }\n\n  // Incoming scene lives inside the morphing card. It fades/settles in over the\n  // final third, once the card has enough area to read as the new scene rather\n  // than a coloured tile.\n  const incomingOpacity = interpolate(t, [2 / 3, 1], [0, 1], {\n    extrapolateLeft: 'clamp',\n    extrapolateRight: 'clamp',\n  });\n\n  return (\n    <AbsoluteFill>\n      <div\n        style={{\n          position: 'absolute',\n          left: `${left}%`,\n          top: `${top}%`,\n          width: `${width}%`,\n          height: `${height}%`,\n          borderRadius: `${radius}px`,\n          overflow: 'hidden',\n          background,\n        }}\n      >\n        <AbsoluteFill style={{ opacity: incomingOpacity }}>{children}</AbsoluteFill>\n      </div>\n    </AbsoluteFill>\n  );\n};\n\n/**\n * A rounded \"card\" starts at a small origin rect — a region of the outgoing\n * scene — and smoothly expands (top/left/width/height + corner radius all\n * interpolated together) to fill the screen, revealing the incoming scene as\n * it grows. The outgoing scene fades out over the first third; the incoming\n * scene fades/settles in over the final third. Onda's calm take on a morphing\n * modal / image-expand-to-fullscreen reveal — one eased timeline, no overshoot.\n *\n * Pair with the recommended Onda timing for the house feel:\n * `linearTiming({ durationInFrames: 24, easing: Easing.bezier(0.16, 1, 0.3, 1) })`\n *\n * Onda-original.\n */\nexport function expandMorph(\n  options?: ExpandMorphOptions,\n): TransitionPresentation<ExpandMorphProps> {\n  const opts = expandMorphSchema.parse(options ?? {});\n  return {\n    component: ExpandMorphPresentation,\n    props: {\n      fromX: opts.fromX,\n      fromY: opts.fromY,\n      fromWidth: opts.fromWidth,\n      fromHeight: opts.fromHeight,\n      borderRadiusFrom: opts.borderRadiusFrom,\n      borderRadiusTo: opts.borderRadiusTo,\n      background: opts.background,\n    },\n  };\n}\n\nexport default expandMorph;\n"
    },
    {
      "path": "registry/transitions/expand-morph/schema.ts",
      "type": "registry:component",
      "target": "components/onda/transitions/expand-morph/schema.ts",
      "content": "import { z } from 'zod';\n\n/** Zod schema for {@link expandMorph} options. */\nexport const expandMorphSchema = z.object({\n  /** Discriminator literal — matches this entry's registry slug. Auto-populated when omitted. */\n  kind: z.literal('expand-morph').default('expand-morph'),\n  /** Origin rect left edge as a 0..1 fraction of the canvas width. */\n  fromX: z.number().min(0).max(1).default(0.375),\n  /** Origin rect top edge as a 0..1 fraction of the canvas height. */\n  fromY: z.number().min(0).max(1).default(0.375),\n  /** Origin rect width as a 0..1 fraction of the canvas width. */\n  fromWidth: z.number().min(0).max(1).default(0.25),\n  /** Origin rect height as a 0..1 fraction of the canvas height. */\n  fromHeight: z.number().min(0).max(1).default(0.25),\n  /** Border radius (px) of the card at its small origin size. */\n  borderRadiusFrom: z.number().min(0).max(200).default(20),\n  /** Border radius (px) of the card once it fills the screen. */\n  borderRadiusTo: z.number().min(0).max(200).default(0),\n  /** Fill behind the morphing card while it expands. */\n  background: z.string().default('var(--onda-bg, #08080A)'),\n});\n\nexport type ExpandMorphOptions = z.input<typeof expandMorphSchema>;\n"
    },
    {
      "path": "registry/transitions/expand-morph/expand-morph.meta.json",
      "type": "registry:file",
      "target": "components/onda/transitions/expand-morph/expand-morph.meta.json",
      "content": "{\n  \"name\": \"expand-morph\",\n  \"title\": \"expandMorph\",\n  \"description\": \"A rounded card starts at a small origin rect — a region of the outgoing scene — and smoothly expands (position, size and corner radius interpolated together) to fill the screen, revealing the incoming scene as it grows. Onda's calm take on a morphing modal / image-expand-to-fullscreen reveal, with no overshoot. Onda-original.\",\n  \"pickWhen\": \"the incoming scene is conceptually \\\"inside\\\" the outgoing — tap-card-to-open, photo-to-fullscreen, modal. Use `morph` for in-place.\",\n  \"category\": \"transitions\",\n  \"tags\": [\n    \"transition\",\n    \"morph\",\n    \"expand\",\n    \"shared-element\",\n    \"modal\",\n    \"scene\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"@remotion/transitions\",\n    \"zod\"\n  ]\n}\n"
    },
    {
      "path": "registry/transitions/expand-morph/README.md",
      "type": "registry:file",
      "target": "components/onda/transitions/expand-morph/README.md",
      "content": "# expandMorph\n\nA rounded \"card\" starts at a small origin rect — a region of the outgoing scene — and smoothly expands (top/left/width/height and corner radius all interpolated together) to fill the screen, revealing the incoming scene as it grows. The outgoing scene fades out over the first third; the incoming scene fades and settles in over the final third. Onda's calm take on a morphing modal / image-expand-to-fullscreen reveal — one eased timeline, no overshoot.\n\nOnda-original. Use inside Remotion's `<TransitionSeries>`.\n\n## Options\n\n| Option | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `fromX` | `number` | `0.375` | Origin rect left edge, as a 0..1 fraction of canvas width. |\n| `fromY` | `number` | `0.375` | Origin rect top edge, as a 0..1 fraction of canvas height. |\n| `fromWidth` | `number` | `0.25` | Origin rect width, as a 0..1 fraction of canvas width. |\n| `fromHeight` | `number` | `0.25` | Origin rect height, as a 0..1 fraction of canvas height. |\n| `borderRadiusFrom` | `number` | `20` | Card corner radius (px) at its small origin size. |\n| `borderRadiusTo` | `number` | `0` | Card corner radius (px) once it fills the screen. |\n| `background` | `string` | `'#08080A'` | Fill behind the morphing card while it expands. |\n\nThe defaults describe a centered quarter-size rect that grows to fullscreen with rounded corners squaring off as it lands.\n\n## Usage\n\n```tsx\nimport { Easing } from 'remotion';\nimport { TransitionSeries, linearTiming } from '@remotion/transitions';\nimport { expandMorph } from './components/onda/transitions/expand-morph/expandMorph';\n\n<TransitionSeries>\n  <TransitionSeries.Sequence durationInFrames={150}><SceneA /></TransitionSeries.Sequence>\n  <TransitionSeries.Transition\n    presentation={expandMorph({ fromX: 0.4, fromY: 0.4, fromWidth: 0.2, fromHeight: 0.2 })}\n    timing={linearTiming({ durationInFrames: 24, easing: Easing.bezier(0.16, 1, 0.3, 1) })}\n  />\n  <TransitionSeries.Sequence durationInFrames={150}><SceneB /></TransitionSeries.Sequence>\n</TransitionSeries>\n```\n"
    }
  ]
}
