{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "retro-group-box",
  "title": "RetroGroupBox",
  "description": "Mac OS 9 primary/secondary group box: an etched frame whose title (text, checkbox or pop-up) interrupts the top border.",
  "dependencies": [
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://nostalgia-ui.com/r/nostalgia-theme.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/retro-group-box.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\n/* ------------------------------------------------------------------ */\n/*  Variants                                                           */\n/* ------------------------------------------------------------------ */\n\n/*\n * The etched frame is a dark 1px line with a white 1px line offset\n * down/right of it: border + inset highlight (top/left) + outer highlight\n * (bottom/right). Primary uses gray-700, secondary the lighter gray-500.\n */\nconst retroGroupBoxFrameVariants = cva(\n  [\"border\", \"shadow-[inset_1px_1px_0_var(--os9-white),1px_1px_0_var(--os9-white)]\"],\n  {\n    variants: {\n      variant: {\n        primary: \"border-os9-gray-700\",\n        secondary: \"border-os9-gray-500\",\n      },\n    },\n    defaultVariants: {\n      variant: \"primary\",\n    },\n  }\n)\n\n/* ------------------------------------------------------------------ */\n/*  RetroGroupBox                                                      */\n/* ------------------------------------------------------------------ */\n\ninterface RetroGroupBoxProps\n  extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\">,\n    VariantProps<typeof retroGroupBoxFrameVariants> {\n  /**\n   * Title that interrupts the top border. A string renders as Charcoal\n   * text; any ReactNode works (e.g. a RetroCheckbox + label, or a\n   * RetroSelect pop-up) for checkbox / pop-up group boxes.\n   */\n  title?: React.ReactNode\n  /** Extra classes for the title plate (set its background here if the\n   *  group box sits on something other than the default gray-200). */\n  titleClassName?: string\n  /** Extra classes for the inner content frame. */\n  contentClassName?: string\n}\n\nconst RetroGroupBox = React.forwardRef<HTMLDivElement, RetroGroupBoxProps>(\n  function RetroGroupBox(\n    {\n      className,\n      variant,\n      title,\n      titleClassName,\n      contentClassName,\n      children,\n      ...props\n    },\n    ref\n  ) {\n    const titleId = React.useId()\n    const hasTitle = title != null && title !== false\n    const isTextTitle = typeof title === \"string\" || typeof title === \"number\"\n\n    return (\n      <div\n        ref={ref}\n        role=\"group\"\n        aria-labelledby={hasTitle ? titleId : undefined}\n        className={cn(\"relative\", hasTitle ? \"pt-[8px]\" : \"pt-px\", className)}\n        {...props}\n      >\n        <div\n          className={cn(\n            retroGroupBoxFrameVariants({ variant }),\n            \"px-[10px] pb-[10px]\",\n            hasTitle ? \"pt-[14px]\" : \"pt-[10px]\",\n            contentClassName\n          )}\n        >\n          {children}\n        </div>\n\n        {hasTitle ? (\n          <div\n            id={titleId}\n            className={cn(\n              // Plate masks the etched line behind the title. Override the\n              // colour via --retro-group-box-bg or titleClassName.\n              \"absolute left-[8px] top-0 flex h-[16px] items-center gap-[4px] px-[4px]\",\n              \"bg-[var(--retro-group-box-bg,var(--os9-gray-200))]\",\n              isTextTitle &&\n                \"font-[family-name:var(--os9-font-heading)] text-[12px] tracking-[0.42px] leading-[0.98] text-os9-black\",\n              titleClassName\n            )}\n          >\n            {title}\n          </div>\n        ) : null}\n      </div>\n    )\n  }\n)\nRetroGroupBox.displayName = \"RetroGroupBox\"\n\nexport { RetroGroupBox, retroGroupBoxFrameVariants }\nexport type { RetroGroupBoxProps }\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}