"""
Input component schemas.

Mirrors lightwave-ui/src/components/base/input/.
"""

from typing import Literal

from pydantic import BaseModel, ConfigDict, Field


class InputProps(BaseModel):
    """
    Input field component props.

    Matches TypeScript InputProps.
    """

    # Value
    value: str | None = Field(None, description="Input value")
    default_value: str | None = Field(None, serialization_alias="defaultValue", description="Default value")

    # Type
    type: Literal["text", "email", "password", "number", "tel", "url", "search"] = Field(
        "text", description="Input type"
    )

    # Labels
    label: str | None = Field(None, description="Field label")
    placeholder: str | None = Field(None, description="Placeholder text")
    hint: str | None = Field(None, description="Hint text below input")

    # Size
    size: Literal["sm", "md"] = Field("sm", description="Input size")

    # State
    is_disabled: bool = Field(False, serialization_alias="isDisabled", description="Disabled state")
    is_required: bool = Field(False, serialization_alias="isRequired", description="Required field")
    is_error: bool = Field(False, serialization_alias="isError", description="Error state")
    error_message: str | None = Field(None, serialization_alias="errorMessage", description="Error message")

    # Icons
    icon_leading: str | None = Field(None, serialization_alias="iconLeading", description="Leading icon")
    icon_trailing: str | None = Field(None, serialization_alias="iconTrailing", description="Trailing icon")

    # Prefix/Suffix
    prefix: str | None = Field(None, description="Text prefix (e.g., '$')")
    suffix: str | None = Field(None, description="Text suffix (e.g., '.com')")

    model_config = ConfigDict(
        populate_by_name=True,
        extra="forbid",
    )


__all__ = [
    "InputProps",
]
