{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "corner-frame",
  "type": "registry:component",
  "title": "Content frame",
  "description": "Give an announcement or a short project brief a restrained visual boundary.",
  "categories": [
    "layout"
  ],
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/registry/overtrue/corner-frame.tsx",
      "type": "registry:component",
      "target": "components/overtrue/corner-frame.tsx",
      "content": "/** Adapted from dashboardcn (MIT), copyright 2026 dashboardcn contributors.\n * Source: https://github.com/NoahGdev/dashboardcn/tree/b1ffacbca0f7a0be60135c8665b9e8c267205c48\n *\n * MIT License\n *\n * Copyright (c) 2026 dashboardcn contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n * ---\n *\n * Portions of this project are derived from shadcn/ui and shadcn/registry-template\n * (https://github.com/shadcn-ui/ui), Copyright (c) 2023 shadcn, licensed under the\n * MIT License. The notice above applies to those portions as well.\n */\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport interface CornerFrameProps extends React.ComponentProps<\"div\"> {\n  /** Length of each registration mark, in pixels. */\n  cornerSize?: number;\n  /** Any CSS color used for the corner marks. */\n  cornerColor?: string;\n  /** Show a quiet hairline around the framed content. */\n  bordered?: boolean;\n  /** Crosshair registration marks, or brackets that hug each corner. */\n  marks?: \"cross\" | \"bracket\";\n}\n\nconst corners = [\"top-left\", \"top-right\", \"bottom-right\", \"bottom-left\"] as const;\n\nconst crossPosition = {\n  \"top-left\": \"top-0 left-0 -translate-x-1/2 -translate-y-1/2\",\n  \"top-right\": \"top-0 right-0 translate-x-1/2 -translate-y-1/2\",\n  \"bottom-right\": \"right-0 bottom-0 translate-x-1/2 translate-y-1/2\",\n  \"bottom-left\": \"bottom-0 left-0 -translate-x-1/2 translate-y-1/2\",\n};\n\nconst bracketPosition = {\n  \"top-left\": \"-top-px -left-px border-t-2 border-l-2\",\n  \"top-right\": \"-top-px -right-px border-t-2 border-r-2\",\n  \"bottom-right\": \"-right-px -bottom-px border-r-2 border-b-2\",\n  \"bottom-left\": \"-bottom-px -left-px border-b-2 border-l-2\",\n};\n\n/** A content frame with small registration marks at every corner. */\nfunction CornerFrame({\n  cornerSize = 10,\n  cornerColor = \"var(--color-muted-foreground)\",\n  bordered = true,\n  marks = \"cross\",\n  className,\n  children,\n  style,\n  ...props\n}: CornerFrameProps) {\n  const cornerStyle = {\n    \"--corner-size\": `${cornerSize}px`,\n    \"--corner-color\": cornerColor,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <div\n      data-slot=\"corner-frame\"\n      data-marks={marks}\n      className={cn(\"relative\", bordered && \"border border-border/70\", className)}\n      style={cornerStyle}\n      {...props}\n    >\n      {children}\n      {corners.map((corner, index) => (\n        <span\n          key={corner}\n          data-corner={corner}\n          aria-hidden=\"true\"\n          className={cn(\n            \"pointer-events-none absolute z-10 size-(--corner-size)\",\n            // Marks settle in one after another, then stay still.\n            \"transition-[scale,opacity] duration-700 ease-[cubic-bezier(0.22,1,0.36,1)] motion-safe:starting:scale-50 motion-safe:starting:opacity-0 motion-reduce:transition-none\",\n            index === 1 && \"delay-[40ms]\",\n            index === 2 && \"delay-[80ms]\",\n            index === 3 && \"delay-[120ms]\",\n            \"dark:drop-shadow-[0_0_4px_color-mix(in_oklab,var(--corner-color)_65%,transparent)]\",\n            marks === \"bracket\"\n              ? cn(\"border-(--corner-color)\", bracketPosition[corner])\n              : cn(\n                  crossPosition[corner],\n                  \"before:absolute before:top-1/2 before:h-px before:w-full before:-translate-y-1/2 before:bg-(--corner-color)\",\n                  \"after:absolute after:left-1/2 after:h-full after:w-px after:-translate-x-1/2 after:bg-(--corner-color)\",\n                ),\n          )}\n        />\n      ))}\n    </div>\n  );\n}\n\nexport { CornerFrame };\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/components/corner-frame. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
