{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "picker",
  "title": "Picker",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/picker/Picker.tsx",
      "content": "import * as React from 'react'\nimport { Platform, StyleSheet, View } from 'react-native'\nimport {\n  Picker as NativePicker,\n  type PickerProps as NativePickerProps,\n  type PickerItemProps as NativePickerItemProps,\n} from '@react-native-picker/picker'\nimport { useTheme, useThemeColors } from '@/lib/theme'\nimport { cn } from '@/lib/utils'\n\nexport type PickerValue = string | number\nexport type PickerRef = NativePicker<PickerValue>\nexport interface PickerItemProps extends Omit<NativePickerItemProps<PickerValue>, 'label' | 'value'> {\n  label: string\n  value: PickerValue\n}\nexport interface PickerProps extends Omit<NativePickerProps<PickerValue>, 'children' | 'onValueChange'> {\n  className?: string\n  children?: React.ReactNode\n  defaultValue?: PickerValue\n  onValueChange?: (value: PickerValue, itemIndex: number) => void\n}\n\nexport const PickerItem = NativePicker.Item as React.ComponentType<PickerItemProps>\n\nfunction pickerChildren(children: React.ReactNode): React.ReactElement<PickerItemProps>[] {\n  return React.Children.toArray(children).flatMap((child) => {\n    if (!React.isValidElement<PickerItemProps>(child)) return []\n    if (child.type === React.Fragment) return pickerChildren((child.props as { children?: React.ReactNode }).children)\n    return [child]\n  })\n}\n\n/**\n * Android RN 0.81 builds require Picker 2.11.3+ for the upstream CMake fix.\n * A JavaScript dependency update cannot replace Expo Go 54's bundled native picker.\n */\nexport const Picker = React.forwardRef<PickerRef, PickerProps>(\n  (\n    {\n      className,\n      children,\n      selectedValue,\n      defaultValue,\n      onValueChange,\n      enabled = true,\n      style,\n      itemStyle,\n      dropdownIconColor,\n      accessibilityState,\n      ...props\n    },\n    ref,\n  ) => {\n    const colors = useThemeColors()\n    const { resolvedTheme } = useTheme()\n    const [internal, setInternal] = React.useState(defaultValue)\n    const options = pickerChildren(children)\n    const resolved = selectedValue ?? internal ?? options[0]?.props.value\n    const selectedIndex = options.findIndex((option) => option.props.value === resolved)\n    return (\n      <View\n        pointerEvents={enabled ? 'auto' : 'none'}\n        className={cn(\n          'overflow-hidden rounded-md border border-input bg-background',\n          !enabled && 'opacity-50',\n          className,\n        )}\n      >\n        <NativePicker\n          ref={ref}\n          {...props}\n          enabled={enabled}\n          selectedValue={Platform.OS === 'web' ? String(selectedIndex) : resolved}\n          accessibilityState={{ ...accessibilityState, disabled: !enabled }}\n          dropdownIconColor={dropdownIconColor ?? colors.foreground}\n          style={[\n            {\n              minHeight: 48,\n              width: '100%',\n              backgroundColor: colors.background,\n              color: colors.foreground,\n              fontSize: Platform.OS === 'ios' ? 17 : 16,\n              ...(Platform.OS === 'web' ? { colorScheme: resolvedTheme } : {}),\n            },\n            style,\n          ]}\n          itemStyle={[{ color: colors.foreground, fontSize: 17 }, itemStyle]}\n          onValueChange={(_nativeValue, index) => {\n            const option = options[index]\n            if (!enabled || !option || option.props.enabled === false) return\n            const next = option.props.value\n            if (selectedValue === undefined) setInternal(next)\n            if (next !== resolved) onValueChange?.(next, index)\n          }}\n        >\n          {options.map((option, index) => {\n            const androidStyle = Platform.OS === 'android' ? StyleSheet.flatten(option.props.style) : undefined\n            const defaultColor = option.props.enabled === false ? colors.mutedForeground : colors.foreground\n            return React.cloneElement(option, {\n              key: option.key ?? `${typeof option.props.value}-${option.props.value}`,\n              value: Platform.OS === 'web' ? String(index) : option.props.value,\n              color: option.props.color ?? (androidStyle?.color ? undefined : defaultColor),\n              // Android paints popup rows separately from the closed picker surface.\n              style:\n                Platform.OS === 'android'\n                  ? { backgroundColor: colors.background, ...androidStyle }\n                  : option.props.style,\n            })\n          })}\n        </NativePicker>\n      </View>\n    )\n  },\n)\nPicker.displayName = 'Picker'\n",
      "type": "registry:ui",
      "target": "~/components/ui/picker/Picker.tsx"
    },
    {
      "path": "packages/registry-native/components/picker/index.ts",
      "content": "export { Picker, PickerItem, type PickerProps, type PickerItemProps, type PickerRef, type PickerValue } from './Picker'\n",
      "type": "registry:ui",
      "target": "~/components/ui/picker/index.ts"
    }
  ],
  "dependencies": [
    "@react-native-picker/picker@^2.11.3"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/theme.json",
    "https://native.uipkge.dev/r/native/utils.json"
  ],
  "description": "System wheel/dialog picker with composed choices, typed string/number values, and cross-platform disabled handling.",
  "categories": [
    "input",
    "selection"
  ]
}