{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "input",
  "description": "input (ui)",
  "dependencies": [
    "@base-ui/react",
    "class-variance-authority"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "src/registry/default/ui/input.tsx",
      "content": "\"use client\";\n\nimport { Input as InputPrimitive } from \"@base-ui/react/input\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport type * as React from \"react\";\nimport { cn } from \"@/registry/default/lib/utils\";\n\nexport const inputVariants = cva(\n  [\n    \"group/input relative inline-flex w-full min-w-0 items-center text-foreground outline-none\",\n    \"focus-within:shadow-[inset_0_0_0_0.125rem_var(--color-primary)]\",\n    \"has-[[aria-invalid=true]]:shadow-[inset_0_0_0_0.125rem_var(--color-destructive)]! data-invalid:shadow-[inset_0_0_0_0.125rem_var(--color-destructive)]!\",\n    \"has-autofill:bg-[color-mix(in_oklab,var(--color-background),var(--color-foreground)_8%)]\",\n    \"has-disabled:pointer-events-none has-disabled:opacity-38 data-disabled:pointer-events-none data-disabled:opacity-38\",\n    \"[&_svg]:shrink-0 [&_svg]:transition-none\",\n    \"[&_button]:transition-none\",\n    \"[&_[data-slot=ripple-hover]]:transition-none!\",\n    \"[&_svg:not(button_*)]:text-muted-foreground focus-within:[&_svg:not(button_*)]:text-primary\",\n    \"has-[[aria-invalid=true]]:[&_svg:not(button_*)]:text-destructive! data-invalid:[&_svg:not(button_*)]:text-destructive!\",\n    \"[&_button[data-variant=ghost]:hover]:text-foreground [&_button[data-variant=ghost]:hover_svg]:text-foreground [&_button[data-variant=ghost]]:text-muted-foreground focus-within:[&_button[data-variant=ghost]]:text-primary\",\n    \"[&:not(:has([data-align=block-start],[data-align=block-end]))_button]:h-[calc(100%-0.5rem)]\",\n    \"[&:not(:has([data-align=block-start],[data-align=block-end]))_button[data-size^=icon]]:aspect-square [&:not(:has([data-align=block-start],[data-align=block-end]))_button[data-size^=icon]]:w-auto\",\n    \"[&:not(:has([data-align=block-start],[data-align=block-end]))_[data-slot=badge]:not([data-size=dot])]:h-[calc(100%-0.5rem)] [&:not(:has([data-align=block-start],[data-align=block-end]))_[data-slot=badge]:not([data-size=dot])]:px-3\",\n    \"data-[shape=rounded]:[&_button]:[--r-full:0.5rem] data-[shape=square]:[&_button]:[--r-full:0.375rem]\",\n    \"data-[shape=rounded]:[&_[data-slot=badge]]:rounded-lg data-[shape=square]:[&_[data-slot=badge]]:rounded-md\",\n  ],\n  {\n    defaultVariants: {\n      shape: \"pill\",\n      size: \"default\",\n      variant: \"filled\",\n    },\n    variants: {\n      shape: {\n        pill: \"rounded-full\",\n        round: \"rounded-full\",\n        rounded: \"rounded-xl\",\n        square: \"rounded-lg\",\n      },\n      size: {\n        default:\n          \"h-10 gap-2.5 px-4 text-sm has-[>[data-slot=badge]:first-child]:ps-1 has-[>button:first-child]:ps-1 has-[>[data-slot=badge]:last-child]:pe-1 has-[>button:last-child]:pe-1 [&_svg:not([class*='size-'])]:size-4.5\",\n        lg: \"h-12 gap-3 px-5 text-base has-[>[data-slot=badge]:first-child]:ps-1 has-[>button:first-child]:ps-1 has-[>[data-slot=badge]:last-child]:pe-1 has-[>button:last-child]:pe-1 [&_svg:not([class*='size-'])]:size-5\",\n        md: \"h-10 gap-2.5 px-4 text-sm has-[>[data-slot=badge]:first-child]:ps-1 has-[>button:first-child]:ps-1 has-[>[data-slot=badge]:last-child]:pe-1 has-[>button:last-child]:pe-1 [&_svg:not([class*='size-'])]:size-4.5\",\n        sm: \"h-9 gap-2 px-3 text-sm has-[>[data-slot=badge]:first-child]:ps-1 has-[>button:first-child]:ps-1 has-[>[data-slot=badge]:last-child]:pe-1 has-[>button:last-child]:pe-1 [&_svg:not([class*='size-'])]:size-4\",\n      },\n      variant: {\n        filled:\n          \"bg-[color-mix(in_oklab,var(--color-background),var(--color-foreground)_6%)]\",\n        outline:\n          \"bg-background shadow-[inset_0_0_0_0.0625rem_var(--color-input)]\",\n        outlined:\n          \"bg-background shadow-[inset_0_0_0_0.0625rem_var(--color-input)]\",\n      },\n    },\n  },\n);\n\nexport type InputProps = Omit<\n  InputPrimitive.Props & React.RefAttributes<HTMLInputElement>,\n  \"size\"\n> &\n  VariantProps<typeof inputVariants> & {\n    size?: VariantProps<typeof inputVariants>[\"size\"] | number;\n    startAddon?: React.ReactNode;\n    unstyled?: boolean;\n    nativeInput?: boolean;\n    children?: React.ReactNode;\n  };\n\nexport function Input({\n  className,\n  variant = \"filled\",\n  shape = \"pill\",\n  size = \"default\",\n  startAddon,\n  unstyled = false,\n  nativeInput = false,\n  style,\n  children,\n  ...props\n}: InputProps): React.ReactElement {\n  const variantSize = typeof size === \"number\" ? \"default\" : size;\n  const htmlSize = typeof size === \"number\" ? size : undefined;\n  const inputClassName = cn(\n    \"m-0 h-full w-full min-w-0 flex-1 border-0 bg-transparent p-0 text-foreground outline-none ring-0\",\n    \"placeholder:text-muted-foreground/72 focus:outline-none focus:ring-0 disabled:cursor-not-allowed\",\n    \"[transition:background-color_5000000s_ease-in-out_0s] autofill:[-webkit-text-fill-color:var(--foreground)]\",\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      \"h-auto cursor-pointer text-muted-foreground file:me-3 file:cursor-pointer file:border-0 file:bg-transparent file:p-0 file:font-medium file:text-foreground file:text-sm\",\n  );\n\n  return (\n    <span\n      className={\n        cn(\n          !unstyled && inputVariants({ shape, size: variantSize, variant }),\n          className,\n        ) || undefined\n      }\n      data-shape={shape}\n      data-size={variantSize}\n      data-slot=\"input-control\"\n      data-variant={variant}\n    >\n      {startAddon && (\n        <span\n          aria-hidden=\"true\"\n          className=\"pointer-events-none flex shrink-0 items-center justify-center\"\n          data-slot=\"input-start-addon\"\n        >\n          {startAddon}\n        </span>\n      )}\n      {nativeInput ? (\n        <input\n          className={inputClassName}\n          data-slot=\"input\"\n          size={htmlSize}\n          style={typeof style === \"function\" ? undefined : style}\n          {...props}\n        />\n      ) : (\n        <InputPrimitive\n          className={inputClassName}\n          data-slot=\"input\"\n          size={htmlSize}\n          style={style}\n          {...props}\n        />\n      )}\n      {children}\n    </span>\n  );\n}\n\nexport { InputPrimitive };\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "ui"
  ],
  "type": "registry:ui"
}