import { component, type Define } from '@sigx/lynx'; import { useThemeColors, type ColorVariant, type SizeScale } from '@sigx/lynx-zero'; export type InputSize = Extract; /** Upstream HeroUI input variants — flat (filled surface) is the default. */ export type InputVariant = 'flat' | 'bordered'; export type InputColor = Exclude; export type InputProps = & Define.Prop<'placeholder', string, false> & Define.Prop<'size', InputSize, false> & Define.Prop<'variant', InputVariant, false> & Define.Prop<'color', InputColor, false> & Define.Prop<'disabled', boolean, false> & Define.Prop<'type', 'text' | 'number' | 'password', false> & Define.Prop<'class', string, false> & Define.Model; const sizeClasses: Record = { sm: 'hero-input-sm', md: '', lg: 'hero-input-lg', }; export const Input = component(({ props }) => { const colors = useThemeColors(); const getClasses = () => { const c = ['hero-input']; if (props.variant === 'bordered') c.push('hero-input-bordered'); if (props.color) c.push(`hero-input-${props.color}`); if (props.size) { const s = sizeClasses[props.size]; if (s) c.push(s); } if (props.class) c.push(props.class); return c.join(' '); }; return () => ( ); });