"""AUTO-GENERATED by scripts/codegen.py — DO NOT EDIT."""
from __future__ import annotations

from typing import Any, Callable

from zuzu.runtime.spec import _add_component
from zuzu.record import Record, RecordQuery
from zuzu.components._utils import _check_visible



def checkbox(label: str, *, default: bool = False) -> dict[str, Any]:
    """Checkbox boolean input."""
    field: dict[str, Any] = {"type": "checkbox", "label": label, "default": default}
    return field


def date_input(label: str, *, required: bool = False) -> dict[str, Any]:
    """Date picker input."""
    field: dict[str, Any] = {"type": "date_input", "label": label, "required": required}
    return field


def datetime_input(label: str, *, required: bool = False) -> dict[str, Any]:
    """Date and time picker input."""
    field: dict[str, Any] = {"type": "datetime_input", "label": label, "required": required}
    return field


def file_input(
    label: str,
    *,
    accept: str = '*',
    required: bool = False,
) -> dict[str, Any]:
    """File URL input (paste a URL to a file)."""
    field: dict[str, Any] = {"type": "file_input", "label": label, "accept": accept, "required": required}
    return field


def image_input(label: str, *, required: bool = False) -> dict[str, Any]:
    """Image URL input with preview."""
    field: dict[str, Any] = {"type": "image_input", "label": label, "required": required}
    return field


def markdown_input(
    label: str,
    *,
    placeholder: str = '',
    required: bool = False,
) -> dict[str, Any]:
    """Markdown editor with preview."""
    field: dict[str, Any] = {"type": "markdown_input", "label": label, "placeholder": placeholder, "required": required}
    return field


def number_input(
    label: str,
    *,
    min: int | float | None = None,
    max: int | float | None = None,
    required: bool = False,
) -> dict[str, Any]:
    """Numeric input with optional min/max constraints."""
    field: dict[str, Any] = {"type": "number_input", "label": label, "required": required}
    if min is not None:
        field["min"] = min
    if max is not None:
        field["max"] = max
    return field


def select(
    label: str,
    *,
    options: list[Any],
    display: str = 'chips',
    required: bool = False,
) -> dict[str, Any]:
    """Choice input. display: dropdown|chips|radio."""
    field: dict[str, Any] = {"type": "select", "label": label, "options": options, "display": display, "required": required}
    return field


def slider(
    label: str,
    *,
    min: int | float = 0,
    max: int | float = 100,
    step: int | float = 1,
    default: int | float | None = None,
) -> dict[str, Any]:
    """Range slider input."""
    field: dict[str, Any] = {"type": "slider", "label": label, "min": min, "max": max, "step": step}
    if default is not None:
        field["default"] = default
    return field


def switch(label: str, *, default: bool = False) -> dict[str, Any]:
    """Toggle switch -- sleeker boolean alternative to checkbox."""
    field: dict[str, Any] = {"type": "switch", "label": label, "default": default}
    return field


def text_input(
    label: str,
    *,
    required: bool = False,
    placeholder: str = '',
) -> dict[str, Any]:
    """Single-line text input field."""
    field: dict[str, Any] = {"type": "text_input", "label": label, "required": required, "placeholder": placeholder}
    return field


def time_input(label: str, *, required: bool = False) -> dict[str, Any]:
    """Time picker input."""
    field: dict[str, Any] = {"type": "time_input", "label": label, "required": required}
    return field
