import React, { forwardRef, ReactNode } from 'react'; import { Box } from './primitives/Box'; import { Stack } from './primitives/Stack'; import { Text } from './Text'; interface SelectOption { value: string; label: string; } interface SelectProps extends React.SelectHTMLAttributes { label?: string; fullWidth?: boolean; pl?: number; errorMessage?: string; variant?: 'default' | 'error'; options?: SelectOption[]; } export const Select = forwardRef( ({ label, fullWidth = true, pl, errorMessage, variant = 'default', options, children, className = '', style, ...props }, ref) => { const isError = variant === 'error' || !!errorMessage; const variantClasses = isError ? 'border-warning-amber focus:border-warning-amber' : 'border-charcoal-outline focus:border-primary-blue'; const defaultClasses = `${fullWidth ? 'w-full' : 'w-auto'} px-3 py-2 bg-deep-graphite border rounded-lg text-white focus:outline-none transition-colors`; const classes = [ defaultClasses, variantClasses, pl ? `pl-${pl}` : '', className ].filter(Boolean).join(' '); return ( {label && ( {label} )} {options ? options.map(opt => ( )) : children} {errorMessage && ( {errorMessage} )} ); } ); Select.displayName = 'Select';