{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "retro-input-group",
  "title": "RetroInputGroup",
  "description": "A Mac OS 9 inset text well combining an input or textarea with addons: RetroInputGroup, RetroInputGroupAddon (inline-start/inline-end/block-start/block-end), RetroInputGroupInput, RetroInputGroupTextarea, RetroInputGroupButton and RetroInputGroupText.",
  "dependencies": [
    "class-variance-authority"
  ],
  "registryDependencies": [
    "https://nostalgia-ui.com/r/nostalgia-theme.json",
    "https://nostalgia-ui.com/r/retro-button.json",
    "https://nostalgia-ui.com/r/retro-input.json",
    "https://nostalgia-ui.com/r/retro-textarea.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ui/retro-input-group.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\nimport { RetroButton } from \"@/registry/new-york/ui/retro-button\"\nimport { RetroInput } from \"@/registry/new-york/ui/retro-input\"\nimport { RetroTextarea } from \"@/registry/new-york/ui/retro-textarea\"\n\n/* ------------------------------------------------------------------ */\n/*  RetroInputGroup                                                    */\n/*                                                                     */\n/*  One inset-bevel text well that hosts an input/textarea plus        */\n/*  addons (icons, text, buttons). The well owns the bevel and the     */\n/*  focus ring; the inner control is made borderless.                  */\n/* ------------------------------------------------------------------ */\n\nconst RetroInputGroup = React.forwardRef<\n  HTMLDivElement,\n  React.ComponentProps<\"div\">\n>(function RetroInputGroup({ className, ...props }, ref) {\n  return (\n    <div\n      ref={ref}\n      role=\"group\"\n      data-slot=\"input-group\"\n      className={cn(\n        \"group/input-group relative flex w-full min-w-0 items-center\",\n        \"h-[24px] has-[>textarea]:h-auto\",\n        \"border border-os9-black bg-os9-white text-os9-black\",\n        // Inset bevel + outer 3D edge (matches RetroInput)\n        \"shadow-[inset_1px_1px_0_var(--os9-gray-700),inset_-1px_-1px_0_var(--os9-white),-1px_0_0_var(--os9-gray-700),0_-1px_0_var(--os9-gray-700),1px_0_0_var(--os9-white),0_1px_0_var(--os9-white)]\",\n        // Block addons stack the group vertically\n        \"has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col\",\n        \"has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col\",\n        // Focus ring when any inner control is focused\n        \"has-[[data-slot=input-group-control]:focus]:shadow-[0_2px_0_0_var(--os9-focus),2px_0_0_0_var(--os9-focus),0_-2px_0_0_var(--os9-focus),-2px_0_0_0_var(--os9-focus),0_0_0_1px_var(--os9-focus)]\",\n        // Invalid\n        \"has-[[data-slot][aria-invalid=true]]:border-[#cc0000]\",\n        // Disabled\n        \"has-[[data-slot=input-group-control]:disabled]:bg-os9-gray-200 has-[[data-slot=input-group-control]:disabled]:opacity-50\",\n        className\n      )}\n      {...props}\n    />\n  )\n})\nRetroInputGroup.displayName = \"RetroInputGroup\"\n\n/* ------------------------------------------------------------------ */\n/*  RetroInputGroupAddon                                               */\n/* ------------------------------------------------------------------ */\n\nconst retroInputGroupAddonVariants = cva(\n  [\n    \"flex h-auto cursor-text items-center justify-center gap-[4px] select-none\",\n    \"py-[2px] text-os9-gray-800\",\n    \"font-[family-name:var(--os9-font-sans)] text-[10px] leading-none\",\n    \"[&>svg]:pointer-events-none [&>svg]:shrink-0\",\n    \"group-has-[[data-slot=input-group-control]:disabled]/input-group:opacity-50\",\n  ],\n  {\n    variants: {\n      align: {\n        \"inline-start\": [\n          \"order-first pl-[6px]\",\n          \"has-[>button]:-ml-px has-[>button]:pl-0\",\n        ],\n        \"inline-end\": [\n          \"order-last pr-[6px]\",\n          \"has-[>button]:-mr-px has-[>button]:pr-0\",\n        ],\n        \"block-start\": [\n          \"order-first w-full justify-start px-[6px] pt-[5px]\",\n          \"[.border-b]:pb-[5px] [.border-b]:border-os9-gray-500\",\n          \"group-has-[>input]/input-group:pt-[4px]\",\n        ],\n        \"block-end\": [\n          \"order-last w-full justify-start px-[6px] pb-[5px]\",\n          \"[.border-t]:pt-[5px] [.border-t]:border-os9-gray-500\",\n          \"group-has-[>input]/input-group:pb-[4px]\",\n        ],\n      },\n    },\n    defaultVariants: {\n      align: \"inline-start\",\n    },\n  }\n)\n\ntype RetroInputGroupAddonProps = React.ComponentProps<\"div\"> &\n  VariantProps<typeof retroInputGroupAddonVariants>\n\nconst RetroInputGroupAddon = React.forwardRef<\n  HTMLDivElement,\n  RetroInputGroupAddonProps\n>(function RetroInputGroupAddon(\n  { className, align = \"inline-start\", onClick, ...props },\n  ref\n) {\n  return (\n    <div\n      ref={ref}\n      role=\"group\"\n      data-slot=\"input-group-addon\"\n      data-align={align}\n      className={cn(retroInputGroupAddonVariants({ align }), className)}\n      onClick={(event) => {\n        onClick?.(event)\n        if (event.defaultPrevented) return\n        // Clicking the addon (but not a button inside it) focuses the field.\n        if ((event.target as HTMLElement).closest(\"button\")) return\n        event.currentTarget.parentElement\n          ?.querySelector<HTMLElement>(\"[data-slot=input-group-control]\")\n          ?.focus()\n      }}\n      {...props}\n    />\n  )\n})\nRetroInputGroupAddon.displayName = \"RetroInputGroupAddon\"\n\n/* ------------------------------------------------------------------ */\n/*  RetroInputGroupButton                                              */\n/* ------------------------------------------------------------------ */\n\nconst retroInputGroupButtonVariants = cva(\"shrink-0 gap-[4px]\", {\n  variants: {\n    size: {\n      xs: \"h-[16px] px-[6px] text-[10px] [&>svg]:size-[10px]\",\n      sm: \"h-[20px] px-[8px] text-[10px]\",\n      \"icon-xs\": \"size-[16px] p-0 [&>svg]:size-[10px]\",\n      \"icon-sm\": \"size-[20px] p-0\",\n    },\n  },\n  defaultVariants: {\n    size: \"xs\",\n  },\n})\n\ntype RetroInputGroupButtonProps = Omit<\n  React.ComponentProps<typeof RetroButton>,\n  \"size\"\n> &\n  VariantProps<typeof retroInputGroupButtonVariants>\n\nconst RetroInputGroupButton = React.forwardRef<\n  HTMLButtonElement,\n  RetroInputGroupButtonProps\n>(function RetroInputGroupButton(\n  { className, type = \"button\", size = \"xs\", ...props },\n  ref\n) {\n  return (\n    <RetroButton\n      ref={ref}\n      type={type}\n      data-size={size}\n      size=\"sm\"\n      className={cn(retroInputGroupButtonVariants({ size }), className)}\n      {...props}\n    />\n  )\n})\nRetroInputGroupButton.displayName = \"RetroInputGroupButton\"\n\n/* ------------------------------------------------------------------ */\n/*  RetroInputGroupText                                                */\n/* ------------------------------------------------------------------ */\n\nconst RetroInputGroupText = React.forwardRef<\n  HTMLSpanElement,\n  React.ComponentProps<\"span\">\n>(function RetroInputGroupText({ className, ...props }, ref) {\n  return (\n    <span\n      ref={ref}\n      data-slot=\"input-group-text\"\n      className={cn(\n        \"flex items-center gap-[4px] text-os9-gray-800\",\n        \"font-[family-name:var(--os9-font-sans)] text-[10px]\",\n        \"[&_svg]:pointer-events-none\",\n        className\n      )}\n      {...props}\n    />\n  )\n})\nRetroInputGroupText.displayName = \"RetroInputGroupText\"\n\n/* ------------------------------------------------------------------ */\n/*  RetroInputGroupInput / RetroInputGroupTextarea                     */\n/* ------------------------------------------------------------------ */\n\n/** Strips the standalone bevel/ring so the group well owns them. */\nconst BARE_CONTROL = [\n  \"flex-1 min-w-0 border-0 bg-transparent\",\n  \"shadow-none focus:shadow-none focus-visible:shadow-none\",\n  \"disabled:bg-transparent disabled:opacity-100\",\n]\n\nconst RetroInputGroupInput = React.forwardRef<\n  HTMLInputElement,\n  React.ComponentProps<typeof RetroInput>\n>(function RetroInputGroupInput({ className, ...props }, ref) {\n  return (\n    <RetroInput\n      ref={ref}\n      data-slot=\"input-group-control\"\n      className={cn(BARE_CONTROL, \"h-[22px] py-0\", className)}\n      {...props}\n    />\n  )\n})\nRetroInputGroupInput.displayName = \"RetroInputGroupInput\"\n\nconst RetroInputGroupTextarea = React.forwardRef<\n  HTMLTextAreaElement,\n  React.ComponentProps<typeof RetroTextarea>\n>(function RetroInputGroupTextarea({ className, ...props }, ref) {\n  return (\n    <RetroTextarea\n      ref={ref}\n      data-slot=\"input-group-control\"\n      className={cn(BARE_CONTROL, \"min-h-[64px] resize-none py-[5px]\", className)}\n      {...props}\n    />\n  )\n})\nRetroInputGroupTextarea.displayName = \"RetroInputGroupTextarea\"\n\nexport {\n  RetroInputGroup,\n  RetroInputGroupAddon,\n  RetroInputGroupButton,\n  RetroInputGroupText,\n  RetroInputGroupInput,\n  RetroInputGroupTextarea,\n  retroInputGroupAddonVariants,\n  retroInputGroupButtonVariants,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}