This commit is contained in:
Khaleel Al-Adhami 2025-02-20 15:23:50 +01:00 committed by GitHub
commit 907024f5af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
237 changed files with 47559 additions and 54704 deletions

View File

@ -1,7 +1,6 @@
"""The Reflex Admin Dashboard.""" """The Reflex Admin Dashboard."""
from dataclasses import dataclass, field from dataclasses import dataclass, field
from typing import Optional
from starlette_admin.base import BaseAdmin as Admin from starlette_admin.base import BaseAdmin as Admin
@ -12,4 +11,4 @@ class AdminDash:
models: list = field(default_factory=list) models: list = field(default_factory=list)
view_overrides: dict = field(default_factory=dict) view_overrides: dict = field(default_factory=dict)
admin: Optional[Admin] = None admin: Admin | None = None

View File

@ -25,12 +25,8 @@ from typing import (
Callable, Callable,
Coroutine, Coroutine,
Dict, Dict,
List,
MutableMapping, MutableMapping,
Optional,
Set,
Type, Type,
Union,
get_args, get_args,
get_type_hints, get_type_hints,
) )
@ -169,7 +165,7 @@ def default_backend_exception_handler(exception: Exception) -> EventSpec:
return window_alert("\n".join(error_message)) return window_alert("\n".join(error_message))
def extra_overlay_function() -> Optional[Component]: def extra_overlay_function() -> Component | None:
"""Extra overlay function to add to the overlay component. """Extra overlay function to add to the overlay component.
Returns: Returns:
@ -252,16 +248,16 @@ class UploadFile(StarletteUploadFile):
file: BinaryIO file: BinaryIO
path: Optional[Path] = dataclasses.field(default=None) path: Path | None = dataclasses.field(default=None)
_deprecated_filename: Optional[str] = dataclasses.field(default=None) _deprecated_filename: str | None = dataclasses.field(default=None)
size: Optional[int] = dataclasses.field(default=None) size: int | None = dataclasses.field(default=None)
headers: Headers = dataclasses.field(default_factory=Headers) headers: Headers = dataclasses.field(default_factory=Headers)
@property @property
def name(self) -> Optional[str]: def name(self) -> str | None:
"""Get the name of the uploaded file. """Get the name of the uploaded file.
Returns: Returns:
@ -271,7 +267,7 @@ class UploadFile(StarletteUploadFile):
return self.path.name return self.path.name
@property @property
def filename(self) -> Optional[str]: def filename(self) -> str | None:
"""Get the filename of the uploaded file. """Get the filename of the uploaded file.
Returns: Returns:
@ -292,13 +288,13 @@ class UploadFile(StarletteUploadFile):
class UnevaluatedPage: class UnevaluatedPage:
"""An uncompiled page.""" """An uncompiled page."""
component: Union[Component, ComponentCallable] component: Component | ComponentCallable
route: str route: str
title: Union[Var, str, None] title: Var | str | None
description: Union[Var, str, None] description: Var | str | None
image: str image: str
on_load: Union[EventType[()], None] on_load: EventType[()] | None
meta: List[Dict[str, str]] meta: list[dict[str, str]]
@dataclasses.dataclass() @dataclasses.dataclass()
@ -324,7 +320,7 @@ class App(MiddlewareMixin, LifespanMixin):
""" """
# The global [theme](https://reflex.dev/docs/styling/theming/#theme) for the entire app. # The global [theme](https://reflex.dev/docs/styling/theming/#theme) for the entire app.
theme: Optional[Component] = dataclasses.field( theme: Component | None = dataclasses.field(
default_factory=lambda: themes.theme(accent_color="blue") default_factory=lambda: themes.theme(accent_color="blue")
) )
@ -332,18 +328,18 @@ class App(MiddlewareMixin, LifespanMixin):
style: ComponentStyle = dataclasses.field(default_factory=dict) style: ComponentStyle = dataclasses.field(default_factory=dict)
# A list of URLs to [stylesheets](https://reflex.dev/docs/styling/custom-stylesheets/) to include in the app. # A list of URLs to [stylesheets](https://reflex.dev/docs/styling/custom-stylesheets/) to include in the app.
stylesheets: List[str] = dataclasses.field(default_factory=list) stylesheets: list[str] = dataclasses.field(default_factory=list)
# A component that is present on every page (defaults to the Connection Error banner). # A component that is present on every page (defaults to the Connection Error banner).
overlay_component: Optional[Union[Component, ComponentCallable]] = ( overlay_component: Component | ComponentCallable | None = dataclasses.field(
dataclasses.field(default=None) default=None
) )
# Error boundary component to wrap the app with. # Error boundary component to wrap the app with.
error_boundary: Optional[ComponentCallable] = dataclasses.field(default=None) error_boundary: ComponentCallable | None = dataclasses.field(default=None)
# App wraps to be applied to the whole app. Expected to be a dictionary of (order, name) to a function that takes whether the state is enabled and optionally returns a component. # App wraps to be applied to the whole app. Expected to be a dictionary of (order, name) to a function that takes whether the state is enabled and optionally returns a component.
app_wraps: Dict[tuple[int, str], Callable[[bool], Optional[Component]]] = ( app_wraps: dict[tuple[int, str], Callable[[bool], Component | None]] = (
dataclasses.field( dataclasses.field(
default_factory=lambda: { default_factory=lambda: {
(55, "ErrorBoundary"): ( (55, "ErrorBoundary"): (
@ -358,24 +354,24 @@ class App(MiddlewareMixin, LifespanMixin):
) )
# Components to add to the head of every page. # Components to add to the head of every page.
head_components: List[Component] = dataclasses.field(default_factory=list) head_components: list[Component] = dataclasses.field(default_factory=list)
# The Socket.IO AsyncServer instance. # The Socket.IO AsyncServer instance.
sio: Optional[AsyncServer] = None sio: AsyncServer | None = None
# The language to add to the html root tag of every page. # The language to add to the html root tag of every page.
html_lang: Optional[str] = None html_lang: str | None = None
# Attributes to add to the html root tag of every page. # Attributes to add to the html root tag of every page.
html_custom_attrs: Optional[Dict[str, str]] = None html_custom_attrs: dict[str, str] | None = None
# A map from a route to an unevaluated page. # A map from a route to an unevaluated page.
_unevaluated_pages: Dict[str, UnevaluatedPage] = dataclasses.field( _unevaluated_pages: dict[str, UnevaluatedPage] = dataclasses.field(
default_factory=dict default_factory=dict
) )
# A map from a page route to the component to render. Users should use `add_page`. # A map from a page route to the component to render. Users should use `add_page`.
_pages: Dict[str, Component] = dataclasses.field(default_factory=dict) _pages: dict[str, Component] = dataclasses.field(default_factory=dict)
# A mapping of pages which created states as they were being evaluated. # A mapping of pages which created states as they were being evaluated.
_stateful_pages: Dict[str, None] = dataclasses.field(default_factory=dict) _stateful_pages: Dict[str, None] = dataclasses.field(default_factory=dict)
@ -384,24 +380,24 @@ class App(MiddlewareMixin, LifespanMixin):
_api: FastAPI | None = None _api: FastAPI | None = None
# The state class to use for the app. # The state class to use for the app.
_state: Optional[Type[BaseState]] = None _state: Type[BaseState] | None = None
# Class to manage many client states. # Class to manage many client states.
_state_manager: Optional[StateManager] = None _state_manager: StateManager | None = None
# Mapping from a route to event handlers to trigger when the page loads. # Mapping from a route to event handlers to trigger when the page loads.
_load_events: Dict[str, List[IndividualEventType[()]]] = dataclasses.field( _load_events: dict[str, list[IndividualEventType[()]]] = dataclasses.field(
default_factory=dict default_factory=dict
) )
# Admin dashboard to view and manage the database. # Admin dashboard to view and manage the database.
admin_dash: Optional[AdminDash] = None admin_dash: AdminDash | None = None
# The async server name space. # The async server name space.
_event_namespace: Optional[EventNamespace] = None _event_namespace: EventNamespace | None = None
# Background tasks that are currently running. # Background tasks that are currently running.
_background_tasks: Set[asyncio.Task] = dataclasses.field(default_factory=set) _background_tasks: set[asyncio.Task] = dataclasses.field(default_factory=set)
# Frontend Error Handler Function # Frontend Error Handler Function
frontend_exception_handler: Callable[[Exception], None] = ( frontend_exception_handler: Callable[[Exception], None] = (
@ -410,7 +406,7 @@ class App(MiddlewareMixin, LifespanMixin):
# Backend Error Handler Function # Backend Error Handler Function
backend_exception_handler: Callable[ backend_exception_handler: Callable[
[Exception], Union[EventSpec, List[EventSpec], None] [Exception], EventSpec | list[EventSpec] | None
] = default_backend_exception_handler ] = default_backend_exception_handler
# Put the toast provider in the app wrap. # Put the toast provider in the app wrap.
@ -897,7 +893,7 @@ class App(MiddlewareMixin, LifespanMixin):
admin.mount_to(self.api) admin.mount_to(self.api)
def _get_frontend_packages(self, imports: Dict[str, set[ImportVar]]): def _get_frontend_packages(self, imports: dict[str, set[ImportVar]]):
"""Gets the frontend packages to be installed and filters out the unnecessary ones. """Gets the frontend packages to be installed and filters out the unnecessary ones.
Args: Args:
@ -1008,9 +1004,7 @@ class App(MiddlewareMixin, LifespanMixin):
for render, kwargs in DECORATED_PAGES[get_config().app_name]: for render, kwargs in DECORATED_PAGES[get_config().app_name]:
self.add_page(render, **kwargs) self.add_page(render, **kwargs)
def _validate_var_dependencies( def _validate_var_dependencies(self, state: Type[BaseState] | None = None) -> None:
self, state: Optional[Type[BaseState]] = None
) -> None:
"""Validate the dependencies of the vars in the app. """Validate the dependencies of the vars in the app.
Args: Args:
@ -1082,7 +1076,7 @@ class App(MiddlewareMixin, LifespanMixin):
self.style = evaluate_style_namespaces(self.style) self.style = evaluate_style_namespaces(self.style)
# Add the app wrappers. # Add the app wrappers.
app_wrappers: Dict[tuple[int, str], Component] = { app_wrappers: dict[tuple[int, str], Component] = {
# Default app wrap component renders {children} # Default app wrap component renders {children}
(0, "AppWrap"): AppWrap.create() (0, "AppWrap"): AppWrap.create()
} }
@ -1550,8 +1544,8 @@ class App(MiddlewareMixin, LifespanMixin):
valid = bool( valid = bool(
return_type == EventSpec return_type == EventSpec
or return_type == Optional[EventSpec] or return_type == EventSpec | None
or return_type == List[EventSpec] or return_type == list[EventSpec]
or return_type == inspect.Signature.empty or return_type == inspect.Signature.empty
or return_type is None or return_type is None
) )
@ -1559,7 +1553,7 @@ class App(MiddlewareMixin, LifespanMixin):
if not valid: if not valid:
raise ValueError( raise ValueError(
f"Provided custom {handler_domain} exception handler `{_fn_name}` has the wrong return type." f"Provided custom {handler_domain} exception handler `{_fn_name}` has the wrong return type."
f"Expected `Union[EventSpec, List[EventSpec], None]` but got `{return_type}`" f"Expected `EventSpec | list[EventSpec] | None` but got `{return_type}`"
) )
@ -1699,7 +1693,7 @@ def upload(app: App):
The upload function. The upload function.
""" """
async def upload_file(request: Request, files: List[FastAPIUploadFile]): async def upload_file(request: Request, files: list[FastAPIUploadFile]):
"""Upload a file. """Upload a file.
Args: Args:
@ -1739,7 +1733,7 @@ def upload(app: App):
# get handler function # get handler function
func = getattr(type(current_state), handler.split(".")[-1]) func = getattr(type(current_state), handler.split(".")[-1])
# check if there exists any handler args with annotation, List[UploadFile] # check if there exists any handler args with annotation, list[UploadFile]
if isinstance(func, EventHandler): if isinstance(func, EventHandler):
if func.is_background: if func.is_background:
raise UploadTypeError( raise UploadTypeError(
@ -1759,7 +1753,7 @@ def upload(app: App):
if not handler_upload_param: if not handler_upload_param:
raise UploadValueError( raise UploadValueError(
f"`{handler}` handler should have a parameter annotated as " f"`{handler}` handler should have a parameter annotated as "
"List[rx.UploadFile]" "list[rx.UploadFile]"
) )
# Make a copy of the files as they are closed after the request. # Make a copy of the files as they are closed after the request.

View File

@ -7,7 +7,7 @@ import contextlib
import dataclasses import dataclasses
import functools import functools
import inspect import inspect
from typing import Callable, Coroutine, Set, Union from typing import Callable, Coroutine
from fastapi import FastAPI from fastapi import FastAPI
@ -22,7 +22,7 @@ class LifespanMixin(AppMixin):
"""A Mixin that allow tasks to run during the whole app lifespan.""" """A Mixin that allow tasks to run during the whole app lifespan."""
# Lifespan tasks that are planned to run. # Lifespan tasks that are planned to run.
lifespan_tasks: Set[Union[asyncio.Task, Callable]] = dataclasses.field( lifespan_tasks: set[asyncio.Task | Callable] = dataclasses.field(
default_factory=set default_factory=set
) )

View File

@ -4,7 +4,6 @@ from __future__ import annotations
import asyncio import asyncio
import dataclasses import dataclasses
from typing import List
from reflex.event import Event from reflex.event import Event
from reflex.middleware import HydrateMiddleware, Middleware from reflex.middleware import HydrateMiddleware, Middleware
@ -18,7 +17,7 @@ class MiddlewareMixin(AppMixin):
"""Middleware Mixin that allow to add middleware to the app.""" """Middleware Mixin that allow to add middleware to the app."""
# Middleware to add to the app. Users should use `add_middleware`. PRIVATE. # Middleware to add to the app. Users should use `add_middleware`. PRIVATE.
middleware: List[Middleware] = dataclasses.field(default_factory=list) middleware: list[Middleware] = dataclasses.field(default_factory=list)
def _init_mixin(self): def _init_mixin(self):
self.middleware.append(HydrateMiddleware()) self.middleware.append(HydrateMiddleware())

View File

@ -2,7 +2,6 @@
import inspect import inspect
from pathlib import Path from pathlib import Path
from typing import Optional
from reflex import constants from reflex import constants
from reflex.config import EnvironmentVariables from reflex.config import EnvironmentVariables
@ -11,7 +10,7 @@ from reflex.config import EnvironmentVariables
def asset( def asset(
path: str, path: str,
shared: bool = False, shared: bool = False,
subfolder: Optional[str] = None, subfolder: str | None = None,
_stack_level: int = 1, _stack_level: int = 1,
) -> str: ) -> str:
"""Add an asset to the app, either shared as a symlink or local. """Add an asset to the app, either shared as a symlink or local.

View File

@ -3,14 +3,14 @@
from __future__ import annotations from __future__ import annotations
import os import os
from typing import TYPE_CHECKING, Any, List, Type from typing import TYPE_CHECKING, Any, Type
import pydantic.v1.main as pydantic_main import pydantic.v1.main as pydantic_main
from pydantic.v1 import BaseModel from pydantic.v1 import BaseModel
from pydantic.v1.fields import ModelField from pydantic.v1.fields import ModelField
def validate_field_name(bases: List[Type["BaseModel"]], field_name: str) -> None: def validate_field_name(bases: list[Type["BaseModel"]], field_name: str) -> None:
"""Ensure that the field's name does not shadow an existing attribute of the model. """Ensure that the field's name does not shadow an existing attribute of the model.
Args: Args:

View File

@ -4,7 +4,7 @@ from __future__ import annotations
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
from typing import TYPE_CHECKING, Dict, Iterable, Optional, Sequence, Tuple, Type, Union from typing import TYPE_CHECKING, Iterable, Sequence, Type
from reflex import constants from reflex import constants
from reflex.compiler import templates, utils from reflex.compiler import templates, utils
@ -94,7 +94,7 @@ def _compile_theme(theme: str) -> str:
return templates.THEME.render(theme=theme) return templates.THEME.render(theme=theme)
def _compile_contexts(state: Optional[Type[BaseState]], theme: Component | None) -> str: def _compile_contexts(state: Type[BaseState] | None, theme: Component | None) -> str:
"""Compile the initial state and contexts. """Compile the initial state and contexts.
Args: Args:
@ -219,7 +219,7 @@ def _compile_component(component: Component | StatefulComponent) -> str:
def _compile_components( def _compile_components(
components: set[CustomComponent], components: set[CustomComponent],
) -> tuple[str, Dict[str, list[ImportVar]]]: ) -> tuple[str, dict[str, list[ImportVar]]]:
"""Compile the components. """Compile the components.
Args: Args:
@ -352,8 +352,8 @@ def _compile_tailwind(
def compile_document_root( def compile_document_root(
head_components: list[Component], head_components: list[Component],
html_lang: Optional[str] = None, html_lang: str | None = None,
html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, html_custom_attrs: dict[str, Var | str] | None = None,
) -> tuple[str, str]: ) -> tuple[str, str]:
"""Compile the document root. """Compile the document root.
@ -415,7 +415,7 @@ def compile_theme(style: ComponentStyle) -> tuple[str, str]:
def compile_contexts( def compile_contexts(
state: Optional[Type[BaseState]], state: Type[BaseState] | None,
theme: Component | None, theme: Component | None,
) -> tuple[str, str]: ) -> tuple[str, str]:
"""Compile the initial state / context. """Compile the initial state / context.
@ -456,7 +456,7 @@ def compile_page(
def compile_components( def compile_components(
components: set[CustomComponent], components: set[CustomComponent],
) -> tuple[str, str, Dict[str, list[ImportVar]]]: ) -> tuple[str, str, dict[str, list[ImportVar]]]:
"""Compile the custom components. """Compile the custom components.
Args: Args:
@ -594,7 +594,7 @@ def compile_unevaluated_page(
state: Type[BaseState] | None = None, state: Type[BaseState] | None = None,
style: ComponentStyle | None = None, style: ComponentStyle | None = None,
theme: Component | None = None, theme: Component | None = None,
) -> Tuple[Component, bool]: ) -> tuple[Component, bool]:
"""Compiles an uncompiled page into a component and adds meta information. """Compiles an uncompiled page into a component and adds meta information.
Args: Args:
@ -679,9 +679,9 @@ class ExecutorSafeFunctions:
""" """
COMPONENTS: Dict[str, BaseComponent] = {} COMPONENTS: dict[str, BaseComponent] = {}
UNCOMPILED_PAGES: Dict[str, UnevaluatedPage] = {} UNCOMPILED_PAGES: dict[str, UnevaluatedPage] = {}
STATE: Optional[Type[BaseState]] = None STATE: Type[BaseState] | None = None
@classmethod @classmethod
def compile_page(cls, route: str) -> tuple[str, str]: def compile_page(cls, route: str) -> tuple[str, str]:

View File

@ -7,7 +7,7 @@ import concurrent.futures
import traceback import traceback
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
from typing import Any, Callable, Dict, Optional, Type, Union from typing import Any, Callable, Type
from urllib.parse import urlparse from urllib.parse import urlparse
from pydantic.v1.fields import ModelField from pydantic.v1.fields import ModelField
@ -345,8 +345,8 @@ def compile_custom_component(
def create_document_root( def create_document_root(
head_components: list[Component] | None = None, head_components: list[Component] | None = None,
html_lang: Optional[str] = None, html_lang: str | None = None,
html_custom_attrs: Optional[Dict[str, Union[Var, str]]] = None, html_custom_attrs: dict[str, Var | str] | None = None,
) -> Component: ) -> Component:
"""Create the document root. """Create the document root.

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.base.fragment import Fragment from reflex.components.base.fragment import Fragment
from reflex.event import EventType from reflex.event import EventType
@ -16,12 +16,12 @@ class AppWrap(Fragment):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,12 +16,12 @@ class Body(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -1,7 +1,5 @@
"""Document components.""" """Document components."""
from typing import Optional
from reflex.components.component import Component from reflex.components.component import Component
@ -16,7 +14,7 @@ class Html(NextDocumentLib):
tag = "Html" tag = "Html"
lang: Optional[str] lang: str | None
class DocumentHead(NextDocumentLib): class DocumentHead(NextDocumentLib):

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,12 +16,12 @@ class NextDocumentLib(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -62,13 +62,13 @@ class Html(NextDocumentLib):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
lang: Optional[str] = None, lang: str | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -109,12 +109,12 @@ class DocumentHead(NextDocumentLib):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -155,12 +155,12 @@ class Main(NextDocumentLib):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -201,12 +201,12 @@ class NextScript(NextDocumentLib):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,8 +2,6 @@
from __future__ import annotations from __future__ import annotations
from typing import Dict, Tuple
from reflex.components.component import Component from reflex.components.component import Component
from reflex.components.datadisplay.logo import svg_logo from reflex.components.datadisplay.logo import svg_logo
from reflex.components.el import a, button, details, div, h2, hr, p, pre, summary from reflex.components.el import a, button, details, div, h2, hr, p, pre, summary
@ -15,8 +13,8 @@ from reflex.vars.object import ObjectVar
def on_error_spec( def on_error_spec(
error: ObjectVar[Dict[str, str]], info: ObjectVar[Dict[str, str]] error: ObjectVar[dict[str, str]], info: ObjectVar[dict[str, str]]
) -> Tuple[Var[str], Var[str]]: ) -> tuple[Var[str], Var[str]]:
"""The spec for the on_error event handler. """The spec for the on_error event handler.
Args: Args:

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Tuple, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -12,8 +12,8 @@ from reflex.vars.base import Var
from reflex.vars.object import ObjectVar from reflex.vars.object import ObjectVar
def on_error_spec( def on_error_spec(
error: ObjectVar[Dict[str, str]], info: ObjectVar[Dict[str, str]] error: ObjectVar[dict[str, str]], info: ObjectVar[dict[str, str]]
) -> Tuple[Var[str], Var[str]]: ... ) -> tuple[Var[str], Var[str]]: ...
class ErrorBoundary(Component): class ErrorBoundary(Component):
@overload @overload
@ -21,20 +21,18 @@ class ErrorBoundary(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
fallback_render: Optional[Union[Component, Var[Component]]] = None, fallback_render: Component | Var[Component] | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_error: Optional[ on_error: Optional[EventType[()] | EventType[str] | EventType[str, str]] = None,
Union[EventType[()], EventType[str], EventType[str, str]]
] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,12 +16,12 @@ class Fragment(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component, MemoizationLeaf from reflex.components.component import Component, MemoizationLeaf
from reflex.event import EventType from reflex.event import EventType
@ -16,12 +16,12 @@ class NextHeadLib(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -62,12 +62,12 @@ class Head(NextHeadLib, MemoizationLeaf):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,14 +16,14 @@ class RawLink(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
href: Optional[Union[Var[str], str]] = None, href: Var[str] | str | None = None,
rel: Optional[Union[Var[str], str]] = None, rel: Var[str] | str | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -66,19 +66,19 @@ class ScriptTag(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
type_: Optional[Union[Var[str], str]] = None, type_: Var[str] | str | None = None,
source: Optional[Union[Var[str], str]] = None, source: Var[str] | str | None = None,
integrity: Optional[Union[Var[str], str]] = None, integrity: Var[str] | str | None = None,
crossorigin: Optional[Union[Var[str], str]] = None, crossorigin: Var[str] | str | None = None,
referrer_policy: Optional[Union[Var[str], str]] = None, referrer_policy: Var[str] | str | None = None,
is_async: Optional[Union[Var[bool], bool]] = None, is_async: Var[bool] | bool | None = None,
defer: Optional[Union[Var[bool], bool]] = None, defer: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,8 +2,6 @@
from __future__ import annotations from __future__ import annotations
from typing import Optional
from reflex.components.base.bare import Bare from reflex.components.base.bare import Bare
from reflex.components.component import Component from reflex.components.component import Component
@ -34,19 +32,19 @@ class Meta(Component):
tag = "meta" tag = "meta"
# The description of character encoding. # The description of character encoding.
char_set: Optional[str] = None char_set: str | None = None
# The value of meta. # The value of meta.
content: Optional[str] = None content: str | None = None
# The name of metadata. # The name of metadata.
name: Optional[str] = None name: str | None = None
# The type of metadata value. # The type of metadata value.
property: Optional[str] = None property: str | None = None
# The type of metadata value. # The type of metadata value.
http_equiv: Optional[str] = None http_equiv: str | None = None
class Description(Meta): class Description(Meta):

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -17,12 +17,12 @@ class Title(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -63,17 +63,17 @@ class Meta(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
char_set: Optional[str] = None, char_set: str | None = None,
content: Optional[str] = None, content: str | None = None,
name: Optional[str] = None, name: str | None = None,
property: Optional[str] = None, property: str | None = None,
http_equiv: Optional[str] = None, http_equiv: str | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -119,17 +119,17 @@ class Description(Meta):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
name: Optional[str] = None, name: str | None = None,
char_set: Optional[str] = None, char_set: str | None = None,
content: Optional[str] = None, content: str | None = None,
property: Optional[str] = None, property: str | None = None,
http_equiv: Optional[str] = None, http_equiv: str | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -175,17 +175,17 @@ class Image(Meta):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
property: Optional[str] = None, property: str | None = None,
char_set: Optional[str] = None, char_set: str | None = None,
content: Optional[str] = None, content: str | None = None,
name: Optional[str] = None, name: str | None = None,
http_equiv: Optional[str] = None, http_equiv: str | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,19 +16,16 @@ class Script(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
src: Optional[Union[Var[str], str]] = None, src: Var[str] | str | None = None,
strategy: Optional[ strategy: Literal["afterInteractive", "beforeInteractive", "lazyOnload"]
Union[ | Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]]
Literal["afterInteractive", "beforeInteractive", "lazyOnload"], | None = None,
Var[Literal["afterInteractive", "beforeInteractive", "lazyOnload"]], style: Style | None = None,
] key: Any | None = None,
] = None, id: Any | None = None,
style: Optional[Style] = None, class_name: Any | None = None,
key: Optional[Any] = None, autofocus: bool | None = None,
id: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,12 +16,12 @@ class StrictMode(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -14,10 +14,8 @@ from typing import (
Any, Any,
Callable, Callable,
ClassVar, ClassVar,
Dict,
Iterator, Iterator,
List, List,
Optional,
Sequence, Sequence,
Set, Set,
Type, Type,
@ -76,19 +74,19 @@ class BaseComponent(Base, ABC):
""" """
# The children nested within the component. # The children nested within the component.
children: List[BaseComponent] = [] children: list[BaseComponent] = []
# The library that the component is based on. # The library that the component is based on.
library: Optional[str] = None library: str | None = None
# List here the non-react dependency needed by `library` # List here the non-react dependency needed by `library`
lib_dependencies: List[str] = [] lib_dependencies: list[str] = []
# List here the dependencies that need to be transpiled by Next.js # List here the dependencies that need to be transpiled by Next.js
transpile_packages: List[str] = [] transpile_packages: list[str] = []
# The tag to use when rendering the component. # The tag to use when rendering the component.
tag: Optional[str] = None tag: str | None = None
@abstractmethod @abstractmethod
def render(self) -> dict: def render(self) -> dict:
@ -175,10 +173,8 @@ def evaluate_style_namespaces(style: ComponentStyle) -> dict:
# Map from component to styling. # Map from component to styling.
ComponentStyle = Dict[ ComponentStyle = dict[str | Type[BaseComponent] | Callable | ComponentNamespace, Any]
Union[str, Type[BaseComponent], Callable, ComponentNamespace], Any ComponentChild = types.PrimitiveType | Var | BaseComponent
]
ComponentChild = Union[types.PrimitiveType, Var, BaseComponent]
ComponentChildTypes = (*types.PrimitiveTypes, Var, BaseComponent) ComponentChildTypes = (*types.PrimitiveTypes, Var, BaseComponent)
@ -221,13 +217,13 @@ class Component(BaseComponent, ABC):
style: Style = Style() style: Style = Style()
# A mapping from event triggers to event chains. # A mapping from event triggers to event chains.
event_triggers: Dict[str, Union[EventChain, Var]] = {} event_triggers: dict[str, EventChain | Var] = {}
# The alias for the tag. # The alias for the tag.
alias: Optional[str] = None alias: str | None = None
# Whether the import is default or named. # Whether the import is default or named.
is_default: Optional[bool] = False is_default: bool | None = False
# A unique key for the component. # A unique key for the component.
key: Any = None key: Any = None
@ -239,31 +235,31 @@ class Component(BaseComponent, ABC):
class_name: Any = None class_name: Any = None
# Special component props. # Special component props.
special_props: List[Var] = [] special_props: list[Var] = []
# Whether the component should take the focus once the page is loaded # Whether the component should take the focus once the page is loaded
autofocus: bool = False autofocus: bool = False
# components that cannot be children # components that cannot be children
_invalid_children: List[str] = [] _invalid_children: list[str] = []
# only components that are allowed as children # only components that are allowed as children
_valid_children: List[str] = [] _valid_children: list[str] = []
# only components that are allowed as parent # only components that are allowed as parent
_valid_parents: List[str] = [] _valid_parents: list[str] = []
# props to change the name of # props to change the name of
_rename_props: Dict[str, str] = {} _rename_props: dict[str, str] = {}
# custom attribute # custom attribute
custom_attrs: Dict[str, Union[Var, Any]] = {} custom_attrs: dict[str, Var | Any] = {}
# When to memoize this component and its children. # When to memoize this component and its children.
_memoization_mode: MemoizationMode = MemoizationMode() _memoization_mode: MemoizationMode = MemoizationMode()
# State class associated with this component instance # State class associated with this component instance
State: Optional[Type[reflex.state.State]] = None State: Type[reflex.state.State] | None = None
def add_imports(self) -> ImportDict | list[ImportDict]: def add_imports(self) -> ImportDict | list[ImportDict]:
"""Add imports for the component. """Add imports for the component.
@ -550,7 +546,7 @@ class Component(BaseComponent, ABC):
if isinstance(class_name, (List, tuple)): if isinstance(class_name, (List, tuple)):
if any(isinstance(c, Var) for c in class_name): if any(isinstance(c, Var) for c in class_name):
kwargs["class_name"] = LiteralArrayVar.create( kwargs["class_name"] = LiteralArrayVar.create(
class_name, _var_type=List[str] class_name, _var_type=list[str]
).join(" ") ).join(" ")
else: else:
kwargs["class_name"] = " ".join(class_name) kwargs["class_name"] = " ".join(class_name)
@ -560,13 +556,13 @@ class Component(BaseComponent, ABC):
def get_event_triggers( def get_event_triggers(
self, self,
) -> Dict[str, types.ArgsSpec | Sequence[types.ArgsSpec]]: ) -> dict[str, types.ArgsSpec | Sequence[types.ArgsSpec]]:
"""Get the event triggers for the component. """Get the event triggers for the component.
Returns: Returns:
The event triggers. The event triggers.
""" """
default_triggers: Dict[str, types.ArgsSpec | Sequence[types.ArgsSpec]] = { default_triggers: dict[str, types.ArgsSpec | Sequence[types.ArgsSpec]] = {
EventTriggers.ON_FOCUS: no_args_event_spec, EventTriggers.ON_FOCUS: no_args_event_spec,
EventTriggers.ON_BLUR: no_args_event_spec, EventTriggers.ON_BLUR: no_args_event_spec,
EventTriggers.ON_CLICK: no_args_event_spec, EventTriggers.ON_CLICK: no_args_event_spec,
@ -670,7 +666,7 @@ class Component(BaseComponent, ABC):
@classmethod @classmethod
@lru_cache(maxsize=None) @lru_cache(maxsize=None)
def get_props(cls) -> Set[str]: def get_props(cls) -> set[str]:
"""Get the unique fields for the component. """Get the unique fields for the component.
Returns: Returns:
@ -680,7 +676,7 @@ class Component(BaseComponent, ABC):
@classmethod @classmethod
@lru_cache(maxsize=None) @lru_cache(maxsize=None)
def get_initial_props(cls) -> Set[str]: def get_initial_props(cls) -> set[str]:
"""Get the initial props to set for the component. """Get the initial props to set for the component.
Returns: Returns:
@ -829,7 +825,7 @@ class Component(BaseComponent, ABC):
return component_style return component_style
def _add_style_recursive( def _add_style_recursive(
self, style: ComponentStyle, theme: Optional[Component] = None self, style: ComponentStyle, theme: Component | None = None
) -> Component: ) -> Component:
"""Add additional style to the component and its children. """Add additional style to the component and its children.
@ -928,7 +924,7 @@ class Component(BaseComponent, ABC):
if prop.startswith(old_prop): if prop.startswith(old_prop):
rendered_dict["props"][ix] = prop.replace(old_prop, new_prop, 1) rendered_dict["props"][ix] = prop.replace(old_prop, new_prop, 1)
def _validate_component_children(self, children: List[Component]): def _validate_component_children(self, children: list[Component]):
"""Validate the children components. """Validate the children components.
Args: Args:
@ -1038,7 +1034,7 @@ class Component(BaseComponent, ABC):
Each var referenced by the component (props, styles, event handlers). Each var referenced by the component (props, styles, event handlers).
""" """
ignore_ids = ignore_ids or set() ignore_ids = ignore_ids or set()
vars: List[Var] | None = getattr(self, "__vars", None) vars: list[Var] | None = getattr(self, "__vars", None)
if vars is not None: if vars is not None:
yield from vars yield from vars
vars = self.__vars = [] vars = self.__vars = []
@ -1211,7 +1207,7 @@ class Component(BaseComponent, ABC):
""" """
return None return None
def _get_all_dynamic_imports(self) -> Set[str]: def _get_all_dynamic_imports(self) -> set[str]:
"""Get dynamic imports for the component and its children. """Get dynamic imports for the component and its children.
Returns: Returns:
@ -1578,7 +1574,7 @@ class Component(BaseComponent, ABC):
def _get_all_custom_components( def _get_all_custom_components(
self, seen: set[str] | None = None self, seen: set[str] | None = None
) -> Set[CustomComponent]: ) -> set[CustomComponent]:
"""Get all the custom components used by the component. """Get all the custom components used by the component.
Args: Args:
@ -1661,7 +1657,7 @@ class CustomComponent(Component):
component_fn: Callable[..., Component] = Component.create component_fn: Callable[..., Component] = Component.create
# The props of the component. # The props of the component.
props: Dict[str, Any] = {} props: dict[str, Any] = {}
def __init__(self, **kwargs): def __init__(self, **kwargs):
"""Initialize the custom component. """Initialize the custom component.
@ -1780,7 +1776,7 @@ class CustomComponent(Component):
return hash(self.tag) return hash(self.tag)
@classmethod @classmethod
def get_props(cls) -> Set[str]: def get_props(cls) -> set[str]:
"""Get the props for the component. """Get the props for the component.
Returns: Returns:
@ -1790,7 +1786,7 @@ class CustomComponent(Component):
def _get_all_custom_components( def _get_all_custom_components(
self, seen: set[str] | None = None self, seen: set[str] | None = None
) -> Set[CustomComponent]: ) -> set[CustomComponent]:
"""Get all the custom components used by the component. """Get all the custom components used by the component.
Args: Args:
@ -1942,7 +1938,7 @@ class StatefulComponent(BaseComponent):
""" """
# A lookup table to caching memoized component instances. # A lookup table to caching memoized component instances.
tag_to_stateful_component: ClassVar[Dict[str, StatefulComponent]] = {} tag_to_stateful_component: ClassVar[dict[str, StatefulComponent]] = {}
# Reference to the original component that was memoized into this component. # Reference to the original component that was memoized into this component.
component: Component component: Component

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.el.elements.typography import Div from reflex.components.el.elements.typography import Div
from reflex.event import EventType from reflex.event import EventType
@ -17,217 +17,190 @@ class AutoScroll(Div):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
access_key: Optional[Union[Var[str], str]] = None, access_key: Var[str] | str | None = None,
auto_capitalize: Optional[ auto_capitalize: Literal[
Union[ "characters", "none", "off", "on", "sentences", "words"
Literal["characters", "none", "off", "on", "sentences", "words"], ]
Var[Literal["characters", "none", "off", "on", "sentences", "words"]], | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
content_editable: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal["inherit", "plaintext-only", False, True], lang: Var[str] | str | None = None,
Var[Literal["inherit", "plaintext-only", False, True]], role: Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
context_menu: Optional[Union[Var[str], str]] = None, | None = None,
dir: Optional[Union[Var[str], str]] = None, slot: Var[str] | str | None = None,
draggable: Optional[Union[Var[bool], bool]] = None, spell_check: Var[bool] | bool | None = None,
enter_key_hint: Optional[ tab_index: Var[int] | int | None = None,
Union[ title: Var[str] | str | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"], style: Style | None = None,
Var[ key: Any | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"] id: Any | None = None,
], class_name: Any | None = None,
] autofocus: bool | None = None,
] = None, custom_attrs: dict[str, Var | Any] | None = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,8 +2,6 @@
from __future__ import annotations from __future__ import annotations
from typing import Optional
from reflex import constants from reflex import constants
from reflex.components.component import Component from reflex.components.component import Component
from reflex.components.core.cond import cond from reflex.components.core.cond import cond
@ -197,7 +195,7 @@ class ConnectionBanner(Component):
"""A connection banner component.""" """A connection banner component."""
@classmethod @classmethod
def create(cls, comp: Optional[Component] = None) -> Component: def create(cls, comp: Component | None = None) -> Component:
"""Create a connection banner component. """Create a connection banner component.
Args: Args:
@ -227,7 +225,7 @@ class ConnectionModal(Component):
"""A connection status modal window.""" """A connection status modal window."""
@classmethod @classmethod
def create(cls, comp: Optional[Component] = None) -> Component: def create(cls, comp: Component | None = None) -> Component:
"""Create a connection banner component. """Create a connection banner component.
Args: Args:

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.components.el.elements.typography import Div from reflex.components.el.elements.typography import Div
@ -48,47 +48,44 @@ class ConnectionToaster(Toaster):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
theme: Optional[Union[Var[str], str]] = None, theme: Var[str] | str | None = None,
rich_colors: Optional[Union[Var[bool], bool]] = None, rich_colors: Var[bool] | bool | None = None,
expand: Optional[Union[Var[bool], bool]] = None, expand: Var[bool] | bool | None = None,
visible_toasts: Optional[Union[Var[int], int]] = None, visible_toasts: Var[int] | int | None = None,
position: Optional[ position: Literal[
Union[ "bottom-center",
Literal[ "bottom-left",
"bottom-center", "bottom-right",
"bottom-left", "top-center",
"bottom-right", "top-left",
"top-center", "top-right",
"top-left", ]
"top-right", | Var[
], Literal[
Var[ "bottom-center",
Literal[ "bottom-left",
"bottom-center", "bottom-right",
"bottom-left", "top-center",
"bottom-right", "top-left",
"top-center", "top-right",
"top-left",
"top-right",
]
],
] ]
] = None, ]
close_button: Optional[Union[Var[bool], bool]] = None, | None = None,
offset: Optional[Union[Var[str], str]] = None, close_button: Var[bool] | bool | None = None,
dir: Optional[Union[Var[str], str]] = None, offset: Var[str] | str | None = None,
hotkey: Optional[Union[Var[str], str]] = None, dir: Var[str] | str | None = None,
invert: Optional[Union[Var[bool], bool]] = None, hotkey: Var[str] | str | None = None,
toast_options: Optional[Union[ToastProps, Var[ToastProps]]] = None, invert: Var[bool] | bool | None = None,
gap: Optional[Union[Var[int], int]] = None, toast_options: ToastProps | Var[ToastProps] | None = None,
loading_icon: Optional[Union[Icon, Var[Icon]]] = None, gap: Var[int] | int | None = None,
pause_when_page_is_hidden: Optional[Union[Var[bool], bool]] = None, loading_icon: Icon | Var[Icon] | None = None,
style: Optional[Style] = None, pause_when_page_is_hidden: Var[bool] | bool | None = None,
key: Optional[Any] = None, style: Style | None = None,
id: Optional[Any] = None, key: Any | None = None,
class_name: Optional[Any] = None, id: Any | None = None,
autofocus: Optional[bool] = None, class_name: Any | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, autofocus: bool | None = None,
custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -143,12 +140,12 @@ class ConnectionBanner(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -182,12 +179,12 @@ class ConnectionModal(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -221,13 +218,13 @@ class WifiOffPulse(Icon):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
size: Optional[Union[Var[int], int]] = None, size: Var[int] | int | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -271,217 +268,190 @@ class ConnectionPulser(Div):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
access_key: Optional[Union[Var[str], str]] = None, access_key: Var[str] | str | None = None,
auto_capitalize: Optional[ auto_capitalize: Literal[
Union[ "characters", "none", "off", "on", "sentences", "words"
Literal["characters", "none", "off", "on", "sentences", "words"], ]
Var[Literal["characters", "none", "off", "on", "sentences", "words"]], | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
content_editable: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal["inherit", "plaintext-only", False, True], lang: Var[str] | str | None = None,
Var[Literal["inherit", "plaintext-only", False, True]], role: Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
context_menu: Optional[Union[Var[str], str]] = None, | None = None,
dir: Optional[Union[Var[str], str]] = None, slot: Var[str] | str | None = None,
draggable: Optional[Union[Var[bool], bool]] = None, spell_check: Var[bool] | bool | None = None,
enter_key_hint: Optional[ tab_index: Var[int] | int | None = None,
Union[ title: Var[str] | str | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"], style: Style | None = None,
Var[ key: Any | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"] id: Any | None = None,
], class_name: Any | None = None,
] autofocus: bool | None = None,
] = None, custom_attrs: dict[str, Var | Any] | None = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -537,217 +507,190 @@ class BackendDisabled(Div):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
access_key: Optional[Union[Var[str], str]] = None, access_key: Var[str] | str | None = None,
auto_capitalize: Optional[ auto_capitalize: Literal[
Union[ "characters", "none", "off", "on", "sentences", "words"
Literal["characters", "none", "off", "on", "sentences", "words"], ]
Var[Literal["characters", "none", "off", "on", "sentences", "words"]], | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
content_editable: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal["inherit", "plaintext-only", False, True], lang: Var[str] | str | None = None,
Var[Literal["inherit", "plaintext-only", False, True]], role: Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
context_menu: Optional[Union[Var[str], str]] = None, | None = None,
dir: Optional[Union[Var[str], str]] = None, slot: Var[str] | str | None = None,
draggable: Optional[Union[Var[bool], bool]] = None, spell_check: Var[bool] | bool | None = None,
enter_key_hint: Optional[ tab_index: Var[int] | int | None = None,
Union[ title: Var[str] | str | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"], style: Style | None = None,
Var[ key: Any | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"] id: Any | None = None,
], class_name: Any | None = None,
] autofocus: bool | None = None,
] = None, custom_attrs: dict[str, Var | Any] | None = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,13 +2,13 @@
from __future__ import annotations from __future__ import annotations
from typing import Dict, Tuple, TypeVar, Union from typing import TypeVar
breakpoints_values = ["30em", "48em", "62em", "80em", "96em"] breakpoints_values = ["30em", "48em", "62em", "80em", "96em"]
breakpoint_names = ["xs", "sm", "md", "lg", "xl"] breakpoint_names = ["xs", "sm", "md", "lg", "xl"]
def set_breakpoints(values: Tuple[str, str, str, str, str]): def set_breakpoints(values: tuple[str, str, str, str, str]):
"""Overwrite default breakpoint values. """Overwrite default breakpoint values.
Args: Args:
@ -22,7 +22,7 @@ K = TypeVar("K", bound=str)
V = TypeVar("V") V = TypeVar("V")
class Breakpoints(Dict[K, V]): class Breakpoints(dict[K, V]):
"""A responsive styling helper.""" """A responsive styling helper."""
def factorize(self): def factorize(self):
@ -46,7 +46,7 @@ class Breakpoints(Dict[K, V]):
@classmethod @classmethod
def create( def create(
cls, cls,
custom: Dict[K, V] | None = None, custom: dict[K, V] | None = None,
initial: V | None = None, initial: V | None = None,
xs: V | None = None, xs: V | None = None,
sm: V | None = None, sm: V | None = None,
@ -94,4 +94,4 @@ breakpoints = Breakpoints.create
T = TypeVar("T") T = TypeVar("T")
Responsive = Union[T, Breakpoints[str, T]] Responsive = T | Breakpoints[str, T]

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -20,12 +20,12 @@ class ClientSideRouting(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -68,13 +68,13 @@ class Default404Page(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
status_code: Optional[Union[Var[int], int]] = None, status_code: Var[int] | int | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,8 +2,6 @@
from __future__ import annotations from __future__ import annotations
from typing import Dict, List, Tuple, Union
from reflex.components.base.fragment import Fragment from reflex.components.base.fragment import Fragment
from reflex.components.tags.tag import Tag from reflex.components.tags.tag import Tag
from reflex.constants.compiler import Hooks from reflex.constants.compiler import Hooks
@ -18,13 +16,13 @@ class Clipboard(Fragment):
"""Clipboard component.""" """Clipboard component."""
# The element ids to attach the event listener to. Defaults to all child components or the document. # The element ids to attach the event listener to. Defaults to all child components or the document.
targets: Var[List[str]] targets: Var[list[str]]
# Called when the user pastes data into the document. Data is a list of tuples of (mime_type, data). Binary types will be base64 encoded as a data uri. # Called when the user pastes data into the document. Data is a list of tuples of (mime_type, data). Binary types will be base64 encoded as a data uri.
on_paste: EventHandler[passthrough_event_spec(List[Tuple[str, str]])] on_paste: EventHandler[passthrough_event_spec(list[tuple[str, str]])]
# Save the original event actions for the on_paste event. # Save the original event actions for the on_paste event.
on_paste_event_actions: Var[Dict[str, Union[bool, int]]] on_paste_event_actions: Var[dict[str, bool | int]]
@classmethod @classmethod
def create(cls, *children, **props): def create(cls, *children, **props):

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, List, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.base.fragment import Fragment from reflex.components.base.fragment import Fragment
from reflex.event import EventType from reflex.event import EventType
@ -17,16 +17,16 @@ class Clipboard(Fragment):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
targets: Optional[Union[List[str], Var[List[str]]]] = None, targets: Var[list[str]] | list[str] | None = None,
on_paste_event_actions: Optional[ on_paste_event_actions: Var[dict[str, bool | int]]
Union[Dict[str, Union[bool, int]], Var[Dict[str, Union[bool, int]]]] | dict[str, bool | int]
] = None, | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -40,9 +40,7 @@ class Clipboard(Fragment):
on_mouse_out: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None,
on_mouse_over: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None,
on_mouse_up: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None,
on_paste: Optional[ on_paste: Optional[EventType[()] | EventType[list[tuple[str, str]]]] = None,
Union[EventType[()], EventType[list[tuple[str, str]]]]
] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, Optional, overload from typing import Any, Dict, overload
from reflex.components.base.fragment import Fragment from reflex.components.base.fragment import Fragment
from reflex.components.component import BaseComponent, Component, MemoizationLeaf from reflex.components.component import BaseComponent, Component, MemoizationLeaf
@ -35,7 +35,7 @@ class Cond(MemoizationLeaf):
cls, cls,
cond: Var, cond: Var,
comp1: BaseComponent, comp1: BaseComponent,
comp2: Optional[BaseComponent] = None, comp2: BaseComponent | None = None,
) -> Component: ) -> Component:
"""Create a conditional component. """Create a conditional component.

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Type, Union from typing import Any, Type
from reflex.components.component import Component from reflex.components.component import Component
from reflex.constants import EventTriggers from reflex.constants import EventTriggers
@ -37,7 +37,7 @@ class DebounceInput(Component):
force_notify_on_blur: Var[bool] force_notify_on_blur: Var[bool]
# If provided, create a fully-controlled input # If provided, create a fully-controlled input
value: Var[Union[str, int, float]] value: Var[str | int | float]
# The ref to attach to the created input # The ref to attach to the created input
input_ref: Var[str] input_ref: Var[str]

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Type, Union, overload from typing import Any, Optional, Type, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -18,19 +18,19 @@ class DebounceInput(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
min_length: Optional[Union[Var[int], int]] = None, min_length: Var[int] | int | None = None,
debounce_timeout: Optional[Union[Var[int], int]] = None, debounce_timeout: Var[int] | int | None = None,
force_notify_by_enter: Optional[Union[Var[bool], bool]] = None, force_notify_by_enter: Var[bool] | bool | None = None,
force_notify_on_blur: Optional[Union[Var[bool], bool]] = None, force_notify_on_blur: Var[bool] | bool | None = None,
value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None, value: Var[float | int | str] | float | int | str | None = None,
input_ref: Optional[Union[Var[str], str]] = None, input_ref: Var[str] | str | None = None,
element: Optional[Union[Type[Component], Var[Type[Component]]]] = None, element: Type[Component] | Var[Type[Component]] | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_change: Optional[EventType[()]] = None, on_change: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,

View File

@ -1,7 +1,5 @@
"""A html component.""" """A html component."""
from typing import Dict
from reflex.components.el.elements.typography import Div from reflex.components.el.elements.typography import Div
from reflex.vars.base import Var from reflex.vars.base import Var
@ -14,7 +12,7 @@ class Html(Div):
""" """
# The HTML to render. # The HTML to render.
dangerouslySetInnerHTML: Var[Dict[str, str]] # noqa: N815 dangerouslySetInnerHTML: Var[dict[str, str]] # noqa: N815
@classmethod @classmethod
def create(cls, *children, **props): def create(cls, *children, **props):

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.el.elements.typography import Div from reflex.components.el.elements.typography import Div
from reflex.event import EventType from reflex.event import EventType
@ -16,220 +16,191 @@ class Html(Div):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
dangerouslySetInnerHTML: Optional[ dangerouslySetInnerHTML: Var[dict[str, str]] | dict[str, str] | None = None,
Union[Dict[str, str], Var[Dict[str, str]]] access_key: Var[str] | str | None = None,
] = None, auto_capitalize: Literal[
access_key: Optional[Union[Var[str], str]] = None, "characters", "none", "off", "on", "sentences", "words"
auto_capitalize: Optional[ ]
Union[ | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
Literal["characters", "none", "off", "on", "sentences", "words"], | None = None,
Var[Literal["characters", "none", "off", "on", "sentences", "words"]], content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
content_editable: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal["inherit", "plaintext-only", False, True], lang: Var[str] | str | None = None,
Var[Literal["inherit", "plaintext-only", False, True]], role: Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
context_menu: Optional[Union[Var[str], str]] = None, | None = None,
dir: Optional[Union[Var[str], str]] = None, slot: Var[str] | str | None = None,
draggable: Optional[Union[Var[bool], bool]] = None, spell_check: Var[bool] | bool | None = None,
enter_key_hint: Optional[ tab_index: Var[int] | int | None = None,
Union[ title: Var[str] | str | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"], style: Style | None = None,
Var[ key: Any | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"] id: Any | None = None,
], class_name: Any | None = None,
] autofocus: bool | None = None,
] = None, custom_attrs: dict[str, Var | Any] | None = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -1,7 +1,7 @@
"""rx.match.""" """rx.match."""
import textwrap import textwrap
from typing import Any, Dict, List, Optional, Tuple, Union from typing import Any, Dict, List
from reflex.components.base import Fragment from reflex.components.base import Fragment
from reflex.components.component import BaseComponent, Component, MemoizationLeaf from reflex.components.component import BaseComponent, Component, MemoizationLeaf
@ -21,13 +21,13 @@ class Match(MemoizationLeaf):
cond: Var[Any] cond: Var[Any]
# The list of match cases to be matched. # The list of match cases to be matched.
match_cases: List[Any] = [] match_cases: list[Any] = []
# The catchall case to match. # The catchall case to match.
default: Any default: Any
@classmethod @classmethod
def create(cls, cond: Any, *cases) -> Union[Component, Var]: def create(cls, cond: Any, *cases) -> Component | Var:
"""Create a Match Component. """Create a Match Component.
Args: Args:
@ -75,9 +75,7 @@ class Match(MemoizationLeaf):
return match_cond_var return match_cond_var
@classmethod @classmethod
def _process_cases( def _process_cases(cls, cases: List) -> tuple[List, Var | BaseComponent | None]:
cls, cases: List
) -> Tuple[List, Optional[Union[Var, BaseComponent]]]:
"""Process the list of match cases and the catchall default case. """Process the list of match cases and the catchall default case.
Args: Args:
@ -125,7 +123,7 @@ class Match(MemoizationLeaf):
return case_element return case_element
@classmethod @classmethod
def _process_match_cases(cls, cases: List) -> List[List[Var]]: def _process_match_cases(cls, cases: List) -> list[list[Var]]:
"""Process the individual match cases. """Process the individual match cases.
Args: Args:
@ -166,7 +164,7 @@ class Match(MemoizationLeaf):
return match_cases return match_cases
@classmethod @classmethod
def _validate_return_types(cls, match_cases: List[List[Var]]) -> None: def _validate_return_types(cls, match_cases: list[list[Var]]) -> None:
"""Validate that match cases have the same return types. """Validate that match cases have the same return types.
Args: Args:
@ -195,9 +193,9 @@ class Match(MemoizationLeaf):
def _create_match_cond_var_or_component( def _create_match_cond_var_or_component(
cls, cls,
match_cond_var: Var, match_cond_var: Var,
match_cases: List[List[Var]], match_cases: list[list[Var]],
default: Optional[Union[Var, BaseComponent]], default: Var | BaseComponent | None,
) -> Union[Component, Var]: ) -> Component | Var:
"""Create and return the match condition var or component. """Create and return the match condition var or component.
Args: Args:

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
from __future__ import annotations from __future__ import annotations
from pathlib import Path from pathlib import Path
from typing import Any, Callable, ClassVar, Dict, List, Optional, Tuple from typing import Any, Callable, ClassVar, List
from reflex.components.base.fragment import Fragment from reflex.components.base.fragment import Fragment
from reflex.components.component import ( from reflex.components.component import (
@ -86,7 +86,7 @@ def selected_files(id_: str = DEFAULT_UPLOAD_ID) -> Var:
id_var = LiteralStringVar.create(id_) id_var = LiteralStringVar.create(id_)
return Var( return Var(
_js_expr=f"(filesById[{id_var!s}] ? filesById[{id_var!s}].map((f) => (f.path || f.name)) : [])", _js_expr=f"(filesById[{id_var!s}] ? filesById[{id_var!s}].map((f) => (f.path || f.name)) : [])",
_var_type=List[str], _var_type=list[str],
_var_data=VarData.merge( _var_data=VarData.merge(
upload_files_context_var_data, id_var._get_all_var_data() upload_files_context_var_data, id_var._get_all_var_data()
), ),
@ -161,7 +161,7 @@ def get_upload_url(file_path: str | Var[str]) -> Var[str]:
return Var.create(f"{uploaded_files_url_prefix}/{file_path}") return Var.create(f"{uploaded_files_url_prefix}/{file_path}")
def _on_drop_spec(files: Var) -> Tuple[Var[Any]]: def _on_drop_spec(files: Var) -> tuple[Var[Any]]:
"""Args spec for the on_drop event trigger. """Args spec for the on_drop event trigger.
Args: Args:
@ -197,7 +197,7 @@ class Upload(MemoizationLeaf):
# The list of accepted file types. This should be a dictionary of MIME types as keys and array of file formats as # The list of accepted file types. This should be a dictionary of MIME types as keys and array of file formats as
# values. # values.
# supported MIME types: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types # supported MIME types: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
accept: Var[Optional[Dict[str, List]]] accept: Var[dict[str, List] | None]
# Whether the dropzone is disabled. # Whether the dropzone is disabled.
disabled: Var[bool] disabled: Var[bool]

View File

@ -4,7 +4,7 @@
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from pathlib import Path from pathlib import Path
from typing import Any, ClassVar, Dict, List, Optional, Union, overload from typing import Any, ClassVar, List, Optional, overload
from reflex.components.base.fragment import Fragment from reflex.components.base.fragment import Fragment
from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf from reflex.components.component import Component, ComponentNamespace, MemoizationLeaf
@ -43,12 +43,12 @@ class UploadFilesProvider(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -89,17 +89,17 @@ class GhostUpload(Fragment):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_drop: Optional[Union[EventType[()], EventType[Any]]] = None, on_drop: Optional[EventType[()] | EventType[Any]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
@ -139,26 +139,26 @@ class Upload(MemoizationLeaf):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None, accept: Var[dict[str, List] | None] | dict[str, List] | None = None,
disabled: Optional[Union[Var[bool], bool]] = None, disabled: Var[bool] | bool | None = None,
max_files: Optional[Union[Var[int], int]] = None, max_files: Var[int] | int | None = None,
max_size: Optional[Union[Var[int], int]] = None, max_size: Var[int] | int | None = None,
min_size: Optional[Union[Var[int], int]] = None, min_size: Var[int] | int | None = None,
multiple: Optional[Union[Var[bool], bool]] = None, multiple: Var[bool] | bool | None = None,
no_click: Optional[Union[Var[bool], bool]] = None, no_click: Var[bool] | bool | None = None,
no_drag: Optional[Union[Var[bool], bool]] = None, no_drag: Var[bool] | bool | None = None,
no_keyboard: Optional[Union[Var[bool], bool]] = None, no_keyboard: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_drop: Optional[Union[EventType[()], EventType[Any]]] = None, on_drop: Optional[EventType[()] | EventType[Any]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
@ -205,26 +205,26 @@ class StyledUpload(Upload):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None, accept: Var[dict[str, List] | None] | dict[str, List] | None = None,
disabled: Optional[Union[Var[bool], bool]] = None, disabled: Var[bool] | bool | None = None,
max_files: Optional[Union[Var[int], int]] = None, max_files: Var[int] | int | None = None,
max_size: Optional[Union[Var[int], int]] = None, max_size: Var[int] | int | None = None,
min_size: Optional[Union[Var[int], int]] = None, min_size: Var[int] | int | None = None,
multiple: Optional[Union[Var[bool], bool]] = None, multiple: Var[bool] | bool | None = None,
no_click: Optional[Union[Var[bool], bool]] = None, no_click: Var[bool] | bool | None = None,
no_drag: Optional[Union[Var[bool], bool]] = None, no_drag: Var[bool] | bool | None = None,
no_keyboard: Optional[Union[Var[bool], bool]] = None, no_keyboard: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_drop: Optional[Union[EventType[()], EventType[Any]]] = None, on_drop: Optional[EventType[()] | EventType[Any]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
@ -271,26 +271,26 @@ class UploadNamespace(ComponentNamespace):
@staticmethod @staticmethod
def __call__( def __call__(
*children, *children,
accept: Optional[Union[Dict[str, List], Var[Optional[Dict[str, List]]]]] = None, accept: Var[dict[str, List] | None] | dict[str, List] | None = None,
disabled: Optional[Union[Var[bool], bool]] = None, disabled: Var[bool] | bool | None = None,
max_files: Optional[Union[Var[int], int]] = None, max_files: Var[int] | int | None = None,
max_size: Optional[Union[Var[int], int]] = None, max_size: Var[int] | int | None = None,
min_size: Optional[Union[Var[int], int]] = None, min_size: Var[int] | int | None = None,
multiple: Optional[Union[Var[bool], bool]] = None, multiple: Var[bool] | bool | None = None,
no_click: Optional[Union[Var[bool], bool]] = None, no_click: Var[bool] | bool | None = None,
no_drag: Optional[Union[Var[bool], bool]] = None, no_drag: Var[bool] | bool | None = None,
no_keyboard: Optional[Union[Var[bool], bool]] = None, no_keyboard: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_drop: Optional[Union[EventType[()], EventType[Any]]] = None, on_drop: Optional[EventType[()] | EventType[Any]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,

View File

@ -4,7 +4,7 @@ from __future__ import annotations
import dataclasses import dataclasses
import typing import typing
from typing import ClassVar, Dict, Literal, Optional, Union from typing import ClassVar, Literal
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.cond import color_mode_cond from reflex.components.core.cond import color_mode_cond
@ -390,7 +390,7 @@ class CodeBlock(Component, MarkdownComponentMap):
alias = "SyntaxHighlighter" alias = "SyntaxHighlighter"
# The theme to use ("light" or "dark"). # The theme to use ("light" or "dark").
theme: Var[Union[Theme, str]] = Theme.one_light theme: Var[Theme | str] = Theme.one_light
# The language to use. # The language to use.
language: Var[LiteralCodeLanguage] = Var.create("python") language: Var[LiteralCodeLanguage] = Var.create("python")
@ -408,16 +408,16 @@ class CodeBlock(Component, MarkdownComponentMap):
wrap_long_lines: Var[bool] wrap_long_lines: Var[bool]
# A custom style for the code block. # A custom style for the code block.
custom_style: Dict[str, Union[str, Var, Color]] = {} custom_style: dict[str, str | Var | Color] = {}
# Props passed down to the code tag. # Props passed down to the code tag.
code_tag_props: Var[Dict[str, str]] code_tag_props: Var[dict[str, str]]
# Whether a copy button should appear. # Whether a copy button should appear.
can_copy: Optional[bool] = False can_copy: bool | None = False
# A custom copy button to override the default one. # A custom copy button to override the default one.
copy_button: Optional[Union[bool, Component]] = None copy_button: bool | Component | None = None
@classmethod @classmethod
def create( def create(

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
from __future__ import annotations from __future__ import annotations
from enum import Enum from enum import Enum
from typing import Any, Dict, List, Literal, Optional, Tuple, TypedDict, Union from typing import Any, Dict, Literal, TypedDict
from reflex.base import Base from reflex.base import Base
from reflex.components.component import Component, NoSSRComponent from reflex.components.component import Component, NoSSRComponent
@ -52,38 +52,38 @@ class GridColumnIcons(Enum):
class DataEditorTheme(Base): class DataEditorTheme(Base):
"""The theme for the DataEditor component.""" """The theme for the DataEditor component."""
accent_color: Optional[str] = None accent_color: str | None = None
accent_fg: Optional[str] = None accent_fg: str | None = None
accent_light: Optional[str] = None accent_light: str | None = None
base_font_style: Optional[str] = None base_font_style: str | None = None
bg_bubble: Optional[str] = None bg_bubble: str | None = None
bg_bubble_selected: Optional[str] = None bg_bubble_selected: str | None = None
bg_cell: Optional[str] = None bg_cell: str | None = None
bg_cell_medium: Optional[str] = None bg_cell_medium: str | None = None
bg_header: Optional[str] = None bg_header: str | None = None
bg_header_has_focus: Optional[str] = None bg_header_has_focus: str | None = None
bg_header_hovered: Optional[str] = None bg_header_hovered: str | None = None
bg_icon_header: Optional[str] = None bg_icon_header: str | None = None
bg_search_result: Optional[str] = None bg_search_result: str | None = None
border_color: Optional[str] = None border_color: str | None = None
cell_horizontal_padding: Optional[int] = None cell_horizontal_padding: int | None = None
cell_vertical_padding: Optional[int] = None cell_vertical_padding: int | None = None
drilldown_border: Optional[str] = None drilldown_border: str | None = None
editor_font_size: Optional[str] = None editor_font_size: str | None = None
fg_icon_header: Optional[str] = None fg_icon_header: str | None = None
font_family: Optional[str] = None font_family: str | None = None
header_bottom_border_color: Optional[str] = None header_bottom_border_color: str | None = None
header_font_style: Optional[str] = None header_font_style: str | None = None
horizontal_border_color: Optional[str] = None horizontal_border_color: str | None = None
line_height: Optional[int] = None line_height: int | None = None
link_color: Optional[str] = None link_color: str | None = None
text_bubble: Optional[str] = None text_bubble: str | None = None
text_dark: Optional[str] = None text_dark: str | None = None
text_group_header: Optional[str] = None text_group_header: str | None = None
text_header: Optional[str] = None text_header: str | None = None
text_header_selected: Optional[str] = None text_header_selected: str | None = None
text_light: Optional[str] = None text_light: str | None = None
text_medium: Optional[str] = None text_medium: str | None = None
class Bounds(TypedDict): class Bounds(TypedDict):
@ -121,7 +121,7 @@ class GridSelectionCurrent(TypedDict):
class GridSelection(TypedDict): class GridSelection(TypedDict):
"""The grid selection.""" """The grid selection."""
current: Optional[GridSelectionCurrent] current: GridSelectionCurrent | None
columns: CompatSelection columns: CompatSelection
rows: CompatSelection rows: CompatSelection
@ -148,14 +148,14 @@ class GroupHeaderClickedEventArgs(TypedDict):
class GridCell(TypedDict): class GridCell(TypedDict):
"""The grid cell.""" """The grid cell."""
span: Optional[List[int]] span: list[int] | None
class GridColumn(TypedDict): class GridColumn(TypedDict):
"""The grid column.""" """The grid column."""
title: str title: str
group: Optional[str] group: str | None
class DataEditor(NoSSRComponent): class DataEditor(NoSSRComponent):
@ -164,7 +164,7 @@ class DataEditor(NoSSRComponent):
tag = "DataEditor" tag = "DataEditor"
is_default = True is_default = True
library: str | None = "@glideapps/glide-data-grid@^6.0.3" library: str | None = "@glideapps/glide-data-grid@^6.0.3"
lib_dependencies: List[str] = [ lib_dependencies: list[str] = [
"lodash@^4.17.21", "lodash@^4.17.21",
"react-responsive-carousel@^3.2.7", "react-responsive-carousel@^3.2.7",
] ]
@ -173,10 +173,10 @@ class DataEditor(NoSSRComponent):
rows: Var[int] rows: Var[int]
# Headers of the columns for the data grid. # Headers of the columns for the data grid.
columns: Var[List[Dict[str, Any]]] columns: Var[list[dict[str, Any]]]
# The data. # The data.
data: Var[List[List[Any]]] data: Var[list[list[Any]]]
# The name of the callback used to find the data to display. # The name of the callback used to find the data to display.
get_cell_content: Var[str] get_cell_content: Var[str]
@ -257,23 +257,23 @@ class DataEditor(NoSSRComponent):
scroll_offset_y: Var[int] scroll_offset_y: Var[int]
# global theme # global theme
theme: Var[Union[DataEditorTheme, Dict]] theme: Var[DataEditorTheme | Dict]
# Fired when a cell is activated. # Fired when a cell is activated.
on_cell_activated: EventHandler[passthrough_event_spec(Tuple[int, int])] on_cell_activated: EventHandler[passthrough_event_spec(tuple[int, int])]
# Fired when a cell is clicked. # Fired when a cell is clicked.
on_cell_clicked: EventHandler[passthrough_event_spec(Tuple[int, int])] on_cell_clicked: EventHandler[passthrough_event_spec(tuple[int, int])]
# Fired when a cell is right-clicked. # Fired when a cell is right-clicked.
on_cell_context_menu: EventHandler[passthrough_event_spec(Tuple[int, int])] on_cell_context_menu: EventHandler[passthrough_event_spec(tuple[int, int])]
# Fired when a cell is edited. # Fired when a cell is edited.
on_cell_edited: EventHandler[passthrough_event_spec(Tuple[int, int], GridCell)] on_cell_edited: EventHandler[passthrough_event_spec(tuple[int, int], GridCell)]
# Fired when a group header is clicked. # Fired when a group header is clicked.
on_group_header_clicked: EventHandler[ on_group_header_clicked: EventHandler[
passthrough_event_spec(Tuple[int, int], GridCell) passthrough_event_spec(tuple[int, int], GridCell)
] ]
# Fired when a group header is right-clicked. # Fired when a group header is right-clicked.
@ -285,23 +285,23 @@ class DataEditor(NoSSRComponent):
on_group_header_renamed: EventHandler[passthrough_event_spec(str, str)] on_group_header_renamed: EventHandler[passthrough_event_spec(str, str)]
# Fired when a header is clicked. # Fired when a header is clicked.
on_header_clicked: EventHandler[passthrough_event_spec(Tuple[int, int])] on_header_clicked: EventHandler[passthrough_event_spec(tuple[int, int])]
# Fired when a header is right-clicked. # Fired when a header is right-clicked.
on_header_context_menu: EventHandler[passthrough_event_spec(Tuple[int, int])] on_header_context_menu: EventHandler[passthrough_event_spec(tuple[int, int])]
# Fired when a header menu item is clicked. # Fired when a header menu item is clicked.
on_header_menu_click: EventHandler[passthrough_event_spec(int, Rectangle)] on_header_menu_click: EventHandler[passthrough_event_spec(int, Rectangle)]
# Fired when an item is hovered. # Fired when an item is hovered.
on_item_hovered: EventHandler[passthrough_event_spec(Tuple[int, int])] on_item_hovered: EventHandler[passthrough_event_spec(tuple[int, int])]
# Fired when a selection is deleted. # Fired when a selection is deleted.
on_delete: EventHandler[passthrough_event_spec(GridSelection)] on_delete: EventHandler[passthrough_event_spec(GridSelection)]
# Fired when editing is finished. # Fired when editing is finished.
on_finished_editing: EventHandler[ on_finished_editing: EventHandler[
passthrough_event_spec(Union[GridCell, None], tuple[int, int]) passthrough_event_spec(GridCell | None, tuple[int, int])
] ]
# Fired when a row is appended. # Fired when a row is appended.

View File

@ -4,7 +4,7 @@
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from enum import Enum from enum import Enum
from typing import Any, Dict, List, Literal, Optional, TypedDict, Union, overload from typing import Any, Dict, Literal, Optional, TypedDict, Union, overload
from reflex.base import Base from reflex.base import Base
from reflex.components.component import NoSSRComponent from reflex.components.component import NoSSRComponent
@ -43,38 +43,38 @@ class GridColumnIcons(Enum):
VideoUri = "video_uri" VideoUri = "video_uri"
class DataEditorTheme(Base): class DataEditorTheme(Base):
accent_color: Optional[str] accent_color: str | None
accent_fg: Optional[str] accent_fg: str | None
accent_light: Optional[str] accent_light: str | None
base_font_style: Optional[str] base_font_style: str | None
bg_bubble: Optional[str] bg_bubble: str | None
bg_bubble_selected: Optional[str] bg_bubble_selected: str | None
bg_cell: Optional[str] bg_cell: str | None
bg_cell_medium: Optional[str] bg_cell_medium: str | None
bg_header: Optional[str] bg_header: str | None
bg_header_has_focus: Optional[str] bg_header_has_focus: str | None
bg_header_hovered: Optional[str] bg_header_hovered: str | None
bg_icon_header: Optional[str] bg_icon_header: str | None
bg_search_result: Optional[str] bg_search_result: str | None
border_color: Optional[str] border_color: str | None
cell_horizontal_padding: Optional[int] cell_horizontal_padding: int | None
cell_vertical_padding: Optional[int] cell_vertical_padding: int | None
drilldown_border: Optional[str] drilldown_border: str | None
editor_font_size: Optional[str] editor_font_size: str | None
fg_icon_header: Optional[str] fg_icon_header: str | None
font_family: Optional[str] font_family: str | None
header_bottom_border_color: Optional[str] header_bottom_border_color: str | None
header_font_style: Optional[str] header_font_style: str | None
horizontal_border_color: Optional[str] horizontal_border_color: str | None
line_height: Optional[int] line_height: int | None
link_color: Optional[str] link_color: str | None
text_bubble: Optional[str] text_bubble: str | None
text_dark: Optional[str] text_dark: str | None
text_group_header: Optional[str] text_group_header: str | None
text_header: Optional[str] text_header: str | None
text_header_selected: Optional[str] text_header_selected: str | None
text_light: Optional[str] text_light: str | None
text_medium: Optional[str] text_medium: str | None
class Bounds(TypedDict): class Bounds(TypedDict):
x: int x: int
@ -97,7 +97,7 @@ class GridSelectionCurrent(TypedDict):
rangeStack: list[Rectangle] rangeStack: list[Rectangle]
class GridSelection(TypedDict): class GridSelection(TypedDict):
current: Optional[GridSelectionCurrent] current: GridSelectionCurrent | None
columns: CompatSelection columns: CompatSelection
rows: CompatSelection rows: CompatSelection
@ -118,11 +118,11 @@ class GroupHeaderClickedEventArgs(TypedDict):
scrollEdge: tuple[int, int] scrollEdge: tuple[int, int]
class GridCell(TypedDict): class GridCell(TypedDict):
span: Optional[List[int]] span: list[int] | None
class GridColumn(TypedDict): class GridColumn(TypedDict):
title: str title: str
group: Optional[str] group: str | None
class DataEditor(NoSSRComponent): class DataEditor(NoSSRComponent):
def add_imports(self) -> ImportDict: ... def add_imports(self) -> ImportDict: ...
@ -132,116 +132,88 @@ class DataEditor(NoSSRComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
rows: Optional[Union[Var[int], int]] = None, rows: Var[int] | int | None = None,
columns: Optional[ columns: Var[list[dict[str, Any]]] | list[dict[str, Any]] | None = None,
Union[List[Dict[str, Any]], Var[List[Dict[str, Any]]]] data: Var[list[list[Any]]] | list[list[Any]] | None = None,
] = None, get_cell_content: Var[str] | str | None = None,
data: Optional[Union[List[List[Any]], Var[List[List[Any]]]]] = None, get_cells_for_selection: Var[bool] | bool | None = None,
get_cell_content: Optional[Union[Var[str], str]] = None, on_paste: Var[bool] | bool | None = None,
get_cells_for_selection: Optional[Union[Var[bool], bool]] = None, draw_focus_ring: Var[bool] | bool | None = None,
on_paste: Optional[Union[Var[bool], bool]] = None, fixed_shadow_x: Var[bool] | bool | None = None,
draw_focus_ring: Optional[Union[Var[bool], bool]] = None, fixed_shadow_y: Var[bool] | bool | None = None,
fixed_shadow_x: Optional[Union[Var[bool], bool]] = None, freeze_columns: Var[int] | int | None = None,
fixed_shadow_y: Optional[Union[Var[bool], bool]] = None, group_header_height: Var[int] | int | None = None,
freeze_columns: Optional[Union[Var[int], int]] = None, header_height: Var[int] | int | None = None,
group_header_height: Optional[Union[Var[int], int]] = None, max_column_auto_width: Var[int] | int | None = None,
header_height: Optional[Union[Var[int], int]] = None, max_column_width: Var[int] | int | None = None,
max_column_auto_width: Optional[Union[Var[int], int]] = None, min_column_width: Var[int] | int | None = None,
max_column_width: Optional[Union[Var[int], int]] = None, row_height: Var[int] | int | None = None,
min_column_width: Optional[Union[Var[int], int]] = None, row_markers: Literal["both", "checkbox", "clickable-number", "none", "number"]
row_height: Optional[Union[Var[int], int]] = None, | Var[Literal["both", "checkbox", "clickable-number", "none", "number"]]
row_markers: Optional[ | None = None,
Union[ row_marker_start_index: Var[int] | int | None = None,
Literal["both", "checkbox", "clickable-number", "none", "number"], row_marker_width: Var[int] | int | None = None,
Var[Literal["both", "checkbox", "clickable-number", "none", "number"]], smooth_scroll_x: Var[bool] | bool | None = None,
] smooth_scroll_y: Var[bool] | bool | None = None,
] = None, vertical_border: Var[bool] | bool | None = None,
row_marker_start_index: Optional[Union[Var[int], int]] = None, column_select: Literal["multi", "none", "single"]
row_marker_width: Optional[Union[Var[int], int]] = None, | Var[Literal["multi", "none", "single"]]
smooth_scroll_x: Optional[Union[Var[bool], bool]] = None, | None = None,
smooth_scroll_y: Optional[Union[Var[bool], bool]] = None, prevent_diagonal_scrolling: Var[bool] | bool | None = None,
vertical_border: Optional[Union[Var[bool], bool]] = None, overscroll_x: Var[int] | int | None = None,
column_select: Optional[ overscroll_y: Var[int] | int | None = None,
Union[ scroll_offset_x: Var[int] | int | None = None,
Literal["multi", "none", "single"], scroll_offset_y: Var[int] | int | None = None,
Var[Literal["multi", "none", "single"]], theme: DataEditorTheme | Dict | Var[DataEditorTheme | Dict] | None = None,
] style: Style | None = None,
] = None, key: Any | None = None,
prevent_diagonal_scrolling: Optional[Union[Var[bool], bool]] = None, id: Any | None = None,
overscroll_x: Optional[Union[Var[int], int]] = None, class_name: Any | None = None,
overscroll_y: Optional[Union[Var[int], int]] = None, autofocus: bool | None = None,
scroll_offset_x: Optional[Union[Var[int], int]] = None, custom_attrs: dict[str, Var | Any] | None = None,
scroll_offset_y: Optional[Union[Var[int], int]] = None,
theme: Optional[
Union[DataEditorTheme, Dict, Var[Union[DataEditorTheme, Dict]]]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_cell_activated: Optional[ on_cell_activated: Optional[EventType[()] | EventType[tuple[int, int]]] = None,
Union[EventType[()], EventType[tuple[int, int]]] on_cell_clicked: Optional[EventType[()] | EventType[tuple[int, int]]] = None,
] = None,
on_cell_clicked: Optional[
Union[EventType[()], EventType[tuple[int, int]]]
] = None,
on_cell_context_menu: Optional[ on_cell_context_menu: Optional[
Union[EventType[()], EventType[tuple[int, int]]] EventType[()] | EventType[tuple[int, int]]
] = None, ] = None,
on_cell_edited: Optional[ on_cell_edited: Optional[
Union[ EventType[()]
EventType[()], | EventType[tuple[int, int]]
EventType[tuple[int, int]], | EventType[tuple[int, int], GridCell]
EventType[tuple[int, int], GridCell],
]
] = None, ] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_column_resize: Optional[ on_column_resize: Optional[
Union[EventType[()], EventType[GridColumn], EventType[GridColumn, int]] EventType[()] | EventType[GridColumn] | EventType[GridColumn, int]
] = None, ] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_delete: Optional[Union[EventType[()], EventType[GridSelection]]] = None, on_delete: Optional[EventType[()] | EventType[GridSelection]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_finished_editing: Optional[ on_finished_editing: Optional[
Union[ EventType[()]
EventType[()], | EventType[Union[GridCell, None]]
EventType[Union[GridCell, None]], | EventType[Union[GridCell, None], tuple[int, int]]
EventType[Union[GridCell, None], tuple[int, int]],
]
] = None, ] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_group_header_clicked: Optional[ on_group_header_clicked: Optional[
Union[ EventType[()]
EventType[()], | EventType[tuple[int, int]]
EventType[tuple[int, int]], | EventType[tuple[int, int], GridCell]
EventType[tuple[int, int], GridCell],
]
] = None, ] = None,
on_group_header_context_menu: Optional[ on_group_header_context_menu: Optional[
Union[ EventType[()] | EventType[int] | EventType[int, GroupHeaderClickedEventArgs]
EventType[()],
EventType[int],
EventType[int, GroupHeaderClickedEventArgs],
]
] = None, ] = None,
on_group_header_renamed: Optional[ on_group_header_renamed: Optional[
Union[EventType[()], EventType[str], EventType[str, str]] EventType[()] | EventType[str] | EventType[str, str]
] = None,
on_header_clicked: Optional[
Union[EventType[()], EventType[tuple[int, int]]]
] = None, ] = None,
on_header_clicked: Optional[EventType[()] | EventType[tuple[int, int]]] = None,
on_header_context_menu: Optional[ on_header_context_menu: Optional[
Union[EventType[()], EventType[tuple[int, int]]] EventType[()] | EventType[tuple[int, int]]
] = None, ] = None,
on_header_menu_click: Optional[ on_header_menu_click: Optional[
Union[EventType[()], EventType[int], EventType[int, Rectangle]] EventType[()] | EventType[int] | EventType[int, Rectangle]
] = None,
on_item_hovered: Optional[
Union[EventType[()], EventType[tuple[int, int]]]
] = None, ] = None,
on_item_hovered: Optional[EventType[()] | EventType[tuple[int, int]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,

View File

@ -1,12 +1,10 @@
"""A Reflex logo component.""" """A Reflex logo component."""
from typing import Union
import reflex as rx import reflex as rx
def svg_logo( def svg_logo(
color: Union[str, rx.Var[str]] = rx.color_mode_cond("#110F1F", "white"), color: str | rx.Var[str] = rx.color_mode_cond("#110F1F", "white"),
**props, **props,
): ):
"""A Reflex logo SVG. """A Reflex logo SVG.

View File

@ -4,7 +4,7 @@ from __future__ import annotations
import re import re
from collections import defaultdict from collections import defaultdict
from typing import Any, Literal, Optional, Union from typing import Any, Literal
from reflex.base import Base from reflex.base import Base
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
@ -403,8 +403,8 @@ class Position(NoExtrasAllowedProps):
class ShikiDecorations(NoExtrasAllowedProps): class ShikiDecorations(NoExtrasAllowedProps):
"""Decorations for the code block.""" """Decorations for the code block."""
start: Union[int, Position] start: int | Position
end: Union[int, Position] end: int | Position
tag_name: str = "span" tag_name: str = "span"
properties: dict[str, Any] = {} properties: dict[str, Any] = {}
always_wrap: bool = False always_wrap: bool = False
@ -415,7 +415,7 @@ class ShikiBaseTransformers(Base):
library: str library: str
fns: list[FunctionStringVar] fns: list[FunctionStringVar]
style: Optional[Style] style: Style | None
class ShikiJsTransformer(ShikiBaseTransformers): class ShikiJsTransformer(ShikiBaseTransformers):
@ -425,7 +425,7 @@ class ShikiJsTransformer(ShikiBaseTransformers):
fns: list[FunctionStringVar] = [ fns: list[FunctionStringVar] = [
FunctionStringVar.create(fn) for fn in SHIKIJS_TRANSFORMER_FNS FunctionStringVar.create(fn) for fn in SHIKIJS_TRANSFORMER_FNS
] ]
style: Optional[Style] = Style( style: Style | None = Style(
{ {
"code": {"line-height": "1.7", "font-size": "0.875em", "display": "grid"}, "code": {"line-height": "1.7", "font-size": "0.875em", "display": "grid"},
# Diffs # Diffs
@ -547,15 +547,13 @@ class ShikiCodeBlock(Component, MarkdownComponentMap):
theme: Var[LiteralCodeTheme] = Var.create("one-light") theme: Var[LiteralCodeTheme] = Var.create("one-light")
# The set of themes to use for different modes. # The set of themes to use for different modes.
themes: Var[Union[list[dict[str, Any]], dict[str, str]]] themes: Var[list[dict[str, Any]] | dict[str, str]]
# The code to display. # The code to display.
code: Var[str] code: Var[str]
# The transformers to use for the syntax highlighter. # The transformers to use for the syntax highlighter.
transformers: Var[list[Union[ShikiBaseTransformers, dict[str, Any]]]] = Var.create( transformers: Var[list[ShikiBaseTransformers | dict[str, Any]]] = Var.create([])
[]
)
# The decorations to use for the syntax highlighter. # The decorations to use for the syntax highlighter.
decorations: Var[list[ShikiDecorations]] = Var.create([]) decorations: Var[list[ShikiDecorations]] = Var.create([])
@ -717,7 +715,7 @@ class ShikiHighLevelCodeBlock(ShikiCodeBlock):
can_copy: bool = False can_copy: bool = False
# copy_button: A custom copy button to override the default one. # copy_button: A custom copy button to override the default one.
copy_button: Optional[Union[Component, bool]] = None copy_button: Component | bool | None = None
@classmethod @classmethod
def create( def create(

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,12 +16,12 @@ class Element(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.el.element import Element from reflex.components.el.element import Element
from reflex.event import EventType from reflex.event import EventType
@ -94,217 +94,190 @@ class BaseHTML(Element):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
access_key: Optional[Union[Var[str], str]] = None, access_key: Var[str] | str | None = None,
auto_capitalize: Optional[ auto_capitalize: Literal[
Union[ "characters", "none", "off", "on", "sentences", "words"
Literal["characters", "none", "off", "on", "sentences", "words"], ]
Var[Literal["characters", "none", "off", "on", "sentences", "words"]], | Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
content_editable: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal["inherit", "plaintext-only", False, True], lang: Var[str] | str | None = None,
Var[Literal["inherit", "plaintext-only", False, True]], role: Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
context_menu: Optional[Union[Var[str], str]] = None, | None = None,
dir: Optional[Union[Var[str], str]] = None, slot: Var[str] | str | None = None,
draggable: Optional[Union[Var[bool], bool]] = None, spell_check: Var[bool] | bool | None = None,
enter_key_hint: Optional[ tab_index: Var[int] | int | None = None,
Union[ title: Var[str] | str | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"], style: Style | None = None,
Var[ key: Any | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"] id: Any | None = None,
], class_name: Any | None = None,
] autofocus: bool | None = None,
] = None, custom_attrs: dict[str, Var | Any] | None = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
from __future__ import annotations from __future__ import annotations
from hashlib import md5 from hashlib import md5
from typing import Any, Dict, Iterator, Literal, Set, Tuple, Union from typing import Any, Iterator, Literal
from jinja2 import Environment from jinja2 import Environment
@ -80,7 +80,7 @@ class Button(BaseHTML):
type: Var[ButtonType] type: Var[ButtonType]
# Value of the button, used when sending form data # Value of the button, used when sending form data
value: Var[Union[str, int, float]] value: Var[str | int | float]
class Datalist(BaseHTML): class Datalist(BaseHTML):
@ -104,7 +104,7 @@ class Fieldset(Element):
name: Var[str] name: Var[str]
def on_submit_event_spec() -> Tuple[Var[dict[str, Any]]]: def on_submit_event_spec() -> tuple[Var[dict[str, Any]]]:
"""Event handler spec for the on_submit event. """Event handler spec for the on_submit event.
Returns: Returns:
@ -113,7 +113,7 @@ def on_submit_event_spec() -> Tuple[Var[dict[str, Any]]]:
return (FORM_DATA,) return (FORM_DATA,)
def on_submit_string_event_spec() -> Tuple[Var[dict[str, str]]]: def on_submit_string_event_spec() -> tuple[Var[dict[str, str]]]:
"""Event handler spec for the on_submit event. """Event handler spec for the on_submit event.
Returns: Returns:
@ -232,7 +232,7 @@ class Form(BaseHTML):
) )
return render_tag return render_tag
def _get_form_refs(self) -> Dict[str, Any]: def _get_form_refs(self) -> dict[str, Any]:
# Send all the input refs to the handler. # Send all the input refs to the handler.
form_refs = {} form_refs = {}
for ref in self._get_all_refs(): for ref in self._get_all_refs():
@ -321,7 +321,7 @@ class Input(BaseHTML):
default_checked: Var[bool] default_checked: Var[bool]
# The initial value for a text field # The initial value for a text field
default_value: Var[Union[str, int, float]] default_value: Var[str | int | float]
# Disables the input # Disables the input
disabled: Var[bool] disabled: Var[bool]
@ -348,16 +348,16 @@ class Input(BaseHTML):
list: Var[str] list: Var[str]
# Specifies the maximum value for the input # Specifies the maximum value for the input
max: Var[Union[str, int, float]] max: Var[str | int | float]
# Specifies the maximum number of characters allowed in the input # Specifies the maximum number of characters allowed in the input
max_length: Var[Union[int, float]] max_length: Var[int | float]
# Specifies the minimum number of characters required in the input # Specifies the minimum number of characters required in the input
min_length: Var[Union[int, float]] min_length: Var[int | float]
# Specifies the minimum value for the input # Specifies the minimum value for the input
min: Var[Union[str, int, float]] min: Var[str | int | float]
# Indicates whether multiple values can be entered in an input of the type email or file # Indicates whether multiple values can be entered in an input of the type email or file
multiple: Var[bool] multiple: Var[bool]
@ -378,19 +378,19 @@ class Input(BaseHTML):
required: Var[bool] required: Var[bool]
# Specifies the visible width of a text control # Specifies the visible width of a text control
size: Var[Union[int, float]] size: Var[int | float]
# URL for image inputs # URL for image inputs
src: Var[str] src: Var[str]
# Specifies the legal number intervals for an input # Specifies the legal number intervals for an input
step: Var[Union[str, int, float]] step: Var[str | int | float]
# Specifies the type of input # Specifies the type of input
type: Var[HTMLInputTypeAttribute] type: Var[HTMLInputTypeAttribute]
# Value of the input # Value of the input
value: Var[Union[str, int, float]] value: Var[str | int | float]
# Fired when the input value changes # Fired when the input value changes
on_change: EventHandler[input_event] on_change: EventHandler[input_event]
@ -462,22 +462,22 @@ class Meter(BaseHTML):
form: Var[str] form: Var[str]
# High limit of range (above this is considered high value) # High limit of range (above this is considered high value)
high: Var[Union[int, float]] high: Var[int | float]
# Low limit of range (below this is considered low value) # Low limit of range (below this is considered low value)
low: Var[Union[int, float]] low: Var[int | float]
# Maximum value of the range # Maximum value of the range
max: Var[Union[int, float]] max: Var[int | float]
# Minimum value of the range # Minimum value of the range
min: Var[Union[int, float]] min: Var[int | float]
# Optimum value in the range # Optimum value in the range
optimum: Var[Union[int, float]] optimum: Var[int | float]
# Current value of the meter # Current value of the meter
value: Var[Union[int, float]] value: Var[int | float]
class Optgroup(BaseHTML): class Optgroup(BaseHTML):
@ -507,7 +507,7 @@ class Option(BaseHTML):
selected: Var[bool] selected: Var[bool]
# Value to be sent as form data # Value to be sent as form data
value: Var[Union[str, int, float]] value: Var[str | int | float]
class Output(BaseHTML): class Output(BaseHTML):
@ -534,10 +534,10 @@ class Progress(BaseHTML):
form: Var[str] form: Var[str]
# Maximum value of the progress indicator # Maximum value of the progress indicator
max: Var[Union[str, int, float]] max: Var[str | int | float]
# Current value of the progress indicator # Current value of the progress indicator
value: Var[Union[str, int, float]] value: Var[str | int | float]
class Select(BaseHTML): class Select(BaseHTML):
@ -720,7 +720,7 @@ class Textarea(BaseHTML):
"enter_key_submit", "enter_key_submit",
] ]
def _get_all_custom_code(self) -> Set[str]: def _get_all_custom_code(self) -> set[str]:
"""Include the custom code for auto_height and enter_key_submit functionality. """Include the custom code for auto_height and enter_key_submit functionality.
Returns: Returns:

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
"""Inline classes.""" """Inline classes."""
from typing import Literal, Union from typing import Literal
from reflex.vars.base import Var from reflex.vars.base import Var
@ -25,7 +25,7 @@ class A(BaseHTML): # Inherits common attributes from BaseMeta
tag = "a" tag = "a"
# Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink. # Specifies that the target (the file specified in the href attribute) will be downloaded when a user clicks on the hyperlink.
download: Var[Union[str, bool]] download: Var[str | bool]
# Specifies the URL of the page the link goes to # Specifies the URL of the page the link goes to
href: Var[str] href: Var[str]
@ -46,7 +46,7 @@ class A(BaseHTML): # Inherits common attributes from BaseMeta
rel: Var[str] rel: Var[str]
# Specifies where to open the linked document # Specifies where to open the linked document
target: Var[Union[str, Literal["_self", "_blank", "_parent", "_top"]]] target: Var[str | Literal["_self", "_blank", "_parent", "_top"]]
class Abbr(BaseHTML): class Abbr(BaseHTML):
@ -97,7 +97,7 @@ class Data(BaseHTML):
tag = "data" tag = "data"
# Specifies the machine-readable translation of the data element. # Specifies the machine-readable translation of the data element.
value: Var[Union[str, int, float]] value: Var[str | int | float]
class Dfn(BaseHTML): class Dfn(BaseHTML):

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
"""Media classes.""" """Media classes."""
from typing import Any, Literal, Union from typing import Any, Literal
from reflex import Component, ComponentNamespace from reflex import Component, ComponentNamespace
from reflex.components.el.elements.inline import ReferrerPolicy from reflex.components.el.elements.inline import ReferrerPolicy
@ -22,7 +22,7 @@ class Area(BaseHTML):
coords: Var[str] coords: Var[str]
# Specifies that the target will be downloaded when clicked # Specifies that the target will be downloaded when clicked
download: Var[Union[str, bool]] download: Var[str | bool]
# Hyperlink reference for the area # Hyperlink reference for the area
href: Var[str] href: Var[str]
@ -291,9 +291,9 @@ class Svg(BaseHTML):
tag = "svg" tag = "svg"
# The width of the svg. # The width of the svg.
width: Var[Union[str, int]] width: Var[str | int]
# The height of the svg. # The height of the svg.
height: Var[Union[str, int]] height: Var[str | int]
# The XML namespace declaration. # The XML namespace declaration.
xmlns: Var[str] xmlns: Var[str]
@ -303,19 +303,19 @@ class Text(BaseHTML):
tag = "text" tag = "text"
# The x coordinate of the starting point of the text baseline. # The x coordinate of the starting point of the text baseline.
x: Var[Union[str, int]] x: Var[str | int]
# The y coordinate of the starting point of the text baseline. # The y coordinate of the starting point of the text baseline.
y: Var[Union[str, int]] y: Var[str | int]
# Shifts the text position horizontally from a previous text element. # Shifts the text position horizontally from a previous text element.
dx: Var[Union[str, int]] dx: Var[str | int]
# Shifts the text position vertically from a previous text element. # Shifts the text position vertically from a previous text element.
dy: Var[Union[str, int]] dy: Var[str | int]
# Rotates orientation of each individual glyph. # Rotates orientation of each individual glyph.
rotate: Var[Union[str, int]] rotate: Var[str | int]
# How the text is stretched or compressed to fit the width defined by the text_length attribute. # How the text is stretched or compressed to fit the width defined by the text_length attribute.
length_adjust: Var[str] length_adjust: Var[str]
# A width that the text should be scaled to fit. # A width that the text should be scaled to fit.
text_length: Var[Union[str, int]] text_length: Var[str | int]
class Line(BaseHTML): class Line(BaseHTML):
@ -323,13 +323,13 @@ class Line(BaseHTML):
tag = "line" tag = "line"
# The x-axis coordinate of the line starting point. # The x-axis coordinate of the line starting point.
x1: Var[Union[str, int]] x1: Var[str | int]
# The x-axis coordinate of the the line ending point. # The x-axis coordinate of the the line ending point.
x2: Var[Union[str, int]] x2: Var[str | int]
# The y-axis coordinate of the line starting point. # The y-axis coordinate of the line starting point.
y1: Var[Union[str, int]] y1: Var[str | int]
# The y-axis coordinate of the the line ending point. # The y-axis coordinate of the the line ending point.
y2: Var[Union[str, int]] y2: Var[str | int]
# The total path length, in user units. # The total path length, in user units.
path_length: Var[int] path_length: Var[int]
@ -339,11 +339,11 @@ class Circle(BaseHTML):
tag = "circle" tag = "circle"
# The x-axis coordinate of the center of the circle. # The x-axis coordinate of the center of the circle.
cx: Var[Union[str, int]] cx: Var[str | int]
# The y-axis coordinate of the center of the circle. # The y-axis coordinate of the center of the circle.
cy: Var[Union[str, int]] cy: Var[str | int]
# The radius of the circle. # The radius of the circle.
r: Var[Union[str, int]] r: Var[str | int]
# The total length for the circle's circumference, in user units. # The total length for the circle's circumference, in user units.
path_length: Var[int] path_length: Var[int]
@ -353,13 +353,13 @@ class Ellipse(BaseHTML):
tag = "ellipse" tag = "ellipse"
# The x position of the center of the ellipse. # The x position of the center of the ellipse.
cx: Var[Union[str, int]] cx: Var[str | int]
# The y position of the center of the ellipse. # The y position of the center of the ellipse.
cy: Var[Union[str, int]] cy: Var[str | int]
# The radius of the ellipse on the x axis. # The radius of the ellipse on the x axis.
rx: Var[Union[str, int]] rx: Var[str | int]
# The radius of the ellipse on the y axis. # The radius of the ellipse on the y axis.
ry: Var[Union[str, int]] ry: Var[str | int]
# The total length for the ellipse's circumference, in user units. # The total length for the ellipse's circumference, in user units.
path_length: Var[int] path_length: Var[int]
@ -369,17 +369,17 @@ class Rect(BaseHTML):
tag = "rect" tag = "rect"
# The x coordinate of the rect. # The x coordinate of the rect.
x: Var[Union[str, int]] x: Var[str | int]
# The y coordinate of the rect. # The y coordinate of the rect.
y: Var[Union[str, int]] y: Var[str | int]
# The width of the rect # The width of the rect
width: Var[Union[str, int]] width: Var[str | int]
# The height of the rect. # The height of the rect.
height: Var[Union[str, int]] height: Var[str | int]
# The horizontal corner radius of the rect. Defaults to ry if it is specified. # The horizontal corner radius of the rect. Defaults to ry if it is specified.
rx: Var[Union[str, int]] rx: Var[str | int]
# The vertical corner radius of the rect. Defaults to rx if it is specified. # The vertical corner radius of the rect. Defaults to rx if it is specified.
ry: Var[Union[str, int]] ry: Var[str | int]
# The total length of the rectangle's perimeter, in user units. # The total length of the rectangle's perimeter, in user units.
path_length: Var[int] path_length: Var[int]
@ -406,25 +406,25 @@ class LinearGradient(BaseHTML):
tag = "linearGradient" tag = "linearGradient"
# Units for the gradient. # Units for the gradient.
gradient_units: Var[Union[str, bool]] gradient_units: Var[str | bool]
# Transform applied to the gradient. # Transform applied to the gradient.
gradient_transform: Var[Union[str, bool]] gradient_transform: Var[str | bool]
# Method used to spread the gradient. # Method used to spread the gradient.
spread_method: Var[Union[str, bool]] spread_method: Var[str | bool]
# X coordinate of the starting point of the gradient. # X coordinate of the starting point of the gradient.
x1: Var[Union[str, int, float]] x1: Var[str | int | float]
# X coordinate of the ending point of the gradient. # X coordinate of the ending point of the gradient.
x2: Var[Union[str, int, float]] x2: Var[str | int | float]
# Y coordinate of the starting point of the gradient. # Y coordinate of the starting point of the gradient.
y1: Var[Union[str, int, float]] y1: Var[str | int | float]
# Y coordinate of the ending point of the gradient. # Y coordinate of the ending point of the gradient.
y2: Var[Union[str, int, float]] y2: Var[str | int | float]
class RadialGradient(BaseHTML): class RadialGradient(BaseHTML):
@ -433,31 +433,31 @@ class RadialGradient(BaseHTML):
tag = "radialGradient" tag = "radialGradient"
# The x coordinate of the end circle of the radial gradient. # The x coordinate of the end circle of the radial gradient.
cx: Var[Union[str, int, float]] cx: Var[str | int | float]
# The y coordinate of the end circle of the radial gradient. # The y coordinate of the end circle of the radial gradient.
cy: Var[Union[str, int, float]] cy: Var[str | int | float]
# The radius of the start circle of the radial gradient. # The radius of the start circle of the radial gradient.
fr: Var[Union[str, int, float]] fr: Var[str | int | float]
# The x coordinate of the start circle of the radial gradient. # The x coordinate of the start circle of the radial gradient.
fx: Var[Union[str, int, float]] fx: Var[str | int | float]
# The y coordinate of the start circle of the radial gradient. # The y coordinate of the start circle of the radial gradient.
fy: Var[Union[str, int, float]] fy: Var[str | int | float]
# Units for the gradient. # Units for the gradient.
gradient_units: Var[Union[str, bool]] gradient_units: Var[str | bool]
# Transform applied to the gradient. # Transform applied to the gradient.
gradient_transform: Var[Union[str, bool]] gradient_transform: Var[str | bool]
# The radius of the end circle of the radial gradient. # The radius of the end circle of the radial gradient.
r: Var[Union[str, int, float]] r: Var[str | int | float]
# Method used to spread the gradient. # Method used to spread the gradient.
spread_method: Var[Union[str, bool]] spread_method: Var[str | bool]
class Stop(BaseHTML): class Stop(BaseHTML):
@ -466,13 +466,13 @@ class Stop(BaseHTML):
tag = "stop" tag = "stop"
# Offset of the gradient stop. # Offset of the gradient stop.
offset: Var[Union[str, float, int]] offset: Var[str | float | int]
# Color of the gradient stop. # Color of the gradient stop.
stop_color: Var[Union[str, Color, bool]] stop_color: Var[str | Color | bool]
# Opacity of the gradient stop. # Opacity of the gradient stop.
stop_opacity: Var[Union[str, float, int, bool]] stop_opacity: Var[str | float | int | bool]
class Path(BaseHTML): class Path(BaseHTML):
@ -481,7 +481,7 @@ class Path(BaseHTML):
tag = "path" tag = "path"
# Defines the shape of the path. # Defines the shape of the path.
d: Var[Union[str, int, float]] d: Var[str | int | float]
class SVG(ComponentNamespace): class SVG(ComponentNamespace):

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,5 @@
"""Metadata classes.""" """Metadata classes."""
from typing import List
from reflex.components.el.element import Element from reflex.components.el.element import Element
from reflex.components.el.elements.inline import ReferrerPolicy from reflex.components.el.elements.inline import ReferrerPolicy
from reflex.components.el.elements.media import CrossOrigin from reflex.components.el.elements.media import CrossOrigin
@ -91,7 +89,7 @@ class StyleEl(Element):
media: Var[str] media: Var[str]
special_props: List[Var] = [Var(_js_expr="suppressHydrationWarning")] special_props: list[Var] = [Var(_js_expr="suppressHydrationWarning")]
base = Base.create base = Base.create

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, List, Union from typing import Any, Dict, List
from reflex.components.component import Component from reflex.components.component import Component
from reflex.components.tags import Tag from reflex.components.tags import Tag
@ -17,7 +17,7 @@ class Gridjs(Component):
library = "gridjs-react@6.1.1" library = "gridjs-react@6.1.1"
lib_dependencies: List[str] = ["gridjs@6.2.0"] lib_dependencies: list[str] = ["gridjs@6.2.0"]
class DataTable(Gridjs): class DataTable(Gridjs):
@ -44,7 +44,7 @@ class DataTable(Gridjs):
resizable: Var[bool] resizable: Var[bool]
# Enable pagination. # Enable pagination.
pagination: Var[Union[bool, Dict]] pagination: Var[bool | Dict]
@classmethod @classmethod
def create(cls, *children, **props): def create(cls, *children, **props):
@ -115,11 +115,11 @@ class DataTable(Gridjs):
if isinstance(self.data, Var) and types.is_dataframe(self.data._var_type): if isinstance(self.data, Var) and types.is_dataframe(self.data._var_type):
self.columns = self.data._replace( self.columns = self.data._replace(
_js_expr=f"{self.data._js_expr}.columns", _js_expr=f"{self.data._js_expr}.columns",
_var_type=List[Any], _var_type=list[Any],
) )
self.data = self.data._replace( self.data = self.data._replace(
_js_expr=f"{self.data._js_expr}.data", _js_expr=f"{self.data._js_expr}.data",
_var_type=List[List[Any]], _var_type=list[list[Any]],
) )
if types.is_dataframe(type(self.data)): if types.is_dataframe(type(self.data)):
# If given a pandas df break up the data and columns # If given a pandas df break up the data and columns

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, List, Optional, Union, overload from typing import Any, Dict, List, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -17,12 +17,12 @@ class Gridjs(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -63,18 +63,18 @@ class DataTable(Gridjs):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Any] = None, data: Any | None = None,
columns: Optional[Union[List, Var[List]]] = None, columns: List | Var[List] | None = None,
search: Optional[Union[Var[bool], bool]] = None, search: Var[bool] | bool | None = None,
sort: Optional[Union[Var[bool], bool]] = None, sort: Var[bool] | bool | None = None,
resizable: Optional[Union[Var[bool], bool]] = None, resizable: Var[bool] | bool | None = None,
pagination: Optional[Union[Dict, Var[Union[Dict, bool]], bool]] = None, pagination: Dict | Var[Dict | bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,12 +16,12 @@ class LucideIconComponent(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -62,13 +62,13 @@ class Icon(LucideIconComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
size: Optional[Union[Var[int], int]] = None, size: Var[int] | int | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -117,13 +117,13 @@ class DynamicIcon(LucideIconComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
name: Optional[Union[Var[str], str]] = None, name: Var[str] | str | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -6,7 +6,7 @@ import dataclasses
import textwrap import textwrap
from functools import lru_cache from functools import lru_cache
from hashlib import md5 from hashlib import md5
from typing import Any, Callable, Dict, Sequence from typing import Any, Callable, Sequence
from reflex.components.component import BaseComponent, Component, CustomComponent from reflex.components.component import BaseComponent, Component, CustomComponent
from reflex.components.tags.tag import Tag from reflex.components.tags.tag import Tag
@ -149,7 +149,7 @@ class Markdown(Component):
is_default = True is_default = True
# The component map from a tag to a lambda that creates a component. # The component map from a tag to a lambda that creates a component.
component_map: Dict[str, Any] = {} component_map: dict[str, Any] = {}
# The hash of the component map, generated at create() time. # The hash of the component map, generated at create() time.
component_map_hash: str = "" component_map_hash: str = ""

View File

@ -5,7 +5,7 @@
# ------------------------------------------------------ # ------------------------------------------------------
import dataclasses import dataclasses
from functools import lru_cache from functools import lru_cache
from typing import Any, Callable, Dict, Optional, Sequence, Union, overload from typing import Any, Callable, Optional, Sequence, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -52,14 +52,14 @@ class Markdown(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
component_map: Optional[Dict[str, Any]] = None, component_map: dict[str, Any] | None = None,
component_map_hash: Optional[str] = None, component_map_hash: str | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,7 +2,6 @@
import dataclasses import dataclasses
from datetime import date, datetime, time, timedelta from datetime import date, datetime, time, timedelta
from typing import List, Optional, Union
from reflex.components.component import NoSSRComponent from reflex.components.component import NoSSRComponent
from reflex.event import EventHandler, passthrough_event_spec from reflex.event import EventHandler, passthrough_event_spec
@ -14,15 +13,15 @@ from reflex.vars.base import LiteralVar, Var
class MomentDelta: class MomentDelta:
"""A delta used for add/subtract prop in Moment.""" """A delta used for add/subtract prop in Moment."""
years: Optional[int] = dataclasses.field(default=None) years: int | None = dataclasses.field(default=None)
quarters: Optional[int] = dataclasses.field(default=None) quarters: int | None = dataclasses.field(default=None)
months: Optional[int] = dataclasses.field(default=None) months: int | None = dataclasses.field(default=None)
weeks: Optional[int] = dataclasses.field(default=None) weeks: int | None = dataclasses.field(default=None)
days: Optional[int] = dataclasses.field(default=None) days: int | None = dataclasses.field(default=None)
hours: Optional[int] = dataclasses.field(default=None) hours: int | None = dataclasses.field(default=None)
minutes: Optional[int] = dataclasses.field(default=None) minutes: int | None = dataclasses.field(default=None)
seconds: Optional[int] = dataclasses.field(default=None) seconds: int | None = dataclasses.field(default=None)
milliseconds: Optional[int] = dataclasses.field(default=None) milliseconds: int | None = dataclasses.field(default=None)
class Moment(NoSSRComponent): class Moment(NoSSRComponent):
@ -31,7 +30,7 @@ class Moment(NoSSRComponent):
tag: str | None = "Moment" tag: str | None = "Moment"
is_default = True is_default = True
library: str | None = "react-moment" library: str | None = "react-moment"
lib_dependencies: List[str] = ["moment"] lib_dependencies: list[str] = ["moment"]
# How often the date update (how often time update / 0 to disable). # How often the date update (how often time update / 0 to disable).
interval: Var[int] interval: Var[int]
@ -79,7 +78,7 @@ class Moment(NoSSRComponent):
duration: Var[str] duration: Var[str]
# The date to display (also work if passed as children). # The date to display (also work if passed as children).
date: Var[Union[str, datetime, date, time, timedelta]] date: Var[str | datetime | date | time | timedelta]
# Shows the duration (elapsed time) between now and the provided datetime. # Shows the duration (elapsed time) between now and the provided datetime.
duration_from_now: Var[bool] duration_from_now: Var[bool]

View File

@ -5,7 +5,7 @@
# ------------------------------------------------------ # ------------------------------------------------------
import dataclasses import dataclasses
from datetime import date, datetime, time, timedelta from datetime import date, datetime, time, timedelta
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import NoSSRComponent from reflex.components.component import NoSSRComponent
from reflex.event import EventType from reflex.event import EventType
@ -15,15 +15,15 @@ from reflex.vars.base import Var
@dataclasses.dataclass(frozen=True) @dataclasses.dataclass(frozen=True)
class MomentDelta: class MomentDelta:
years: Optional[int] years: int | None
quarters: Optional[int] quarters: int | None
months: Optional[int] months: int | None
weeks: Optional[int] weeks: int | None
days: Optional[int] days: int | None
hours: Optional[int] hours: int | None
minutes: Optional[int] minutes: int | None
seconds: Optional[int] seconds: int | None
milliseconds: Optional[int] milliseconds: int | None
class Moment(NoSSRComponent): class Moment(NoSSRComponent):
def add_imports(self) -> ImportDict: ... def add_imports(self) -> ImportDict: ...
@ -32,44 +32,41 @@ class Moment(NoSSRComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
interval: Optional[Union[Var[int], int]] = None, interval: Var[int] | int | None = None,
format: Optional[Union[Var[str], str]] = None, format: Var[str] | str | None = None,
trim: Optional[Union[Var[bool], bool]] = None, trim: Var[bool] | bool | None = None,
parse: Optional[Union[Var[str], str]] = None, parse: Var[str] | str | None = None,
add: Optional[Union[MomentDelta, Var[MomentDelta]]] = None, add: MomentDelta | Var[MomentDelta] | None = None,
subtract: Optional[Union[MomentDelta, Var[MomentDelta]]] = None, subtract: MomentDelta | Var[MomentDelta] | None = None,
from_now: Optional[Union[Var[bool], bool]] = None, from_now: Var[bool] | bool | None = None,
from_now_during: Optional[Union[Var[int], int]] = None, from_now_during: Var[int] | int | None = None,
to_now: Optional[Union[Var[bool], bool]] = None, to_now: Var[bool] | bool | None = None,
with_title: Optional[Union[Var[bool], bool]] = None, with_title: Var[bool] | bool | None = None,
title_format: Optional[Union[Var[str], str]] = None, title_format: Var[str] | str | None = None,
diff: Optional[Union[Var[str], str]] = None, diff: Var[str] | str | None = None,
decimal: Optional[Union[Var[bool], bool]] = None, decimal: Var[bool] | bool | None = None,
unit: Optional[Union[Var[str], str]] = None, unit: Var[str] | str | None = None,
duration: Optional[Union[Var[str], str]] = None, duration: Var[str] | str | None = None,
date: Optional[ date: Var[date | datetime | str | time | timedelta]
Union[ | date
Var[Union[date, datetime, str, time, timedelta]], | datetime
date, | str
datetime, | time
str, | timedelta
time, | None = None,
timedelta, duration_from_now: Var[bool] | bool | None = None,
] unix: Var[bool] | bool | None = None,
] = None, local: Var[bool] | bool | None = None,
duration_from_now: Optional[Union[Var[bool], bool]] = None, tz: Var[str] | str | None = None,
unix: Optional[Union[Var[bool], bool]] = None, locale: Var[str] | str | None = None,
local: Optional[Union[Var[bool], bool]] = None, style: Style | None = None,
tz: Optional[Union[Var[str], str]] = None, key: Any | None = None,
locale: Optional[Union[Var[str], str]] = None, id: Any | None = None,
style: Optional[Style] = None, class_name: Any | None = None,
key: Optional[Any] = None, autofocus: bool | None = None,
id: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_change: Optional[Union[EventType[()], EventType[str]]] = None, on_change: Optional[EventType[()] | EventType[str]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -18,12 +18,12 @@ class NextComponent(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Literal, Optional, Union from typing import Any, Literal
from reflex.event import EventHandler, no_args_event_spec from reflex.event import EventHandler, no_args_event_spec
from reflex.utils import console, types from reflex.utils import console, types
@ -69,8 +69,8 @@ class Image(NextComponent):
def create( def create(
cls, cls,
*children, *children,
width: Optional[Union[int, str]] = None, width: int | str | None = None,
height: Optional[Union[int, str]] = None, height: int | str | None = None,
**props, **props,
): ):
"""Create an Image component from next/image. """Create an Image component from next/image.

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.event import EventType from reflex.event import EventType
from reflex.style import Style from reflex.style import Style
@ -19,26 +19,24 @@ class Image(NextComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
width: Optional[Union[int, str]] = None, width: int | str | None = None,
height: Optional[Union[int, str]] = None, height: int | str | None = None,
src: Optional[Union[Any, Var[Any]]] = None, src: Any | Var[Any] | None = None,
alt: Optional[Union[Var[str], str]] = None, alt: Var[str] | str | None = None,
loader: Optional[Union[Any, Var[Any]]] = None, loader: Any | Var[Any] | None = None,
fill: Optional[Union[Var[bool], bool]] = None, fill: Var[bool] | bool | None = None,
sizes: Optional[Union[Var[str], str]] = None, sizes: Var[str] | str | None = None,
quality: Optional[Union[Var[int], int]] = None, quality: Var[int] | int | None = None,
priority: Optional[Union[Var[bool], bool]] = None, priority: Var[bool] | bool | None = None,
placeholder: Optional[Union[Var[str], str]] = None, placeholder: Var[str] | str | None = None,
loading: Optional[ loading: Literal["eager", "lazy"] | Var[Literal["eager", "lazy"]] | None = None,
Union[Literal["eager", "lazy"], Var[Literal["eager", "lazy"]]] blur_data_url: Var[str] | str | None = None,
] = None, style: Style | None = None,
blur_data_url: Optional[Union[Var[str], str]] = None, key: Any | None = None,
style: Optional[Style] = None, id: Any | None = None,
key: Optional[Any] = None, class_name: Any | None = None,
id: Optional[Any] = None, autofocus: bool | None = None,
class_name: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,14 +16,14 @@ class NextLink(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
href: Optional[Union[Var[str], str]] = None, href: Var[str] | str | None = None,
pass_href: Optional[Union[Var[bool], bool]] = None, pass_href: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -1,7 +1,5 @@
"""Wrapping of the next-video component.""" """Wrapping of the next-video component."""
from typing import Optional
from reflex.components.component import Component from reflex.components.component import Component
from reflex.vars.base import Var from reflex.vars.base import Var
@ -17,7 +15,7 @@ class Video(NextComponent):
# the URL # the URL
src: Var[str] src: Var[str]
as_: Optional[Component] as_: Component | None
@classmethod @classmethod
def create(cls, *children, **props) -> NextComponent: def create(cls, *children, **props) -> NextComponent:

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -18,14 +18,14 @@ class Video(NextComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
src: Optional[Union[Var[str], str]] = None, src: Var[str] | str | None = None,
as_: Optional[Component] = None, as_: Component | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, List, Tuple, TypedDict, TypeVar, Union from typing import Any, Dict, TypedDict, TypeVar
from reflex.components.component import Component, NoSSRComponent from reflex.components.component import Component, NoSSRComponent
from reflex.components.core.cond import color_mode_cond from reflex.components.core.cond import color_mode_cond
@ -21,7 +21,7 @@ except ImportError:
Template = Any Template = Any
def _event_points_data_signature(e0: Var) -> Tuple[Var[List[Point]]]: def _event_points_data_signature(e0: Var) -> tuple[Var[list[Point]]]:
"""For plotly events with event data containing a point array. """For plotly events with event data containing a point array.
Args: Args:
@ -35,58 +35,35 @@ def _event_points_data_signature(e0: Var) -> Tuple[Var[List[Point]]]:
T = TypeVar("T") T = TypeVar("T")
ItemOrList = Union[T, List[T]] ItemOrList = T | list[T]
class BBox(TypedDict): class BBox(TypedDict):
"""Bounding box for a point in a plotly graph.""" """Bounding box for a point in a plotly graph."""
x0: Union[float, int, None] x0: float | int | None
x1: Union[float, int, None] x1: float | int | None
y0: Union[float, int, None] y0: float | int | None
y1: Union[float, int, None] y1: float | int | None
z0: Union[float, int, None] z0: float | int | None
z1: Union[float, int, None] z1: float | int | None
class Point(TypedDict): class Point(TypedDict):
"""A point in a plotly graph.""" """A point in a plotly graph."""
x: Union[float, int, None] x: float | int | None
y: Union[float, int, None] y: float | int | None
z: Union[float, int, None] z: float | int | None
lat: Union[float, int, None] lat: float | int | None
lon: Union[float, int, None] lon: float | int | None
curveNumber: Union[int, None] curveNumber: int | None
pointNumber: Union[int, None] pointNumber: int | None
pointNumbers: Union[List[int], None] pointNumbers: list[int] | None
pointIndex: Union[int, None] pointIndex: int | None
markerColor: Union[ markerColor: ItemOrList[ItemOrList[float | int | str | None]] | None
ItemOrList[ markerSize: ItemOrList[ItemOrList[float | int | None,]] | None
ItemOrList[ bbox: BBox | None
Union[
float,
int,
str,
None,
]
]
],
None,
]
markerSize: Union[
ItemOrList[
ItemOrList[
Union[
float,
int,
None,
]
]
],
None,
]
bbox: Union[BBox, None]
class Plotly(NoSSRComponent): class Plotly(NoSSRComponent):
@ -94,7 +71,7 @@ class Plotly(NoSSRComponent):
library = "react-plotly.js@2.6.0" library = "react-plotly.js@2.6.0"
lib_dependencies: List[str] = ["plotly.js@2.35.3"] lib_dependencies: list[str] = ["plotly.js@2.35.3"]
tag = "Plot" tag = "Plot"

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, List, Optional, TypedDict, TypeVar, Union, overload from typing import Any, Dict, Optional, TypedDict, TypeVar, overload
from reflex.components.component import NoSSRComponent from reflex.components.component import NoSSRComponent
from reflex.event import EventType from reflex.event import EventType
@ -21,29 +21,29 @@ except ImportError:
Figure = Any Figure = Any
Template = Any Template = Any
T = TypeVar("T") T = TypeVar("T")
ItemOrList = Union[T, List[T]] ItemOrList = T | list[T]
class BBox(TypedDict): class BBox(TypedDict):
x0: Union[float, int, None] x0: float | int | None
x1: Union[float, int, None] x1: float | int | None
y0: Union[float, int, None] y0: float | int | None
y1: Union[float, int, None] y1: float | int | None
z0: Union[float, int, None] z0: float | int | None
z1: Union[float, int, None] z1: float | int | None
class Point(TypedDict): class Point(TypedDict):
x: Union[float, int, None] x: float | int | None
y: Union[float, int, None] y: float | int | None
z: Union[float, int, None] z: float | int | None
lat: Union[float, int, None] lat: float | int | None
lon: Union[float, int, None] lon: float | int | None
curveNumber: Union[int, None] curveNumber: int | None
pointNumber: Union[int, None] pointNumber: int | None
pointNumbers: Union[List[int], None] pointNumbers: list[int] | None
pointIndex: Union[int, None] pointIndex: int | None
markerColor: Union[ItemOrList[ItemOrList[Union[float, int, str, None]]], None] markerColor: ItemOrList[ItemOrList[float | int | str | None]] | None
markerSize: Union[ItemOrList[ItemOrList[Union[float, int, None]]], None] markerSize: ItemOrList[ItemOrList[float | int | None,]] | None
bbox: Union[BBox, None] bbox: BBox | None
class Plotly(NoSSRComponent): class Plotly(NoSSRComponent):
def add_imports(self) -> dict[str, str]: ... def add_imports(self) -> dict[str, str]: ...
@ -53,17 +53,17 @@ class Plotly(NoSSRComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -72,12 +72,12 @@ class Plotly(NoSSRComponent):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -91,11 +91,11 @@ class Plotly(NoSSRComponent):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "Plotly": ) -> "Plotly":
@ -152,17 +152,17 @@ class PlotlyBasic(Plotly):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -171,12 +171,12 @@ class PlotlyBasic(Plotly):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -190,11 +190,11 @@ class PlotlyBasic(Plotly):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "PlotlyBasic": ) -> "PlotlyBasic":
@ -247,17 +247,17 @@ class PlotlyCartesian(Plotly):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -266,12 +266,12 @@ class PlotlyCartesian(Plotly):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -285,11 +285,11 @@ class PlotlyCartesian(Plotly):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "PlotlyCartesian": ) -> "PlotlyCartesian":
@ -342,17 +342,17 @@ class PlotlyGeo(Plotly):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -361,12 +361,12 @@ class PlotlyGeo(Plotly):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -380,11 +380,11 @@ class PlotlyGeo(Plotly):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "PlotlyGeo": ) -> "PlotlyGeo":
@ -437,17 +437,17 @@ class PlotlyGl3d(Plotly):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -456,12 +456,12 @@ class PlotlyGl3d(Plotly):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -475,11 +475,11 @@ class PlotlyGl3d(Plotly):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "PlotlyGl3d": ) -> "PlotlyGl3d":
@ -532,17 +532,17 @@ class PlotlyGl2d(Plotly):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -551,12 +551,12 @@ class PlotlyGl2d(Plotly):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -570,11 +570,11 @@ class PlotlyGl2d(Plotly):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "PlotlyGl2d": ) -> "PlotlyGl2d":
@ -627,17 +627,17 @@ class PlotlyMapbox(Plotly):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -646,12 +646,12 @@ class PlotlyMapbox(Plotly):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -665,11 +665,11 @@ class PlotlyMapbox(Plotly):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "PlotlyMapbox": ) -> "PlotlyMapbox":
@ -722,17 +722,17 @@ class PlotlyFinance(Plotly):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -741,12 +741,12 @@ class PlotlyFinance(Plotly):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -760,11 +760,11 @@ class PlotlyFinance(Plotly):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "PlotlyFinance": ) -> "PlotlyFinance":
@ -817,17 +817,17 @@ class PlotlyStrict(Plotly):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
data: Optional[Union[Figure, Var[Figure]]] = None, # type: ignore data: Figure | Var[Figure] | None = None, # type: ignore
layout: Optional[Union[Dict, Var[Dict]]] = None, layout: Dict | Var[Dict] | None = None,
template: Optional[Union[Template, Var[Template]]] = None, # type: ignore template: Template | Var[Template] | None = None, # type: ignore
config: Optional[Union[Dict, Var[Dict]]] = None, config: Dict | Var[Dict] | None = None,
use_resize_handler: Optional[Union[Var[bool], bool]] = None, use_resize_handler: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_after_plot: Optional[EventType[()]] = None, on_after_plot: Optional[EventType[()]] = None,
on_animated: Optional[EventType[()]] = None, on_animated: Optional[EventType[()]] = None,
on_animating_frame: Optional[EventType[()]] = None, on_animating_frame: Optional[EventType[()]] = None,
@ -836,12 +836,12 @@ class PlotlyStrict(Plotly):
on_before_hover: Optional[EventType[()]] = None, on_before_hover: Optional[EventType[()]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_button_clicked: Optional[EventType[()]] = None, on_button_clicked: Optional[EventType[()]] = None,
on_click: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_click: Optional[EventType[()] | EventType[list[Point]]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_deselect: Optional[EventType[()]] = None, on_deselect: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
on_focus: Optional[EventType[()]] = None, on_focus: Optional[EventType[()]] = None,
on_hover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_hover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_mount: Optional[EventType[()]] = None, on_mount: Optional[EventType[()]] = None,
on_mouse_down: Optional[EventType[()]] = None, on_mouse_down: Optional[EventType[()]] = None,
on_mouse_enter: Optional[EventType[()]] = None, on_mouse_enter: Optional[EventType[()]] = None,
@ -855,11 +855,11 @@ class PlotlyStrict(Plotly):
on_relayouting: Optional[EventType[()]] = None, on_relayouting: Optional[EventType[()]] = None,
on_restyle: Optional[EventType[()]] = None, on_restyle: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_selected: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selected: Optional[EventType[()] | EventType[list[Point]]] = None,
on_selecting: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_selecting: Optional[EventType[()] | EventType[list[Point]]] = None,
on_transition_interrupted: Optional[EventType[()]] = None, on_transition_interrupted: Optional[EventType[()]] = None,
on_transitioning: Optional[EventType[()]] = None, on_transitioning: Optional[EventType[()]] = None,
on_unhover: Optional[Union[EventType[()], EventType[List[Point]]]] = None, on_unhover: Optional[EventType[()] | EventType[list[Point]]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
) -> "PlotlyStrict": ) -> "PlotlyStrict":

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, List, Literal, Tuple, Union from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.colors import color from reflex.components.core.colors import color
@ -72,7 +72,7 @@ class AccordionComponent(RadixPrimitiveComponent):
return ["color_scheme", "variant"] return ["color_scheme", "variant"]
def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: def on_value_change(value: Var[str | list[str]]) -> tuple[Var[str | list[str]]]:
"""Handle the on_value_change event. """Handle the on_value_change event.
Args: Args:
@ -95,10 +95,10 @@ class AccordionRoot(AccordionComponent):
type: Var[LiteralAccordionType] type: Var[LiteralAccordionType]
# The value of the item to expand. # The value of the item to expand.
value: Var[Union[str, List[str]]] value: Var[str | list[str]]
# The default value of the item to expand. # The default value of the item to expand.
default_value: Var[Union[str, List[str]]] default_value: Var[str | list[str]]
# Whether or not the accordion is collapsible. # Whether or not the accordion is collapsible.
collapsible: Var[bool] collapsible: Var[bool]
@ -124,7 +124,7 @@ class AccordionRoot(AccordionComponent):
# Whether to show divider lines between items. # Whether to show divider lines between items.
show_dividers: Var[bool] show_dividers: Var[bool]
_valid_children: List[str] = ["AccordionItem"] _valid_children: list[str] = ["AccordionItem"]
# Fired when the opened the accordions changes. # Fired when the opened the accordions changes.
on_value_change: EventHandler[on_value_change] on_value_change: EventHandler[on_value_change]
@ -196,18 +196,18 @@ class AccordionItem(AccordionComponent):
disabled: Var[bool] disabled: Var[bool]
# The header of the accordion item. # The header of the accordion item.
header: Var[Union[Component, str]] header: Var[Component | str]
# The content of the accordion item. # The content of the accordion item.
content: Var[Union[Component, str, None]] = Var.create(None) content: Var[Component | str | None] = Var.create(None)
_valid_children: List[str] = [ _valid_children: list[str] = [
"AccordionHeader", "AccordionHeader",
"AccordionTrigger", "AccordionTrigger",
"AccordionContent", "AccordionContent",
] ]
_valid_parents: List[str] = ["AccordionRoot"] _valid_parents: list[str] = ["AccordionRoot"]
@classmethod @classmethod
def create( def create(

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
from reflex.components.lucide.icon import Icon from reflex.components.lucide.icon import Icon
@ -26,81 +26,75 @@ class AccordionComponent(RadixPrimitiveComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
color_scheme: Optional[ color_scheme: Literal[
Union[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet", ]
"yellow", | Var[
], Literal[
Var[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet",
"yellow",
]
],
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ variant: Literal["classic", "ghost", "outline", "soft", "surface"]
Literal["classic", "ghost", "outline", "soft", "surface"], | Var[Literal["classic", "ghost", "outline", "soft", "surface"]]
Var[Literal["classic", "ghost", "outline", "soft", "surface"]], | None = None,
] as_child: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, key: Any | None = None,
style: Optional[Style] = None, id: Any | None = None,
key: Optional[Any] = None, class_name: Any | None = None,
id: Optional[Any] = None, autofocus: bool | None = None,
class_name: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -138,7 +132,7 @@ class AccordionComponent(RadixPrimitiveComponent):
""" """
... ...
def on_value_change(value: Var[str | List[str]]) -> Tuple[Var[str | List[str]]]: ... def on_value_change(value: Var[str | list[str]]) -> tuple[Var[str | list[str]]]: ...
class AccordionRoot(AccordionComponent): class AccordionRoot(AccordionComponent):
def add_style(self): ... def add_style(self): ...
@ -147,106 +141,92 @@ class AccordionRoot(AccordionComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
type: Optional[ type: Literal["multiple", "single"]
Union[Literal["multiple", "single"], Var[Literal["multiple", "single"]]] | Var[Literal["multiple", "single"]]
] = None, | None = None,
value: Optional[Union[List[str], Var[Union[List[str], str]], str]] = None, value: Var[list[str] | str] | list[str] | str | None = None,
default_value: Optional[ default_value: Var[list[str] | str] | list[str] | str | None = None,
Union[List[str], Var[Union[List[str], str]], str] collapsible: Var[bool] | bool | None = None,
] = None, disabled: Var[bool] | bool | None = None,
collapsible: Optional[Union[Var[bool], bool]] = None, dir: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None,
disabled: Optional[Union[Var[bool], bool]] = None, orientation: Literal["horizontal", "vertical"]
dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None, | Var[Literal["horizontal", "vertical"]]
orientation: Optional[ | None = None,
Union[ radius: Literal["full", "large", "medium", "none", "small"]
Literal["horizontal", "vertical"], | Var[Literal["full", "large", "medium", "none", "small"]]
Var[Literal["horizontal", "vertical"]], | None = None,
duration: Var[int] | int | None = None,
easing: Var[str] | str | None = None,
show_dividers: Var[bool] | bool | None = None,
color_scheme: Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
radius: Optional[ | None = None,
Union[ variant: Literal["classic", "ghost", "outline", "soft", "surface"]
Literal["full", "large", "medium", "none", "small"], | Var[Literal["classic", "ghost", "outline", "soft", "surface"]]
Var[Literal["full", "large", "medium", "none", "small"]], | None = None,
] as_child: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
duration: Optional[Union[Var[int], int]] = None, key: Any | None = None,
easing: Optional[Union[Var[str], str]] = None, id: Any | None = None,
show_dividers: Optional[Union[Var[bool], bool]] = None, class_name: Any | None = None,
color_scheme: Optional[ autofocus: bool | None = None,
Union[ custom_attrs: dict[str, Var | Any] | None = None,
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
],
Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
],
]
] = None,
variant: Optional[
Union[
Literal["classic", "ghost", "outline", "soft", "surface"],
Var[Literal["classic", "ghost", "outline", "soft", "surface"]],
]
] = None,
as_child: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -262,9 +242,7 @@ class AccordionRoot(AccordionComponent):
on_mouse_up: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
on_value_change: Optional[ on_value_change: Optional[EventType[()] | EventType[str | list[str]]] = None,
Union[EventType[()], EventType[str | List[str]]]
] = None,
**props, **props,
) -> "AccordionRoot": ) -> "AccordionRoot":
"""Create the component. """Create the component.
@ -305,87 +283,79 @@ class AccordionItem(AccordionComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
value: Optional[Union[Var[str], str]] = None, value: Var[str] | str | None = None,
disabled: Optional[Union[Var[bool], bool]] = None, disabled: Var[bool] | bool | None = None,
header: Optional[Union[Component, Var[Union[Component, str]], str]] = None, header: Component | Var[Component | str] | str | None = None,
content: Optional[ content: Component | Var[Component | str | None] | str | None = None,
Union[Component, Var[Optional[Union[Component, str]]], str] color_scheme: Literal[
] = None, "amber",
color_scheme: Optional[ "blue",
Union[ "bronze",
Literal[ "brown",
"amber", "crimson",
"blue", "cyan",
"bronze", "gold",
"brown", "grass",
"crimson", "gray",
"cyan", "green",
"gold", "indigo",
"grass", "iris",
"gray", "jade",
"green", "lime",
"indigo", "mint",
"iris", "orange",
"jade", "pink",
"lime", "plum",
"mint", "purple",
"orange", "red",
"pink", "ruby",
"plum", "sky",
"purple", "teal",
"red", "tomato",
"ruby", "violet",
"sky", "yellow",
"teal", ]
"tomato", | Var[
"violet", Literal[
"yellow", "amber",
], "blue",
Var[ "bronze",
Literal[ "brown",
"amber", "crimson",
"blue", "cyan",
"bronze", "gold",
"brown", "grass",
"crimson", "gray",
"cyan", "green",
"gold", "indigo",
"grass", "iris",
"gray", "jade",
"green", "lime",
"indigo", "mint",
"iris", "orange",
"jade", "pink",
"lime", "plum",
"mint", "purple",
"orange", "red",
"pink", "ruby",
"plum", "sky",
"purple", "teal",
"red", "tomato",
"ruby", "violet",
"sky", "yellow",
"teal",
"tomato",
"violet",
"yellow",
]
],
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ variant: Literal["classic", "ghost", "outline", "soft", "surface"]
Literal["classic", "ghost", "outline", "soft", "surface"], | Var[Literal["classic", "ghost", "outline", "soft", "surface"]]
Var[Literal["classic", "ghost", "outline", "soft", "surface"]], | None = None,
] as_child: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, key: Any | None = None,
style: Optional[Style] = None, id: Any | None = None,
key: Optional[Any] = None, class_name: Any | None = None,
id: Optional[Any] = None, autofocus: bool | None = None,
class_name: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -435,81 +405,75 @@ class AccordionHeader(AccordionComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
color_scheme: Optional[ color_scheme: Literal[
Union[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet", ]
"yellow", | Var[
], Literal[
Var[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet",
"yellow",
]
],
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ variant: Literal["classic", "ghost", "outline", "soft", "surface"]
Literal["classic", "ghost", "outline", "soft", "surface"], | Var[Literal["classic", "ghost", "outline", "soft", "surface"]]
Var[Literal["classic", "ghost", "outline", "soft", "surface"]], | None = None,
] as_child: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, key: Any | None = None,
style: Optional[Style] = None, id: Any | None = None,
key: Optional[Any] = None, class_name: Any | None = None,
id: Optional[Any] = None, autofocus: bool | None = None,
class_name: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -555,81 +519,75 @@ class AccordionTrigger(AccordionComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
color_scheme: Optional[ color_scheme: Literal[
Union[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet", ]
"yellow", | Var[
], Literal[
Var[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet",
"yellow",
]
],
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ variant: Literal["classic", "ghost", "outline", "soft", "surface"]
Literal["classic", "ghost", "outline", "soft", "surface"], | Var[Literal["classic", "ghost", "outline", "soft", "surface"]]
Var[Literal["classic", "ghost", "outline", "soft", "surface"]], | None = None,
] as_child: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, key: Any | None = None,
style: Optional[Style] = None, id: Any | None = None,
key: Optional[Any] = None, class_name: Any | None = None,
id: Optional[Any] = None, autofocus: bool | None = None,
class_name: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -675,13 +633,13 @@ class AccordionIcon(Icon):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
size: Optional[Union[Var[int], int]] = None, size: Var[int] | int | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -724,81 +682,75 @@ class AccordionContent(AccordionComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
color_scheme: Optional[ color_scheme: Literal[
Union[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet", ]
"yellow", | Var[
], Literal[
Var[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet",
"yellow",
]
],
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ variant: Literal["classic", "ghost", "outline", "soft", "surface"]
Literal["classic", "ghost", "outline", "soft", "surface"], | Var[Literal["classic", "ghost", "outline", "soft", "surface"]]
Var[Literal["classic", "ghost", "outline", "soft", "surface"]], | None = None,
] as_child: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, key: Any | None = None,
style: Optional[Style] = None, id: Any | None = None,
key: Optional[Any] = None, class_name: Any | None = None,
id: Optional[Any] = None, autofocus: bool | None = None,
class_name: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -1,7 +1,5 @@
"""The base component for Radix primitives.""" """The base component for Radix primitives."""
from typing import List
from reflex.components.component import Component from reflex.components.component import Component
from reflex.components.tags.tag import Tag from reflex.components.tags.tag import Tag
from reflex.utils import format from reflex.utils import format
@ -14,7 +12,7 @@ class RadixPrimitiveComponent(Component):
# Change the default rendered element for the one passed as a child. # Change the default rendered element for the one passed as a child.
as_child: Var[bool] as_child: Var[bool]
lib_dependencies: List[str] = ["@emotion/react@^11.11.1"] lib_dependencies: list[str] = ["@emotion/react@^11.11.1"]
class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent): class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent):

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.components.component import Component from reflex.components.component import Component
from reflex.event import EventType from reflex.event import EventType
@ -16,13 +16,13 @@ class RadixPrimitiveComponent(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -64,13 +64,13 @@ class RadixPrimitiveComponentWithClassName(RadixPrimitiveComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -4,7 +4,7 @@
# Style based on https://ui.shadcn.com/docs/components/drawer # Style based on https://ui.shadcn.com/docs/components/drawer
from __future__ import annotations from __future__ import annotations
from typing import Any, List, Literal, Optional, Union from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.primitives.base import RadixPrimitiveComponent
@ -20,7 +20,7 @@ class DrawerComponent(RadixPrimitiveComponent):
library = "vaul" library = "vaul"
lib_dependencies: List[str] = ["@radix-ui/react-dialog@^1.0.5"] lib_dependencies: list[str] = ["@radix-ui/react-dialog@^1.0.5"]
LiteralDirectionType = Literal["top", "bottom", "left", "right"] LiteralDirectionType = Literal["top", "bottom", "left", "right"]
@ -58,7 +58,7 @@ class DrawerRoot(DrawerComponent):
handle_only: Var[bool] handle_only: Var[bool]
# Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Also Accept px values, which doesn't take screen height into account. # Array of numbers from 0 to 100 that corresponds to % of the screen a given snap point should take up. Should go from least visible. Also Accept px values, which doesn't take screen height into account.
snap_points: Optional[List[Union[str, float]]] snap_points: list[str | float] | None
# Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point. # Index of a snapPoint from which the overlay fade should be applied. Defaults to the last snap point.
fade_from_index: Var[int] fade_from_index: Var[int]

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, List, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import ComponentNamespace from reflex.components.component import ComponentNamespace
from reflex.components.radix.primitives.base import RadixPrimitiveComponent from reflex.components.radix.primitives.base import RadixPrimitiveComponent
@ -17,13 +17,13 @@ class DrawerComponent(RadixPrimitiveComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -67,31 +67,28 @@ class DrawerRoot(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
default_open: Optional[Union[Var[bool], bool]] = None, default_open: Var[bool] | bool | None = None,
open: Optional[Union[Var[bool], bool]] = None, open: Var[bool] | bool | None = None,
modal: Optional[Union[Var[bool], bool]] = None, modal: Var[bool] | bool | None = None,
direction: Optional[ direction: Literal["bottom", "left", "right", "top"]
Union[ | Var[Literal["bottom", "left", "right", "top"]]
Literal["bottom", "left", "right", "top"], | None = None,
Var[Literal["bottom", "left", "right", "top"]], dismissible: Var[bool] | bool | None = None,
] handle_only: Var[bool] | bool | None = None,
] = None, snap_points: list[float | str] | None = None,
dismissible: Optional[Union[Var[bool], bool]] = None, fade_from_index: Var[int] | int | None = None,
handle_only: Optional[Union[Var[bool], bool]] = None, scroll_lock_timeout: Var[int] | int | None = None,
snap_points: Optional[List[Union[float, str]]] = None, prevent_scroll_restoration: Var[bool] | bool | None = None,
fade_from_index: Optional[Union[Var[int], int]] = None, should_scale_background: Var[bool] | bool | None = None,
scroll_lock_timeout: Optional[Union[Var[int], int]] = None, close_threshold: Var[float] | float | None = None,
prevent_scroll_restoration: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
should_scale_background: Optional[Union[Var[bool], bool]] = None, style: Style | None = None,
close_threshold: Optional[Union[Var[float], float]] = None, key: Any | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, id: Any | None = None,
style: Optional[Style] = None, class_name: Any | None = None,
key: Optional[Any] = None, autofocus: bool | None = None,
id: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
class_name: Optional[Any] = None, on_animation_end: Optional[EventType[()] | EventType[bool]] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_animation_end: Optional[Union[EventType[()], EventType[bool]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -105,7 +102,7 @@ class DrawerRoot(DrawerComponent):
on_mouse_out: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None,
on_mouse_over: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None,
on_mouse_up: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None,
on_open_change: Optional[Union[EventType[()], EventType[bool]]] = None, on_open_change: Optional[EventType[()] | EventType[bool]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
@ -148,13 +145,13 @@ class DrawerTrigger(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -196,13 +193,13 @@ class DrawerPortal(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -244,13 +241,13 @@ class DrawerContent(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_close_auto_focus: Optional[EventType[()]] = None, on_close_auto_focus: Optional[EventType[()]] = None,
@ -301,13 +298,13 @@ class DrawerOverlay(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -349,13 +346,13 @@ class DrawerClose(DrawerTrigger):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -397,13 +394,13 @@ class DrawerTitle(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -445,13 +442,13 @@ class DrawerDescription(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -493,13 +490,13 @@ class DrawerHandle(DrawerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -549,31 +546,28 @@ class Drawer(ComponentNamespace):
@staticmethod @staticmethod
def __call__( def __call__(
*children, *children,
default_open: Optional[Union[Var[bool], bool]] = None, default_open: Var[bool] | bool | None = None,
open: Optional[Union[Var[bool], bool]] = None, open: Var[bool] | bool | None = None,
modal: Optional[Union[Var[bool], bool]] = None, modal: Var[bool] | bool | None = None,
direction: Optional[ direction: Literal["bottom", "left", "right", "top"]
Union[ | Var[Literal["bottom", "left", "right", "top"]]
Literal["bottom", "left", "right", "top"], | None = None,
Var[Literal["bottom", "left", "right", "top"]], dismissible: Var[bool] | bool | None = None,
] handle_only: Var[bool] | bool | None = None,
] = None, snap_points: list[float | str] | None = None,
dismissible: Optional[Union[Var[bool], bool]] = None, fade_from_index: Var[int] | int | None = None,
handle_only: Optional[Union[Var[bool], bool]] = None, scroll_lock_timeout: Var[int] | int | None = None,
snap_points: Optional[List[Union[float, str]]] = None, prevent_scroll_restoration: Var[bool] | bool | None = None,
fade_from_index: Optional[Union[Var[int], int]] = None, should_scale_background: Var[bool] | bool | None = None,
scroll_lock_timeout: Optional[Union[Var[int], int]] = None, close_threshold: Var[float] | float | None = None,
prevent_scroll_restoration: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
should_scale_background: Optional[Union[Var[bool], bool]] = None, style: Style | None = None,
close_threshold: Optional[Union[Var[float], float]] = None, key: Any | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, id: Any | None = None,
style: Optional[Style] = None, class_name: Any | None = None,
key: Optional[Any] = None, autofocus: bool | None = None,
id: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
class_name: Optional[Any] = None, on_animation_end: Optional[EventType[()] | EventType[bool]] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_animation_end: Optional[Union[EventType[()], EventType[bool]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -587,7 +581,7 @@ class Drawer(ComponentNamespace):
on_mouse_out: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None,
on_mouse_over: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None,
on_mouse_up: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None,
on_open_change: Optional[Union[EventType[()], EventType[bool]]] = None, on_open_change: Optional[EventType[()] | EventType[bool]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Optional from typing import Any
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.colors import color from reflex.components.core.colors import color
@ -58,10 +58,10 @@ class ProgressIndicator(ProgressComponent):
alias = "RadixProgressIndicator" alias = "RadixProgressIndicator"
# The current progress value. # The current progress value.
value: Var[Optional[int]] value: Var[int | None]
# The maximum progress value. # The maximum progress value.
max: Var[Optional[int]] max: Var[int | None]
# The color scheme of the progress indicator. # The color scheme of the progress indicator.
color_scheme: Var[LiteralAccentColor] color_scheme: Var[LiteralAccentColor]
@ -98,10 +98,10 @@ class Progress(ProgressRoot):
color_scheme: Var[LiteralAccentColor] color_scheme: Var[LiteralAccentColor]
# The current progress value. # The current progress value.
value: Var[Optional[int]] value: Var[int | None]
# The maximum progress value. # The maximum progress value.
max: Var[Optional[int]] max: Var[int | None]
@classmethod @classmethod
def create(cls, **props) -> Component: def create(cls, **props) -> Component:

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import ComponentNamespace from reflex.components.component import ComponentNamespace
from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName
@ -17,13 +17,13 @@ class ProgressComponent(RadixPrimitiveComponentWithClassName):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -66,19 +66,16 @@ class ProgressRoot(ProgressComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
radius: Optional[ radius: Literal["full", "large", "medium", "none", "small"]
Union[ | Var[Literal["full", "large", "medium", "none", "small"]]
Literal["full", "large", "medium", "none", "small"], | None = None,
Var[Literal["full", "large", "medium", "none", "small"]], as_child: Var[bool] | bool | None = None,
] style: Style | None = None,
] = None, key: Any | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, id: Any | None = None,
style: Optional[Style] = None, class_name: Any | None = None,
key: Optional[Any] = None, autofocus: bool | None = None,
id: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -122,77 +119,74 @@ class ProgressIndicator(ProgressComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
value: Optional[Union[Var[Optional[int]], int]] = None, value: Var[int | None] | int | None = None,
max: Optional[Union[Var[Optional[int]], int]] = None, max: Var[int | None] | int | None = None,
color_scheme: Optional[ color_scheme: Literal[
Union[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet", ]
"yellow", | Var[
], Literal[
Var[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet",
"yellow",
]
],
] ]
] = None, ]
as_child: Optional[Union[Var[bool], bool]] = None, | None = None,
style: Optional[Style] = None, as_child: Var[bool] | bool | None = None,
key: Optional[Any] = None, style: Style | None = None,
id: Optional[Any] = None, key: Any | None = None,
class_name: Optional[Any] = None, id: Any | None = None,
autofocus: Optional[bool] = None, class_name: Any | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, autofocus: bool | None = None,
custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -237,83 +231,77 @@ class Progress(ProgressRoot):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
color_scheme: Optional[ color_scheme: Literal[
Union[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet", ]
"yellow", | Var[
], Literal[
Var[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet",
"yellow",
]
],
] ]
] = None, ]
value: Optional[Union[Var[Optional[int]], int]] = None, | None = None,
max: Optional[Union[Var[Optional[int]], int]] = None, value: Var[int | None] | int | None = None,
radius: Optional[ max: Var[int | None] | int | None = None,
Union[ radius: Literal["full", "large", "medium", "none", "small"]
Literal["full", "large", "medium", "none", "small"], | Var[Literal["full", "large", "medium", "none", "small"]]
Var[Literal["full", "large", "medium", "none", "small"]], | None = None,
] as_child: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, key: Any | None = None,
style: Optional[Style] = None, id: Any | None = None,
key: Optional[Any] = None, class_name: Any | None = None,
id: Optional[Any] = None, autofocus: bool | None = None,
class_name: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -359,83 +347,77 @@ class ProgressNamespace(ComponentNamespace):
@staticmethod @staticmethod
def __call__( def __call__(
*children, *children,
color_scheme: Optional[ color_scheme: Literal[
Union[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet", ]
"yellow", | Var[
], Literal[
Var[ "amber",
Literal[ "blue",
"amber", "bronze",
"blue", "brown",
"bronze", "crimson",
"brown", "cyan",
"crimson", "gold",
"cyan", "grass",
"gold", "gray",
"grass", "green",
"gray", "indigo",
"green", "iris",
"indigo", "jade",
"iris", "lime",
"jade", "mint",
"lime", "orange",
"mint", "pink",
"orange", "plum",
"pink", "purple",
"plum", "red",
"purple", "ruby",
"red", "sky",
"ruby", "teal",
"sky", "tomato",
"teal", "violet",
"tomato", "yellow",
"violet",
"yellow",
]
],
] ]
] = None, ]
value: Optional[Union[Var[Optional[int]], int]] = None, | None = None,
max: Optional[Union[Var[Optional[int]], int]] = None, value: Var[int | None] | int | None = None,
radius: Optional[ max: Var[int | None] | int | None = None,
Union[ radius: Literal["full", "large", "medium", "none", "small"]
Literal["full", "large", "medium", "none", "small"], | Var[Literal["full", "large", "medium", "none", "small"]]
Var[Literal["full", "large", "medium", "none", "small"]], | None = None,
] as_child: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, key: Any | None = None,
style: Optional[Style] = None, id: Any | None = None,
key: Optional[Any] = None, class_name: Any | None = None,
id: Optional[Any] = None, autofocus: bool | None = None,
class_name: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, List, Literal, Tuple from typing import Any, Literal
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName
@ -20,8 +20,8 @@ class SliderComponent(RadixPrimitiveComponentWithClassName):
def on_value_event_spec( def on_value_event_spec(
value: Var[List[int]], value: Var[list[int]],
) -> Tuple[Var[List[int]]]: ) -> tuple[Var[list[int]]]:
"""Event handler spec for the value event. """Event handler spec for the value event.
Args: Args:
@ -39,9 +39,9 @@ class SliderRoot(SliderComponent):
tag = "Root" tag = "Root"
alias = "RadixSliderRoot" alias = "RadixSliderRoot"
default_value: Var[List[int]] default_value: Var[list[int]]
value: Var[List[int]] value: Var[list[int]]
name: Var[str] name: Var[str]

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, List, Literal, Optional, Tuple, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName from reflex.components.radix.primitives.base import RadixPrimitiveComponentWithClassName
@ -20,13 +20,13 @@ class SliderComponent(RadixPrimitiveComponentWithClassName):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -62,7 +62,7 @@ class SliderComponent(RadixPrimitiveComponentWithClassName):
""" """
... ...
def on_value_event_spec(value: Var[List[int]]) -> Tuple[Var[List[int]]]: ... def on_value_event_spec(value: Var[list[int]]) -> tuple[Var[list[int]]]: ...
class SliderRoot(SliderComponent): class SliderRoot(SliderComponent):
def add_style(self) -> dict[str, Any] | None: ... def add_style(self) -> dict[str, Any] | None: ...
@ -71,29 +71,26 @@ class SliderRoot(SliderComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
default_value: Optional[Union[List[int], Var[List[int]]]] = None, default_value: Var[list[int]] | list[int] | None = None,
value: Optional[Union[List[int], Var[List[int]]]] = None, value: Var[list[int]] | list[int] | None = None,
name: Optional[Union[Var[str], str]] = None, name: Var[str] | str | None = None,
disabled: Optional[Union[Var[bool], bool]] = None, disabled: Var[bool] | bool | None = None,
orientation: Optional[ orientation: Literal["horizontal", "vertical"]
Union[ | Var[Literal["horizontal", "vertical"]]
Literal["horizontal", "vertical"], | None = None,
Var[Literal["horizontal", "vertical"]], dir: Literal["ltr", "rtl"] | Var[Literal["ltr", "rtl"]] | None = None,
] inverted: Var[bool] | bool | None = None,
] = None, min: Var[int] | int | None = None,
dir: Optional[Union[Literal["ltr", "rtl"], Var[Literal["ltr", "rtl"]]]] = None, max: Var[int] | int | None = None,
inverted: Optional[Union[Var[bool], bool]] = None, step: Var[int] | int | None = None,
min: Optional[Union[Var[int], int]] = None, min_steps_between_thumbs: Var[int] | int | None = None,
max: Optional[Union[Var[int], int]] = None, as_child: Var[bool] | bool | None = None,
step: Optional[Union[Var[int], int]] = None, style: Style | None = None,
min_steps_between_thumbs: Optional[Union[Var[int], int]] = None, key: Any | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, id: Any | None = None,
style: Optional[Style] = None, class_name: Any | None = None,
key: Optional[Any] = None, autofocus: bool | None = None,
id: Optional[Any] = None, custom_attrs: dict[str, Var | Any] | None = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -109,8 +106,8 @@ class SliderRoot(SliderComponent):
on_mouse_up: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
on_value_change: Optional[Union[EventType[()], EventType[List[int]]]] = None, on_value_change: Optional[EventType[()] | EventType[list[int]]] = None,
on_value_commit: Optional[Union[EventType[()], EventType[List[int]]]] = None, on_value_commit: Optional[EventType[()] | EventType[list[int]]] = None,
**props, **props,
) -> "SliderRoot": ) -> "SliderRoot":
"""Create the component. """Create the component.
@ -140,13 +137,13 @@ class SliderTrack(SliderComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -189,13 +186,13 @@ class SliderRange(SliderComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -238,13 +235,13 @@ class SliderThumb(SliderComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -2,7 +2,7 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, Literal from typing import Any, Literal
from reflex.components import Component from reflex.components import Component
from reflex.components.core.breakpoints import Responsive from reflex.components.core.breakpoints import Responsive
@ -116,7 +116,7 @@ class RadixThemesComponent(Component):
library = library + " && <3.1.5" library = library + " && <3.1.5"
# "Fake" prop color_scheme is used to avoid shadowing CSS prop "color". # "Fake" prop color_scheme is used to avoid shadowing CSS prop "color".
_rename_props: Dict[str, str] = {"colorScheme": "color"} _rename_props: dict[str, str] = {"colorScheme": "color"}
@classmethod @classmethod
def create( def create(

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components import Component from reflex.components import Component
from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.breakpoints import Breakpoints
@ -56,54 +56,33 @@ class CommonMarginProps(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
m: Optional[ m: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Union[ | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | None = None,
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], mx: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
] | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
] = None, | None = None,
mx: Optional[ my: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Union[ | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | None = None,
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], mt: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
] | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
] = None, | None = None,
my: Optional[ mr: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Union[ | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | None = None,
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], mb: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
] | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
] = None, | None = None,
mt: Optional[ ml: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Union[ | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | None = None,
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], style: Style | None = None,
] key: Any | None = None,
] = None, id: Any | None = None,
mr: Optional[ class_name: Any | None = None,
Union[ autofocus: bool | None = None,
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], custom_attrs: dict[str, Var | Any] | None = None,
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]],
]
] = None,
mb: Optional[
Union[
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]],
]
] = None,
ml: Optional[
Union[
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]],
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -151,131 +130,61 @@ class CommonPaddingProps(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
p: Optional[ p: Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Union[ | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Breakpoints[ | Var[
str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
], | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ]
Var[ | None = None,
Union[ px: Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Breakpoints[ | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
str, | Var[
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
], | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], ]
] | None = None,
], py: Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
] | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
] = None, | Var[
px: Optional[ Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Union[ | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Breakpoints[ ]
str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] | None = None,
], pt: Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Var[ | Var[
Union[ Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Breakpoints[ | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
str, ]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | None = None,
], pr: Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
] | Var[
], Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
] | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
] = None, ]
py: Optional[ | None = None,
Union[ pb: Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Breakpoints[ | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] | Var[
], Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Var[ ]
Union[ | None = None,
Breakpoints[ pl: Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
str, | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | Var[
], Breakpoints[str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
] ]
], | None = None,
] style: Style | None = None,
] = None, key: Any | None = None,
pt: Optional[ id: Any | None = None,
Union[ class_name: Any | None = None,
Breakpoints[ autofocus: bool | None = None,
str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] custom_attrs: dict[str, Var | Any] | None = None,
],
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[
Union[
Breakpoints[
str,
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
],
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
]
],
]
] = None,
pr: Optional[
Union[
Breakpoints[
str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
],
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[
Union[
Breakpoints[
str,
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
],
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
]
],
]
] = None,
pb: Optional[
Union[
Breakpoints[
str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
],
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[
Union[
Breakpoints[
str,
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
],
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
]
],
]
] = None,
pl: Optional[
Union[
Breakpoints[
str, Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
],
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
Var[
Union[
Breakpoints[
str,
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
],
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
]
],
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -323,13 +232,13 @@ class RadixLoadingProp(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
loading: Optional[Union[Var[bool], bool]] = None, loading: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -371,12 +280,12 @@ class RadixThemesComponent(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -420,12 +329,12 @@ class RadixThemesTriggerComponent(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -460,104 +369,89 @@ class Theme(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
color_mode: Optional[Literal["dark", "inherit", "light"]] = None, color_mode: Literal["dark", "inherit", "light"] | None = None,
theme_panel: Optional[bool] = False, theme_panel: bool | None = False,
has_background: Optional[Union[Var[bool], bool]] = None, has_background: Var[bool] | bool | None = None,
appearance: Optional[ appearance: Literal["dark", "inherit", "light"]
Union[ | Var[Literal["dark", "inherit", "light"]]
Literal["dark", "inherit", "light"], | None = None,
Var[Literal["dark", "inherit", "light"]], accent_color: Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
accent_color: Optional[ | None = None,
Union[ gray_color: Literal["auto", "gray", "mauve", "olive", "sage", "sand", "slate"]
Literal[ | Var[Literal["auto", "gray", "mauve", "olive", "sage", "sand", "slate"]]
"amber", | None = None,
"blue", panel_background: Literal["solid", "translucent"]
"bronze", | Var[Literal["solid", "translucent"]]
"brown", | None = None,
"crimson", radius: Literal["full", "large", "medium", "none", "small"]
"cyan", | Var[Literal["full", "large", "medium", "none", "small"]]
"gold", | None = None,
"grass", scaling: Literal["100%", "105%", "110%", "90%", "95%"]
"gray", | Var[Literal["100%", "105%", "110%", "90%", "95%"]]
"green", | None = None,
"indigo", style: Style | None = None,
"iris", key: Any | None = None,
"jade", id: Any | None = None,
"lime", class_name: Any | None = None,
"mint", autofocus: bool | None = None,
"orange", custom_attrs: dict[str, Var | Any] | None = None,
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
],
Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
],
]
] = None,
gray_color: Optional[
Union[
Literal["auto", "gray", "mauve", "olive", "sage", "sand", "slate"],
Var[Literal["auto", "gray", "mauve", "olive", "sage", "sand", "slate"]],
]
] = None,
panel_background: Optional[
Union[Literal["solid", "translucent"], Var[Literal["solid", "translucent"]]]
] = None,
radius: Optional[
Union[
Literal["full", "large", "medium", "none", "small"],
Var[Literal["full", "large", "medium", "none", "small"]],
]
] = None,
scaling: Optional[
Union[
Literal["100%", "105%", "110%", "90%", "95%"],
Var[Literal["100%", "105%", "110%", "90%", "95%"]],
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -610,13 +504,13 @@ class ThemePanel(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
default_open: Optional[Union[Var[bool], bool]] = None, default_open: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -661,12 +555,12 @@ class RadixThemesColorModeProvider(Component):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -17,7 +17,7 @@ rx.text(
from __future__ import annotations from __future__ import annotations
from typing import Any, Dict, List, Literal, Optional, Union, get_args from typing import Any, Literal, get_args
from reflex.components.component import BaseComponent from reflex.components.component import BaseComponent
from reflex.components.core.cond import Cond, color_mode_cond, cond from reflex.components.core.cond import Cond, color_mode_cond, cond
@ -66,9 +66,9 @@ class ColorModeIcon(Cond):
LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"] LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"]
position_values: List[str] = list(get_args(LiteralPosition)) position_values: list[str] = list(get_args(LiteralPosition))
position_map: Dict[str, List[str]] = { position_map: dict[str, list[str]] = {
"position": position_values, "position": position_values,
"left": ["top-left", "bottom-left"], "left": ["top-left", "bottom-left"],
"right": ["top-right", "bottom-right"], "right": ["top-right", "bottom-right"],
@ -78,7 +78,7 @@ position_map: Dict[str, List[str]] = {
# needed to inverse contains for find # needed to inverse contains for find
def _find(const: List[str], var: Any): def _find(const: list[str], var: Any):
return LiteralArrayVar.create(const).contains(var) return LiteralArrayVar.create(const).contains(var)
@ -99,7 +99,7 @@ class ColorModeIconButton(IconButton):
"""Icon Button for toggling light / dark mode via toggle_color_mode.""" """Icon Button for toggling light / dark mode via toggle_color_mode."""
# The position of the icon button. Follow document flow if None. # The position of the icon button. Follow document flow if None.
position: Optional[Union[LiteralPosition, Var[LiteralPosition]]] = None position: LiteralPosition | Var[LiteralPosition] | None = None
# Allow picking the "system" value for the color mode. # Allow picking the "system" value for the color mode.
allow_system: bool = False allow_system: bool = False

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, List, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import BaseComponent from reflex.components.component import BaseComponent
from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.breakpoints import Breakpoints
@ -25,15 +25,15 @@ class ColorModeIcon(Cond):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
cond: Optional[Union[Any, Var[Any]]] = None, cond: Any | Var[Any] | None = None,
comp1: Optional[BaseComponent] = None, comp1: BaseComponent | None = None,
comp2: Optional[BaseComponent] = None, comp2: BaseComponent | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -63,8 +63,8 @@ class ColorModeIcon(Cond):
... ...
LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"] LiteralPosition = Literal["top-left", "top-right", "bottom-left", "bottom-right"]
position_values: List[str] position_values: list[str]
position_map: Dict[str, List[str]] position_map: dict[str, list[str]]
class ColorModeIconButton(IconButton): class ColorModeIconButton(IconButton):
@overload @overload
@ -72,334 +72,282 @@ class ColorModeIconButton(IconButton):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
position: Optional[ position: Literal["bottom-left", "bottom-right", "top-left", "top-right"]
Union[ | Literal["bottom-left", "bottom-right", "top-left", "top-right"]
Literal["bottom-left", "bottom-right", "top-left", "top-right"], | Var[Literal["bottom-left", "bottom-right", "top-left", "top-right"]]
Union[ | None = None,
Literal["bottom-left", "bottom-right", "top-left", "top-right"], allow_system: bool | None = None,
Var[ as_child: Var[bool] | bool | None = None,
Literal["bottom-left", "bottom-right", "top-left", "top-right"] size: Breakpoints[str, Literal["1", "2", "3", "4"]]
], | Literal["1", "2", "3", "4"]
], | Var[
Breakpoints[str, Literal["1", "2", "3", "4"]] | Literal["1", "2", "3", "4"]
]
| None = None,
variant: Literal["classic", "ghost", "outline", "soft", "solid", "surface"]
| Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]]
| None = None,
color_scheme: Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
allow_system: Optional[bool] = None, | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, high_contrast: Var[bool] | bool | None = None,
size: Optional[ radius: Literal["full", "large", "medium", "none", "small"]
Union[ | Var[Literal["full", "large", "medium", "none", "small"]]
Breakpoints[str, Literal["1", "2", "3", "4"]], | None = None,
Literal["1", "2", "3", "4"], auto_focus: Var[bool] | bool | None = None,
Var[ disabled: Var[bool] | bool | None = None,
Union[ form: Var[str] | str | None = None,
Breakpoints[str, Literal["1", "2", "3", "4"]], form_action: Var[str] | str | None = None,
Literal["1", "2", "3", "4"], form_enc_type: Var[str] | str | None = None,
] form_method: Var[str] | str | None = None,
], form_no_validate: Var[bool] | bool | None = None,
form_target: Var[str] | str | None = None,
name: Var[str] | str | None = None,
type: Literal["button", "reset", "submit"]
| Var[Literal["button", "reset", "submit"]]
| None = None,
value: Var[float | int | str] | float | int | str | None = None,
access_key: Var[str] | str | None = None,
auto_capitalize: Literal[
"characters", "none", "off", "on", "sentences", "words"
]
| Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal["classic", "ghost", "outline", "soft", "solid", "surface"], lang: Var[str] | str | None = None,
Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]], role: Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
color_scheme: Optional[ | None = None,
Union[ slot: Var[str] | str | None = None,
Literal[ spell_check: Var[bool] | bool | None = None,
"amber", tab_index: Var[int] | int | None = None,
"blue", title: Var[str] | str | None = None,
"bronze", loading: Var[bool] | bool | None = None,
"brown", style: Style | None = None,
"crimson", key: Any | None = None,
"cyan", id: Any | None = None,
"gold", class_name: Any | None = None,
"grass", autofocus: bool | None = None,
"gray", custom_attrs: dict[str, Var | Any] | None = None,
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
],
Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
],
]
] = None,
high_contrast: Optional[Union[Var[bool], bool]] = None,
radius: Optional[
Union[
Literal["full", "large", "medium", "none", "small"],
Var[Literal["full", "large", "medium", "none", "small"]],
]
] = None,
auto_focus: Optional[Union[Var[bool], bool]] = None,
disabled: Optional[Union[Var[bool], bool]] = None,
form: Optional[Union[Var[str], str]] = None,
form_action: Optional[Union[Var[str], str]] = None,
form_enc_type: Optional[Union[Var[str], str]] = None,
form_method: Optional[Union[Var[str], str]] = None,
form_no_validate: Optional[Union[Var[bool], bool]] = None,
form_target: Optional[Union[Var[str], str]] = None,
name: Optional[Union[Var[str], str]] = None,
type: Optional[
Union[
Literal["button", "reset", "submit"],
Var[Literal["button", "reset", "submit"]],
]
] = None,
value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None,
access_key: Optional[Union[Var[str], str]] = None,
auto_capitalize: Optional[
Union[
Literal["characters", "none", "off", "on", "sentences", "words"],
Var[Literal["characters", "none", "off", "on", "sentences", "words"]],
]
] = None,
content_editable: Optional[
Union[
Literal["inherit", "plaintext-only", False, True],
Var[Literal["inherit", "plaintext-only", False, True]],
]
] = None,
context_menu: Optional[Union[Var[str], str]] = None,
dir: Optional[Union[Var[str], str]] = None,
draggable: Optional[Union[Var[bool], bool]] = None,
enter_key_hint: Optional[
Union[
Literal["done", "enter", "go", "next", "previous", "search", "send"],
Var[
Literal["done", "enter", "go", "next", "previous", "search", "send"]
],
]
] = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
loading: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -475,106 +423,91 @@ class ColorModeSwitch(Switch):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
default_checked: Optional[Union[Var[bool], bool]] = None, default_checked: Var[bool] | bool | None = None,
checked: Optional[Union[Var[bool], bool]] = None, checked: Var[bool] | bool | None = None,
disabled: Optional[Union[Var[bool], bool]] = None, disabled: Var[bool] | bool | None = None,
required: Optional[Union[Var[bool], bool]] = None, required: Var[bool] | bool | None = None,
name: Optional[Union[Var[str], str]] = None, name: Var[str] | str | None = None,
value: Optional[Union[Var[str], str]] = None, value: Var[str] | str | None = None,
size: Optional[ size: Breakpoints[str, Literal["1", "2", "3"]]
Union[ | Literal["1", "2", "3"]
Breakpoints[str, Literal["1", "2", "3"]], | Var[Breakpoints[str, Literal["1", "2", "3"]] | Literal["1", "2", "3"]]
Literal["1", "2", "3"], | None = None,
Var[ variant: Literal["classic", "soft", "surface"]
Union[ | Var[Literal["classic", "soft", "surface"]]
Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] | None = None,
] color_scheme: Literal[
], "amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ high_contrast: Var[bool] | bool | None = None,
Literal["classic", "soft", "surface"], radius: Literal["full", "none", "small"]
Var[Literal["classic", "soft", "surface"]], | Var[Literal["full", "none", "small"]]
] | None = None,
] = None, style: Style | None = None,
color_scheme: Optional[ key: Any | None = None,
Union[ id: Any | None = None,
Literal[ class_name: Any | None = None,
"amber", autofocus: bool | None = None,
"blue", custom_attrs: dict[str, Var | Any] | None = None,
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
],
Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
],
]
] = None,
high_contrast: Optional[Union[Var[bool], bool]] = None,
radius: Optional[
Union[
Literal["full", "none", "small"], Var[Literal["full", "none", "small"]]
]
] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_change: Optional[Union[EventType[()], EventType[bool]]] = None, on_change: Optional[EventType[()] | EventType[bool]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import ComponentNamespace from reflex.components.component import ComponentNamespace
from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.breakpoints import Breakpoints
@ -22,14 +22,14 @@ class AlertDialogRoot(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
open: Optional[Union[Var[bool], bool]] = None, open: Var[bool] | bool | None = None,
default_open: Optional[Union[Var[bool], bool]] = None, default_open: Var[bool] | bool | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -43,7 +43,7 @@ class AlertDialogRoot(RadixThemesComponent):
on_mouse_out: Optional[EventType[()]] = None, on_mouse_out: Optional[EventType[()]] = None,
on_mouse_over: Optional[EventType[()]] = None, on_mouse_over: Optional[EventType[()]] = None,
on_mouse_up: Optional[EventType[()]] = None, on_mouse_up: Optional[EventType[()]] = None,
on_open_change: Optional[Union[EventType[()], EventType[bool]]] = None, on_open_change: Optional[EventType[()] | EventType[bool]] = None,
on_scroll: Optional[EventType[()]] = None, on_scroll: Optional[EventType[()]] = None,
on_unmount: Optional[EventType[()]] = None, on_unmount: Optional[EventType[()]] = None,
**props, **props,
@ -77,12 +77,12 @@ class AlertDialogTrigger(RadixThemesTriggerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -117,230 +117,197 @@ class AlertDialogContent(elements.Div, RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
size: Optional[ size: Breakpoints[str, Literal["1", "2", "3", "4"]]
Union[ | Literal["1", "2", "3", "4"]
Breakpoints[str, Literal["1", "2", "3", "4"]], | Var[
Literal["1", "2", "3", "4"], Breakpoints[str, Literal["1", "2", "3", "4"]] | Literal["1", "2", "3", "4"]
Var[ ]
Union[ | None = None,
Breakpoints[str, Literal["1", "2", "3", "4"]], force_mount: Var[bool] | bool | None = None,
Literal["1", "2", "3", "4"], access_key: Var[str] | str | None = None,
] auto_capitalize: Literal[
], "characters", "none", "off", "on", "sentences", "words"
]
| Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
force_mount: Optional[Union[Var[bool], bool]] = None, | None = None,
access_key: Optional[Union[Var[str], str]] = None, item_prop: Var[str] | str | None = None,
auto_capitalize: Optional[ lang: Var[str] | str | None = None,
Union[ role: Literal[
Literal["characters", "none", "off", "on", "sentences", "words"], "alert",
Var[Literal["characters", "none", "off", "on", "sentences", "words"]], "alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
content_editable: Optional[ | None = None,
Union[ slot: Var[str] | str | None = None,
Literal["inherit", "plaintext-only", False, True], spell_check: Var[bool] | bool | None = None,
Var[Literal["inherit", "plaintext-only", False, True]], tab_index: Var[int] | int | None = None,
] title: Var[str] | str | None = None,
] = None, style: Style | None = None,
context_menu: Optional[Union[Var[str], str]] = None, key: Any | None = None,
dir: Optional[Union[Var[str], str]] = None, id: Any | None = None,
draggable: Optional[Union[Var[bool], bool]] = None, class_name: Any | None = None,
enter_key_hint: Optional[ autofocus: bool | None = None,
Union[ custom_attrs: dict[str, Var | Any] | None = None,
Literal["done", "enter", "go", "next", "previous", "search", "send"],
Var[
Literal["done", "enter", "go", "next", "previous", "search", "send"]
],
]
] = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_close_auto_focus: Optional[EventType[()]] = None, on_close_auto_focus: Optional[EventType[()]] = None,
@ -408,12 +375,12 @@ class AlertDialogTitle(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -457,12 +424,12 @@ class AlertDialogDescription(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -506,12 +473,12 @@ class AlertDialogAction(RadixThemesTriggerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
@ -546,12 +513,12 @@ class AlertDialogCancel(RadixThemesTriggerComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -1,7 +1,5 @@
"""Interactive components provided by @radix-ui/themes.""" """Interactive components provided by @radix-ui/themes."""
from typing import Union
from reflex.vars.base import Var from reflex.vars.base import Var
from ..base import RadixThemesComponent from ..base import RadixThemesComponent
@ -13,7 +11,7 @@ class AspectRatio(RadixThemesComponent):
tag = "AspectRatio" tag = "AspectRatio"
# The ratio of the width to the height of the element # The ratio of the width to the height of the element
ratio: Var[Union[float, int]] ratio: Var[float | int]
aspect_ratio = AspectRatio.create aspect_ratio = AspectRatio.create

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Optional, Union, overload from typing import Any, Optional, overload
from reflex.event import EventType from reflex.event import EventType
from reflex.style import Style from reflex.style import Style
@ -17,13 +17,13 @@ class AspectRatio(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
ratio: Optional[Union[Var[Union[float, int]], float, int]] = None, ratio: Var[float | int] | float | int | None = None,
style: Optional[Style] = None, style: Style | None = None,
key: Optional[Any] = None, key: Any | None = None,
id: Optional[Any] = None, id: Any | None = None,
class_name: Optional[Any] = None, class_name: Any | None = None,
autofocus: Optional[bool] = None, autofocus: bool | None = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None, custom_attrs: dict[str, Var | Any] | None = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.breakpoints import Breakpoints
from reflex.event import EventType from reflex.event import EventType
@ -20,100 +20,85 @@ class Avatar(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
variant: Optional[ variant: Literal["soft", "solid"] | Var[Literal["soft", "solid"]] | None = None,
Union[Literal["soft", "solid"], Var[Literal["soft", "solid"]]] size: Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]]
] = None, | Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]
size: Optional[ | Var[
Union[ Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Breakpoints[str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]], | Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"]
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], ]
Var[ | None = None,
Union[ color_scheme: Literal[
Breakpoints[ "amber",
str, Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"] "blue",
], "bronze",
Literal["1", "2", "3", "4", "5", "6", "7", "8", "9"], "brown",
] "crimson",
], "cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
color_scheme: Optional[ | None = None,
Union[ high_contrast: Var[bool] | bool | None = None,
Literal[ radius: Literal["full", "large", "medium", "none", "small"]
"amber", | Var[Literal["full", "large", "medium", "none", "small"]]
"blue", | None = None,
"bronze", src: Var[str] | str | None = None,
"brown", fallback: Var[str] | str | None = None,
"crimson", style: Style | None = None,
"cyan", key: Any | None = None,
"gold", id: Any | None = None,
"grass", class_name: Any | None = None,
"gray", autofocus: bool | None = None,
"green", custom_attrs: dict[str, Var | Any] | None = None,
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
],
Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
],
]
] = None,
high_contrast: Optional[Union[Var[bool], bool]] = None,
radius: Optional[
Union[
Literal["full", "large", "medium", "none", "small"],
Var[Literal["full", "large", "medium", "none", "small"]],
]
] = None,
src: Optional[Union[Var[str], str]] = None,
fallback: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.breakpoints import Breakpoints
from reflex.components.el import elements from reflex.components.el import elements
@ -19,303 +19,260 @@ class Badge(elements.Span, RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
variant: Optional[ variant: Literal["outline", "soft", "solid", "surface"]
Union[ | Var[Literal["outline", "soft", "solid", "surface"]]
Literal["outline", "soft", "solid", "surface"], | None = None,
Var[Literal["outline", "soft", "solid", "surface"]], size: Breakpoints[str, Literal["1", "2", "3"]]
| Literal["1", "2", "3"]
| Var[Breakpoints[str, Literal["1", "2", "3"]] | Literal["1", "2", "3"]]
| None = None,
color_scheme: Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
size: Optional[ | None = None,
Union[ high_contrast: Var[bool] | bool | None = None,
Breakpoints[str, Literal["1", "2", "3"]], radius: Literal["full", "large", "medium", "none", "small"]
Literal["1", "2", "3"], | Var[Literal["full", "large", "medium", "none", "small"]]
Var[ | None = None,
Union[ access_key: Var[str] | str | None = None,
Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] auto_capitalize: Literal[
] "characters", "none", "off", "on", "sentences", "words"
], ]
| Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
color_scheme: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal[ lang: Var[str] | str | None = None,
"amber", role: Literal[
"blue", "alert",
"bronze", "alertdialog",
"brown", "application",
"crimson", "article",
"cyan", "banner",
"gold", "button",
"grass", "cell",
"gray", "checkbox",
"green", "columnheader",
"indigo", "combobox",
"iris", "complementary",
"jade", "contentinfo",
"lime", "definition",
"mint", "dialog",
"orange", "directory",
"pink", "document",
"plum", "feed",
"purple", "figure",
"red", "form",
"ruby", "grid",
"sky", "gridcell",
"teal", "group",
"tomato", "heading",
"violet", "img",
"yellow", "link",
], "list",
Var[ "listbox",
Literal[ "listitem",
"amber", "log",
"blue", "main",
"bronze", "marquee",
"brown", "math",
"crimson", "menu",
"cyan", "menubar",
"gold", "menuitem",
"grass", "menuitemcheckbox",
"gray", "menuitemradio",
"green", "navigation",
"indigo", "none",
"iris", "note",
"jade", "option",
"lime", "presentation",
"mint", "progressbar",
"orange", "radio",
"pink", "radiogroup",
"plum", "region",
"purple", "row",
"red", "rowgroup",
"ruby", "rowheader",
"sky", "scrollbar",
"teal", "search",
"tomato", "searchbox",
"violet", "separator",
"yellow", "slider",
] "spinbutton",
], "status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
high_contrast: Optional[Union[Var[bool], bool]] = None, | None = None,
radius: Optional[ slot: Var[str] | str | None = None,
Union[ spell_check: Var[bool] | bool | None = None,
Literal["full", "large", "medium", "none", "small"], tab_index: Var[int] | int | None = None,
Var[Literal["full", "large", "medium", "none", "small"]], title: Var[str] | str | None = None,
] style: Style | None = None,
] = None, key: Any | None = None,
access_key: Optional[Union[Var[str], str]] = None, id: Any | None = None,
auto_capitalize: Optional[ class_name: Any | None = None,
Union[ autofocus: bool | None = None,
Literal["characters", "none", "off", "on", "sentences", "words"], custom_attrs: dict[str, Var | Any] | None = None,
Var[Literal["characters", "none", "off", "on", "sentences", "words"]],
]
] = None,
content_editable: Optional[
Union[
Literal["inherit", "plaintext-only", False, True],
Var[Literal["inherit", "plaintext-only", False, True]],
]
] = None,
context_menu: Optional[Union[Var[str], str]] = None,
dir: Optional[Union[Var[str], str]] = None,
draggable: Optional[Union[Var[bool], bool]] = None,
enter_key_hint: Optional[
Union[
Literal["done", "enter", "go", "next", "previous", "search", "send"],
Var[
Literal["done", "enter", "go", "next", "previous", "search", "send"]
],
]
] = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.breakpoints import Breakpoints
from reflex.components.el import elements from reflex.components.el import elements
@ -21,322 +21,277 @@ class Button(elements.Button, RadixLoadingProp, RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
size: Optional[ size: Breakpoints[str, Literal["1", "2", "3", "4"]]
Union[ | Literal["1", "2", "3", "4"]
Breakpoints[str, Literal["1", "2", "3", "4"]], | Var[
Literal["1", "2", "3", "4"], Breakpoints[str, Literal["1", "2", "3", "4"]] | Literal["1", "2", "3", "4"]
Var[ ]
Union[ | None = None,
Breakpoints[str, Literal["1", "2", "3", "4"]], variant: Literal["classic", "ghost", "outline", "soft", "solid", "surface"]
Literal["1", "2", "3", "4"], | Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]]
] | None = None,
], color_scheme: Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ high_contrast: Var[bool] | bool | None = None,
Literal["classic", "ghost", "outline", "soft", "solid", "surface"], radius: Literal["full", "large", "medium", "none", "small"]
Var[Literal["classic", "ghost", "outline", "soft", "solid", "surface"]], | Var[Literal["full", "large", "medium", "none", "small"]]
| None = None,
auto_focus: Var[bool] | bool | None = None,
disabled: Var[bool] | bool | None = None,
form: Var[str] | str | None = None,
form_action: Var[str] | str | None = None,
form_enc_type: Var[str] | str | None = None,
form_method: Var[str] | str | None = None,
form_no_validate: Var[bool] | bool | None = None,
form_target: Var[str] | str | None = None,
name: Var[str] | str | None = None,
type: Literal["button", "reset", "submit"]
| Var[Literal["button", "reset", "submit"]]
| None = None,
value: Var[float | int | str] | float | int | str | None = None,
access_key: Var[str] | str | None = None,
auto_capitalize: Literal[
"characters", "none", "off", "on", "sentences", "words"
]
| Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
color_scheme: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal[ lang: Var[str] | str | None = None,
"amber", role: Literal[
"blue", "alert",
"bronze", "alertdialog",
"brown", "application",
"crimson", "article",
"cyan", "banner",
"gold", "button",
"grass", "cell",
"gray", "checkbox",
"green", "columnheader",
"indigo", "combobox",
"iris", "complementary",
"jade", "contentinfo",
"lime", "definition",
"mint", "dialog",
"orange", "directory",
"pink", "document",
"plum", "feed",
"purple", "figure",
"red", "form",
"ruby", "grid",
"sky", "gridcell",
"teal", "group",
"tomato", "heading",
"violet", "img",
"yellow", "link",
], "list",
Var[ "listbox",
Literal[ "listitem",
"amber", "log",
"blue", "main",
"bronze", "marquee",
"brown", "math",
"crimson", "menu",
"cyan", "menubar",
"gold", "menuitem",
"grass", "menuitemcheckbox",
"gray", "menuitemradio",
"green", "navigation",
"indigo", "none",
"iris", "note",
"jade", "option",
"lime", "presentation",
"mint", "progressbar",
"orange", "radio",
"pink", "radiogroup",
"plum", "region",
"purple", "row",
"red", "rowgroup",
"ruby", "rowheader",
"sky", "scrollbar",
"teal", "search",
"tomato", "searchbox",
"violet", "separator",
"yellow", "slider",
] "spinbutton",
], "status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
high_contrast: Optional[Union[Var[bool], bool]] = None, | None = None,
radius: Optional[ slot: Var[str] | str | None = None,
Union[ spell_check: Var[bool] | bool | None = None,
Literal["full", "large", "medium", "none", "small"], tab_index: Var[int] | int | None = None,
Var[Literal["full", "large", "medium", "none", "small"]], title: Var[str] | str | None = None,
] loading: Var[bool] | bool | None = None,
] = None, style: Style | None = None,
auto_focus: Optional[Union[Var[bool], bool]] = None, key: Any | None = None,
disabled: Optional[Union[Var[bool], bool]] = None, id: Any | None = None,
form: Optional[Union[Var[str], str]] = None, class_name: Any | None = None,
form_action: Optional[Union[Var[str], str]] = None, autofocus: bool | None = None,
form_enc_type: Optional[Union[Var[str], str]] = None, custom_attrs: dict[str, Var | Any] | None = None,
form_method: Optional[Union[Var[str], str]] = None,
form_no_validate: Optional[Union[Var[bool], bool]] = None,
form_target: Optional[Union[Var[str], str]] = None,
name: Optional[Union[Var[str], str]] = None,
type: Optional[
Union[
Literal["button", "reset", "submit"],
Var[Literal["button", "reset", "submit"]],
]
] = None,
value: Optional[Union[Var[Union[float, int, str]], float, int, str]] = None,
access_key: Optional[Union[Var[str], str]] = None,
auto_capitalize: Optional[
Union[
Literal["characters", "none", "off", "on", "sentences", "words"],
Var[Literal["characters", "none", "off", "on", "sentences", "words"]],
]
] = None,
content_editable: Optional[
Union[
Literal["inherit", "plaintext-only", False, True],
Var[Literal["inherit", "plaintext-only", False, True]],
]
] = None,
context_menu: Optional[Union[Var[str], str]] = None,
dir: Optional[Union[Var[str], str]] = None,
draggable: Optional[Union[Var[bool], bool]] = None,
enter_key_hint: Optional[
Union[
Literal["done", "enter", "go", "next", "previous", "search", "send"],
Var[
Literal["done", "enter", "go", "next", "previous", "search", "send"]
],
]
] = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
loading: Optional[Union[Var[bool], bool]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -1,6 +1,6 @@
"""Interactive components provided by @radix-ui/themes.""" """Interactive components provided by @radix-ui/themes."""
from typing import Literal, Union from typing import Literal
import reflex as rx import reflex as rx
from reflex.components.component import Component, ComponentNamespace from reflex.components.component import Component, ComponentNamespace
@ -57,7 +57,7 @@ class Callout(CalloutRoot):
icon: Var[str] icon: Var[str]
@classmethod @classmethod
def create(cls, text: Union[str, Var[str]], **props) -> Component: def create(cls, text: str | Var[str], **props) -> Component:
"""Create a callout component. """Create a callout component.
Args: Args:

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.breakpoints import Breakpoints
from reflex.components.el import elements from reflex.components.el import elements
@ -19,236 +19,201 @@ class Card(elements.Div, RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
size: Optional[ size: Breakpoints[str, Literal["1", "2", "3", "4", "5"]]
Union[ | Literal["1", "2", "3", "4", "5"]
Breakpoints[str, Literal["1", "2", "3", "4", "5"]], | Var[
Literal["1", "2", "3", "4", "5"], Breakpoints[str, Literal["1", "2", "3", "4", "5"]]
Var[ | Literal["1", "2", "3", "4", "5"]
Union[ ]
Breakpoints[str, Literal["1", "2", "3", "4", "5"]], | None = None,
Literal["1", "2", "3", "4", "5"], variant: Literal["classic", "ghost", "surface"]
] | Var[Literal["classic", "ghost", "surface"]]
], | None = None,
access_key: Var[str] | str | None = None,
auto_capitalize: Literal[
"characters", "none", "off", "on", "sentences", "words"
]
| Var[Literal["characters", "none", "off", "on", "sentences", "words"]]
| None = None,
content_editable: Literal["inherit", "plaintext-only", False, True]
| Var[Literal["inherit", "plaintext-only", False, True]]
| None = None,
context_menu: Var[str] | str | None = None,
dir: Var[str] | str | None = None,
draggable: Var[bool] | bool | None = None,
enter_key_hint: Literal[
"done", "enter", "go", "next", "previous", "search", "send"
]
| Var[Literal["done", "enter", "go", "next", "previous", "search", "send"]]
| None = None,
hidden: Var[bool] | bool | None = None,
input_mode: Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
]
| Var[
Literal[
"decimal", "email", "none", "numeric", "search", "tel", "text", "url"
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ item_prop: Var[str] | str | None = None,
Literal["classic", "ghost", "surface"], lang: Var[str] | str | None = None,
Var[Literal["classic", "ghost", "surface"]], role: Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
| Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
] ]
] = None, ]
access_key: Optional[Union[Var[str], str]] = None, | None = None,
auto_capitalize: Optional[ slot: Var[str] | str | None = None,
Union[ spell_check: Var[bool] | bool | None = None,
Literal["characters", "none", "off", "on", "sentences", "words"], tab_index: Var[int] | int | None = None,
Var[Literal["characters", "none", "off", "on", "sentences", "words"]], title: Var[str] | str | None = None,
] style: Style | None = None,
] = None, key: Any | None = None,
content_editable: Optional[ id: Any | None = None,
Union[ class_name: Any | None = None,
Literal["inherit", "plaintext-only", False, True], autofocus: bool | None = None,
Var[Literal["inherit", "plaintext-only", False, True]], custom_attrs: dict[str, Var | Any] | None = None,
]
] = None,
context_menu: Optional[Union[Var[str], str]] = None,
dir: Optional[Union[Var[str], str]] = None,
draggable: Optional[Union[Var[bool], bool]] = None,
enter_key_hint: Optional[
Union[
Literal["done", "enter", "go", "next", "previous", "search", "send"],
Var[
Literal["done", "enter", "go", "next", "previous", "search", "send"]
],
]
] = None,
hidden: Optional[Union[Var[bool], bool]] = None,
input_mode: Optional[
Union[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
],
Var[
Literal[
"decimal",
"email",
"none",
"numeric",
"search",
"tel",
"text",
"url",
]
],
]
] = None,
item_prop: Optional[Union[Var[str], str]] = None,
lang: Optional[Union[Var[str], str]] = None,
role: Optional[
Union[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
],
Var[
Literal[
"alert",
"alertdialog",
"application",
"article",
"banner",
"button",
"cell",
"checkbox",
"columnheader",
"combobox",
"complementary",
"contentinfo",
"definition",
"dialog",
"directory",
"document",
"feed",
"figure",
"form",
"grid",
"gridcell",
"group",
"heading",
"img",
"link",
"list",
"listbox",
"listitem",
"log",
"main",
"marquee",
"math",
"menu",
"menubar",
"menuitem",
"menuitemcheckbox",
"menuitemradio",
"navigation",
"none",
"note",
"option",
"presentation",
"progressbar",
"radio",
"radiogroup",
"region",
"row",
"rowgroup",
"rowheader",
"scrollbar",
"search",
"searchbox",
"separator",
"slider",
"spinbutton",
"status",
"switch",
"tab",
"table",
"tablist",
"tabpanel",
"term",
"textbox",
"timer",
"toolbar",
"tooltip",
"tree",
"treegrid",
"treeitem",
]
],
]
] = None,
slot: Optional[Union[Var[str], str]] = None,
spell_check: Optional[Union[Var[bool], bool]] = None,
tab_index: Optional[Union[Var[int], int]] = None,
title: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,

View File

@ -3,7 +3,7 @@
# ------------------- DO NOT EDIT ---------------------- # ------------------- DO NOT EDIT ----------------------
# This file was generated by `reflex/utils/pyi_generator.py`! # This file was generated by `reflex/utils/pyi_generator.py`!
# ------------------------------------------------------ # ------------------------------------------------------
from typing import Any, Dict, Literal, Optional, Union, overload from typing import Any, Literal, Optional, overload
from reflex.components.component import ComponentNamespace from reflex.components.component import ComponentNamespace
from reflex.components.core.breakpoints import Breakpoints from reflex.components.core.breakpoints import Breakpoints
@ -22,101 +22,88 @@ class Checkbox(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
as_child: Optional[Union[Var[bool], bool]] = None, as_child: Var[bool] | bool | None = None,
size: Optional[ size: Breakpoints[str, Literal["1", "2", "3"]]
Union[ | Literal["1", "2", "3"]
Breakpoints[str, Literal["1", "2", "3"]], | Var[Breakpoints[str, Literal["1", "2", "3"]] | Literal["1", "2", "3"]]
Literal["1", "2", "3"], | None = None,
Var[ variant: Literal["classic", "soft", "surface"]
Union[ | Var[Literal["classic", "soft", "surface"]]
Breakpoints[str, Literal["1", "2", "3"]], Literal["1", "2", "3"] | None = None,
] color_scheme: Literal[
], "amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
variant: Optional[ | None = None,
Union[ high_contrast: Var[bool] | bool | None = None,
Literal["classic", "soft", "surface"], default_checked: Var[bool] | bool | None = None,
Var[Literal["classic", "soft", "surface"]], checked: Var[bool] | bool | None = None,
] disabled: Var[bool] | bool | None = None,
] = None, required: Var[bool] | bool | None = None,
color_scheme: Optional[ name: Var[str] | str | None = None,
Union[ value: Var[str] | str | None = None,
Literal[ style: Style | None = None,
"amber", key: Any | None = None,
"blue", id: Any | None = None,
"bronze", class_name: Any | None = None,
"brown", autofocus: bool | None = None,
"crimson", custom_attrs: dict[str, Var | Any] | None = None,
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
],
Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
],
]
] = None,
high_contrast: Optional[Union[Var[bool], bool]] = None,
default_checked: Optional[Union[Var[bool], bool]] = None,
checked: Optional[Union[Var[bool], bool]] = None,
disabled: Optional[Union[Var[bool], bool]] = None,
required: Optional[Union[Var[bool], bool]] = None,
name: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_change: Optional[Union[EventType[()], EventType[bool]]] = None, on_change: Optional[EventType[()] | EventType[bool]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
@ -171,100 +158,89 @@ class HighLevelCheckbox(RadixThemesComponent):
def create( # type: ignore def create( # type: ignore
cls, cls,
*children, *children,
text: Optional[Union[Var[str], str]] = None, text: Var[str] | str | None = None,
spacing: Optional[ spacing: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Union[ | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | None = None,
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], size: Literal["1", "2", "3"] | Var[Literal["1", "2", "3"]] | None = None,
as_child: Var[bool] | bool | None = None,
variant: Literal["classic", "soft", "surface"]
| Var[Literal["classic", "soft", "surface"]]
| None = None,
color_scheme: Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
size: Optional[ | None = None,
Union[Literal["1", "2", "3"], Var[Literal["1", "2", "3"]]] high_contrast: Var[bool] | bool | None = None,
] = None, default_checked: Var[bool] | bool | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, checked: Var[bool] | bool | None = None,
variant: Optional[ disabled: Var[bool] | bool | None = None,
Union[ required: Var[bool] | bool | None = None,
Literal["classic", "soft", "surface"], name: Var[str] | str | None = None,
Var[Literal["classic", "soft", "surface"]], value: Var[str] | str | None = None,
] style: Style | None = None,
] = None, key: Any | None = None,
color_scheme: Optional[ id: Any | None = None,
Union[ class_name: Any | None = None,
Literal[ autofocus: bool | None = None,
"amber", custom_attrs: dict[str, Var | Any] | None = None,
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
],
Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
],
]
] = None,
high_contrast: Optional[Union[Var[bool], bool]] = None,
default_checked: Optional[Union[Var[bool], bool]] = None,
checked: Optional[Union[Var[bool], bool]] = None,
disabled: Optional[Union[Var[bool], bool]] = None,
required: Optional[Union[Var[bool], bool]] = None,
name: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_change: Optional[Union[EventType[()], EventType[bool]]] = None, on_change: Optional[EventType[()] | EventType[bool]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,
@ -316,100 +292,89 @@ class CheckboxNamespace(ComponentNamespace):
@staticmethod @staticmethod
def __call__( def __call__(
*children, *children,
text: Optional[Union[Var[str], str]] = None, text: Var[str] | str | None = None,
spacing: Optional[ spacing: Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
Union[ | Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]]
Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"], | None = None,
Var[Literal["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]], size: Literal["1", "2", "3"] | Var[Literal["1", "2", "3"]] | None = None,
as_child: Var[bool] | bool | None = None,
variant: Literal["classic", "soft", "surface"]
| Var[Literal["classic", "soft", "surface"]]
| None = None,
color_scheme: Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
| Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
] ]
] = None, ]
size: Optional[ | None = None,
Union[Literal["1", "2", "3"], Var[Literal["1", "2", "3"]]] high_contrast: Var[bool] | bool | None = None,
] = None, default_checked: Var[bool] | bool | None = None,
as_child: Optional[Union[Var[bool], bool]] = None, checked: Var[bool] | bool | None = None,
variant: Optional[ disabled: Var[bool] | bool | None = None,
Union[ required: Var[bool] | bool | None = None,
Literal["classic", "soft", "surface"], name: Var[str] | str | None = None,
Var[Literal["classic", "soft", "surface"]], value: Var[str] | str | None = None,
] style: Style | None = None,
] = None, key: Any | None = None,
color_scheme: Optional[ id: Any | None = None,
Union[ class_name: Any | None = None,
Literal[ autofocus: bool | None = None,
"amber", custom_attrs: dict[str, Var | Any] | None = None,
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
],
Var[
Literal[
"amber",
"blue",
"bronze",
"brown",
"crimson",
"cyan",
"gold",
"grass",
"gray",
"green",
"indigo",
"iris",
"jade",
"lime",
"mint",
"orange",
"pink",
"plum",
"purple",
"red",
"ruby",
"sky",
"teal",
"tomato",
"violet",
"yellow",
]
],
]
] = None,
high_contrast: Optional[Union[Var[bool], bool]] = None,
default_checked: Optional[Union[Var[bool], bool]] = None,
checked: Optional[Union[Var[bool], bool]] = None,
disabled: Optional[Union[Var[bool], bool]] = None,
required: Optional[Union[Var[bool], bool]] = None,
name: Optional[Union[Var[str], str]] = None,
value: Optional[Union[Var[str], str]] = None,
style: Optional[Style] = None,
key: Optional[Any] = None,
id: Optional[Any] = None,
class_name: Optional[Any] = None,
autofocus: Optional[bool] = None,
custom_attrs: Optional[Dict[str, Union[Var, Any]]] = None,
on_blur: Optional[EventType[()]] = None, on_blur: Optional[EventType[()]] = None,
on_change: Optional[Union[EventType[()], EventType[bool]]] = None, on_change: Optional[EventType[()] | EventType[bool]] = None,
on_click: Optional[EventType[()]] = None, on_click: Optional[EventType[()]] = None,
on_context_menu: Optional[EventType[()]] = None, on_context_menu: Optional[EventType[()]] = None,
on_double_click: Optional[EventType[()]] = None, on_double_click: Optional[EventType[()]] = None,

Some files were not shown because too many files have changed in this diff Show More