import type { BorderType, ShapeType, ShadowType, SizeType, Spacing, TextAlignments } from ".."; import type { VerticalAlignment } from "../alignment"; import type { BaseComponent } from "../base"; import type { ColorGradientScheme } from "../colors"; import type { Overrides } from "../overrides"; export type InputTextCapitalizeType = "none" | "sentences" | "words" | "characters"; export type InputTextKeyboardType = "decimal" | "email" | "numeric" | "password" | "tel" | "text" | "url"; export type ReservedAttribute = "$email" | "$displayName" | "$phoneNumber"; export type InputTextValidationFormat = "email" | "uri"; /** * JSON Schema subset mapped to native HTML constraint attributes. * Keys keep the JSON Schema camelCase vocabulary. */ export interface InputTextValidation { minimum?: number | null; maximum?: number | null; minLength?: number | null; maxLength?: number | null; pattern?: string | null; format?: InputTextValidationFormat | null; } export type InputTextValidationRule = "required" | "minimum" | "maximum" | "minLength" | "maxLength" | "pattern" | "format"; /** Per-rule error copy; `validation_error_lid` is the fallback for missing keys. */ export type InputTextValidationErrorLids = Partial>; export interface InputTextProps extends BaseComponent { type: "input_text"; visible?: boolean | null; placeholder_lid: string; keyboard_type: InputTextKeyboardType; capitalize: InputTextCapitalizeType; field_id: string; reserved_attribute?: ReservedAttribute | null; required: boolean; validation?: InputTextValidation | null; validation_error_lid?: string | null; validation_error_lids?: InputTextValidationErrorLids | null; size: SizeType; padding: Spacing; margin: Spacing; vertical_alignment?: VerticalAlignment | null; border?: BorderType | null; shape?: ShapeType | null; shadow?: ShadowType | null; font_name?: string | null; font_weight_int?: number | null; font_size: number; horizontal_alignment: keyof typeof TextAlignments; color: ColorGradientScheme; placeholder_font_name?: string | null; placeholder_font_weight_int?: number | null; placeholder_font_size: number; placeholder_horizontal_alignment: keyof typeof TextAlignments; placeholder_color: ColorGradientScheme; background_color?: ColorGradientScheme | null; overrides?: Overrides; }