"""Core dataclasses for card stack state, render context, and URL routing."""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../../nbs/core/models.ipynb.

# %% auto #0
__all__ = ['CardStackState', 'CardRenderContext', 'CardStackUrls']

# %% ../../nbs/core/models.ipynb #a1000003
from dataclasses import dataclass
from typing import Optional

# %% ../../nbs/core/models.ipynb #a1000005
@dataclass
class CardStackState:
    """Viewport state for a card stack instance."""
    focused_index: int = 0              # Index of focused item in the items list
    visible_count: int = 3              # Number of card slots visible in viewport
    card_width: int = 80               # Max width of card stack inner container in rem
    card_scale: int = 100              # Content scale percentage (50-200)
    active_mode: Optional[str] = None  # Current interaction mode name (consumer-defined)
    focus_position: Optional[int] = None  # Slot offset for focused card (None=center, -1=bottom)

# %% ../../nbs/core/models.ipynb #a1000010
@dataclass
class CardRenderContext:
    """Context passed to the consumer's render_card callback."""
    card_role: str                     # "focused" or "context"
    index: int                         # Item's position in the full items list
    total_items: int                   # Total item count
    is_first: bool                     # Whether this is the first item
    is_last: bool                      # Whether this is the last item
    active_mode: Optional[str]         # Current interaction mode
    card_scale: int                    # Scale percentage (50-200)
    distance_from_focus: int           # Signed slot offset from focused card (0=focused)

# %% ../../nbs/core/models.ipynb #a1000015
@dataclass
class CardStackUrls:
    """URL bundle for card stack navigation and viewport operations."""

    # Navigation URLs
    nav_up: str = ""        # Navigate to previous item
    nav_down: str = ""      # Navigate to next item
    nav_first: str = ""     # Navigate to first item
    nav_last: str = ""      # Navigate to last item
    nav_page_up: str = ""   # Page jump up
    nav_page_down: str = "" # Page jump down
    nav_to_index: str = ""  # Navigate to specific index (click-to-focus)

    # Viewport URLs
    update_viewport: str = ""  # Change visible_count (full viewport re-render)
    save_width: str = ""       # Persist card_width
    save_scale: str = ""       # Persist card_scale
