{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "iphone-duo",
  "type": "registry:ui",
  "files": [
    {
      "path": "registry/designali/ui/apple/iphone-duo.tsx",
      "content": "import * as React from \"react\";\n\ninterface IPhoneDuoProps {\n  children?: React.ReactNode;\n  className?: string;\n\n  /** Phone size */\n  size?: \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n  /** Phone orientation (Ignored when side is \"frontback\") */\n  orientation?: \"portrait\" | \"landscape\";\n\n  /** Phone view side (front, back, or frontback) */\n  side?: \"front\" | \"back\" | \"frontback\";\n\n  /** Frame color */\n  color?: \"night-sky\" | \"star-white\";\n}\n\ntype PhoneColor = NonNullable<IPhoneDuoProps[\"color\"]>;\n\ninterface SideImageSet {\n  portrait: string;\n  landscape: string;\n}\n\ninterface OrientationImageSet {\n  front: SideImageSet;\n  back: SideImageSet;\n  frontback: string; // Single image without orientation\n}\n\n// ==========================================\n// 📱 DEVICE IMAGES CONFIGURATION\n// ==========================================\nconst phoneImages: Record<PhoneColor, OrientationImageSet> = {\n  \"night-sky\": {\n    front: {\n      portrait: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Night%20Sky%20-%20Inner%20Open%20Portrait.png?updatedAt=1790829512133\",\n      landscape: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Night%20Sky%20-%20Inner%20Open%20Landscape.png?updatedAt=1790829512135\",\n    },\n    back: {\n      portrait: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Night%20Sky%20-%20Outer%20Closed%20Portrait.png?updatedAt=1790829511949\",\n      landscape: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Night%20Sky%20-%20Outer%20Closed%20Landscape.png?updatedAt=1790829511938\",\n    },\n    frontback: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Night%20Sky%20-%20Outer%20Open.png?updatedAt=1790829512290\",\n  },\n  \"star-white\": {\n    front: {\n      portrait: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Star%20White%20-%20Inner%20Open%20Portrait.png?updatedAt=1790829512079\",\n      landscape: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Star%20White%20-%20Inner%20Open%20Landscape.png?updatedAt=1790829512033\",\n    },\n    back: {\n      portrait: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Star%20White%20-%20Outer%20Closed%20Portrait.png?updatedAt=1790829511959\",\n      landscape: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Star%20White%20-%20Outer%20Closed%20Landscape.png?updatedAt=1790829511960\",\n    },\n    frontback: \"https://ik.imagekit.io/designali/images/apple/iPhone%20Duo/iPhone%20Duo%20-%20Star%20White%20-%20Outer%20Open.png?updatedAt=1790829512168\",\n  },\n};\n\n// ==========================================\n// 📏 OVERALL DEVICE HEIGHT SIZES\n// ==========================================\nconst deviceSizeClasses = {\n  // --- 1. FRONT VIEW SIZES ---\n  front: {\n    portrait: {\n      sm: \"h-[24rem]\",\n      md: \"h-[32rem]\",\n      lg: \"h-[40rem]\",\n      xl: \"h-[48rem]\",\n    },\n    landscape: {\n      sm: \"h-[12rem]\",\n      md: \"h-[16rem]\",\n      lg: \"h-[20rem]\",\n      xl: \"h-[24rem]\",\n    },\n  },\n  \n  // --- 2. BACK VIEW SIZES ---\n  back: {\n    portrait: {\n      sm: \"h-[24rem]\",\n      md: \"h-[32rem]\",\n      lg: \"h-[40rem]\",\n      xl: \"h-[48rem]\",\n    },\n    landscape: {\n      sm: \"h-[12rem]\",\n      md: \"h-[16rem]\",\n      lg: \"h-[20rem]\",\n      xl: \"h-[24rem]\",\n    },\n  },\n\n  // --- 3. FRONTBACK VIEW SIZES (NO ORIENTATION) ---\n  frontback: {\n    sm: \"h-[40rem]\",\n    md: \"h-[48rem]\",\n    lg: \"h-[52rem]\",\n    xl: \"h-[64rem]\",\n  },\n};\n\n// ==========================================\n// 🖼️ ASPECT RATIO CLASSES\n// ==========================================\nconst aspectRatioClasses = {\n  // --- 1. FRONT ASPECT RATIO ---\n  front: {\n    portrait: \"aspect-[9/19.5]\",\n    landscape: \"aspect-[19.5/9]\",\n  },\n  \n  // --- 2. BACK ASPECT RATIO ---\n  back: {\n    portrait: \"aspect-[9/19.5]\",\n    landscape: \"aspect-[19.5/9]\",\n  },\n\n  // --- 3. FRONTBACK ASPECT RATIO ---\n  frontback: \"aspect-[9/19.5]\",\n};\n\n// ==========================================\n// 🎨 BORDER RADIUS (ROUNDED) CLASSES\n// ==========================================\nconst roundedClasses = {\n  // --- 1. FRONT VIEW ROUNDED ---\n  front: {\n    portrait: {\n      sm: \"rounded-[16px]\",\n      md: \"rounded-[10px]\",\n      lg: \"rounded-[16px]\",\n      xl: \"rounded-[20px]\",\n    },\n    landscape: {\n      sm: \"rounded-[16px]\",\n      md: \"rounded-[20px]\",\n      lg: \"rounded-[24px]\",\n      xl: \"rounded-[30px]\",\n    },\n  },\n  \n  // --- 2. BACK VIEW ROUNDED ---\n  back: {\n    portrait: {\n      sm: \"rounded-l-[4px] rounded-r-[12px]\",\n      md: \"rounded-l-[6px] rounded-r-[14px]\",\n      lg: \"rounded-l-[8px] rounded-r-[16px]\",\n      xl: \"rounded-l-[10px] rounded-r-[20px]\",\n    },\n    landscape: {\n      sm: \"rounded-t-[20px] rounded-b-[6px]\",\n      md: \"rounded-t-[30px] rounded-b-[10px]\",\n      lg: \"rounded-t-[30px] rounded-b-[10px]\",\n      xl: \"rounded-t-[30px] rounded-b-[10px]\",\n    },\n  },\n\n  // --- 3. FRONTBACK VIEW ROUNDED (NO ORIENTATION) ---\n  frontback: {\n    sm: \"rounded-l-[1px] rounded-r-[12px]\",\n    md: \"rounded-l-[2px] rounded-r-[16px]\",\n    lg: \"rounded-l-[4px] rounded-r-[20px]\",\n    xl: \"rounded-l-[6px] rounded-r-[24px]\",\n  },\n};\n\n// ==========================================\n// 📐 SCREEN POSITION CLASSES (INSET)\n// ==========================================\nconst screenPositionClasses = {\n  // --- 1. FRONT VIEW POSITIONS ---\n  front: {\n    portrait: {\n      sm: \"left-[5.5%] right-[5.5%] top-[19.5%] bottom-[20%]\",\n      md: \"left-[5.5%] right-[5.5%] top-[20%] bottom-[20%]\",\n      lg: \"left-[5%] right-[5%] top-[20%] bottom-[20%]\",\n      xl: \"left-[5%] right-[5%] top-[20%] bottom-[20%]\",\n    },\n    landscape: {\n      sm: \"left-[20.5%] right-[20.5%] top-[5%] bottom-[4.5%]\",\n      md: \"left-[20.5%] right-[20.5%] top-[5%] bottom-[4.5%]\",\n      lg: \"left-[20%] right-[20%] top-[5%] bottom-[5%]\",\n      xl: \"left-[20%] right-[20%] top-[5%] bottom-[5%]\",\n    },\n  },\n\n  // --- 2. BACK VIEW POSITIONS ---\n  back: {\n    portrait: {\n      sm: \"left-[5.5%] right-[5.5%] top-[19.5%] bottom-[20%]\",\n      md: \"left-[5.5%] right-[5.5%] top-[20%] bottom-[20%]\",\n      lg: \"left-[5%] right-[5%] top-[20%] bottom-[20%]\",\n      xl: \"left-[5%] right-[5%] top-[20%] bottom-[20%]\",\n    },\n    landscape: {\n      sm: \"left-[20%] right-[20%] top-[5%] bottom-[4.5%]\",\n      md: \"left-[20%] right-[20%] top-[5%] bottom-[4.5%]\",\n      lg: \"left-[20%] right-[20%] top-[5%] bottom-[5%]\",\n      xl: \"left-[20%] right-[20%] top-[5%] bottom-[5%]\",\n    },\n  },\n\n  // --- 3. FRONTBACK VIEW POSITIONS (NO ORIENTATION) ---\n  frontback: {\n    sm: \"left-[51%] right-[2%] top-[34.5%] bottom-[34.5%]\",\n    md: \"left-[51%] right-[2%] top-[34.5%] bottom-[34.5%]\",\n    lg: \"left-[51%] right-[2%] top-[34.5%] bottom-[34.5%]\",\n    xl: \"left-[51%] right-[2%] top-[34.5%] bottom-[34.5%]\",\n  },\n};\n\n// ==========================================\n// 🚀 MAIN COMPONENT\n// ==========================================\nexport function IPhoneDuo({\n  children,\n  className = \"\",\n  size = \"xl\",\n  orientation = \"portrait\",\n  side = \"frontback\",\n  color = \"star-white\",\n}: IPhoneDuoProps) {\n  \n  const isFrontBack = side === \"frontback\";\n  const isLandscape = !isFrontBack && orientation === \"landscape\";\n  const currentOrientation = isLandscape ? \"landscape\" : \"portrait\";\n  \n  const colorImages = phoneImages[color] || phoneImages[\"night-sky\"];\n\n  // Dynamic class variables\n  let frameImage = \"\";\n  let currentSizeClass = \"\";\n  let currentPositionClass = \"\";\n  let currentRoundedClass = \"\";\n  let currentAspectRatioClass = \"\";\n\n  if (isFrontBack) {\n    // Frontback view handling (no orientation)\n    frameImage = colorImages.frontback;\n    currentSizeClass = deviceSizeClasses.frontback[size];\n    currentPositionClass = screenPositionClasses.frontback[size];\n    currentRoundedClass = roundedClasses.frontback[size];\n    currentAspectRatioClass = aspectRatioClasses.frontback;\n  } else {\n    // Front and Back views handling (uses orientation)\n    const sideImages = colorImages[side] as SideImageSet;\n    frameImage = isLandscape ? sideImages.landscape : sideImages.portrait;\n    currentSizeClass = deviceSizeClasses[side][currentOrientation][size];\n    currentPositionClass = screenPositionClasses[side][currentOrientation][size];\n    currentRoundedClass = roundedClasses[side][currentOrientation][size];\n    currentAspectRatioClass = aspectRatioClasses[side][currentOrientation];\n  }\n\n  return (\n    <div\n      className={`\n        relative inline-block\n        ${currentSizeClass}\n        ${currentAspectRatioClass}\n        ${className}\n      `}\n    >\n      <img\n        src={frameImage}\n        alt=\"iPhone Duo Mockup\"\n        className=\"pointer-events-none absolute inset-0 z-10 h-full w-full select-none object-contain\"\n      />\n\n      {children && (\n        <div\n          className={`\n            absolute overflow-hidden bg-background\n            ${currentPositionClass}\n            ${currentRoundedClass}\n          `}\n        >\n          <div className=\"h-full w-full overflow-y-auto\">\n            {children}\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}",
      "type": "registry:ui"
    }
  ]
}