"""
Tabs component schemas.

Mirrors lightwave-ui/src/components/application/tabs/.
"""

from typing import Literal

from pydantic import BaseModel, ConfigDict, Field


class TabItem(BaseModel):
    """
    Tab item definition.
    """

    key: str = Field(..., description="Tab key/identifier")
    label: str = Field(..., description="Tab label")
    icon: str | None = Field(None, description="Tab icon")
    disabled: bool = Field(False, description="Tab is disabled")
    badge: str | None = Field(None, description="Badge text (e.g., count)")

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


class TabsProps(BaseModel):
    """
    Tabs component props.

    Matches TypeScript TabsProps.
    """

    # Tabs
    tabs: list[TabItem] = Field(..., description="Tab definitions")

    # Selection
    selected_key: str | None = Field(None, serialization_alias="selectedKey", description="Selected tab key")
    default_selected_key: str | None = Field(
        None,
        serialization_alias="defaultSelectedKey",
        description="Default selected tab",
    )

    # Variants
    variant: Literal["default", "pills", "underline"] = Field("default", description="Tab style variant")

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

    # Layout
    orientation: Literal["horizontal", "vertical"] = Field("horizontal", description="Tab orientation")
    full_width: bool = Field(False, serialization_alias="fullWidth", description="Tabs fill container width")

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


__all__ = [
    "TabItem",
    "TabsProps",
]
