{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "input-group",
  "title": "Input Group",
  "description": "A shadcn-style input group component built with Ark UI primitives.",
  "dependencies": ["@ark-ui/react", "class-variance-authority"],
  "files": [
    {
      "path": "src/components/ui/input-group.tsx",
      "content": "\"use client\";\n\nimport { ark } from \"@ark-ui/react/factory\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type { ComponentProps } from \"react\";\n\nimport { cn } from \"@/lib/utils\";\n\nexport type InputGroupProps = ComponentProps<typeof ark.div>;\n\nexport const InputGroup = ({ className, ...props }: InputGroupProps) => (\n  <ark.div\n    data-slot=\"input-group\"\n    className={cn(\n      \"group/input-group relative flex w-full min-w-0 flex-row flex-wrap items-stretch overflow-hidden rounded-lg border border-input bg-background not-dark:bg-clip-padding text-base text-foreground shadow-xs/5 ring-ring/24 transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] not-has-disabled:not-has-focus-within:not-has-aria-invalid:before:shadow-[0_1px_--theme(--color-black/4%)] has-focus-within:has-aria-invalid:border-destructive/64 has-focus-within:has-aria-invalid:ring-destructive/16 has-aria-invalid:border-destructive/36 has-focus-within:border-ring has-autofill:bg-foreground/4 has-disabled:opacity-64 has-[:disabled,:focus-within,[aria-invalid]]:shadow-none has-focus-within:ring-[3px] sm:text-sm dark:bg-input/32 dark:has-autofill:bg-foreground/8 dark:has-aria-invalid:ring-destructive/24 dark:not-has-disabled:not-has-focus-within:not-has-aria-invalid:before:shadow-[0_-1px_--theme(--color-white/6%)]\",\n      \"has-data-[slot=input-group-textarea]:flex-col has-[[data-slot=input-group-addon][data-align=block-start]]:flex-col has-[[data-slot=input-group-addon][data-align=block-end]]:flex-col\",\n      className,\n    )}\n    {...props}\n  />\n);\n\nconst inputGroupAddonVariants = cva(\n  \"flex h-auto cursor-text select-none items-center justify-center gap-2 leading-none [&>kbd]:rounded-[calc(var(--radius)-5px)] in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4.5 sm:in-[[data-slot=input-group]:has([data-slot=input-control],[data-slot=textarea-control])]:[&_svg:not([class*='size-'])]:size-4 [&_svg]:-mx-0.5 not-has-[button]:**:[svg:not([class*='opacity-'])]:opacity-80\",\n  {\n    defaultVariants: {\n      align: \"inline-start\",\n    },\n    variants: {\n      align: {\n        \"block-end\":\n          \"order-last w-full justify-start px-[calc(--spacing(3)-1px)] pb-[calc(--spacing(3)-1px)] [.border-t]:pt-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n        \"block-start\":\n          \"order-first w-full justify-start px-[calc(--spacing(3)-1px)] pt-[calc(--spacing(3)-1px)] [.border-b]:pb-[calc(--spacing(3)-1px)] [[data-size=sm]+&]:px-[calc(--spacing(2.5)-1px)]\",\n        \"inline-end\":\n          \"order-last pe-[calc(--spacing(3)-1px)] has-[>:last-child[data-slot=badge]]:-me-1.5 has-[>button]:-me-2 has-[>kbd:last-child]:me-[-0.35rem] [[data-size=sm]+&]:pe-[calc(--spacing(2.5)-1px)]\",\n        \"inline-start\":\n          \"order-first ps-[calc(--spacing(3)-1px)] has-[>:last-child[data-slot=badge]]:-ms-1.5 has-[>button]:-ms-2 has-[>kbd:last-child]:ms-[-0.35rem] [[data-size=sm]+&]:ps-[calc(--spacing(2.5)-1px)]\",\n      },\n    },\n  },\n);\n\nexport type InputGroupAddonProps = ComponentProps<typeof ark.div> &\n  VariantProps<typeof inputGroupAddonVariants>;\n\nexport const InputGroupAddon = ({\n  className,\n  align = \"inline-start\",\n  ...props\n}: InputGroupAddonProps) => {\n  return (\n    <ark.div\n      className={cn(inputGroupAddonVariants({ align }), className)}\n      data-align={align}\n      data-slot=\"input-group-addon\"\n      onMouseDown={(e: React.MouseEvent<HTMLDivElement>) => {\n        const target = e.target as HTMLElement;\n        const isInteractive = target.closest(\n          \"button, a, input, select, textarea, [role='button'], [role='combobox'], [role='listbox'], [data-slot='select-trigger']\",\n        );\n        if (isInteractive) return;\n        e.preventDefault();\n        const parent = e.currentTarget.parentElement;\n        const input = parent?.querySelector<\n          HTMLInputElement | HTMLTextAreaElement\n        >(\"input, textarea\");\n        if (input && !parent?.querySelector(\"input:focus, textarea:focus\")) {\n          input.focus();\n        }\n      }}\n      {...props}\n    />\n  );\n};\n\nexport type InputGroupTextProps = ComponentProps<typeof ark.span>;\n\nexport const InputGroupText = ({\n  className,\n  ...props\n}: InputGroupTextProps) => (\n  <ark.span\n    data-slot=\"input-group-text\"\n    className={cn(\n      \"text-muted-foreground [&_svg:not([class*='size-'])]:size-4\",\n      className,\n    )}\n    {...props}\n  />\n);\n\nconst inputGroupFieldSize = {\n  default: \"\",\n  lg: \"h-9.5 leading-9.5 sm:h-8.5 sm:leading-8.5\",\n  sm: \"h-7.5 leading-7.5 sm:h-6.5 sm:leading-6.5\",\n} as const;\n\nexport type InputGroupInputProps = Omit<\n  ComponentProps<typeof ark.input>,\n  \"size\"\n> & {\n  size?: keyof typeof inputGroupFieldSize | number;\n};\n\nexport const InputGroupInput = ({\n  className,\n  size = \"default\",\n  ...props\n}: InputGroupInputProps) => (\n  <ark.input\n    data-slot=\"input-group-input\"\n    data-size={typeof size === \"string\" ? size : undefined}\n    className={cn(\n      \"order-2 min-h-8.5 min-w-0 flex-1 rounded-none border-0 bg-transparent px-[calc(--spacing(3)-1px)] leading-8.5 shadow-none outline-none [transition:background-color_5000000s_ease-in-out_0s] placeholder:text-muted-foreground/72 focus-visible:ring-0 disabled:pointer-events-none disabled:cursor-not-allowed sm:min-h-7.5 sm:leading-7.5\",\n      size === \"sm\" && inputGroupFieldSize.sm,\n      size === \"lg\" && inputGroupFieldSize.lg,\n      props.type === \"search\" &&\n        \"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none\",\n      props.type === \"file\" &&\n        \"text-muted-foreground file:me-3 file:bg-transparent file:font-medium file:text-foreground file:text-sm\",\n      className,\n    )}\n    size={typeof size === \"number\" ? size : undefined}\n    {...props}\n  />\n);\n\nexport type InputGroupTextareaProps = Omit<\n  ComponentProps<typeof ark.textarea>,\n  \"size\"\n> & {\n  size?: keyof typeof inputGroupFieldSize;\n};\n\nexport const InputGroupTextarea = ({\n  className,\n  size = \"default\",\n  ...props\n}: InputGroupTextareaProps) => (\n  <ark.textarea\n    data-slot=\"input-group-textarea\"\n    data-size={size}\n    className={cn(\n      \"order-2 min-h-16 w-full min-w-0 flex-1 resize-none rounded-none border-0 bg-transparent px-[calc(--spacing(3)-1px)] py-2.5 shadow-none outline-none [transition:background-color_5000000s_ease-in-out_0s] placeholder:text-muted-foreground/72 focus-visible:ring-0 disabled:pointer-events-none disabled:cursor-not-allowed sm:py-2 sm:text-sm\",\n      size === \"sm\" && \"min-h-14 py-2 text-sm\",\n      size === \"lg\" && \"min-h-20 py-3 text-base sm:text-sm\",\n      className,\n    )}\n    {...props}\n  />\n);\n\nexport { inputGroupAddonVariants };\n",
      "type": "registry:ui",
      "target": "src/components/ui/input-group.tsx"
    }
  ],
  "type": "registry:ui"
}
