'use client'; import React from 'react'; import { createInput } from '@gluestack-ui/core/input/creator'; import { View, Pressable, TextInput } from 'react-native'; import { tva } from '@gluestack-ui/utils/nativewind-utils'; import { withStyleContext } from '@gluestack-ui/utils/nativewind-utils'; import { styled } from 'nativewind'; import type { VariantProps } from '@gluestack-ui/utils/nativewind-utils'; import { UIIcon } from '@gluestack-ui/core/icon/creator'; const SCOPE = 'INPUT'; const StyledUIIcon = styled(UIIcon, { className: "style" }); const UIInput = createInput({ Root: withStyleContext(View, SCOPE), Icon: StyledUIIcon, Slot: Pressable, Input: TextInput, }); const inputStyle = tva({ base: 'min-h-9 w-full flex-row items-center rounded-md border border-border dark:bg-input/30 bg-transparent shadow-xs transition-[color,box-shadow] overflow-hidden data-[focus=true]:outline-none data-[focus=true]:border-ring dark:data-[focus=true]:border-ring data-[focus=true]:web:ring-[3px] data-[focus=true]:web:ring-ring/50 data-[invalid=true]:border-destructive/40 dark:data-[invalid=true]:border-destructive/40 data-[invalid=true]:web:ring-destructive/20 dark:data-[invalid=true]:web:ring-destructive/40 data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 px-3 gap-2', }); const inputIconStyle = tva({ base: 'justify-center items-center text-muted-foreground fill-none h-4 w-4', }); const inputSlotStyle = tva({ base: 'justify-center items-center web:disabled:cursor-not-allowed', }); const inputFieldStyle = tva({ base: 'flex-1 text-foreground text-sm md:text-sm py-1 h-full placeholder:text-muted-foreground web:outline-none ios:leading-[0px] web:cursor-text web:data-[disabled=true]:cursor-not-allowed', }); type IInputProps = React.ComponentProps & VariantProps & { className?: string }; const Input = React.forwardRef, IInputProps>( function Input({ className, ...props }, ref) { return ( ); } ); type IInputIconProps = React.ComponentProps & VariantProps & { className?: string; height?: number; width?: number; }; const InputIcon = React.forwardRef< React.ComponentRef, IInputIconProps >(function InputIcon({ className, ...props }, ref) { return ( ); }); type IInputSlotProps = React.ComponentProps & VariantProps & { className?: string }; const InputSlot = React.forwardRef< React.ComponentRef, IInputSlotProps >(function InputSlot({ className, ...props }, ref) { return ( ); }); type IInputFieldProps = React.ComponentProps & VariantProps & { className?: string }; const InputField = React.forwardRef< React.ComponentRef, IInputFieldProps >(function InputField({ className, ...props }, ref) { return ( ); }); Input.displayName = 'Input'; InputIcon.displayName = 'InputIcon'; InputSlot.displayName = 'InputSlot'; InputField.displayName = 'InputField'; export { Input, InputField, InputIcon, InputSlot };