{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "password-input",
  "title": "Password Input",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/password-input/PasswordInput.tsx",
      "content": "import * as React from 'react'\nimport { TextInput, View, type ViewProps } from 'react-native'\nimport { Eye, EyeOff } from 'lucide-react-native'\nimport { Input, type InputProps } from '@/components/ui/input'\nimport { IconButton } from '@/components/ui/icon-button'\nimport { cn } from '@/lib/utils'\n\nexport interface PasswordInputProps extends Omit<InputProps, 'secureTextEntry' | 'multiline' | 'suffixIcon' | 'style'> {\n  visible?: boolean\n  defaultVisible?: boolean\n  onVisibleChange?: (visible: boolean) => void\n  disabled?: boolean\n  showLabel?: string\n  hideLabel?: string\n  inputClassName?: string\n  style?: ViewProps['style']\n}\n\nexport const PasswordInput = React.forwardRef<React.ComponentRef<typeof TextInput>, PasswordInputProps>(\n  (\n    {\n      value,\n      defaultValue = '',\n      onChangeText,\n      visible,\n      defaultVisible = false,\n      onVisibleChange,\n      disabled = false,\n      editable = true,\n      invalid,\n      className,\n      inputClassName,\n      containerClassName,\n      style,\n      showLabel = 'Show password',\n      hideLabel = 'Hide password',\n      onFocus,\n      onBlur,\n      autoComplete = 'current-password',\n      autoCapitalize = 'none',\n      autoCorrect = false,\n      ...props\n    },\n    ref,\n  ) => {\n    const [internalValue, setInternalValue] = React.useState(defaultValue)\n    const [internalVisible, setInternalVisible] = React.useState(defaultVisible)\n    const [focused, setFocused] = React.useState(false)\n    const input = React.useRef<React.ComponentRef<typeof TextInput>>(null)\n    const wasFocused = React.useRef(false)\n    const resolvedVisible = visible ?? internalVisible\n    const canEdit = editable && !disabled\n    const setInputRef = React.useCallback(\n      (node: React.ComponentRef<typeof TextInput> | null) => {\n        input.current = node\n        if (typeof ref === 'function') return ref(node)\n        if (ref) ref.current = node\n      },\n      [ref],\n    )\n\n    return (\n      <View\n        style={style}\n        className={cn(\n          'flex-row items-center rounded-md border border-muted-foreground bg-background',\n          focused && !invalid && 'border-ring bg-muted',\n          invalid && 'border-destructive',\n          className,\n        )}\n      >\n        <View className=\"min-w-0 flex-1\">\n          <Input\n            {...props}\n            ref={setInputRef}\n            value={value ?? internalValue}\n            editable={canEdit}\n            invalid={invalid}\n            secureTextEntry={!resolvedVisible}\n            multiline={false}\n            autoComplete={autoComplete}\n            autoCapitalize={autoCapitalize}\n            autoCorrect={autoCorrect}\n            className={inputClassName}\n            containerClassName={cn('border-0', containerClassName)}\n            onChangeText={(next) => {\n              if (!canEdit || props.readOnly) return\n              if (value === undefined) setInternalValue(next)\n              onChangeText?.(next)\n            }}\n            onFocus={(event) => {\n              setFocused(true)\n              onFocus?.(event)\n            }}\n            onBlur={(event) => {\n              setFocused(false)\n              onBlur?.(event)\n            }}\n          />\n        </View>\n        <IconButton\n          icon={resolvedVisible ? EyeOff : Eye}\n          accessibilityLabel={resolvedVisible ? hideLabel : showLabel}\n          accessibilityState={{ expanded: resolvedVisible }}\n          disabled={!canEdit}\n          onPressIn={() => {\n            wasFocused.current = input.current?.isFocused() ?? focused\n          }}\n          onPress={() => {\n            if (!canEdit) return\n            const restoreFocus = wasFocused.current || input.current?.isFocused() || focused\n            wasFocused.current = false\n            const next = !resolvedVisible\n            if (visible === undefined) setInternalVisible(next)\n            onVisibleChange?.(next)\n            if (restoreFocus) input.current?.focus()\n          }}\n        />\n      </View>\n    )\n  },\n)\nPasswordInput.displayName = 'PasswordInput'\n",
      "type": "registry:ui",
      "target": "~/components/ui/password-input/PasswordInput.tsx"
    },
    {
      "path": "packages/registry-native/components/password-input/index.ts",
      "content": "export { PasswordInput } from './PasswordInput'\nexport type { PasswordInputProps } from './PasswordInput'\n",
      "type": "registry:ui",
      "target": "~/components/ui/password-input/index.ts"
    }
  ],
  "dependencies": [
    "lucide-react-native"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/input.json",
    "https://native.uipkge.dev/r/native/icon-button.json"
  ],
  "description": "Password text entry with controlled visibility and a separately labelled reveal action.",
  "categories": [
    "control"
  ]
}