{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "input",
  "title": "Input",
  "description": "Six field styles with top, floating, inline or hidden labels, focus ring, glow, underline-grow or lift, error shake with sliding messages, icon and text addons, clear button, counter and auto-growing textarea.",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "https://goodui.dev/r/goodui-motion.json",
    "https://goodui.dev/r/locale.json"
  ],
  "files": [
    {
      "path": "registry/components/core/input.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\nimport { CircleAlert, CircleCheck, X } from \"lucide-react\"\nimport { cn } from \"@/lib/utils\"\nimport { useLabels } from \"@/lib/goodui-locale\"\nimport { GooduiTokens, spring } from \"@/lib/goodui-motion\"\n\n/*\n * One field, independent layers: every axis combines with every other.\n *   variant    how it is painted         tone       focus color\n *   labelMode  top / floating / inline   animation  how focus looks\n *   state      default / error / success (message slides in, error shakes)\n *   shape, size, shadow, leading / trailing (icon or text), addonBefore / addonAfter, clearable, multiline.\n */\n\nexport type InputVariant = \"outline\" | \"filled\" | \"underline\" | \"ghost\" | \"neo\" | \"glass\"\nexport type InputTone = \"primary\" | \"neutral\" | \"success\" | \"warning\" | \"danger\" | \"info\"\nexport type InputSize = \"sm\" | \"md\" | \"lg\"\nexport type InputShape = \"square\" | \"rounded\" | \"pill\"\nexport type InputLabelMode = \"top\" | \"floating\" | \"inline\" | \"none\"\nexport type InputState = \"default\" | \"error\" | \"success\"\nexport type InputAnimation = \"none\" | \"ring\" | \"glow\" | \"underline-grow\" | \"lift\"\nexport type InputShadow = \"none\" | \"sm\" | \"md\" | \"inner\"\n\ntype Native = Omit<React.ComponentProps<\"input\">, \"size\" | \"prefix\" | \"value\" | \"defaultValue\" | \"onChange\">\n\nexport type InputLabels = { clear: string }\nconst DEFAULT_LABELS: InputLabels = { clear: \"Clear\" }\n\nexport type InputProps = Native & {\n  /** Field style: outline (default), filled, underline, ghost, neo-brutalist or frosted glass. */\n  variant?: InputVariant\n  /** Focus color (ring, border, floating label). Overridden by state=\"error\" or \"success\". */\n  tone?: InputTone\n  size?: InputSize\n  shape?: InputShape\n  /** Field shadow; inner draws an inset shadow. Ignored by neo, which has its own offset shadow. */\n  shadow?: InputShadow\n  /** How the field reacts to focus. */\n  animation?: InputAnimation\n  /** Field label; placement is set by labelMode. */\n  label?: React.ReactNode\n  /** top: above the field. floating: inside, floats up on focus. inline: inside, before the value. none: screen-reader only. */\n  labelMode?: InputLabelMode\n  /** Helper text under the field (hidden while a message shows). */\n  description?: React.ReactNode\n  /** Validation state: colors the field, adds an icon, sets aria-invalid on error and shows message. */\n  state?: InputState\n  /** Error or success text; slides in under the field. */\n  message?: React.ReactNode\n  /** Shake the field when it enters the error state. */\n  shake?: boolean\n  /** Change it (e.g. a submit counter) to shake again while already in the error state. */\n  shakeKey?: React.Key\n  /** Icon or short text inside the field, before the value. */\n  leading?: React.ReactNode\n  /** Icon or short text inside the field, after the value. */\n  trailing?: React.ReactNode\n  /** Attached segment before the field, e.g. \"https://\". */\n  addonBefore?: React.ReactNode\n  /** Attached segment after the field, e.g. \".com\". */\n  addonAfter?: React.ReactNode\n  /** Shows a × button while the field has a value. */\n  clearable?: boolean\n  /** Shows \"12/80\" when maxLength is set. */\n  showCount?: boolean\n  /** Renders a <textarea>. */\n  multiline?: boolean\n  /** Visible rows of the textarea (multiline only). */\n  rows?: number\n  /** Textarea grows with its content. */\n  autoResize?: boolean\n  /** Controlled value. */\n  value?: string\n  /** Initial value when uncontrolled. */\n  defaultValue?: string\n  /** Called with the new string on typing and when the clear button empties the field. */\n  onValueChange?: (value: string) => void\n  /** Native change event. The clear button fires it too (with an empty value), so form libraries see the reset. */\n  onChange?: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void\n  /** A small light on the field border follows the pointer. Ignored by underline and neo, and with animation=\"none\". */\n  borderLight?: boolean\n  /** false shrinks the field to its content width. */\n  fullWidth?: boolean\n  /** Class for the field box (the root gets className). */\n  fieldClassName?: string\n  /** Text for built-in controls and screen readers; pass translations here. */\n  labels?: Partial<InputLabels>\n}\n\nconst CSS = `\n.pc-input{--pc-c:var(--primary);--pc-fg:var(--primary-foreground)}\n.pc-input[data-tone=neutral]{--pc-c:var(--foreground);--pc-fg:var(--background)}\n.pc-input[data-tone=success]{--pc-c:oklch(0.53 0.13 155);--pc-fg:#fff}\n.pc-input[data-tone=warning]{--pc-c:oklch(0.75 0.16 70);--pc-fg:oklch(0.25 0.05 70)}\n.pc-input[data-tone=danger]{--pc-c:oklch(0.56 0.21 27);--pc-fg:#fff}\n.pc-input[data-tone=info]{--pc-c:oklch(0.55 0.17 250);--pc-fg:#fff}\n.dark .pc-input[data-tone=success]{--pc-c:oklch(0.7 0.16 155);--pc-fg:oklch(0.2 0.05 155)}\n.dark .pc-input[data-tone=danger]{--pc-c:oklch(0.68 0.2 25);--pc-fg:oklch(0.2 0.05 25)}\n.dark .pc-input[data-tone=info]{--pc-c:oklch(0.7 0.15 245);--pc-fg:oklch(0.2 0.05 245)}\n.pc-input{--pc-tint:color-mix(in oklab,var(--pc-c) 14%,transparent);--pc-ink:color-mix(in oklab,var(--pc-c) 82%,var(--foreground))}\n.pc-input[data-tone=warning]{--pc-ink:color-mix(in oklab,var(--pc-c) 62%,var(--foreground))}\n.pc-input[data-state=error]{--pc-c:oklch(0.56 0.21 27);--pc-in-s:var(--pc-c)}\n.pc-input[data-state=success]{--pc-c:oklch(0.53 0.13 155);--pc-in-s:var(--pc-c)}\n.pc-input{--pc-in-muted:color-mix(in oklab,var(--muted-foreground) 80%,var(--foreground))}\n.dark .pc-input[data-state=error]{--pc-c:oklch(0.68 0.2 25)}\n.dark .pc-input[data-state=success]{--pc-c:oklch(0.7 0.16 155)}\n\n.pc-input-field{--pc-in-mx:50%;--pc-in-my:50%;position:relative;isolation:isolate;border:1px solid transparent;box-shadow:var(--pc-in-v,0 0 #0000),var(--pc-in-sh,0 0 #0000),var(--pc-in-f,0 0 #0000)}\n.pc-input[data-variant=outline] .pc-input-field{--pc-in-v:var(--pc-well);background:var(--background);border-color:var(--pc-in-s,var(--input))}\n.pc-input[data-variant=outline] .pc-input-field:hover{border-color:var(--pc-in-s,color-mix(in oklab,var(--foreground) 25%,var(--input)))}\n.pc-input[data-variant=filled] .pc-input-field{--pc-in-v:var(--pc-well);background:var(--muted);border-color:var(--pc-in-s,transparent)}\n.pc-input[data-variant=filled] .pc-input-field:hover{background:color-mix(in oklab,var(--muted) 70%,var(--foreground) 5%)}\n.pc-input[data-variant=filled] .pc-input-field:focus-within{background:var(--background)}\n.pc-input[data-variant=underline] .pc-input-field{border-width:0 0 1px;border-radius:0!important;border-color:var(--pc-in-s,var(--input));background:transparent}\n.pc-input[data-variant=underline] .pc-input-field{padding-inline:2px}\n.pc-input[data-variant=ghost] .pc-input-field{background:transparent;border-color:var(--pc-in-s,transparent)}\n.pc-input[data-variant=ghost] .pc-input-field:hover{background:color-mix(in oklab,var(--muted) 60%,transparent)}\n.pc-input[data-variant=ghost] .pc-input-field:focus-within{background:var(--muted)}\n.pc-input[data-variant=neo] .pc-input-field{background:var(--background);border:2px solid var(--foreground);--pc-in-v:3px 3px 0 var(--pc-in-s,var(--foreground))}\n.pc-input[data-variant=glass] .pc-input-field{background:color-mix(in oklab,var(--background) 45%,transparent);border-color:var(--pc-in-s,color-mix(in oklab,var(--foreground) 14%,transparent));-webkit-backdrop-filter:blur(14px) saturate(1.6);backdrop-filter:blur(14px) saturate(1.6);--pc-in-v:inset 0 1px 0 color-mix(in oklab,white 40%,transparent)}\n.pc-input .pc-input-field:focus-within{border-color:var(--pc-c)}\n.pc-input[data-variant=neo] .pc-input-field:focus-within{border-color:var(--foreground)}\n\n.pc-input[data-shadow=sm] .pc-input-field{--pc-in-sh:0 1px 2px hsl(var(--pc-sh)/.08)}\n.pc-input[data-shadow=md] .pc-input-field{--pc-in-sh:0 4px 14px -4px hsl(var(--pc-sh)/.16)}\n.pc-input[data-shadow=inner] .pc-input-field{--pc-in-sh:inset 0 2px 4px hsl(var(--pc-sh)/.1)}\n\n.pc-input:not([data-anim=none]) .pc-input-field{transition:box-shadow 150ms var(--pc-ease-out),border-color 150ms var(--pc-ease-out),background-color 150ms ease}\n.pc-input[data-anim=ring] .pc-input-field:focus-within{--pc-in-f:0 0 0 3px color-mix(in oklab,var(--pc-c) 16%,transparent)}\n.pc-input[data-anim=glow] .pc-input-field:focus-within{--pc-in-f:0 0 0 3px color-mix(in oklab,var(--pc-c) 14%,transparent),0 8px 24px -10px color-mix(in oklab,var(--pc-c) 60%,transparent)}\n.pc-input[data-anim=lift] .pc-input-field{transition:transform .2s var(--pc-ease-out),box-shadow 150ms var(--pc-ease-out),border-color 150ms var(--pc-ease-out),background-color 150ms ease}\n.pc-input[data-anim=lift] .pc-input-field:focus-within{transform:translateY(-2px);--pc-in-f:0 10px 22px -12px color-mix(in oklab,var(--pc-c) 70%,rgb(0 0 0/.4))}\n.pc-input[data-variant=neo][data-anim=lift] .pc-input-field:focus-within{transform:translate(-1px,-1px);--pc-in-v:5px 5px 0 var(--pc-in-s,var(--foreground));--pc-in-f:0 0 #0000}\n.pc-input-grow{position:absolute;left:0;right:0;bottom:0;height:2px;background:var(--pc-c);transform:scaleX(0);transition:transform .3s var(--pc-ease-out);pointer-events:none;border-radius:2px}\n.pc-input .pc-input-field:focus-within .pc-input-grow{transform:scaleX(1)}\n.pc-input[data-anim=underline-grow] .pc-input-field:focus-within{border-color:var(--pc-in-s,var(--input))}\n.pc-input[data-anim=underline-grow][data-variant=neo] .pc-input-field:focus-within{border-color:var(--foreground)}\n\n/* One pixel of light inside the border, masked to a ring. overflow:hidden on the field clips anything outside it. */\n.pc-input-light{position:absolute;inset:0;z-index:2;padding:1px;border-radius:inherit;pointer-events:none;opacity:0;transition:opacity .25s ease;background:radial-gradient(110px circle at var(--pc-in-mx) var(--pc-in-my),color-mix(in oklab,var(--pc-c) 80%,var(--foreground)),transparent 70%);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0)}\n.pc-input-field:hover>.pc-input-light{opacity:.9}\n.pc-input-field:focus-within>.pc-input-light{opacity:0}\n.pc-input-control{background:transparent;outline:none;min-width:0;width:100%;color:inherit}\n.pc-input-control::placeholder{color:color-mix(in oklab,var(--muted-foreground) 88%,var(--foreground));opacity:1}\n.pc-input-control:disabled{cursor:not-allowed}\ntextarea.pc-input-control{resize:vertical}\n.pc-input[data-autoresize] textarea.pc-input-control{resize:none;overflow:hidden}\n\n.pc-input-float{position:absolute;inset-inline-start:0;top:50%;transform-origin:left center;transform:translateY(-50%);color:var(--pc-in-muted);pointer-events:none;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;transition:transform .18s var(--pc-ease-out),color .18s}\n.pc-input-float:dir(rtl){transform-origin:right center}\n.pc-input[data-multiline] .pc-input-float{top:.8em;transform:none}\n.pc-input[data-label=floating] .pc-input-control::placeholder{opacity:0;transition:opacity .15s}\n.pc-input[data-label=floating] .pc-input-control:focus::placeholder{opacity:1}\n.pc-input-control:focus~.pc-input-float,.pc-input-control:not(:placeholder-shown)~.pc-input-float{transform:translateY(calc(-50% - .78em)) scale(.78)}\n.pc-input[data-multiline] .pc-input-control:focus~.pc-input-float,.pc-input[data-multiline] .pc-input-control:not(:placeholder-shown)~.pc-input-float{transform:translateY(-.55em) scale(.78)}\n.pc-input .pc-input-control:focus~.pc-input-float{color:var(--pc-ink)}\n\n.pc-input-x{display:inline-flex;align-items:center;justify-content:center;border-radius:9999px;color:var(--pc-in-muted);transition:background-color .15s,color .15s}\n.pc-input-x:hover{color:var(--foreground);background:color-mix(in oklab,var(--foreground) 9%,transparent)}\n.pc-input-add{background:color-mix(in oklab,var(--muted) 75%,transparent);color:var(--pc-in-muted)}\n.pc-input[data-variant=underline] .pc-input-add,.pc-input[data-variant=ghost] .pc-input-add{background:transparent}\n.pc-input[data-state=error] .pc-input-msg{color:var(--pc-ink)}\n.pc-input[data-state=success] .pc-input-msg{color:var(--pc-ink)}\n\n.pc-input[data-shake] .pc-input-field{animation:pc-input-shake .42s cubic-bezier(.36,.07,.19,.97)}\n@keyframes pc-input-shake{10%,90%{translate:-1px 0}20%,80%{translate:2px 0}30%,50%,70%{translate:-4px 0}40%,60%{translate:4px 0}}\n@media (prefers-reduced-motion:reduce){\n  .pc-input *{transition:none!important;animation:none!important}\n  .pc-input-light{display:none}\n  .pc-input .pc-input-field:focus-within{transform:none!important}\n}\n`\n\nconst H: Record<InputSize, string> = { sm: \"min-h-8 text-sm\", md: \"min-h-10 text-sm\", lg: \"min-h-12 text-base\" }\nconst H_FLOAT: Record<InputSize, string> = { sm: \"min-h-11 text-sm\", md: \"min-h-13 text-sm\", lg: \"min-h-15 text-base\" }\nconst PAD: Record<InputSize, string> = { sm: \"px-2.5 gap-2\", md: \"px-3 gap-2\", lg: \"px-4 gap-2.5\" }\nconst SVG: Record<InputSize, string> = { sm: \"[&_svg]:size-3.5\", md: \"[&_svg]:size-4\", lg: \"[&_svg]:size-[18px]\" }\nconst SHAPES: Record<InputShape, string> = { square: \"rounded-none\", rounded: \"rounded-lg\", pill: \"rounded-full\" }\nconst X_SIZE: Record<InputSize, string> = { sm: \"size-5 [&_svg]:size-3\", md: \"size-6 [&_svg]:size-3.5\", lg: \"size-7 [&_svg]:size-4\" }\n\nexport function Input({\n  variant = \"outline\",\n  tone = \"primary\",\n  size = \"md\",\n  shape = \"rounded\",\n  shadow = \"none\",\n  animation = \"ring\",\n  label,\n  labelMode = \"top\",\n  description,\n  state = \"default\",\n  message,\n  shake = true,\n  shakeKey,\n  leading,\n  trailing,\n  addonBefore,\n  addonAfter,\n  clearable,\n  showCount,\n  multiline,\n  rows = 3,\n  autoResize,\n  value,\n  defaultValue,\n  onValueChange,\n  onChange,\n  borderLight = true,\n  fullWidth = true,\n  className,\n  fieldClassName,\n  id,\n  placeholder,\n  disabled,\n  maxLength,\n  labels,\n  ref: refProp,\n  ...props\n}: InputProps) {\n  const l = useLabels(\"input\", DEFAULT_LABELS, labels)\n  const reduce = useReducedMotion()\n  const autoId = React.useId()\n  const inputId = id ?? autoId\n  const msgId = `${inputId}-msg`\n  const ref = React.useRef<HTMLInputElement & HTMLTextAreaElement>(null)\n  // Merge the caller's ref (e.g. react-hook-form's register) with the internal one.\n  const setRef = React.useCallback(\n    (el: (HTMLInputElement & HTMLTextAreaElement) | null) => {\n      ref.current = el\n      if (typeof refProp === \"function\") refProp(el)\n      else if (refProp) refProp.current = el\n    },\n    [refProp],\n  )\n  const [inner, setInner] = React.useState(defaultValue ?? \"\")\n  const val = value ?? inner\n  const [shaking, setShaking] = React.useState(false)\n\n  // Shake when entering the error state, or when the error message changes.\n  const msgKey = typeof message === \"string\" ? message : \"\"\n  const prev = React.useRef({ state, msgKey, shakeKey })\n  React.useEffect(() => {\n    const was = prev.current\n    prev.current = { state, msgKey, shakeKey }\n    if (!shake || state !== \"error\" || (was.state === \"error\" && was.msgKey === msgKey && was.shakeKey === shakeKey)) return\n    setShaking(false)\n    const raf = requestAnimationFrame(() => setShaking(true))\n    const t = setTimeout(() => setShaking(false), 480)\n    return () => {\n      cancelAnimationFrame(raf)\n      clearTimeout(t)\n    }\n  }, [state, msgKey, shakeKey, shake])\n\n  React.useLayoutEffect(() => {\n    const el = ref.current\n    if (!multiline || !autoResize || !el) return\n    el.style.height = \"auto\"\n    el.style.height = `${el.scrollHeight}px`\n  }, [val, multiline, autoResize])\n\n  // Uncontrolled fields stay native (defaultValue), so libraries that write el.value (react-hook-form defaults,\n  // reset) keep working; `inner` only mirrors the DOM for the counter and the clear button.\n  React.useEffect(() => {\n    if (value === undefined && ref.current) setInner(ref.current.value)\n  }, [value])\n\n  const set = (v: string) => {\n    if (value === undefined) setInner(v)\n    onValueChange?.(v)\n  }\n\n  // Clear through a real input event so onChange, onValueChange and form libraries all see the empty value.\n  const clear = () => {\n    const el = ref.current\n    if (!el) return set(\"\")\n    const proto = el instanceof HTMLTextAreaElement ? HTMLTextAreaElement.prototype : HTMLInputElement.prototype\n    Object.getOwnPropertyDescriptor(proto, \"value\")?.set?.call(el, \"\")\n    el.dispatchEvent(new Event(\"input\", { bubbles: true }))\n    el.focus()\n  }\n\n  const floating = labelMode === \"floating\" && !!label\n  const stateIcon = state === \"error\" ? <CircleAlert className=\"text-[var(--pc-c)]\" /> : state === \"success\" ? <CircleCheck className=\"text-[var(--pc-c)]\" /> : null\n  const hasMsg = !!message && state !== \"default\"\n  const light = borderLight && !disabled && animation !== \"none\" && variant !== \"underline\" && variant !== \"neo\"\n  const count = showCount && maxLength ? `${val.length}/${maxLength}` : null\n\n  const control = {\n    ref: setRef,\n    id: inputId,\n    ...(value !== undefined ? { value } : { defaultValue }),\n    disabled,\n    maxLength,\n    placeholder: floating ? (placeholder ?? \" \") : placeholder,\n    \"aria-invalid\": state === \"error\" || undefined,\n    \"aria-describedby\": hasMsg || description ? msgId : undefined,\n    \"aria-label\": props[\"aria-label\"] ?? (labelMode === \"none\" && typeof label === \"string\" ? label : undefined),\n    onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n      set(e.target.value)\n      onChange?.(e)\n    },\n    className: cn(\n      \"pc-input-control\",\n      multiline ? (floating ? \"pt-6 pb-2\" : \"py-2\") : floating ? \"self-stretch pt-4\" : \"self-stretch\",\n      multiline && \"leading-relaxed\",\n    ),\n  }\n\n  const side = (node: React.ReactNode, slot: string) =>\n    node ? (\n      <span data-slot={slot} className={cn(\"inline-flex shrink-0 items-center text-[var(--pc-in-muted)]\", multiline && \"self-start pt-2.5\")}>\n        {node}\n      </span>\n    ) : null\n\n  const addon = (node: React.ReactNode, slot: string, before: boolean) =>\n    node ? (\n      <span\n        data-slot={slot}\n        className={cn(\n          \"pc-input-add -my-px flex shrink-0 items-center self-stretch whitespace-nowrap\",\n          size === \"lg\" ? \"px-4\" : \"px-3\",\n          before ? \"border-e\" : \"border-s\",\n          before ? (size === \"lg\" ? \"-ms-4\" : size === \"sm\" ? \"-ms-2.5\" : \"-ms-3\") : size === \"lg\" ? \"-me-4\" : size === \"sm\" ? \"-me-2.5\" : \"-me-3\",\n        )}\n      >\n        {node}\n      </span>\n    ) : null\n\n  return (\n    <>\n      <GooduiTokens />\n      <style href=\"pc-input\" precedence=\"default\">\n        {CSS}\n      </style>\n      <div\n        data-slot=\"input\"\n        data-variant={variant}\n        data-tone={tone}\n        data-state={state}\n        data-anim={animation}\n        data-shadow={variant === \"neo\" ? \"none\" : shadow}\n        data-label={floating ? \"floating\" : labelMode}\n        data-multiline={multiline ? \"\" : undefined}\n        data-autoresize={multiline && autoResize ? \"\" : undefined}\n        data-shake={shaking ? \"\" : undefined}\n        className={cn(\"pc-input flex flex-col gap-1.5\", fullWidth ? \"w-full\" : \"w-fit\", disabled && \"opacity-60\", className)}\n      >\n        {label && labelMode === \"top\" && (\n          <label htmlFor={inputId} className=\"text-sm leading-none font-medium\">\n            {label}\n          </label>\n        )}\n        {label && labelMode === \"none\" && typeof label !== \"string\" && (\n          <label htmlFor={inputId} className=\"sr-only\">\n            {label}\n          </label>\n        )}\n        <div\n          data-slot=\"field\"\n          // Written straight to the element: the light must not re-render the form on every pointer move.\n          onPointerMove={\n            light\n              ? (e) => {\n                  const r = e.currentTarget.getBoundingClientRect()\n                  e.currentTarget.style.setProperty(\"--pc-in-mx\", `${e.clientX - r.left}px`)\n                  e.currentTarget.style.setProperty(\"--pc-in-my\", `${e.clientY - r.top}px`)\n                }\n              : undefined\n          }\n          onPointerDown={(e) => {\n            if (e.target === e.currentTarget) {\n              e.preventDefault()\n              ref.current?.focus()\n            }\n          }}\n          className={cn(\n            \"pc-input-field flex cursor-text overflow-hidden\",\n            multiline ? \"items-stretch\" : \"items-center\",\n            multiline ? (floating ? \"min-h-20\" : \"\") : floating ? H_FLOAT[size] : H[size],\n            multiline && (size === \"lg\" ? \"text-base\" : \"text-sm\"),\n            PAD[size],\n            SVG[size],\n            \"[&_svg]:shrink-0\",\n            multiline && shape === \"pill\" ? \"rounded-2xl\" : SHAPES[shape],\n            fieldClassName,\n          )}\n        >\n          {addon(addonBefore, \"addon-before\", true)}\n          {side(leading, \"leading\")}\n          {label && labelMode === \"inline\" && (\n            <label htmlFor={inputId} className={cn(\"shrink-0 font-medium whitespace-nowrap text-[var(--pc-in-muted)]\", multiline && \"self-start pt-2\")}>\n              {label}\n            </label>\n          )}\n          <div className=\"relative flex min-w-0 flex-1 self-stretch\">\n            {multiline ? (\n              <textarea rows={rows} {...(props as React.ComponentProps<\"textarea\">)} {...control} />\n            ) : (\n              <input {...props} {...control} />\n            )}\n            {floating && (\n              <label htmlFor={inputId} className=\"pc-input-float\">\n                {label}\n              </label>\n            )}\n          </div>\n          {clearable && val && !disabled && (\n            <button\n              type=\"button\"\n              aria-label={l.clear}\n              onClick={clear}\n              className={cn(\"pc-press pc-input-x shrink-0 cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring/50\", X_SIZE[size], multiline && \"self-start mt-2\")}\n            >\n              <X />\n            </button>\n          )}\n          {side(stateIcon, \"state-icon\")}\n          {side(trailing, \"trailing\")}\n          {addon(addonAfter, \"addon-after\", false)}\n          {light && <span className=\"pc-input-light\" aria-hidden=\"true\" />}\n          {animation === \"underline-grow\" && <span className=\"pc-input-grow\" aria-hidden=\"true\" />}\n        </div>\n        {(hasMsg || description || count) && (\n          <div className=\"flex items-start gap-3 text-xs\">\n            <div id={msgId} className=\"min-w-0 flex-1\" aria-live=\"polite\">\n              <AnimatePresence mode=\"wait\" initial={false}>\n                {hasMsg ? (\n                  <motion.p\n                    key={`${state}:${msgKey}`}\n                    className=\"pc-input-msg overflow-hidden font-medium\"\n                    initial={{ opacity: 0, height: 0, y: -6 }}\n                    animate={{ opacity: 1, height: \"auto\", y: 0 }}\n                    exit={{ opacity: 0, height: 0, y: -4 }}\n                    transition={reduce ? { duration: 0 } : spring.snap}\n                  >\n                    {message}\n                  </motion.p>\n                ) : description ? (\n                  <motion.p\n                    key=\"desc\"\n                    className=\"overflow-hidden text-muted-foreground\"\n                    initial={{ opacity: 0 }}\n                    animate={{ opacity: 1 }}\n                    exit={{ opacity: 0 }}\n                    transition={reduce ? { duration: 0 } : { duration: 0.15 }}\n                  >\n                    {description}\n                  </motion.p>\n                ) : null}\n              </AnimatePresence>\n            </div>\n            {count && <span className=\"shrink-0 text-muted-foreground tabular-nums\">{count}</span>}\n          </div>\n        )}\n      </div>\n    </>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/input.tsx"
    }
  ],
  "categories": [
    "components",
    "core"
  ],
  "type": "registry:component"
}