{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "phone-frame",
  "title": "Phone Frame",
  "description": "A generic phone drawn in CSS around a screenshot or any content, with an island, a notch or no cut-out, that scales with its width.",
  "registryDependencies": [
    "@corsair-ui/utils"
  ],
  "files": [
    {
      "path": "registry/default/ui/phone-frame.tsx",
      "content": "import type { ComponentProps, CSSProperties } from \"react\";\nimport { cn } from \"@/registry/default/lib/utils\";\n\ntype PhoneFrameNotch = \"island\" | \"notch\" | \"none\";\n\ninterface PhoneFrameProps extends ComponentProps<\"div\"> {\n  /** Cut-out at the top of the screen: a floating pill, a classic notch, or nothing. */\n  notch?: PhoneFrameNotch;\n  /**\n   * Width / height of the whole frame, as a number (`0.5`) or a CSS ratio\n   * (`\"9 / 19.5\"`). The frame reserves this box before anything loads.\n   */\n  aspect?: number | string;\n  /**\n   * Space between the body edge and the screen. Any CSS length; `cqw` units\n   * are relative to the frame's width, so the default scales with it.\n   */\n  bezel?: string;\n  /** Corner radius of the body. The screen's radius is this minus the bezel. */\n  radius?: string;\n  /** Draw the decorative side buttons on the edges of the body. */\n  buttons?: boolean;\n  /** Classes for the screen element that holds the children. */\n  screenClassName?: string;\n}\n\n/** Decorative side buttons: [side, top, height], in percentages of the frame height. */\nconst BUTTONS = [\n  [\"left\", \"18%\", \"5%\"],\n  [\"left\", \"26%\", \"9%\"],\n  [\"left\", \"37%\", \"9%\"],\n  [\"right\", \"28%\", \"13%\"],\n] as const;\n\n/**\n * A generic phone drawn in CSS around a screenshot or any content. Set the\n * width with a class (`w-64`, `w-72`…): the bezel, corners and cut-out are in\n * container units, so they scale with it, and the height follows `aspect`, so\n * the frame takes its final size at first paint. The body, cut-out and side\n * buttons are decoration hidden from screen readers; the children keep their\n * own semantics, so give images their `alt`. A server component with no\n * motion; it works inside parallax, magnetic or tilt wrappers. For a shadow\n * that follows the rounded body, use a `drop-shadow-*` class.\n *\n * @example\n * <PhoneFrame className=\"w-72 drop-shadow-xl\">\n *   <Image src=\"/screens/home.png\" alt=\"The home screen\" fill className=\"object-cover\" />\n * </PhoneFrame>\n */\nfunction PhoneFrame({\n  notch = \"island\",\n  aspect = \"9 / 19.5\",\n  bezel = \"3.5cqw\",\n  radius = \"14cqw\",\n  buttons = true,\n  screenClassName,\n  className,\n  style,\n  children,\n  ...props\n}: PhoneFrameProps) {\n  return (\n    <div\n      data-slot=\"phone-frame\"\n      data-notch={notch}\n      className={cn(\"[container-type:inline-size] relative isolate w-64 shrink-0\", className)}\n      style={\n        {\n          aspectRatio: String(aspect),\n          \"--phone-frame-bezel\": bezel,\n          \"--phone-frame-radius\": radius,\n          ...style,\n        } as CSSProperties\n      }\n      {...props}\n    >\n      {buttons &&\n        BUTTONS.map(([side, top, height]) => (\n          <span\n            key={`${side}-${top}`}\n            aria-hidden=\"true\"\n            data-slot=\"phone-frame-button\"\n            data-side={side}\n            className={cn(\n              \"bg-border pointer-events-none absolute w-[1.2cqw]\",\n              side === \"left\" ? \"left-[-1cqw] rounded-l-[1cqw]\" : \"right-[-1cqw] rounded-r-[1cqw]\"\n            )}\n            style={{ top, height }}\n          />\n        ))}\n      <span\n        aria-hidden=\"true\"\n        data-slot=\"phone-frame-body\"\n        className=\"bg-card border-border ring-foreground/10 pointer-events-none absolute inset-0 rounded-[var(--phone-frame-radius)] border ring-1 ring-inset\"\n      />\n      <div\n        data-slot=\"phone-frame-screen\"\n        className={cn(\n          \"bg-background absolute inset-[var(--phone-frame-bezel)] overflow-hidden\",\n          \"rounded-[max(0px,calc(var(--phone-frame-radius)_-_var(--phone-frame-bezel)))]\",\n          screenClassName\n        )}\n      >\n        {children}\n        {notch === \"island\" && (\n          <span\n            aria-hidden=\"true\"\n            data-slot=\"phone-frame-notch\"\n            className=\"bg-card ring-border pointer-events-none absolute top-[2.5cqw] left-1/2 z-10 h-[8cqw] w-[28cqw] -translate-x-1/2 rounded-full ring-1\"\n          />\n        )}\n        {notch === \"notch\" && (\n          <span\n            aria-hidden=\"true\"\n            data-slot=\"phone-frame-notch\"\n            className=\"bg-card border-border pointer-events-none absolute top-0 left-1/2 z-10 h-[6.5cqw] w-[42cqw] -translate-x-1/2 rounded-b-[4.5cqw] border border-t-0\"\n          />\n        )}\n      </div>\n    </div>\n  );\n}\n\nexport { PhoneFrame, type PhoneFrameNotch, type PhoneFrameProps };\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "creative"
  ],
  "type": "registry:ui"
}