{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "split-screen",
  "type": "registry:component",
  "title": "SplitScreen",
  "description": "A two-pane split layout — left and right content panes (any JSX) divided by a thin token line. A container that wraps arbitrary content; the two panes slide in from their outer edges on the house spring.",
  "dependencies": [
    "remotion",
    "zod",
    "react"
  ],
  "registryDependencies": [
    "lib-canvas",
    "lib-hooks"
  ],
  "files": [
    {
      "path": "registry/components/split-screen/SplitScreen.tsx",
      "type": "registry:component",
      "target": "components/onda/split-screen/SplitScreen.tsx",
      "content": "import React from 'react';\nimport { PlacementBox } from '../../../lib/canvas';\nimport { useEntrance } from '../../../lib/hooks';\nimport { splitScreenSchema, type SplitScreenSchemaProps } from './schema';\n\nexport { splitScreenSchema };\n\n/**\n * Props for {@link SplitScreen}: the serializable schema props plus the two\n * content panes. Like `browser-frame` / `device-frame`'s `children`, the\n * `left` / `right` `ReactNode`s can't be Zod-validated, so they live only here.\n */\nexport type SplitScreenProps = SplitScreenSchemaProps & {\n  /** Content for the left (or top) pane. */\n  left?: React.ReactNode;\n  /** Content for the right (or bottom) pane. */\n  right?: React.ReactNode;\n};\n\nconst DIVIDER = 'var(--onda-border, #1C1C22)';\nconst PANE_BG = 'var(--onda-surface, #0E0E12)';\nconst PLACEHOLDER = 'var(--onda-faint, #56565F)';\n\nfunction Pane({\n  content,\n  style,\n  flex,\n  label,\n}: {\n  content: React.ReactNode;\n  style: { opacity: number; transform: string };\n  flex: number;\n  label: string;\n}) {\n  return (\n    <div\n      style={{\n        flex: `${flex} 1 0`,\n        minWidth: 0,\n        minHeight: 0,\n        position: 'relative',\n        overflow: 'hidden',\n        background: PANE_BG,\n        opacity: style.opacity,\n        transform: style.transform,\n      }}\n    >\n      {content ?? (\n        <div\n          style={{\n            width: '100%',\n            height: '100%',\n            display: 'grid',\n            placeItems: 'center',\n            color: PLACEHOLDER,\n            fontFamily: 'var(--onda-font-body, \"Space Grotesk\", sans-serif)',\n            fontSize: 28,\n            letterSpacing: '0.04em',\n          }}\n        >\n          {label}\n        </div>\n      )}\n    </div>\n  );\n}\n\n/**\n * A two-pane split layout — `left` and `right` content panes (any JSX) divided\n * by a thin token line. A **container**, the documented exception to the\n * \"self-contained\" rule, since wrapping arbitrary content is its whole job.\n * When `animate`, the two panes slide in from their outer edges on the house\n * spring (a 16px settle), each from the opposite side.\n *\n * @example\n * <SplitScreen left={<Before />} right={<After />} placement=\"center\" />\n */\nexport const SplitScreen: React.FC<SplitScreenProps> = ({\n  left,\n  right,\n  orientation,\n  ratio,\n  gap,\n  divider,\n  animate,\n  delay,\n  width,\n  height,\n  placement,\n}) => {\n  const horizontal = orientation === 'horizontal';\n\n  // Panes settle in from their outer edges: left from the left, right from the\n  // right (or top/bottom when vertical). House spring, 16px travel.\n  const leftEntrance = useEntrance({\n    type: 'slide',\n    delay,\n    direction: horizontal ? 'left' : 'up',\n    distance: 16,\n  });\n  const rightEntrance = useEntrance({\n    type: 'slide',\n    delay,\n    direction: horizontal ? 'right' : 'down',\n    distance: 16,\n  });\n\n  const still = { opacity: 1, transform: 'none' };\n  const leftStyle = animate ? leftEntrance : still;\n  const rightStyle = animate ? rightEntrance : still;\n\n  return (\n    <PlacementBox placement={placement}>\n      <div\n        style={{\n          width,\n          height,\n          display: 'flex',\n          flexDirection: horizontal ? 'row' : 'column',\n          gap,\n          overflow: 'hidden',\n          borderRadius: 20,\n          background: 'var(--onda-bg, #08080A)',\n        }}\n      >\n        <Pane content={left} style={leftStyle} flex={ratio} label={horizontal ? 'Left' : 'Top'} />\n        {divider && (\n          <div\n            style={{\n              flex: '0 0 auto',\n              alignSelf: 'stretch',\n              background: DIVIDER,\n              ...(horizontal ? { width: 1 } : { height: 1 }),\n            }}\n          />\n        )}\n        <Pane content={right} style={rightStyle} flex={1 - ratio} label={horizontal ? 'Right' : 'Bottom'} />\n      </div>\n    </PlacementBox>\n  );\n};\n\nexport default SplitScreen;\n"
    },
    {
      "path": "registry/components/split-screen/schema.ts",
      "type": "registry:component",
      "target": "components/onda/split-screen/schema.ts",
      "content": "import { z } from 'zod';\nimport { placementSchema } from '../../../lib/canvas-schemas';\n\n/**\n * Zod schema for {@link SplitScreen}'s *serializable* props.\n *\n * The two content panes (`left` / `right`) are `React.ReactNode` and can't be\n * Zod-validated, so — like `browser-frame` / `device-frame` do for `children`\n * — they live only on the component's TS props, not in this schema. This schema\n * covers everything that is plain data (layout, ratio, animation).\n */\nexport const splitScreenSchema = z.object({\n  /** Discriminator literal — matches this entry's registry slug. Auto-populated when omitted. */\n  kind: z.literal('split-screen').default('split-screen'),\n  /** Pane axis: `horizontal` = side-by-side, `vertical` = stacked. */\n  orientation: z.enum(['horizontal', 'vertical']).default('horizontal'),\n  /** Fraction (0..1) of the main axis given to the `left` (or top) pane. */\n  ratio: z.number().min(0).max(1).default(0.5),\n  /** Gap between the two panes in px. */\n  gap: z.number().min(0).default(0),\n  /** Draw a thin token divider in the gap between the panes. */\n  divider: z.boolean().default(true),\n  /** Slide the two panes in from their outer edges on the house spring. */\n  animate: z.boolean().default(true),\n  /** Frames before the entrance. */\n  delay: z.number().int().min(0).default(0),\n  /** Overall width in px. */\n  width: z.number().default(1280),\n  /** Overall height in px. */\n  height: z.number().default(720),\n  /** Where on the canvas this sits. */\n  placement: placementSchema.optional(),\n});\n\n/**\n * Inferred props for {@link SplitScreen}. The `left` / `right` `ReactNode`\n * panes are added on top of this in the component file (see `SplitScreenProps`).\n */\nexport type SplitScreenSchemaProps = z.infer<typeof splitScreenSchema>;\n"
    },
    {
      "path": "registry/components/split-screen/split-screen.meta.json",
      "type": "registry:file",
      "target": "components/onda/split-screen/split-screen.meta.json",
      "content": "{\n  \"name\": \"split-screen\",\n  \"title\": \"SplitScreen\",\n  \"description\": \"A two-pane split layout — left and right content panes (any JSX) divided by a thin token line. A container that wraps arbitrary content; the two panes slide in from their outer edges on the house spring.\",\n  \"pickWhen\": \"two things shown side-by-side as equals — before/after, comparison, code-and-result. Use `code-diff` for inline before/after of code itself.\",\n  \"category\": \"interface\",\n  \"tags\": [\n    \"layout\",\n    \"split\",\n    \"container\",\n    \"comparison\",\n    \"two-pane\"\n  ],\n  \"dependencies\": [\n    \"remotion\",\n    \"zod\",\n    \"react\"\n  ]\n}\n"
    },
    {
      "path": "registry/components/split-screen/README.md",
      "type": "registry:file",
      "target": "components/onda/split-screen/README.md",
      "content": "# SplitScreen\n\nA two-pane split layout. Pass `left` and `right` content (any JSX); they sit side-by-side (or stacked when `orientation=\"vertical\"`), divided by a thin token line. Like `browser-frame` and `device-frame`, it's a **container** — the documented exception to the component contract's \"self-contained\" rule, since wrapping arbitrary content is its entire purpose. When `animate`, the two panes slide in from their outer edges on the house spring (a 16px settle), each from the opposite side. Use `ratio` to make one pane larger than the other.\n\nBecause the panes are `React.ReactNode`, they live on the component's TS props rather than in the Zod schema (`splitScreenSchema` covers only the serializable layout props) — the same approach `browser-frame` / `device-frame` take for `children`.\n\n## Props\n\n| Prop | Type | Default | Notes |\n| --- | --- | --- | --- |\n| `left` | `ReactNode?` | — | Left (or top) pane content. |\n| `right` | `ReactNode?` | — | Right (or bottom) pane content. |\n| `orientation` | `'horizontal' \\| 'vertical'` | `'horizontal'` | Pane axis — side-by-side or stacked. |\n| `ratio` | `number` | `0.5` | Fraction (0..1) of the main axis given to the `left`/top pane. |\n| `gap` | `number` | `0` | Gap between panes in px. |\n| `divider` | `boolean` | `true` | Thin token line between panes. |\n| `animate` | `boolean` | `true` | Slide the panes in from their outer edges. |\n| `delay` | `number` | `0` | Frames before the entrance. |\n| `width` | `number` | `1280` | Overall width in px. |\n| `height` | `number` | `720` | Overall height in px. |\n| `placement` | region or `{x,y,anchor}` | — | Canvas placement. |\n\n## Usage\n\n```tsx\nimport { SplitScreen } from './components/onda/split-screen/SplitScreen';\n\nexport const CompareScene = () => (\n  <SplitScreen\n    placement=\"center\"\n    ratio={0.5}\n    left={\n      <div style={{ display: 'grid', placeItems: 'center', height: '100%', color: '#8E8E98', fontFamily: '\"Clash Display\", sans-serif', fontSize: 64 }}>\n        Before\n      </div>\n    }\n    right={\n      <div style={{ display: 'grid', placeItems: 'center', height: '100%', color: '#F2F2F4', fontFamily: '\"Clash Display\", sans-serif', fontSize: 64 }}>\n        After\n      </div>\n    }\n  />\n);\n```\n"
    }
  ]
}
