{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "input",
  "title": "Input",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/input/Input.tsx",
      "content": "import * as React from 'react'\nimport { Platform, Pressable, TextInput, View, type TextInputProps } from 'react-native'\nimport Animated, {\n  useAnimatedStyle,\n  useReducedMotion,\n  useSharedValue,\n  withSequence,\n  withTiming,\n} from 'react-native-reanimated'\nimport { cn } from '@/lib/utils'\nimport { useThemeColors } from '@/lib/theme'\nimport { motionDurations } from '@/lib/motion'\n\nexport interface InputProps extends TextInputProps {\n  className?: string\n  containerClassName?: string\n  invalid?: boolean\n  /** Non-interactive leading content, usually an icon. */\n  prefixIcon?: React.ReactNode\n  /** Non-interactive trailing content, usually an icon or unit label. */\n  suffixIcon?: React.ReactNode\n  /** Shake the field when it becomes invalid. Fires on the false -> true transition only. */\n  shakeOnInvalid?: boolean\n}\n\nconst Input = React.forwardRef<React.ComponentRef<typeof TextInput>, InputProps>(\n  (\n    {\n      className,\n      containerClassName,\n      invalid,\n      editable = true,\n      shakeOnInvalid = true,\n      prefixIcon,\n      suffixIcon,\n      placeholderTextColor,\n      accessibilityState,\n      onFocus,\n      onBlur,\n      ...props\n    },\n    ref,\n  ) => {\n    const colors = useThemeColors()\n    const reduced = useReducedMotion()\n    const inputRef = React.useRef<React.ComponentRef<typeof TextInput>>(null)\n    const [focused, setFocused] = React.useState(false)\n    const shake = useSharedValue(0)\n    const shakeStyle = useAnimatedStyle(() => ({ transform: [{ translateX: shake.value }] }))\n    const wasInvalid = React.useRef(invalid)\n    const setInputRef = React.useCallback(\n      (input: React.ComponentRef<typeof TextInput> | null) => {\n        inputRef.current = input\n        if (typeof ref === 'function') return ref(input)\n        if (ref) ref.current = input\n      },\n      [ref],\n    )\n\n    React.useEffect(() => {\n      if (invalid && !wasInvalid.current && shakeOnInvalid && !reduced) {\n        const step = motionDurations.fast / 3\n        shake.value = withSequence(\n          withTiming(-8, { duration: step }),\n          withTiming(8, { duration: step }),\n          withTiming(-6, { duration: step }),\n          withTiming(6, { duration: step }),\n          withTiming(0, { duration: step }),\n        )\n      }\n      wasInvalid.current = invalid\n    }, [invalid, shakeOnInvalid, reduced, shake])\n\n    return (\n      <Animated.View cssInterop={false} style={shakeStyle}>\n        <Pressable\n          accessible={false}\n          focusable={false}\n          disabled={!editable}\n          onPress={() => inputRef.current?.focus()}\n          className={cn(\n            'flex-row items-center gap-[8px] rounded-md border border-muted-foreground bg-background px-3',\n            focused && !invalid && 'border-ring bg-muted',\n            invalid && 'border-destructive',\n            !editable && 'opacity-50',\n            containerClassName,\n          )}\n        >\n          {prefixIcon ? (\n            <View pointerEvents=\"none\" className=\"shrink-0\">\n              {prefixIcon}\n            </View>\n          ) : null}\n          <TextInput\n            ref={setInputRef}\n            editable={editable}\n            placeholderTextColor={placeholderTextColor ?? colors.mutedForeground}\n            accessibilityState={{ ...accessibilityState, disabled: !editable }}\n            onFocus={(event) => {\n              setFocused(true)\n              onFocus?.(event)\n            }}\n            onBlur={(event) => {\n              setFocused(false)\n              onBlur?.(event)\n            }}\n            className={cn(\n              'min-h-[48px] min-w-0 flex-1 py-2 text-foreground',\n              Platform.OS === 'ios' ? 'text-[17px] leading-[22px]' : 'text-[16px] leading-[24px]',\n              className,\n            )}\n            {...props}\n          />\n          {suffixIcon ? (\n            <View pointerEvents=\"none\" className=\"shrink-0\">\n              {suffixIcon}\n            </View>\n          ) : null}\n        </Pressable>\n      </Animated.View>\n    )\n  },\n)\nInput.displayName = 'Input'\n\nexport { Input }\n",
      "type": "registry:ui",
      "target": "~/components/ui/input/Input.tsx"
    },
    {
      "path": "packages/registry-native/components/input/index.ts",
      "content": "export { Input, type InputProps } from './Input'\n",
      "type": "registry:ui",
      "target": "~/components/ui/input/index.ts"
    }
  ],
  "dependencies": [
    "react-native-reanimated"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/motion.json"
  ],
  "description": "Mobile text field (View + TextInput) with focus, invalid, and disabled states, prefix/suffix icon slots, and a shake-on-invalid animation. Works with RN + Expo keyboard.",
  "categories": [
    "control"
  ]
}